Skip to content
This repository has been archived by the owner on Nov 13, 2023. It is now read-only.

fix: Update build/test scripts to be compatible with npm@9 #935

Merged
merged 6 commits into from
Feb 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Use Node.js LTS
uses: actions/setup-node@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Check Changelog Updated
uses: awharn/check_changelog_action@v0.0.2
uses: awharn/check_changelog_action@v1
with:
header: '## Recent Changes'
file: 'CHANGELOG.md'
6 changes: 3 additions & 3 deletions .github/workflows/imperative.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
Expand Down Expand Up @@ -71,7 +71,7 @@ jobs:

- name: Archive Results
if: ${{ always() && steps.build.outcome == 'success' }}
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.os }}-${{ matrix.node-version }}-results
path: __tests__/__results__/
Expand All @@ -89,7 +89,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: false
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Use Node.js LTS
uses: actions/setup-node@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: ${{ github.event.workflow_run.head_repository.full_name }}
ref: ${{ github.event.workflow_run.head_branch }}
Expand Down
3 changes: 2 additions & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
@zowe:registry=https://zowe.jfrog.io/zowe/api/npm/npm-release/
@zowe:registry=https://zowe.jfrog.io/zowe/api/npm/npm-release/
install-links=false
3 changes: 2 additions & 1 deletion __tests__/src/TestUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ export function executeTestCLICommand(cliBinModule: string, testContext: any, ar
}
const childEnv = JSON.parse(JSON.stringify(env)); // copy current env
childEnv.FORCE_COLOR = "0";
childEnv.npm_config_install_links = "false";
const child = spawnSync(nodeCommand, args, {
cwd: execDir,
encoding: "utf8",
Expand Down Expand Up @@ -419,7 +420,7 @@ export function runCliScript(scriptPath: string, cwd: string, args: any = [], en
// Color can vary OS/terminal
const childEnv = JSON.parse(JSON.stringify(process.env));
childEnv.FORCE_COLOR = "0";

childEnv.npm_config_install_links = "false";
// Add .npm-global folder where test CLIs are installed to front of PATH
if (process.platform === "win32") {
childEnv.Path = nodePath.join(__dirname, "..", "..", ".npm-global") + ";" + childEnv.Path;
Expand Down
2 changes: 1 addition & 1 deletion scripts/sampleCliTool.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ switch (process.argv[2]) {
runAll((dir) => ({ command: "npm run build", cwd: dir }), true);
break;
case "install":
runAll((dir) => ({ command: `npm install -g . --prefix ${npmPrefix}`, cwd: dir }));
runAll((dir) => ({ command: `npm install -g . --prefix ${npmPrefix} --install-links=false`, cwd: dir }));
break;
case "uninstall":
// Delete install folder since npm uninstall doesn't work as expected: https://github.com/npm/npm/issues/17905
Expand Down