-
Notifications
You must be signed in to change notification settings - Fork 4
ENG-785 Use commonjs in whole project #377
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
9e79844
4a5bbb3
1c87a51
e5188a2
1d70c26
b3fa1ba
9964297
dac8623
d16af2a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,16 @@ | ||
| { | ||
| "extends": "@repo/typescript-config/react-library.json", | ||
| "include": ["src", "src/types.d.ts", "tailwind.config.ts", "tests", "scripts"], | ||
| "include": [ | ||
| "src", | ||
| "src/types.d.ts", | ||
| "tailwind.config.ts", | ||
| "tests", | ||
| "scripts" | ||
| ], | ||
| "compilerOptions": { | ||
| "baseUrl": ".", | ||
| "outDir": "dist", | ||
| "allowJs": false, | ||
| "esModuleInterop": false, | ||
| "forceConsistentCasingInFileNames": true, | ||
| "jsx": "react", | ||
| "noUncheckedIndexedAccess": false | ||
| } | ||
| } |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| { | ||
| "default": { | ||
| "loader": ["ts-node/esm"], | ||
| "import": ["features/step-definitions/**/*.ts"] | ||
| "requireModule": ["ts-node/register"], | ||
| "require": ["features/step-definitions/**/*.ts"] | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,24 +3,54 @@ | |
| "version": "0.0.0", | ||
| "private": true, | ||
| "license": "Apache-2.0", | ||
| "type": "module", | ||
| "exports": { | ||
| "./lib/*": "./src/lib/*.ts", | ||
| "./dbDotEnv": "./src/dbDotEnv.ts", | ||
| "./dbTypes": "./src/dbTypes.ts", | ||
| "./inputTypes": "./src/inputTypes.ts" | ||
| "./lib/*": { | ||
| "types": "./dist/src/lib/*.d.ts", | ||
| "require": "./dist/src/lib/*.js", | ||
| "default": "./dist/src/lib/*.js" | ||
| }, | ||
| "./dbDotEnv": { | ||
| "types": "./dist/src/dbDotEnv.d.ts", | ||
| "require": "./dist/src/dbDotEnv.js", | ||
| "default": "./dist/src/dbDotEnv.js" | ||
| }, | ||
| "./dbTypes": { | ||
| "types": "./dist/src/dbTypes.d.ts", | ||
| "require": "./dist/src/dbTypes.js", | ||
| "default": "./dist/src/dbTypes.js" | ||
| }, | ||
| "./inputTypes": { | ||
| "types": "./dist/src/inputTypes.d.ts", | ||
| "default": "./dist/src/inputTypes.d.ts" | ||
| } | ||
| }, | ||
| "typesVersions": { | ||
| "*": { | ||
| "lib/*": [ | ||
| "dist/src/lib/*.d.ts" | ||
| ], | ||
| "./dbDotEnv": [ | ||
| "dist/src/dbDotEnv.d.ts" | ||
| ], | ||
| "./dbTypes": [ | ||
| "dist/src/dbTypes.d.ts" | ||
| ], | ||
| "./inputTypes": [ | ||
| "dist/src/inputTypes.d.ts" | ||
| ] | ||
| } | ||
| }, | ||
| "scripts": { | ||
| "init": "supabase login", | ||
| "dev": "supabase start && tsx scripts/createEnv.ts && supabase functions serve", | ||
| "dev": "supabase start && tsx scripts/createEnv.mts && supabase functions serve", | ||
| "stop": "supabase stop", | ||
| "check-types": "tsc --noEmit --skipLibCheck", | ||
| "check-types": "tsc --emitDeclarationOnly --skipLibCheck", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we want the check-types to emit declarations? Aren't we just running a check here?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the package declarations are not generated, the check of the apps, that refer to those declarations, fails.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @maparent
I also cd packages/database and ran |
||
| "check-schema": "tsx scripts/lint.ts && supabase stop && npm run dbdiff", | ||
| "lint": "eslint . && tsx scripts/lint.ts", | ||
| "lint:fix": "tsx scripts/lint.ts -f", | ||
| "build": "tsx scripts/build.ts && npm run genenv -- local", | ||
| "build": "tsc && tsx scripts/build.ts && npm run genenv -- local", | ||
| "test": "tsc && cucumber-js", | ||
| "genenv": "tsx scripts/createEnv.ts", | ||
| "genenv": "tsx scripts/createEnv.mts", | ||
| "gentypes:production": "supabase start && supabase gen types typescript --project-id \"$SUPABASE_PROJECT_ID\" --schema public > src/dbTypes.ts", | ||
| "dbdiff": "supabase stop && supabase db diff", | ||
| "dbdiff:save": "supabase stop && supabase db diff -f", | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,15 @@ | ||
| import dotenv from "dotenv"; | ||
| import { readFileSync, existsSync } from "fs"; | ||
| import { join, dirname } from "path"; | ||
| import { join, dirname, basename } from "path"; | ||
| import { fileURLToPath } from "url"; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. unused
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. used at line 8.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @maparent |
||
|
|
||
| const __dirname = dirname(dirname(fileURLToPath(import.meta.url))); | ||
| const findRoot = (): string => { | ||
| let dir = __filename; | ||
| while (basename(dir) !== "database") { | ||
| dir = dirname(dir); | ||
| } | ||
| return dir; | ||
| }; | ||
|
|
||
| export const getVariant = (): string | null => { | ||
| if (process.env.HOME === "/vercel" || process.env.GITHUB_ACTIONS === "true") | ||
|
|
@@ -23,7 +29,7 @@ export const getVariant = (): string | null => { | |
| export const envFilePath = () => { | ||
| const variant: string | null = getVariant(); | ||
| if (variant === null) return null; | ||
| const name = join(__dirname, `.env.${variant}`); | ||
| const name = join(findRoot(), `.env.${variant}`); | ||
| return existsSync(name) ? name : null; | ||
| }; | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,6 @@ | |
| "compilerOptions": { | ||
| "baseUrl": ".", | ||
| "rootDir": ".", | ||
| "noEmit": true, | ||
| "outDir": "dist" | ||
| }, | ||
| "include": [ | ||
|
|
||



Uh oh!
There was an error while loading. Please reload this page.