Skip to content

Commit 9c705c2

Browse files
authored
build: use rolldown to bundle the output file (#721)
* build: use rolldown to bundle to output file * chore: update bin path * chore: output.file is already set in config; CLI arg is redundant * chore: update rolldown to beta.7 * fix: accidentally removed vitest during merging
1 parent cb15d1b commit 9c705c2

File tree

8 files changed

+571
-445
lines changed

8 files changed

+571
-445
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
bundle.js
12
outfile.cjs
23

34
TODOs

LICENSE

+109-88
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,20 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2424
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2525
SOFTWARE.
2626

27-
# License of the files in the directories template in create-vue
27+
## License of the files in the directories template in create-vue
28+
2829
The files in the directories template in create-vue and files
2930
generated from those files are licensed under the CC0 1.0 Universal license:
3031

3132
CC0 1.0 Universal
33+
3234
Statement of Purpose
35+
3336
The laws of most jurisdictions throughout the world automatically confer
3437
exclusive Copyright and Related Rights (defined below) upon the creator and
3538
subsequent owner(s) (each and all, an "owner") of an original work of
3639
authorship and/or a database (each, a "Work").
40+
3741
Certain owners wish to permanently relinquish those rights to a Work for the
3842
purpose of contributing to a commons of creative, cultural and scientific
3943
works ("Commons") that the public can reliably and without fear of later
@@ -44,32 +48,42 @@ contribute to the Commons to promote the ideal of a free culture and the
4448
further production of creative, cultural and scientific works, or to gain
4549
reputation or greater distribution for their Work in part through the use and
4650
efforts of others.
51+
4752
For these and/or other purposes and motivations, and without any expectation
4853
of additional consideration or compensation, the person associating CC0 with a
4954
Work (the "Affirmer"), to the extent that he or she is an owner of Copyright
5055
and Related Rights in the Work, voluntarily elects to apply CC0 to the Work
5156
and publicly distribute the Work under its terms, with knowledge of his or her
5257
Copyright and Related Rights in the Work and the meaning and intended legal
5358
effect of CC0 on those rights.
59+
5460
1. Copyright and Related Rights. A Work made available under CC0 may be
5561
protected by copyright and related or neighboring rights ("Copyright and
5662
Related Rights"). Copyright and Related Rights include, but are not limited
5763
to, the following:
58-
i. the right to reproduce, adapt, distribute, perform, display, communicate,
59-
and translate a Work;
60-
ii. moral rights retained by the original author(s) and/or performer(s);
61-
iii. publicity and privacy rights pertaining to a person's image or likeness
62-
depicted in a Work;
63-
iv. rights protecting against unfair competition in regards to a Work,
64-
subject to the limitations in paragraph 4(a), below;
65-
v. rights protecting the extraction, dissemination, use and reuse of data in
66-
a Work;
67-
vi. database rights (such as those arising under Directive 96/9/EC of the
68-
European Parliament and of the Council of 11 March 1996 on the legal
69-
protection of databases, and under any national implementation thereof,
70-
including any amended or successor version of such directive); and
71-
vii. other similar, equivalent or corresponding rights throughout the world
72-
based on applicable law or treaty, and any national implementations thereof.
64+
65+
i. the right to reproduce, adapt, distribute, perform, display, communicate,
66+
and translate a Work;
67+
68+
ii. moral rights retained by the original author(s) and/or performer(s);
69+
70+
iii. publicity and privacy rights pertaining to a person's image or likeness
71+
depicted in a Work;
72+
73+
iv. rights protecting against unfair competition in regards to a Work,
74+
subject to the limitations in paragraph 4(a), below;
75+
76+
v. rights protecting the extraction, dissemination, use and reuse of data in
77+
a Work;
78+
79+
vi. database rights (such as those arising under Directive 96/9/EC of the
80+
European Parliament and of the Council of 11 March 1996 on the legal
81+
protection of databases, and under any national implementation thereof,
82+
including any amended or successor version of such directive); and
83+
84+
vii. other similar, equivalent or corresponding rights throughout the world
85+
based on applicable law or treaty, and any national implementations thereof.
86+
7387
2. Waiver. To the greatest extent permitted by, but not in contravention of,
7488
applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and
7589
unconditionally waives, abandons, and surrenders all of Affirmer's Copyright
@@ -85,6 +99,7 @@ detriment of Affirmer's heirs and successors, fully intending that such Waiver
8599
shall not be subject to revocation, rescission, cancellation, termination, or
86100
any other legal or equitable action to disrupt the quiet enjoyment of the Work
87101
by the public as contemplated by Affirmer's express Statement of Purpose.
102+
88103
3. Public License Fallback. Should any part of the Waiver for any reason be
89104
judged legally invalid or ineffective under applicable law, then the Waiver
90105
shall be preserved to the maximum extent permitted taking into account
@@ -105,55 +120,96 @@ affirms that he or she will not (i) exercise any of his or her remaining
105120
Copyright and Related Rights in the Work or (ii) assert any associated claims
106121
and causes of action with respect to the Work, in either case contrary to
107122
Affirmer's express Statement of Purpose.
123+
108124
4. Limitations and Disclaimers.
109-
a. No trademark or patent rights held by Affirmer are waived, abandoned,
110-
surrendered, licensed or otherwise affected by this document.
111-
b. Affirmer offers the Work as-is and makes no representations or warranties
112-
of any kind concerning the Work, express, implied, statutory or otherwise,
113-
including without limitation warranties of title, merchantability, fitness
114-
for a particular purpose, non infringement, or the absence of latent or
115-
other defects, accuracy, or the present or absence of errors, whether or not
116-
discoverable, all to the greatest extent permissible under applicable law.
117-
c. Affirmer disclaims responsibility for clearing rights of other persons
118-
that may apply to the Work or any use thereof, including without limitation
119-
any person's Copyright and Related Rights in the Work. Further, Affirmer
120-
disclaims responsibility for obtaining any necessary consents, permissions
121-
or other rights required for any use of the Work.
122-
d. Affirmer understands and acknowledges that Creative Commons is not a
123-
party to this document and has no duty or obligation with respect to this
124-
CC0 or use of the Work.
125+
126+
a. No trademark or patent rights held by Affirmer are waived, abandoned,
127+
surrendered, licensed or otherwise affected by this document.
128+
129+
b. Affirmer offers the Work as-is and makes no representations or warranties
130+
of any kind concerning the Work, express, implied, statutory or otherwise,
131+
including without limitation warranties of title, merchantability, fitness
132+
for a particular purpose, non infringement, or the absence of latent or
133+
other defects, accuracy, or the present or absence of errors, whether or not
134+
discoverable, all to the greatest extent permissible under applicable law.
135+
136+
c. Affirmer disclaims responsibility for clearing rights of other persons
137+
that may apply to the Work or any use thereof, including without limitation
138+
any person's Copyright and Related Rights in the Work. Further, Affirmer
139+
disclaims responsibility for obtaining any necessary consents, permissions
140+
or other rights required for any use of the Work.
141+
142+
d. Affirmer understands and acknowledges that Creative Commons is not a
143+
party to this document and has no duty or obligation with respect to this
144+
CC0 or use of the Work.
145+
125146
For more information, please see
126147
<http://creativecommons.org/publicdomain/zero/1.0/>
127148

128149
## Licenses of bundled dependencies
129150

130151
The published create-vue artifact additionally contains code with the following licenses:
131-
MIT, Apache-2.0, ISC
152+
MIT, ISC, Apache-2.0
132153

133154
## Bundled dependencies
134155

135-
## @clack/core
156+
## sisteransi
136157

137158
License: MIT
138-
By: Nate Moore
139-
Repository: git+https://github.com/natemoo-re/clack.git
159+
By: Terkel Gjervig
160+
Repository: https://github.com/terkelg/sisteransi
140161

141162
> MIT License
142163
>
143-
> Copyright (c) Nate Moore
164+
> Copyright (c) 2018 Terkel Gjervig Nielsen
144165
>
145-
> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
166+
> Permission is hereby granted, free of charge, to any person obtaining a copy
167+
> of this software and associated documentation files (the "Software"), to deal
168+
> in the Software without restriction, including without limitation the rights
169+
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
170+
> copies of the Software, and to permit persons to whom the Software is
171+
> furnished to do so, subject to the following conditions:
146172
>
147-
> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
173+
> The above copyright notice and this permission notice shall be included in all
174+
> copies or substantial portions of the Software.
148175
>
149-
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
176+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
177+
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
178+
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
179+
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
180+
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
181+
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
182+
> SOFTWARE.
150183
>
151184

152-
## @clack/prompts
185+
## picocolors
186+
187+
License: ISC
188+
By: Alexey Raspopov
189+
Repository: alexeyraspopov/picocolors
190+
191+
> ISC License
192+
>
193+
> Copyright (c) 2021-2024 Oleksii Raspopov, Kostiantyn Denysov, Anton Verinov
194+
>
195+
> Permission to use, copy, modify, and/or distribute this software for any
196+
> purpose with or without fee is hereby granted, provided that the above
197+
> copyright notice and this permission notice appear in all copies.
198+
>
199+
> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
200+
> WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
201+
> MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
202+
> ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
203+
> WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
204+
> ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
205+
> OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
206+
>
207+
208+
## @clack/core
153209

154210
License: MIT
155211
By: Nate Moore
156-
Repository: git+https://github.com/natemoo-re/clack.git
212+
Repository: https://github.com/natemoo-re/clack
157213

158214
> MIT License
159215
>
@@ -166,33 +222,21 @@ Repository: git+https://github.com/natemoo-re/clack.git
166222
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
167223
>
168224

169-
## @vue/create-eslint-config
225+
## @clack/prompts
170226

171227
License: MIT
172-
By: Haoqun Jiang
173-
Repository: git+https://github.com/vuejs/create-eslint-config.git
228+
By: Nate Moore
229+
Repository: https://github.com/natemoo-re/clack
174230

175231
> MIT License
176232
>
177-
> Copyright (c) 2022 vuejs
233+
> Copyright (c) Nate Moore
178234
>
179-
> Permission is hereby granted, free of charge, to any person obtaining a copy
180-
> of this software and associated documentation files (the "Software"), to deal
181-
> in the Software without restriction, including without limitation the rights
182-
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
183-
> copies of the Software, and to permit persons to whom the Software is
184-
> furnished to do so, subject to the following conditions:
235+
> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
185236
>
186-
> The above copyright notice and this permission notice shall be included in all
187-
> copies or substantial portions of the Software.
237+
> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
188238
>
189-
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
190-
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
191-
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
192-
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
193-
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
194-
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
195-
> SOFTWARE.
239+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
196240
>
197241

198242
## ejs
@@ -405,38 +449,15 @@ Repository: git://github.com/mde/ejs.git
405449
> limitations under the License.
406450
>
407451

408-
## picocolors
409-
410-
License: ISC
411-
By: Alexey Raspopov
412-
Repository: git+https://github.com/alexeyraspopov/picocolors.git
413-
414-
> ISC License
415-
>
416-
> Copyright (c) 2021-2024 Oleksii Raspopov, Kostiantyn Denysov, Anton Verinov
417-
>
418-
> Permission to use, copy, modify, and/or distribute this software for any
419-
> purpose with or without fee is hereby granted, provided that the above
420-
> copyright notice and this permission notice appear in all copies.
421-
>
422-
> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
423-
> WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
424-
> MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
425-
> ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
426-
> WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
427-
> ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
428-
> OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
429-
>
430-
431-
## sisteransi
452+
## @vue/create-eslint-config
432453

433454
License: MIT
434-
By: Terkel Gjervig
435-
Repository: git+https://github.com/terkelg/sisteransi.git
455+
By: Haoqun Jiang
456+
Repository: git+https://github.com/vuejs/create-eslint-config.git
436457

437458
> MIT License
438459
>
439-
> Copyright (c) 2018 Terkel Gjervig Nielsen
460+
> Copyright (c) 2022 vuejs
440461
>
441462
> Permission is hereby granted, free of charge, to any person obtaining a copy
442463
> of this software and associated documentation files (the "Software"), to deal

index.ts

+2-6
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { trimBoilerplate, removeCSSImport, emptyRouterConfig } from './utils/tri
2121

2222
import cliPackageJson from './package.json'
2323

24-
const language = getLanguage()
24+
const language = await getLanguage(path.resolve(import.meta.dirname, 'locales'))
2525

2626
const FEATURE_FLAGS = [
2727
'default',
@@ -368,11 +368,7 @@ async function init() {
368368
const pkg = { name: result.packageName, version: '0.0.0' }
369369
fs.writeFileSync(path.resolve(root, 'package.json'), JSON.stringify(pkg, null, 2))
370370

371-
// todo:
372-
// work around the esbuild issue that `import.meta.url` cannot be correctly transpiled
373-
// when bundling for node and the format is cjs
374-
// const templateRoot = new URL('./template', import.meta.url).pathname
375-
const templateRoot = path.resolve(__dirname, 'template')
371+
const templateRoot = new URL('./template', import.meta.url).pathname
376372
const callbacks = []
377373
const render = function render(templateName) {
378374
const templateDir = path.resolve(templateRoot, templateName)

package.json

+5-3
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
"type": "module",
66
"packageManager": "pnpm@10.7.0",
77
"bin": {
8-
"create-vue": "outfile.cjs"
8+
"create-vue": "bundle.js"
99
},
1010
"files": [
1111
"locales",
12-
"outfile.cjs",
12+
"bundle.js",
1313
"template",
1414
"!template/**/node_modules/.bin/*"
1515
],
@@ -19,7 +19,7 @@
1919
"scripts": {
2020
"prepare": "husky",
2121
"format": "prettier --write .",
22-
"build": "zx ./scripts/build.mjs",
22+
"build": "rolldown -c rolldown.config.ts",
2323
"snapshot": "zx ./scripts/snapshot.mjs",
2424
"pretest": "pnpm run build && pnpm run snapshot",
2525
"test": "zx ./scripts/test.mjs",
@@ -53,6 +53,8 @@
5353
"lint-staged": "^15.5.0",
5454
"picocolors": "^1.1.1",
5555
"prettier": "3.5.3",
56+
"rolldown": "1.0.0-beta.7",
57+
"rollup-plugin-license": "^3.6.0",
5658
"vitest": "^3.1.1",
5759
"zx": "^8.4.1"
5860
},

0 commit comments

Comments
 (0)