@@ -2,10 +2,10 @@ name: Test different bundlers with Uppy
2
2
3
3
on :
4
4
push :
5
- branches : [ main ]
5
+ branches : [main]
6
6
pull_request :
7
7
# We want all branches so we configure types to be the GH default again
8
- types : [ opened, synchronize, reopened ]
8
+ types : [opened, synchronize, reopened]
9
9
paths-ignore :
10
10
- ' **.md'
11
11
- ' **.d.ts'
27
27
uses : actions/checkout@v3
28
28
- name : Get yarn cache directory path
29
29
id : yarn-cache-dir-path
30
- run : echo "dir=$(corepack yarn config get cacheFolder)" >> $GITHUB_OUTPUT
30
+ run :
31
+ echo "dir=$(corepack yarn config get cacheFolder)" >> $GITHUB_OUTPUT
31
32
- uses : actions/cache@v3
32
33
id : yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
33
34
with :
40
41
with :
41
42
node-version : lts/*
42
43
- name : Install dependencies
43
- run : corepack yarn workspaces focus $(corepack yarn workspaces list --json | jq -r .name | awk '/^@uppy-example/{ next } { if ($0!="uppy.io") print $0 }')
44
+ run :
45
+ corepack yarn workspaces focus $(corepack yarn workspaces list --json
46
+ | jq -r .name | awk '/^@uppy-example/{ next } { if ($0!="uppy.io")
47
+ print $0 }')
44
48
env :
45
49
# https://docs.cypress.io/guides/references/advanced-installation#Skipping-installation
46
50
CYPRESS_INSTALL_BINARY : 0
64
68
})();
65
69
EOF
66
70
- name : Eject public packages from repo
67
- run : mkdir /tmp/artifacts && corepack yarn workspaces foreach --no-private pack --install-if-needed -o /tmp/artifacts/%s-${{ github.sha }}.tgz
71
+ run :
72
+ mkdir /tmp/artifacts && corepack yarn workspaces foreach --no-private
73
+ pack --install-if-needed -o /tmp/artifacts/%s-${{ github.sha }}.tgz
68
74
- name : Upload artifact
69
75
if : success()
70
76
uses : actions/upload-artifact@v3
@@ -85,18 +91,17 @@ jobs:
85
91
with :
86
92
path : /tmp/
87
93
- name : Extract tarball
88
- run : tar -xzf /tmp/packages/uppy-${{ github.sha }}.tgz --strip-components 1
94
+ run :
95
+ tar -xzf /tmp/packages/uppy-${{ github.sha }}.tgz --strip-components 1
89
96
- name : Add Rollup as a dev dependency
90
97
run : >-
91
- npm i --save-dev
92
- @rollup/plugin-commonjs @rollup/plugin-node-resolve
98
+ npm i --save-dev @rollup/plugin-commonjs @rollup/plugin-node-resolve
93
99
rollup@${{matrix.bundler-version}}
94
100
- run : npx rollup --version
95
101
- name : Create Rollup config file
96
102
run : >-
97
- echo '
98
- import cjs from "@rollup/plugin-commonjs";
99
- import { nodeResolve } from "@rollup/plugin-node-resolve";
103
+ echo ' import cjs from "@rollup/plugin-commonjs"; import { nodeResolve
104
+ } from "@rollup/plugin-node-resolve";
100
105
101
106
export default {
102
107
input: "./index.mjs",
@@ -124,12 +129,16 @@ jobs:
124
129
with :
125
130
path : /tmp/
126
131
- name : Extract tarball
127
- run : tar -xzf /tmp/packages/uppy-${{ github.sha }}.tgz --strip-components 1
132
+ run :
133
+ tar -xzf /tmp/packages/uppy-${{ github.sha }}.tgz --strip-components 1
128
134
- name : Add Webpack as a dev dependency
129
135
run : npm i --save-dev webpack-cli webpack@${{matrix.bundler-version}}
130
136
- run : npx webpack --version
131
137
- name : Create Webpack config file
132
- run : echo 'module.exports={mode:"production",target:"web",entry:"./index.mjs"}' > webpack.config.js
138
+ run :
139
+ echo
140
+ ' module.exports={mode:"production",target:"web",entry:"./index.mjs"}'
141
+ > webpack.config.js
133
142
- name : Bundle
134
143
run : npx webpack
135
144
@@ -146,7 +155,8 @@ jobs:
146
155
with :
147
156
path : /tmp/
148
157
- name : Extract tarball
149
- run : tar -xzf /tmp/packages/uppy-${{ github.sha }}.tgz --strip-components 1
158
+ run :
159
+ tar -xzf /tmp/packages/uppy-${{ github.sha }}.tgz --strip-components 1
150
160
- name : Fix package.json to work with Parcel
151
161
run : |
152
162
node <<'EOF'
@@ -175,12 +185,15 @@ jobs:
175
185
with :
176
186
path : /tmp/
177
187
- name : Extract tarball
178
- run : tar -xzf /tmp/packages/uppy-${{ github.sha }}.tgz --strip-components 1
188
+ run :
189
+ tar -xzf /tmp/packages/uppy-${{ github.sha }}.tgz --strip-components 1
179
190
- name : Add Vite as a dev dependency
180
191
run : npm i --save-dev vite@${{matrix.bundler-version}}
181
192
- run : npx vite --version
182
193
- name : Create index.html
183
- run : echo '<!doctype html><html><head><script type="module" src="./index.mjs"></script></head></html>' > index.html
194
+ run :
195
+ echo '<!doctype html><html><head><script type="module"
196
+ src="./index.mjs"></script></head></html>' > index.html
184
197
- name : Bundle
185
198
run : npx vite build
186
199
@@ -197,11 +210,12 @@ jobs:
197
210
with :
198
211
path : /tmp/
199
212
- name : Extract tarball
200
- run : tar -xzf /tmp/packages/uppy-${{ github.sha }}.tgz --strip-components 1
213
+ run :
214
+ tar -xzf /tmp/packages/uppy-${{ github.sha }}.tgz --strip-components 1
201
215
- name : Add ESBuild as a dev dependency
202
216
run : npm i --save-dev esbuild@${{matrix.bundler-version}}
203
217
- run : npx esbuild --version
204
218
- name : Bundle
205
219
run : npx esbuild index.mjs --bundle --outfile=/dev/null
206
-
220
+
207
221
# Browserify: doesn't support ESM.
0 commit comments