feature: add sync script for versions

pull/1549/head
mehmet-erim 6 years ago
parent 1d2178639a
commit fba7c884fe

@ -4,28 +4,35 @@
"lerna": "lerna"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.801.2",
"@angular-devkit/build-ng-packagr": "~0.801.2",
"@angular/animations": "~8.1.2",
"@angular/cdk": "^8.0.1",
"@angular/cli": "~8.1.2",
"@angular/common": "~8.1.2",
"@angular/compiler": "~8.1.2",
"@angular/compiler-cli": "~8.1.2",
"@angular/core": "~8.1.2",
"@angular/forms": "~8.1.2",
"@angular/language-service": "~8.1.2",
"@angular/platform-browser": "~8.1.2",
"@angular/platform-browser-dynamic": "~8.1.2",
"@angular/router": "~8.1.2",
"rxjs": "~6.4.0",
"tslib": "^1.9.0",
"zone.js": "~0.9.1",
"@angular-devkit/build-angular": "~0.801.2",
"@angular-devkit/build-ng-packagr": "~0.801.2",
"@angular/cli": "~8.1.2",
"@angular/compiler-cli": "~8.1.2",
"@angular/language-service": "~8.1.2",
"@ng-bootstrap/ng-bootstrap": "^5.0.0-rc.1",
"@ngx-validate/core": "^0.0.1",
"@ngxs/router-plugin": "^3.5.0",
"@ngxs/storage-plugin": "^3.5.0",
"@ngxs/store": "^3.5.0",
"@types/jasmine": "~3.3.8",
"@types/jasminewd2": "~2.0.3",
"@types/node": "~8.9.4",
"angular-oauth2-oidc": "^8.0.1",
"bootstrap": "^4.3.1",
"codelyzer": "^5.0.0",
"font-awesome": "^4.7.0",
"jasmine-core": "~3.4.0",
"jasmine-spec-reporter": "~4.2.1",
"just-compare": "^1.3.0",
"karma": "~4.1.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
@ -33,25 +40,18 @@
"karma-jasmine-html-reporter": "^1.4.0",
"lerna": "^3.16.4",
"ng-packagr": "^5.1.0",
"ngx-perfect-scrollbar": "^8.0.0",
"primeicons": "^1.0.0",
"primeng": "^8.0.0",
"protractor": "~5.4.0",
"symlink-manager": "^1.1.2",
"rxjs": "~6.4.0",
"snq": "^1.0.3",
"symlink-manager": "^1.2.0",
"ts-node": "~7.0.0",
"tsickle": "^0.35.0",
"tslib": "^1.9.0",
"tslint": "~5.15.0",
"typescript": "~3.4.3",
"@ngxs/router-plugin": "^3.5.0",
"@ngxs/storage-plugin": "^3.5.0",
"@ngxs/store": "^3.5.0",
"angular-oauth2-oidc": "^8.0.1",
"just-compare": "^1.3.0",
"snq": "^1.0.3",
"@angular/cdk": "^8.0.1",
"@ng-bootstrap/ng-bootstrap": "^5.0.0-rc.1",
"@ngx-validate/core": "^0.0.1",
"bootstrap": "^4.3.1",
"font-awesome": "^4.7.0",
"ngx-perfect-scrollbar": "^8.0.0",
"primeicons": "^1.0.0",
"primeng": "^8.0.0"
"zone.js": "~0.9.1"
}
}

@ -0,0 +1,28 @@
"use strict"
const child_process = require("child_process")
const { env } = process
const { parent } = module
const REQUIRE_ESM = "--require esm"
const REQUIRE_DOT_YARN = "--require ./.yarn.js"
let { NODE_OPTIONS } = env
if (typeof NODE_OPTIONS === "string") {
NODE_OPTIONS += " "
} else {
NODE_OPTIONS = ""
}
if (parent != null &&
parent.id === "internal/preload") {
env.NODE_OPTIONS = NODE_OPTIONS.replace(REQUIRE_DOT_YARN, REQUIRE_ESM)
} else {
child_process.spawn("yarn", process.argv.slice(2), {
env: Object.assign({}, env, {
NODE_OPTIONS: REQUIRE_DOT_YARN + " " + NODE_OPTIONS
}),
stdio: "inherit"
})
}

@ -0,0 +1 @@
yarn-path "./.yarn.js"

@ -0,0 +1 @@
import execa from 'execa';

@ -0,0 +1,4 @@
// 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');

@ -0,0 +1,20 @@
{
"name": "scripts",
"version": "1.0.0",
"description": "Abp publish helper scripts",
"main": "index.js",
"modules": "[build.js, sync.js]",
"scripts": {
"build": "node -r esm build.js",
"sync": "node -r esm sync.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"babel-preset-node6": "^11.0.0",
"esm": "^3.2.25",
"execa": "^2.0.3",
"fs-extra": "^8.1.0"
}
}

@ -0,0 +1,24 @@
// ESM syntax is supported.
import execa from 'execa';
import fse from 'fs-extra';
(async () => {
const { projects } = await fse.readJSON('../angular.json');
const projectNames = Object.keys(projects);
projectNames.forEach(async project => {
const { dependencies: distDependencies, version } = await fse.readJSON(`../dist/${project}/package.json`);
const srcPackagePath = `../packages/${project}/package.json`;
const srcPackage = await fse.readJSON(srcPackagePath);
if (distDependencies) {
for (const key in srcPackage.dependencies) {
if (distDependencies.hasOwnProperty(key)) {
srcPackage.dependencies[key] = distDependencies[key];
}
}
}
await fse.writeJSON(srcPackagePath, { ...srcPackage, version }, { spaces: 2 });
});
})();
Loading…
Cancel
Save