-
-
Notifications
You must be signed in to change notification settings - Fork 31
133 lines (131 loc) · 3.71 KB
/
esm-lint.yml
File metadata and controls
133 lines (131 loc) · 3.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
env:
IMPORT_STATEMENT: export * as pageDetect from "github-url-detection"
# FILE GENERATED WITH: npx ghat fregante/ghatemplates/esm-lint
# SOURCE: https://github.com/fregante/ghatemplates
# OPTIONS: {"exclude":["jobs.Snowpack"]}
name: ESM
on:
pull_request:
branches:
- '*'
push:
branches:
- master
- main
jobs:
Pack:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version-file: package.json
- run: npm install
- run: npm run build --if-present
- run: npm pack --dry-run
- run: npm pack | tail -1 | xargs -n1 tar -xzf
- uses: actions/upload-artifact@v6
with:
name: package
path: package
Publint:
runs-on: ubuntu-latest
needs: Pack
steps:
- uses: actions/download-artifact@v7
with:
name: package
path: artifact
- run: npx publint ./artifact
Webpack:
runs-on: ubuntu-latest
needs: Pack
steps:
- uses: actions/download-artifact@v7
with:
name: package
path: artifact
- run: npm install --omit=dev ./artifact
- run: echo "$IMPORT_STATEMENT" > index.js
- run: webpack --entry ./index.js
- run: cat dist/main.js
Parcel:
runs-on: ubuntu-latest
needs: Pack
steps:
- uses: actions/download-artifact@v7
with:
name: package
path: artifact
- run: npm install --omit=dev ./artifact
- run: echo "$IMPORT_STATEMENT" > index.js
- run: >
echo '{"@parcel/resolver-default": {"packageExports": true}}' >
package.json
- run: npx parcel@2 build index.js
- run: cat dist/index.js
Rollup:
runs-on: ubuntu-latest
needs: Pack
steps:
- uses: actions/download-artifact@v7
with:
name: package
path: artifact
- run: npm install --omit=dev ./artifact rollup@4 @rollup/plugin-json @rollup/plugin-node-resolve
- run: echo "$IMPORT_STATEMENT" > index.js
- run: npx rollup -p node-resolve -p @rollup/plugin-json index.js
Vite:
runs-on: ubuntu-latest
needs: Pack
steps:
- uses: actions/download-artifact@v7
with:
name: package
path: artifact
- run: npm install --omit=dev ./artifact
- run: echo '<script type="module">$IMPORT_STATEMENT</script>' > index.html
- run: npx vite build
- run: cat dist/assets/*
esbuild:
runs-on: ubuntu-latest
needs: Pack
steps:
- uses: actions/download-artifact@v7
with:
name: package
path: artifact
- run: echo '{}' > package.json
- run: echo "$IMPORT_STATEMENT" > index.js
- run: npm install --omit=dev ./artifact
- run: npx esbuild --bundle index.js
TypeScript:
runs-on: ubuntu-latest
needs: Pack
steps:
- uses: actions/download-artifact@v7
with:
name: package
path: artifact
- run: echo '{"type":"module"}' > package.json
- run: npm install --omit=dev ./artifact @sindresorhus/tsconfig
- run: echo "$IMPORT_STATEMENT" > index.ts
- run: >
echo '{"extends":"@sindresorhus/tsconfig","files":["index.ts"]}' >
tsconfig.json
- run: npx --package typescript -- tsc
- run: cat distribution/index.js
Node:
runs-on: ubuntu-latest
needs: Pack
steps:
- uses: actions/download-artifact@v7
with:
name: package
path: artifact
- uses: actions/setup-node@v6
with:
node-version-file: artifact/package.json
- run: echo "$IMPORT_STATEMENT" > index.mjs
- run: npm install --omit=dev ./artifact
- run: node index.mjs