Skip to content

Commit d36c9ee

Browse files
authored
Merge pull request #901 from 06kellyjac/license-inventory-cli
feat(experimental): init li cli for adding data to li
2 parents dd871e2 + ab8d0e3 commit d36c9ee

File tree

16 files changed

+5393
-15
lines changed

16 files changed

+5393
-15
lines changed

.github/workflows/dependency-review.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ jobs:
2121
with:
2222
comment-summary-in-pr: always
2323
fail-on-severity: high
24-
allow-licenses: MIT, Apache-2.0, BSD-3-Clause, ISC, BSD-2-Clause, Unlicense, CC0-1.0, 0BSD, X11, MPL-2.0, MPL-1.0, MPL-1.1, MPL-2.0, Zlib
24+
allow-licenses: MIT, Apache-2.0, BSD-3-Clause, BSD-3-Clause-Clear, ISC, BSD-2-Clause, Unlicense, CC0-1.0, 0BSD, X11, MPL-2.0, MPL-1.0, MPL-1.1, MPL-2.0, Zlib
2525
fail-on-scopes: development, runtime
2626
allow-dependencies-licenses: 'pkg:npm/caniuse-lite'
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: experimental-inventory-cli - Publish to NPM
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
version:
6+
description: 'release version without v prefix'
7+
required: true
8+
type: string
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Harden Runner
17+
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
18+
with:
19+
egress-policy: audit
20+
21+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
22+
23+
# Setup .npmrc file to publish to npm
24+
- uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4
25+
with:
26+
node-version: '18.x'
27+
registry-url: 'https://registry.npmjs.org'
28+
29+
- name: check version matches input
30+
run: |
31+
grep "\"version\": \"${{ github.event.inputs.version }}\"," package.json
32+
working-directory: ./experimental/li-cli
33+
34+
- run: npm ci
35+
working-directory: ./experimental/li-cli
36+
37+
- run: npm run build
38+
working-directory: ./experimental/li-cli
39+
40+
- run: npm publish --access=public
41+
working-directory: ./experimental/li-cli
42+
env:
43+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/experimental-inventory-publish.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
name: experimental-inventory - Publish to NPM
22
on:
3-
push:
4-
tags:
5-
- 'license-inventory-*'
3+
workflow_dispatch:
4+
inputs:
5+
version:
6+
description: 'release version without v prefix'
7+
required: true
8+
type: string
69
permissions:
710
contents: read
811

@@ -23,6 +26,11 @@ jobs:
2326
node-version: '18.x'
2427
registry-url: 'https://registry.npmjs.org'
2528

29+
- name: check version matches input
30+
run: |
31+
grep "\"version\": \"${{ github.event.inputs.version }}\"," package.json
32+
working-directory: ./experimental/license-inventory
33+
2634
- run: npm ci
2735
working-directory: ./experimental/license-inventory
2836

experimental/li-cli/jest.config.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { pathsToModuleNameMapper } from 'ts-jest';
2+
import { compilerOptions } from './tsconfig.json';
3+
import type { JestConfigWithTsJest } from 'ts-jest';
4+
5+
const jestConfig: JestConfigWithTsJest = {
6+
roots: ['<rootDir>/src'],
7+
modulePaths: [compilerOptions.baseUrl],
8+
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths),
9+
preset: 'ts-jest',
10+
testEnvironment: 'node',
11+
};
12+
13+
export default jestConfig;

0 commit comments

Comments
 (0)