NPM ignore few files while publish
Change-Id: I5889b90e605dd009f7a7387ca4a8f67f24d1df6e
This commit is contained in:
parent
220b75cb81
commit
312b1dd8bd
5 changed files with 8 additions and 3 deletions
|
@ -14,6 +14,8 @@ const contextDir = `${argv._[0]}/` ?? './';
|
||||||
// create app folder
|
// create app folder
|
||||||
const appsDir = `${contextDir}/apps`;
|
const appsDir = `${contextDir}/apps`;
|
||||||
const appDir = isMonorepo ? `${contextDir}/apps/${appName}-fe` : `${contextDir}/`;
|
const appDir = isMonorepo ? `${contextDir}/apps/${appName}-fe` : `${contextDir}/`;
|
||||||
|
|
||||||
|
// prepare structure folders
|
||||||
if (!fs.existsSync(appDir)) {
|
if (!fs.existsSync(appDir)) {
|
||||||
if (!fs.existsSync(contextDir)) {
|
if (!fs.existsSync(contextDir)) {
|
||||||
fs.mkdirSync(contextDir);
|
fs.mkdirSync(contextDir);
|
||||||
|
@ -25,6 +27,11 @@ if (!fs.existsSync(appDir)) {
|
||||||
fs.mkdirSync(`${appDir}/src`);
|
fs.mkdirSync(`${appDir}/src`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// rename internal files
|
||||||
|
fs.renameSync(`${rootDir}/source/shared/npmrc`, `${rootDir}/source/shared/.npmrc`);
|
||||||
|
fs.renameSync(`${rootDir}/source/shared/gitignore`, `${rootDir}/source/shared/.gitignore`);
|
||||||
|
fs.renameSync(`${rootDir}/source/shared/prettierrc`, `${rootDir}/source/shared/.prettierrc`);
|
||||||
|
|
||||||
// copy folder content
|
// copy folder content
|
||||||
try {
|
try {
|
||||||
fs.cpSync(`${rootDir}/source/shared/`, contextDir, {
|
fs.cpSync(`${rootDir}/source/shared/`, contextDir, {
|
||||||
|
|
|
@ -7,8 +7,6 @@
|
||||||
"dev": "pnpm -r dev"
|
"dev": "pnpm -r dev"
|
||||||
},
|
},
|
||||||
"dependencies": {},
|
"dependencies": {},
|
||||||
"devDependencies": {
|
"devDependencies": {},
|
||||||
"@types/node": "18.11.9"
|
|
||||||
},
|
|
||||||
"peerDependencies": {}
|
"peerDependencies": {}
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue