Skip to content

Commit

Permalink
chore: Exclude sourceMaps from prod builds and introduced base tsconf…
Browse files Browse the repository at this point in the history
…ig (#161)

Co-authored-by: Christiaan Landman <[email protected]>
  • Loading branch information
Chriztiaan and Christiaan Landman authored May 13, 2024
1 parent 7197949 commit f5e42af
Show file tree
Hide file tree
Showing 14 changed files with 44 additions and 82 deletions.
11 changes: 11 additions & 0 deletions .changeset/young-emus-pump.md
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 1 addition & 1 deletion .github/workflows/dev-packages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions demos/react-native-supabase-todolist/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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": [],
Expand Down
16 changes: 2 additions & 14 deletions packages/attachments/tsconfig.json
Original file line number Diff line number Diff line change
@@ -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": [
{
Expand Down
13 changes: 1 addition & 12 deletions packages/common/tsconfig.json
Original file line number Diff line number Diff line change
@@ -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/**/*"]
Expand Down
2 changes: 1 addition & 1 deletion packages/kysely-driver/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
6 changes: 1 addition & 5 deletions packages/kysely-driver/tsconfig.json
Original file line number Diff line number Diff line change
@@ -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'. */
},
Expand Down
14 changes: 1 addition & 13 deletions packages/react-native/tsconfig.json
Original file line number Diff line number Diff line change
@@ -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": [
Expand Down
15 changes: 2 additions & 13 deletions packages/react/tsconfig.json
Original file line number Diff line number Diff line change
@@ -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": [
{
Expand Down
16 changes: 2 additions & 14 deletions packages/vue/tsconfig.json
Original file line number Diff line number Diff line change
@@ -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": [
{
Expand Down
2 changes: 1 addition & 1 deletion packages/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
6 changes: 1 addition & 5 deletions packages/web/tsconfig.json
Original file line number Diff line number Diff line change
@@ -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
Expand Down
17 changes: 17 additions & 0 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
@@ -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"
}
}

0 comments on commit f5e42af

Please sign in to comment.