Browse Source

feat: create remove-lock-files script

pull/6433/head
mehmet-erim 5 years ago
parent
commit
e38c232ae7
  1. 22
      npm/scripts/package.json
  2. 26
      npm/scripts/remove-lock-files.ts
  3. 17
      npm/scripts/tsconfig.json
  4. 6
      npm/scripts/utils/log.ts
  5. 2278
      npm/scripts/yarn.lock

22
npm/scripts/package.json

@ -0,0 +1,22 @@
{
"name": "abp-npm-scripts",
"version": "1.0.0",
"description": "",
"scripts": {
"remove-lock-files": "ts-node -r tsconfig-paths/register remove-lock-files.ts"
},
"dependencies": {
"chalk": "^4.1.0",
"commander": "^6.1.0",
"execa": "^4.0.3",
"fs-extra": "^9.0.1",
"glob": "^7.1.6",
"npm-check-updates": "^9.0.1",
"typescript": "^4.0.2"
},
"devDependencies": {
"@types/fs-extra": "^9.0.1",
"ts-node": "^9.0.0",
"tsconfig-paths": "^3.9.0"
}
}

26
npm/scripts/remove-lock-files.ts

@ -0,0 +1,26 @@
import fse from 'fs-extra';
import { log } from './utils/log';
removeLockFiles();
export async function removeLockFiles() {
const folders = [
'../../templates/app/angular',
'../../templates/app/react-native',
'../../templates/module/angular',
];
try {
for (let i = 0; i < folders.length; i++) {
await fse.remove(`${folders[i]}/yarn.lock`);
await fse.remove(`${folders[i]}/package-lock.json`);
}
} catch (error) {
throwError(error?.message || error);
}
}
function throwError(error: string) {
log.error(error);
process.exit(1);
}

17
npm/scripts/tsconfig.json

@ -0,0 +1,17 @@
{
"compilerOptions": {
"module": "commonjs",
"declaration": true,
"removeComments": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es2017",
"sourceMap": true,
"outDir": "./dist",
"baseUrl": "./",
"incremental": true,
"esModuleInterop": true,
"types": ["node"]
},
"exclude": ["node_modules", "dist"]
}

6
npm/scripts/utils/log.ts

@ -0,0 +1,6 @@
import { bold } from 'chalk';
export const log = {
info: (message: string) => console.log(bold.blue(`\n${message}\n`)),
error: (message: string) => console.log(bold.underline.red(`\n${message}\n`)),
};

2278
npm/scripts/yarn.lock

File diff suppressed because it is too large
Loading…
Cancel
Save