diff --git a/.changeset/young-emus-pump.md b/.changeset/young-emus-pump.md new file mode 100644 index 00000000..7a50e627 --- /dev/null +++ b/.changeset/young-emus-pump.md @@ -0,0 +1,11 @@ +--- +'@powersync/kysely-driver': patch +'@powersync/react-native': patch +'@powersync/attachments': patch +'@powersync/common': patch +'@powersync/react': patch +'@powersync/vue': patch +'@powersync/web': patch +--- + +Introduced base tsconfig. SourceMaps are now excluded in dev and release publishes. diff --git a/.github/workflows/dev-packages.yaml b/.github/workflows/dev-packages.yaml index 5031b8b9..7bfedb60 100644 --- a/.github/workflows/dev-packages.yaml +++ b/.github/workflows/dev-packages.yaml @@ -37,7 +37,7 @@ jobs: - name: Install dependencies run: pnpm install - name: Build - run: pnpm build:packages + run: pnpm build:packages:prod - name: Publish run: | pnpm changeset version --no-git-tag --snapshot dev diff --git a/demos/react-native-supabase-todolist/package.json b/demos/react-native-supabase-todolist/package.json index 20851f24..7cf17cb2 100644 --- a/demos/react-native-supabase-todolist/package.json +++ b/demos/react-native-supabase-todolist/package.json @@ -5,8 +5,7 @@ "scripts": { "android": "expo run:android", "ios": "expo run:ios", - "clean": "watchman watch-del-all && rm -rf .expo", - "preinstall": "cd ../.. && pnpm build:packages" + "clean": "watchman watch-del-all && rm -rf .expo" }, "dependencies": { "@azure/core-asynciterator-polyfill": "^1.0.2", diff --git a/package.json b/package.json index 47454d54..1d5efdf5 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "main": "index.js", "scripts": { "build:packages": "pnpm run --filter './packages/**' -r build", + "build:packages:prod": "pnpm build:packages --sourceMap false", "watch:packages": "pnpm run --parallel --filter './packages/**' -r build -w", "build": "pnpm run -r build", "ci:publish": "changeset publish && git push --follow-tags", @@ -15,7 +16,7 @@ "docs:start": "pnpm --filter docs start", "format": "prettier --write .", "lint": "eslint .", - "release": "pnpm build:packages && pnpm changeset publish", + "release": "pnpm build:packages:prod && pnpm changeset publish", "test": "pnpm run -r test" }, "keywords": [], diff --git a/packages/attachments/tsconfig.json b/packages/attachments/tsconfig.json index c3821cad..2e5a4401 100644 --- a/packages/attachments/tsconfig.json +++ b/packages/attachments/tsconfig.json @@ -1,22 +1,10 @@ { + "extends": "../../tsconfig.base", "compilerOptions": { "baseUrl": "./", - "esModuleInterop": true, "jsx": "react", "rootDir": "src", - "composite": true, - "outDir": "./lib", - "lib": ["esnext", "DOM"], - "module": "esnext", - "sourceMap": true, - "moduleResolution": "node", - "noFallthroughCasesInSwitch": true, - "noImplicitReturns": true, - "noImplicitUseStrict": false, - "noStrictGenericChecks": false, - "resolveJsonModule": true, - "skipLibCheck": true, - "target": "esnext" + "outDir": "./lib" }, "references": [ { diff --git a/packages/common/tsconfig.json b/packages/common/tsconfig.json index 3f9b79e0..43686f95 100644 --- a/packages/common/tsconfig.json +++ b/packages/common/tsconfig.json @@ -1,24 +1,13 @@ { + "extends": "../../tsconfig.base", "compilerOptions": { "baseUrl": "./", - "esModuleInterop": true, "jsx": "react", "types": ["node"], "rootDir": "src", "outDir": "./lib", - "composite": true, "lib": ["esnext"], - "module": "esnext", "declaration": true, - "sourceMap": true, - "moduleResolution": "node", - "noFallthroughCasesInSwitch": true, - "noImplicitReturns": true, - "noImplicitUseStrict": false, - "noStrictGenericChecks": false, - "resolveJsonModule": true, - "skipLibCheck": true, - "target": "esnext", "strictNullChecks": true }, "include": ["src/**/*"] diff --git a/packages/kysely-driver/package.json b/packages/kysely-driver/package.json index 13e58f59..dc7e7141 100644 --- a/packages/kysely-driver/package.json +++ b/packages/kysely-driver/package.json @@ -20,7 +20,7 @@ "homepage": "https://docs.powersync.com", "scripts": { "build": "tsc --build", - "clean": "rm -rf dist tsconfig.tsbuildinfo", + "clean": "rm -rf lib tsconfig.tsbuildinfo", "watch": "tsc --build -w", "test": "pnpm build && vitest" }, diff --git a/packages/kysely-driver/tsconfig.json b/packages/kysely-driver/tsconfig.json index a112118f..e626ebec 100644 --- a/packages/kysely-driver/tsconfig.json +++ b/packages/kysely-driver/tsconfig.json @@ -1,16 +1,12 @@ { + "extends": "../../tsconfig.base", "compilerOptions": { - "composite": true, "baseUrl": "./", "declaration": true /* Generates corresponding '.d.ts' file. */, - "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */, "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */, "lib": ["DOM", "ES2020", "WebWorker"] /* Specify library files to be included in the compilation. */, "module": "es2020" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */, - "moduleResolution": "node" /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */, "outDir": "./lib" /* Redirect output structure to the directory. */, - "skipLibCheck": true /* Skip type checking of declaration files. */, - "sourceMap": true /* Generates corresponding '.map' file. */, "strict": true /* Enable all strict type-checking options. */, "target": "es6" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */ }, diff --git a/packages/react-native/tsconfig.json b/packages/react-native/tsconfig.json index f373a39c..08a47064 100644 --- a/packages/react-native/tsconfig.json +++ b/packages/react-native/tsconfig.json @@ -1,22 +1,10 @@ { + "extends": "../../tsconfig.base", "compilerOptions": { "baseUrl": "./", - "esModuleInterop": true, "jsx": "react", "rootDir": "src", - "composite": true, "outDir": "./lib", - "lib": ["esnext", "DOM"], - "module": "esnext", - "sourceMap": true, - "moduleResolution": "node", - "noFallthroughCasesInSwitch": true, - "noImplicitReturns": true, - "noImplicitUseStrict": false, - "noStrictGenericChecks": false, - "resolveJsonModule": true, - "skipLibCheck": true, - "target": "esnext", "strictNullChecks": true }, "references": [ diff --git a/packages/react/tsconfig.json b/packages/react/tsconfig.json index c8cbe375..f660e295 100644 --- a/packages/react/tsconfig.json +++ b/packages/react/tsconfig.json @@ -1,22 +1,11 @@ { + "extends": "../../tsconfig.base", "compilerOptions": { "baseUrl": "./", - "esModuleInterop": true, "jsx": "react", "rootDir": "src", - "composite": true, "outDir": "./lib", - "lib": ["es2022", "DOM"], - "module": "esnext", - "sourceMap": true, - "moduleResolution": "node", - "noFallthroughCasesInSwitch": true, - "noImplicitReturns": true, - "noImplicitUseStrict": false, - "noStrictGenericChecks": false, - "resolveJsonModule": true, - "skipLibCheck": true, - "target": "esnext" + "lib": ["es2022", "DOM"] }, "references": [ { diff --git a/packages/vue/tsconfig.json b/packages/vue/tsconfig.json index 714b7302..f0b7fa0b 100644 --- a/packages/vue/tsconfig.json +++ b/packages/vue/tsconfig.json @@ -1,22 +1,10 @@ { + "extends": "../../tsconfig.base", "compilerOptions": { "baseUrl": "./", - "esModuleInterop": true, "jsx": "preserve", - "rootDir": "src", - "composite": true, "outDir": "./lib", - "lib": ["es2022", "DOM"], - "module": "esnext", - "sourceMap": true, - "moduleResolution": "node", - "noFallthroughCasesInSwitch": true, - "noImplicitReturns": true, - "noImplicitUseStrict": false, - "noStrictGenericChecks": false, - "resolveJsonModule": true, - "skipLibCheck": true, - "target": "esnext" + "rootDir": "src" }, "references": [ { diff --git a/packages/web/package.json b/packages/web/package.json index 4774c320..c299b2f0 100644 --- a/packages/web/package.json +++ b/packages/web/package.json @@ -19,7 +19,7 @@ "homepage": "https://docs.powersync.com", "scripts": { "build": "tsc --build", - "clean": "rm -rf dist tsconfig.tsbuildinfo", + "clean": "rm -rf lib tsconfig.tsbuildinfo", "watch": "tsc --build -w", "test": "pnpm build && vitest" }, diff --git a/packages/web/tsconfig.json b/packages/web/tsconfig.json index 10903ae1..4accee0f 100644 --- a/packages/web/tsconfig.json +++ b/packages/web/tsconfig.json @@ -1,19 +1,15 @@ { + "extends": "../../tsconfig.base", "compilerOptions": { - "composite": true, "paths": { "@powersync/web": ["src/index.ts"] }, "baseUrl": "./", "declaration": true /* Generates corresponding '.d.ts' file. */, - "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */, "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */, "lib": ["DOM", "ES2020", "WebWorker"] /* Specify library files to be included in the compilation. */, "module": "es2020" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */, - "moduleResolution": "node" /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */, "outDir": "./lib" /* Redirect output structure to the directory. */, - "skipLibCheck": true /* Skip type checking of declaration files. */, - "sourceMap": true /* Generates corresponding '.map' file. */, "strict": true /* Enable all strict type-checking options. */, "target": "es6" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */, "strictNullChecks": true diff --git a/tsconfig.base.json b/tsconfig.base.json new file mode 100644 index 00000000..150b463d --- /dev/null +++ b/tsconfig.base.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "composite": true, + "esModuleInterop": true, + "lib": ["esnext", "DOM"], + "module": "esnext", + "moduleResolution": "node", + "noFallthroughCasesInSwitch": true, + "noImplicitReturns": true, + "noImplicitUseStrict": false, + "noStrictGenericChecks": false, + "resolveJsonModule": true, + "skipLibCheck": true, + "sourceMap": true, + "target": "esnext" + } +}