Skip to content

Commit e958f9e

Browse files
committed
Native ESM
Signed-off-by: Sora Morimoto <[email protected]>
1 parent 9a8ccd0 commit e958f9e

31 files changed

+2272
-6544
lines changed

.eslintrc.json

Lines changed: 0 additions & 30 deletions
This file was deleted.
Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Example Dependency Submission
2-
on:
3-
push
2+
3+
on: push
44

55
permissions:
66
contents: write
@@ -9,21 +9,15 @@ jobs:
99
example-submission:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- name: 'Checkout Repository'
13-
uses: actions/checkout@v4
12+
- uses: actions/checkout@v4
1413
- uses: actions/setup-node@v4
15-
# As of 2023-02-22, the ubuntu-latest image uses npm v8.3.1. This version
16-
# has a bug that prevents loading dependency-submission-toolkit in the
17-
# 'example/' project. npm v8.4.1 (same version in Codespace created on
18-
# same date) is known to work. Not pinned to latest to avoid
19-
# reproducibility issues.
20-
- run: npm install [email protected] -g
14+
with:
15+
node-version: 16
2116
- name: Install NPM dependencies
2217
run: npm ci
2318
- name: Run all NPM build/test actions
24-
run: npm -w:example rebuild && npm run all -w:example
19+
run: npm run --workspace example all
2520
- name: Run dependency submission
2621
uses: ./
27-
id: example
2822
with:
2923
npm-package-directory: ./

.github/workflows/publish.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,16 @@ jobs:
88
publish-npm:
99
runs-on: ubuntu-latest
1010
steps:
11-
- name: Checkout the project
12-
uses: actions/checkout@v4
13-
- name: Use Node.js 16.x (LTS)
14-
uses: actions/setup-node@v4
11+
- uses: actions/checkout@v4
12+
- uses: actions/setup-node@v4
1513
with:
16-
node-version: 16.x
17-
registry-url: https://registry.npmjs.org/
18-
cache: npm
14+
node-version: 16
15+
registry-url: https://registry.npmjs.org
1916
- run: npm ci
2017
- run: npm test
2118
- run: npm version ${TAG_NAME} --git-tag-version=false --allow-same-version
2219
env:
2320
TAG_NAME: ${{ github.event.release.tag_name }}
2421
- run: npm whoami; npm publish --access public
2522
env:
26-
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
23+
NODE_AUTH_TOKEN: ${{ secrets.npm_token }}

.github/workflows/test.yml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
name: 'build-test'
2+
23
on: # rebuild any PRs and main branch changes
34
pull_request:
4-
branches:
5+
branches:
56
- main
67
- 'releases/*'
78
push:
@@ -14,14 +15,10 @@ jobs:
1415
runs-on: ubuntu-latest
1516
steps:
1617
- uses: actions/checkout@v4
17-
# As of 2023-02-22, the ubuntu-latest image uses npm v8.3.1. This version
18-
# has a bug that prevents loading dependency-submission-toolkit in the
19-
# 'example/' project. npm v8.4.1 (same version in Codespace created on
20-
# same date) is known to work. Not pinned to latest to avoid
21-
# reproducibility issues.
22-
- run: npm install [email protected] -g
18+
- uses: actions/setup-node@v4
19+
with:
20+
node-version: 16
2321
- name: Install NPM dependencies
2422
run: npm ci
25-
- run: npm install
2623
- name: Run all NPM build/test actions
27-
run: npm rebuild && npm run all
24+
run: npm run all

.npmignore

Lines changed: 0 additions & 8 deletions
This file was deleted.

.prettierignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.prettierrc

Lines changed: 0 additions & 7 deletions
This file was deleted.

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ inputs:
1111
default: './'
1212
runs:
1313
using: 'node16'
14-
main: 'example/action-dist/index.js'
14+
main: 'example/dist/index.js'

biome.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"$schema": "node_modules/@biomejs/biome/configuration_schema.json",
3+
"files": {
4+
"ignoreUnknown": true
5+
},
6+
"formatter": {
7+
"enabled": true,
8+
"indentStyle": "space"
9+
},
10+
"javascript": {
11+
"formatter": {
12+
"quoteStyle": "single",
13+
"semicolons": "asNeeded",
14+
"trailingComma": "none"
15+
}
16+
},
17+
"linter": {
18+
"enabled": true,
19+
"rules": {
20+
"recommended": true
21+
}
22+
},
23+
"organizeImports": {
24+
"enabled": true
25+
},
26+
"vcs": {
27+
"clientKind": "git",
28+
"enabled": true,
29+
"useIgnoreFile": true
30+
}
31+
}

example/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
import { main } from './npm-detector'
1+
import { main } from './npm-detector.js'
22

33
main()

0 commit comments

Comments
 (0)