Skip to content

Commit c2e3bac

Browse files
Merge branch 'master' into type-clean-require
2 parents 5419d90 + 38dc51a commit c2e3bac

File tree

11 files changed

+102
-293
lines changed

11 files changed

+102
-293
lines changed

.github/workflows/node.js.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3+
4+
name: Node.js CI
5+
6+
on:
7+
push:
8+
branches: [ master ]
9+
pull_request:
10+
branches: [ master ]
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
17+
strategy:
18+
matrix:
19+
node-version: [12.x, 14.x, 16.x]
20+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
21+
22+
steps:
23+
- uses: actions/checkout@v2
24+
- name: Use Node.js ${{ matrix.node-version }}
25+
uses: actions/setup-node@v2
26+
with:
27+
node-version: ${{ matrix.node-version }}
28+
cache: 'npm'
29+
- run: npm ci
30+
- run: npm test

CHANGELOG.md

Lines changed: 41 additions & 283 deletions
Large diffs are not rendered by default.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "oc",
3-
"version": "0.49.2",
3+
"version": "0.49.3",
44
"description": "A framework for developing and distributing html components",
55
"main": "./dist/index.js",
66
"types": "./dist/index.d.ts",

src/cli/domain/handle-dependencies/install-compiler.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ export default function installCompiler(
2222
dependency,
2323
installPath: componentPath,
2424
save: false,
25-
silent: true
25+
silent: true,
26+
usePrefix: false
2627
};
2728

2829
npm.installDependency(npmOptions, err => {

src/cli/domain/handle-dependencies/install-missing-dependencies.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ export default function installMissingDependencies(
2323
dependencies: missing,
2424
installPath: path.resolve('.'),
2525
save: false,
26-
silent: true
26+
silent: true,
27+
usePrefix: true
2728
};
2829

2930
npm.installDependencies(npmOptions, err => {

src/cli/domain/init-template/install-template.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ export default function installTemplate(
2222
dependency: compiler,
2323
installPath: componentPath,
2424
isDev: true,
25-
save: true
25+
save: true,
26+
usePrefix: false
2627
};
2728

2829
logger.log(strings.messages.cli.installCompiler(compiler));

src/components/oc-client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "oc-client",
33
"description": "The OpenComponents client-side javascript client",
4-
"version": "0.49.2",
4+
"version": "0.49.3",
55
"repository": "https://github.com/opencomponents/oc/tree/master/components/oc-client",
66
"author": "Matteo Figus <[email protected]>",
77
"oc": {

src/utils/npm-utils.ts

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,14 @@ const buildInstallCommand = (options: {
88
installPath: string;
99
save?: boolean;
1010
isDev?: boolean;
11+
usePrefix: boolean;
1112
}) => {
1213
const args = ['install'];
1314

15+
if (options.usePrefix) {
16+
args.push('--prefix', options.installPath);
17+
}
18+
1419
if (options.save) {
1520
args.push('--save-exact');
1621
args.push(options.isDev ? '--save-dev' : '--save');
@@ -54,7 +59,12 @@ export const init = (
5459
};
5560

5661
export const installDependencies = (
57-
options: { dependencies: string[]; installPath: string; silent: boolean },
62+
options: {
63+
dependencies: string[];
64+
installPath: string;
65+
silent: boolean;
66+
usePrefix: boolean;
67+
},
5868
callback: Callback<{ dest: string }, string | number>
5969
): void => {
6070
const { dependencies, installPath, silent } = options;
@@ -75,7 +85,12 @@ export const installDependencies = (
7585
};
7686

7787
export const installDependency = (
78-
options: { dependency: string; installPath: string; silent?: boolean },
88+
options: {
89+
dependency: string;
90+
installPath: string;
91+
silent?: boolean;
92+
usePrefix: boolean;
93+
},
7994
callback: Callback<{ dest: string }, string | number>
8095
): void => {
8196
const { dependency, installPath, silent } = options;

test/unit/cli-domain-handle-dependencies-install-compiler.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ describe('cli : domain : handle-dependencies : install-compiler', () => {
5656
dependency: '[email protected]',
5757
installPath: '/path/to/components/component/',
5858
save: false,
59-
silent: true
59+
silent: true,
60+
usePrefix: false
6061
});
6162
});
6263

test/unit/cli-domain-handle-dependencies-install-missing-dependencies.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ describe('cli : domain : handle-dependencies : install-missing-dependencies', ()
8282
dependencies: ['[email protected]', 'underscore@latest'],
8383
installPath: '/path/to/oc-running',
8484
save: false,
85-
silent: true
85+
silent: true,
86+
usePrefix: true
8687
});
8788
});
8889

0 commit comments

Comments
 (0)