Browse Source

ci(scripts): convert all scripts extensions to ts

pull/2531/head
mehmet-erim 7 years ago
parent
commit
a7695a34cb
  1. 2
      npm/ng-packs/package.json
  2. 2
      npm/ng-packs/scripts/build.ts
  3. 4
      npm/ng-packs/scripts/index.js
  4. 1
      npm/ng-packs/scripts/install-new-dependencies.ts
  5. 1382
      npm/ng-packs/scripts/package-lock.json
  6. 19
      npm/ng-packs/scripts/package.json
  7. 1
      npm/ng-packs/scripts/prod-build.ts
  8. 1
      npm/ng-packs/scripts/publish.ts
  9. 0
      npm/ng-packs/scripts/push.ts
  10. 9
      npm/ng-packs/scripts/sync.ts
  11. 16
      npm/ng-packs/scripts/tsconfig.json
  12. 1193
      npm/ng-packs/scripts/yarn.lock

2
npm/ng-packs/package.json

@ -12,7 +12,7 @@
"test": "ng test --watchAll --runInBand", "test": "ng test --watchAll --runInBand",
"commit": "git-cz", "commit": "git-cz",
"lint": "ng lint", "lint": "ng lint",
"scripts:build": "cd scripts && npm install && yarn build", "scripts:build": "cd scripts && yarn && yarn build",
"prepare:workspace": "yarn scripts:build", "prepare:workspace": "yarn scripts:build",
"ci": "yarn prepare:workspace && yarn ci:test && yarn ng lint && yarn ci:build", "ci": "yarn prepare:workspace && yarn ci:test && yarn ng lint && yarn ci:build",
"ci:test": "ng test --coverage=false", "ci:test": "ng test --coverage=false",

2
npm/ng-packs/scripts/build.js → npm/ng-packs/scripts/build.ts

@ -1,6 +1,4 @@
// ESM syntax is supported.
import execa from 'execa'; import execa from 'execa';
import fse from 'fs-extra';
import program from 'commander'; import program from 'commander';
(async () => { (async () => {

4
npm/ng-packs/scripts/index.js

@ -1,4 +0,0 @@
// Set options as a parameter, environment variable, or rc file.
// eslint-disable-next-line no-global-assign
require = require('esm')(module /* , options */);
module.exports = require('./main.js');

1
npm/ng-packs/scripts/install-new-dependencies.js → npm/ng-packs/scripts/install-new-dependencies.ts

@ -1,4 +1,3 @@
// ESM syntax is supported.
import execa from 'execa'; import execa from 'execa';
import fse from 'fs-extra'; import fse from 'fs-extra';

1382
npm/ng-packs/scripts/package-lock.json

File diff suppressed because it is too large

19
npm/ng-packs/scripts/package.json

@ -3,14 +3,12 @@
"version": "1.0.0", "version": "1.0.0",
"description": "ABP helper scripts", "description": "ABP helper scripts",
"main": "index.js", "main": "index.js",
"modules": "[build.js, sync.js]",
"scripts": { "scripts": {
"build": "node -r esm build.js", "build": "ts-node -r tsconfig-paths/register build.ts",
"build:prod": "node -r esm prod-build.js", "build:prod": "ts-node -r tsconfig-paths/register prod-build.ts",
"publish-packages": "node -r esm publish.js", "publish-packages": "ts-node -r tsconfig-paths/register publish.ts",
"install-new-dependencies": "node -r esm install-new-dependencies.js", "install-new-dependencies": "ts-node -r tsconfig-paths/register install-new-dependencies.ts",
"sync": "node -r esm sync.js", "sync": "ts-node -r tsconfig-paths/register sync.ts"
"test": "echo \"Error: no test specified\" && exit 1"
}, },
"author": "", "author": "",
"dependencies": { "dependencies": {
@ -18,9 +16,12 @@
"commander": "^4.0.1", "commander": "^4.0.1",
"execa": "^2.0.3", "execa": "^2.0.3",
"fs-extra": "^8.1.0", "fs-extra": "^8.1.0",
"prompt-confirm": "^2.0.4" "prompt-confirm": "^2.0.4",
"typescript": "^3.7.4"
}, },
"devDependencies": { "devDependencies": {
"esm": "^3.2.25" "esm": "^3.2.25",
"ts-node": "^8.5.4",
"tsconfig-paths": "^3.9.0"
} }
} }

1
npm/ng-packs/scripts/prod-build.js → npm/ng-packs/scripts/prod-build.ts

@ -1,4 +1,3 @@
// ESM syntax is supported.
import execa from 'execa'; import execa from 'execa';
import fse from 'fs-extra'; import fse from 'fs-extra';

1
npm/ng-packs/scripts/publish.js → npm/ng-packs/scripts/publish.ts

@ -1,4 +1,3 @@
// ESM syntax is supported.
import execa from 'execa'; import execa from 'execa';
import fse from 'fs-extra'; import fse from 'fs-extra';

0
npm/ng-packs/scripts/push.js → npm/ng-packs/scripts/push.ts

9
npm/ng-packs/scripts/sync.js → npm/ng-packs/scripts/sync.ts

@ -1,4 +1,3 @@
// ESM syntax is supported.
import fse from 'fs-extra'; import fse from 'fs-extra';
import execa from 'execa'; import execa from 'execa';
@ -8,7 +7,9 @@ import execa from 'execa';
for (let i = 0; i < projectNames.length; i++) { for (let i = 0; i < projectNames.length; i++) {
const project = projectNames[i]; const project = projectNames[i];
const { dependencies: distDependencies, version } = await fse.readJson(`../dist/${project}/package.json`); const { dependencies: distDependencies, version } = await fse.readJson(
`../dist/${project}/package.json`,
);
const srcPackagePath = `../packages/${project}/package.json`; const srcPackagePath = `../packages/${project}/package.json`;
const srcPackage = await fse.readJson(srcPackagePath); const srcPackage = await fse.readJson(srcPackagePath);
@ -25,7 +26,9 @@ import execa from 'execa';
try { try {
await execa('git', ['add', '../packages/*', '../package.json'], { stdout: 'inherit' }); await execa('git', ['add', '../packages/*', '../package.json'], { stdout: 'inherit' });
await execa('git', ['commit', '-m', 'Update source packages versions', '--no-verify'], { stdout: 'inherit' }); await execa('git', ['commit', '-m', 'Update source packages versions', '--no-verify'], {
stdout: 'inherit',
});
} catch (error) { } catch (error) {
console.error(error.stderr); console.error(error.stderr);
} }

16
npm/ng-packs/scripts/tsconfig.json

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

1193
npm/ng-packs/scripts/yarn.lock

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