Skip to content

Commit 4b138bb

Browse files
feat(scripts): add the template dependencies copy script
1 parent 33a767d commit 4b138bb

File tree

3 files changed

+26
-10
lines changed

3 files changed

+26
-10
lines changed

dependenciesCopy.js

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
const fs = require('fs');
2+
const packageDependencies = require('./package.json');
3+
4+
const dependencies = {
5+
dependencies: packageDependencies.dependencies,
6+
};
7+
8+
fs.writeFile('template.json', JSON.stringify(dependencies, null, 2), function(
9+
err,
10+
) {
11+
if (err) {
12+
console.log('error in writing file to template.json', err);
13+
}
14+
});

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"build": "react-scripts build",
4545
"test": "react-scripts test",
4646
"eject": "react-scripts eject",
47-
"copy": "cp -a src/. template/src && cp -a public/. template/public && cp -a .gitignore template/gitignore && rm -rf template/src/configDummy.js && rm -rf template/src/config.js && cp .eslintrc template/ && cp src/configDummy.js template/src/config.js",
47+
"copy": "node dependenciesCopy.js && cp -a src/. template/src && cp -a public/. template/public && cp -a .gitignore template/gitignore && rm -rf template/src/configDummy.js && rm -rf template/src/config.js && cp .eslintrc template/ && cp src/configDummy.js template/src/config.js",
4848
"clean": "rm -rf template/src && rm -rf template/public template/gitignore template/.eslintrc",
4949
"prepublishOnly": "npm run clean && npm run copy"
5050
},

template.json

+11-9
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
{
22
"dependencies": {
3+
"@testing-library/jest-dom": "^4.2.4",
4+
"@testing-library/react": "^9.3.2",
5+
"@testing-library/user-event": "^7.1.2",
6+
"firebase": "^7.1.0",
7+
"history": "^4.10.1",
8+
"prop-types": "^15.7.2",
9+
"react": "^16.12.0",
10+
"react-dom": "^16.12.0",
311
"react-redux": "^7.1.3",
4-
"redux": "^4.0.0",
512
"react-redux-firebase": "3.0.6",
6-
"firebase": "^7.1.0",
7-
"redux-firestore": "latest",
813
"react-router-dom": "^5.1.2",
9-
"redux-auth-wrapper": "^3.0.0",
1014
"react-scripts": "3.3.0",
11-
"react-dom": "^16.12.0",
12-
"react": "^16.12.0",
13-
"@testing-library/react": "^9.3.2",
14-
"@testing-library/jest-dom": "^4.2.4",
15-
"@testing-library/user-event": "^7.1.2"
15+
"redux": "^4.0.0",
16+
"redux-auth-wrapper": "^3.0.0",
17+
"redux-firestore": "latest"
1618
}
1719
}

0 commit comments

Comments
 (0)