Browse Source

Merge pull request #6419 from abpframework/feat/6399-2

Created a script that removes the lock files in the UI templates
pull/6423/head
Bunyamin Coskuner 6 years ago
committed by GitHub
parent
commit
2b5607b2e8
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      npm/publish.ps1
  2. 22
      npm/scripts/package.json
  3. 26
      npm/scripts/remove-lock-files.ts
  4. 17
      npm/scripts/tsconfig.json
  5. 6
      npm/scripts/utils/log.ts
  6. 2278
      npm/scripts/yarn.lock
  7. 9732
      templates/app/angular/yarn.lock
  8. 7139
      templates/app/react-native/yarn.lock
  9. 4
      templates/module/angular/.gitignore

4
npm/publish.ps1

@ -31,6 +31,10 @@ $commands = (
"npm run lerna -- version $Version --yes --no-commit-hooks --skip-git --force-publish",
"npm run replace-with-tilde",
$PacksPublishCommand,
"cd scripts",
"yarn",
"yarn remove-lock-files",
"cd ..",
$UpdateGulpCommand
)

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

9732
templates/app/angular/yarn.lock

File diff suppressed because it is too large

7139
templates/app/react-native/yarn.lock

File diff suppressed because it is too large

4
templates/module/angular/.gitignore

@ -43,6 +43,4 @@ testem.log
# System Files
.DS_Store
Thumbs.db
yarn.lock
Thumbs.db
Loading…
Cancel
Save