Skip to content
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

ci: fix ts-node scripts #5225

Merged
merged 1 commit into from
Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ jobs:
DATABASE_URL: postgresql://affine:affine@localhost:5432/affine

- name: Run init-db script
run: yarn workspace @affine/server exec ts-node ./scripts/init-db.ts
run: yarn workspace @affine/server exec node --loader ts-node/esm/transpile-only ./scripts/init-db.ts
env:
DATABASE_URL: postgresql://affine:affine@localhost:5432/affine

Expand Down Expand Up @@ -464,7 +464,7 @@ jobs:
DATABASE_URL: postgresql://affine:affine@localhost:5432/affine

- name: Run init-db script
run: yarn workspace @affine/server exec ts-node ./scripts/init-db.ts
run: yarn workspace @affine/server exec node --loader ts-node/esm/transpile-only ./scripts/init-db.ts
- name: Download storage.node
uses: actions/download-artifact@v3
with:
Expand Down Expand Up @@ -588,7 +588,7 @@ jobs:
- name: Output check
if: ${{ matrix.spec.os == 'macos-latest' && matrix.spec.arch == 'arm64' }}
run: |
yarn workspace @affine/electron ts-node ./scripts/macos-arm64-output-check.ts
yarn workspace @affine/electron exec node --loader ts-node/esm/transpile-only ./scripts/macos-arm64-output-check.ts

- name: Upload test results
if: ${{ failure() }}
Expand Down
16 changes: 8 additions & 8 deletions packages/frontend/electron/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
"homepage": "https://github.com/toeverything/AFFiNE",
"scripts": {
"start": "electron .",
"dev": "DEV_SERVER_URL=http://localhost:8080 yarn ts-node ./scripts/dev.ts",
"dev:prod": "yarn ts-node scripts/dev.ts",
"build": "NODE_ENV=production ts-node scripts/build-layers.ts",
"build:dev": "NODE_ENV=development ts-node scripts/build-layers.ts",
"generate-assets": "ts-node scripts/generate-assets.ts",
"package": "cross-env NODE_OPTIONS=\"--loader ts-node/esm\" electron-forge package",
"make": "cross-env NODE_OPTIONS=\"--loader ts-node/esm\" electron-forge make",
"make-squirrel": "yarn ts-node scripts/make-squirrel.ts"
"dev": "DEV_SERVER_URL=http://localhost:8080 node --loader ts-node/esm/transpile-only ./scripts/dev.ts",
"dev:prod": "yarn node --loader ts-node/esm/transpile-only scripts/dev.ts",
"build": "NODE_ENV=production node --loader ts-node/esm/transpile-only scripts/build-layers.ts",
"build:dev": "NODE_ENV=development node --loader ts-node/esm/transpile-only scripts/build-layers.ts",
"generate-assets": "node --loader ts-node/esm/transpile-only scripts/generate-assets.ts",
"package": "cross-env NODE_OPTIONS=\"--loader ts-node/esm/transpile-only\" electron-forge package",
"make": "cross-env NODE_OPTIONS=\"--loader ts-node/esm/transpile-only\" electron-forge make",
"make-squirrel": "node --loader ts-node/esm/transpile-only scripts/make-squirrel.ts"
},
"main": "./dist/main.js",
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/frontend/i18n/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
"scripts": {
"build": "node build.mjs",
"dev": "node dev.mjs",
"sync-languages": "ts-node -P ./tsconfig.node.json src/scripts/sync.ts",
"sync-languages": "node --loader ts-node/esm/transpile-only src/scripts/sync.ts",
"sync-languages:check": "yarn run sync-languages --check",
"download-resources": "ts-node -P ./tsconfig.node.json src/scripts/download.ts"
"download-resources": "node --loader ts-node/esm/transpile-only src/scripts/download.ts"
},
"keywords": [],
"repository": {
Expand Down
8 changes: 0 additions & 8 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"compilerOptions": {
"verbatimModuleSyntax": true,
// Classification follows https://www.typescriptlang.org/tsconfig

// Type Checking
"strict": true,
"exactOptionalPropertyTypes": false,
Expand All @@ -16,7 +15,6 @@
"noPropertyAccessFromIndexSignature": false,
"noUncheckedIndexedAccess": false,
"useUnknownInCatchVariables": true,

// Modules
"module": "ESNext",
"moduleResolution": "bundler",
Expand All @@ -28,16 +26,13 @@
"sourceMap": true,
// skip type emit for @internal types
// "stripInternal": true,

// JavaScript Support
"allowJs": false,
"checkJs": false,

// Interop Constraints
"forceConsistentCasingInFileNames": true,
"allowSyntheticDefaultImports": true,
"isolatedModules": true,

// Language and Environment
"jsx": "preserve",
"jsxImportSource": "@emotion/react",
Expand All @@ -46,11 +41,9 @@
"useDefineForClassFields": false,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,

// Projects
"composite": true,
"incremental": true,

// Completeness
"skipLibCheck": true, // skip all type checks for .d.ts files
"paths": {
Expand Down Expand Up @@ -81,7 +74,6 @@
"@affine/native": ["./packages/frontend/native/index.d.ts"],
"@affine/native/*": ["./packages/frontend/native/*"],
"@affine/storage": ["./packages/backend/storage/index.d.ts"],

// Development only
"@affine/electron/*": ["./packages/frontend/electron/src/*"]
}
Expand Down
Loading