Skip to content

Commit

Permalink
[feat #457] update install scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
r-hannuschka committed Dec 31, 2021
1 parent 3ba38a5 commit 5a3af07
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 22 deletions.
27 changes: 27 additions & 0 deletions src/bin/package-install.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
const fs = require('fs');
const cp = require('child_process');
const os = require('os');
const resolve = require('path').resolve;
const dirname = require('path').dirname;

const libs = process.argv.slice(2);

// run all libs
for (let library of libs) {

const path = resolve(process.cwd(), library, 'package.json');

if (!fs.existsSync(path)) {
return;
}

var npmCmd = os.platform().startsWith('win') ? 'npm.cmd' : 'npm';

// install folder
cp.spawn(npmCmd, ['i'], {
env: process.env,
cwd: dirname(path),
stdio: 'inherit'
});
}

2 changes: 1 addition & 1 deletion src/e2e/integration/foo/example-2.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ test('test', async ({ page }) => {

// Click text=Validation
await page.click('text=Validation');
await expect(page).toHaveURL('http://localhost:4200/#/validation')
await expect(page).toHaveURL('http://localhost:4200/#/validation');

// Click text=Ngx File Drop
await page.click('text=Ngx File Drop');
Expand Down
17 changes: 0 additions & 17 deletions src/e2e/playwright.config.ts

This file was deleted.

3 changes: 2 additions & 1 deletion src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"github-actions:unit-tests-core": "ng test core --watch=false --code-coverage",
"github-actions:unit-tests-ui": "ng test ui --watch=false --code-coverage",
"test:code-coverage": "ng test --code-coverage",
"postinstall": "npm run build:builders && npm run install:builders"
"preinstall": "node ./bin/package-install projects/builders && npm run build:builders",
"postinstall": "npm run install:builders"
},
"private": true,
"dependencies": {
Expand Down
30 changes: 29 additions & 1 deletion src/projects/builders/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/projects/builders/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"build": "tsc",
"prebuild": "rimraf ./dist/*",
"postbuild": "cpx ./{package,builders}.json ./dist && cpx ./src/**/schema.json ./dist && npm run package",
"postbuild": "cpx \"./{package,builders}.json\" ./dist && cpx ./src/**/schema.json ./dist && npm run package",
"package": "tar -cvf ./builders.tar.gz -C ./dist ."
},
"builders": "builders.json",
Expand All @@ -17,7 +17,7 @@
"@angular-devkit/core": "12.2.11",
"@playwright/test": "1.16.1",
"chokidar": "3.5.2",
"rxjs": "^6.6.7"
"rxjs": "6.6.7"
},
"devDependencies": {
"cpx": "1.5.0",
Expand Down

0 comments on commit 5a3af07

Please sign in to comment.