Skip to content

Commit a36a198

Browse files
committed
fix(template): avoid additional build tsconfig plus minor improvements
release-npm
1 parent 9b4a484 commit a36a198

File tree

6 files changed

+13
-20
lines changed

6 files changed

+13
-20
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Starting point for creating React Native plugins in TypeScript without native co
77
- Bundle plugin in TypeScript with esbuild
88
- Setup demo app with plugin installed
99
- Watch plugin for changes
10+
- Jest, ESLint and Prettier configured
1011

1112
## Usage
1213

template/create-app.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ execSync('npm install $(npm pack .. | tail -1) --legacy-peer-deps', {
3232

3333
console.log('')
3434
console.log('🍞 React Native App created inside /app.')
35-
console.log('🛠️ To run the example with the plugin included:')
35+
console.log('🛠️ To run the example with the plugin included:')
3636
console.log('🐚 cd app')
3737
console.log('🐚 npm run ios / npm run android')
38-
console.log('🌪️ To copy over the changes from the plugin source run:')
38+
console.log('🌪️ To copy over the changes from the plugin source run:')
3939
console.log('🐚 npm run watch')
40-
console.log('🛠️ This will copy changes over to the app.')
40+
console.log('🛠️ This will copy changes over to the app.')

template/package.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
},
1212
"scripts": {
1313
"app": "node create-app.js",
14-
"build": "esbuild index.tsx --outdir=dist --bundle --minify --format=esm --sourcemap --external:react-native --external:react && npm run build:types",
14+
"app:install": "npm i --no-save $(npm pack . | tail -1) --prefix app",
15+
"build": "esbuild index.tsx --outdir=dist --bundle --minify --format=esm --sourcemap --external:react-native --external:react && tsc",
1516
"watch": "concurrently --kill-others \"npm run build:watch\" \"npm run copy\"",
1617
"copy": "cpx 'dist/**/*' app/node_modules/<%= name %>/dist --watch",
17-
"build:types": "tsc --project tsconfig-build.json",
1818
"build:watch": "esbuild index.tsx --watch --outdir=dist --bundle --format=esm --sourcemap --external:react-native --external:react",
1919
"test": "jest",
2020
"test:watch": "jest --watchAll",
@@ -107,10 +107,5 @@
107107
"json",
108108
"node"
109109
]
110-
},
111-
"babel": {
112-
"presets": [
113-
"module:metro-react-native-babel-preset"
114-
]
115110
}
116111
}

template/test/tsconfig.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"include": ["*"]
4+
}

template/tsconfig-build.json

Lines changed: 0 additions & 8 deletions
This file was deleted.

template/tsconfig.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@
1313
"skipLibCheck": true,
1414
"resolveJsonModule": true,
1515
"declaration": true,
16-
"noEmit": true,
1716
"outDir": "dist",
17+
"emitDeclarationOnly": true,
1818
"paths": {
1919
"<%= name %>": ["."]
2020
}
2121
},
22-
"exclude": ["node_modules", "babel.config.cjs"]
22+
"include": ["index.tsx"],
23+
"exclude": ["node_modules"]
2324
}

0 commit comments

Comments
 (0)