GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — chore: Unlock package-lock deps during build phase · cloudscape-design/.github@0f50cde

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • .github
    • actions/unlock-dependencies
      • action.yml
      • index.js
    • workflows
      • build-lint-test.yml
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎.github/actions/unlock-dependencies/action.yml‎

Copy file name to clipboard
+12Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: "Unlock Cloudscape dependencies in package-lock"
2+
description: "Removes all @cloudscape-design dependencies from package-lock file"
3+
4+
runs:
5+
using: "composite"
6+
steps:
7+
- name: Use Node.js 16
8+
uses: actions/setup-node@v3
9+
with:
10+
node-version: 16
11+
- run: node ${{ github.action_path }}/index.js
12+
shell: bash
Collapse file

‎.github/actions/unlock-dependencies/index.js‎

Copy file name to clipboard
+29Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/usr/bin/env node
2+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
// SPDX-License-Identifier: Apache-2.0
4+
5+
const fs = require("fs");
6+
const path = require("path");
7+
8+
/**
9+
* Remove specific @cloudscape-design/* packages where we should always use the latest minor release.
10+
*/
11+
const filename = path.resolve(process.env.GITHUB_WORKSPACE, "package-lock.json");
12+
const packageLock = JSON.parse(fs.readFileSync(filename));
13+
14+
function removeDependencies(dependencyName, packages) {
15+
if (dependencyName.includes("@cloudscape-design/")) {
16+
delete packages[dependencyName];
17+
}
18+
}
19+
20+
Object.keys(packageLock.packages).forEach((dependencyName) => {
21+
removeDependencies(dependencyName, packageLock.packages);
22+
});
23+
24+
Object.keys(packageLock.dependencies).forEach((dependencyName) => {
25+
removeDependencies(dependencyName, packageLock.dependencies);
26+
});
27+
28+
fs.writeFileSync(filename, JSON.stringify(packageLock, null, 2) + "\n");
29+
console.log("Removed @cloudscape-design/ dependencies from package-lock file");
Collapse file

‎.github/workflows/build-lint-test.yml‎

Copy file name to clipboardExpand all lines: .github/workflows/build-lint-test.yml
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ jobs:
3030
uses: actions/setup-node@v3
3131
with:
3232
node-version: 16
33+
- name: Unlock dependencies
34+
uses: cloudscape-design/.github/.github/actions/unlock-dependencies@main
3335
- run: npm i --force
3436
- run: npm run lint
3537
- run: npm run build

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.