Skip to content

Commit 8405cc1

Browse files
committed
fix(template): remove package.json export, order package & lint config
release-npm
1 parent 2be79f8 commit 8405cc1

File tree

3 files changed

+37
-34
lines changed

3 files changed

+37
-34
lines changed

template/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@ node_modules
22
# package-lock.json has no effect when publishing your plugin to npm.
33
package-lock.json
44
dist
5+
<%= pascal %>App
56
app/**/*
67
!app/App.tsx

template/create-app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ execSync('npm run build', {
2525
})
2626

2727
// Install this package locally, avoiding symlinks.
28-
execSync('npm install $(npm pack .. | tail -1) --legacy-peer-deps', {
28+
execSync('npm install $(npm pack .. | tail -1)', {
2929
cwd: join(process.cwd(), 'app'),
3030
stdio: 'inherit',
3131
})

template/package.json

Lines changed: 35 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,6 @@
22
"name": "<%= name %>",
33
"version": "1.0.0",
44
"license": "MIT",
5-
"main": "./dist/index.js",
6-
"type": "module",
7-
"types": "./dist/index.d.ts",
8-
"exports": {
9-
".": {
10-
"types": "./dist/index.d.ts",
11-
"default": "./dist/index.js"
12-
},
13-
"./package.json": "./package.json"
14-
},
155
"scripts": {
166
"app": "node create-app.js",
177
"app:install": "npm i --no-save $(npm pack . | tail -1) --prefix app",
@@ -24,10 +14,6 @@
2414
"lint": "eslint . --fix --ext .js,.jsx,.ts,.tsx",
2515
"format": "prettier \"{,!(app|dist)/**/}*.{ts,tsx}\" --write"
2616
},
27-
"peerDependencies": {
28-
"react": ">= 18",
29-
"react-native": ">= 0.70"
30-
},
3117
"devDependencies": {
3218
"@react-native-community/cli": "^13.0.0",
3319
"@react-native/babel-preset": "^0.74.0",
@@ -52,44 +38,60 @@
5238
"react-test-renderer": "^18.2.0",
5339
"typescript": "^5.3.3"
5440
},
41+
"peerDependencies": {
42+
"react": ">= 18",
43+
"react-native": ">= 0.70"
44+
},
45+
"type": "module",
46+
"main": "./dist/index.js",
47+
"exports": {
48+
".": {
49+
"types": "./dist/index.d.ts",
50+
"default": "./dist/index.js"
51+
}
52+
},
53+
"types": "./dist/index.d.ts",
5554
"files": [
5655
"dist"
5756
],
57+
"prettier": {
58+
"printWidth": 100,
59+
"semi": false,
60+
"singleQuote": true
61+
},
5862
"eslintConfig": {
59-
"root": true,
60-
"extends": "@react-native-community",
63+
"extends": "@react-native",
6164
"rules": {
6265
"semi": 0
6366
},
6467
"ignorePatterns": [
6568
"dist",
6669
"app"
67-
]
68-
},
69-
"prettier": {
70-
"semi": false,
71-
"singleQuote": true,
72-
"printWidth": 100
70+
],
71+
"root": true
7372
},
7473
"jest": {
75-
"preset": "react-native",
76-
"testPathIgnorePatterns": [
77-
"/app/"
78-
],
79-
"transformIgnorePatterns": [
80-
"node_modules/(?!react-native|@react-native)"
81-
],
82-
"moduleNameMapper": {
83-
"react-dom": "react-native",
84-
"<%= name %>": "<rootDir>"
85-
},
8674
"moduleFileExtensions": [
8775
"ts",
8876
"tsx",
8977
"js",
9078
"jsx",
9179
"json",
9280
"node"
81+
],
82+
"moduleNameMapper": {
83+
"react-dom": "react-native",
84+
"<%= name %>": "<rootDir>"
85+
},
86+
"preset": "react-native",
87+
"testPathIgnorePatterns": [
88+
"/app/"
89+
],
90+
"transformIgnorePatterns": [
91+
"node_modules/(?!react-native|@react-native)"
9392
]
93+
},
94+
"publishConfig": {
95+
"provenance": false
9496
}
9597
}

0 commit comments

Comments
 (0)