@quilted/create 0.1.50 → 0.1.52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/build/cjs/app.cjs +16 -211
  3. package/build/cjs/index.cjs +13 -1
  4. package/build/cjs/index2.cjs +157 -326
  5. package/build/cjs/index3.cjs +307 -7793
  6. package/build/cjs/index4.cjs +7402 -7181
  7. package/build/cjs/index5.cjs +7633 -0
  8. package/build/cjs/module.cjs +318 -0
  9. package/build/cjs/package.cjs +1 -1
  10. package/build/cjs/shared/package-manager.cjs +2 -2
  11. package/build/esm/app.mjs +1 -196
  12. package/build/esm/index.mjs +13 -1
  13. package/build/esm/index2.mjs +157 -325
  14. package/build/esm/index3.mjs +306 -7793
  15. package/build/esm/index4.mjs +7402 -7174
  16. package/build/esm/index5.mjs +7624 -0
  17. package/build/esm/module.mjs +296 -0
  18. package/build/esm/package.mjs +1 -1
  19. package/build/esm/shared/package-manager.mjs +2 -2
  20. package/build/tsconfig.tsbuildinfo +1 -1
  21. package/build/typescript/help.d.ts +1 -1
  22. package/build/typescript/help.d.ts.map +1 -1
  23. package/build/typescript/module.d.ts +2 -0
  24. package/build/typescript/module.d.ts.map +1 -0
  25. package/build/typescript/shared/prompts.d.ts +2 -2
  26. package/build/typescript/shared/prompts.d.ts.map +1 -1
  27. package/build/typescript/shared.d.ts +1 -1
  28. package/build/typescript/shared.d.ts.map +1 -1
  29. package/package.json +1 -1
  30. package/source/create.ts +7 -1
  31. package/source/help.ts +6 -1
  32. package/source/module.ts +426 -0
  33. package/source/shared/prompts.ts +2 -2
  34. package/source/shared.ts +2 -0
  35. package/templates/module/module.ts +3 -0
  36. package/templates/module/package.json +24 -0
  37. package/templates/module/quilt.project.ts +5 -0
  38. package/templates/module/tsconfig.json +9 -0
@@ -0,0 +1,318 @@
1
+ 'use strict';
2
+
3
+ var fs = require('node:fs');
4
+ var path = require('node:path');
5
+ var index$1 = require('./index2.cjs');
6
+ var packageManager = require('./shared/package-manager.cjs');
7
+ var index = require('./index.cjs');
8
+ require('node:tty');
9
+ require('node:child_process');
10
+ require('node:url');
11
+ require('node:readline');
12
+ require('node:events');
13
+
14
+ function _interopNamespaceDefault(e) {
15
+ var n = Object.create(null);
16
+ if (e) {
17
+ Object.keys(e).forEach(function (k) {
18
+ if (k !== 'default') {
19
+ var d = Object.getOwnPropertyDescriptor(e, k);
20
+ Object.defineProperty(n, k, d.get ? d : {
21
+ enumerable: true,
22
+ get: function () { return e[k]; }
23
+ });
24
+ }
25
+ });
26
+ }
27
+ n["default"] = e;
28
+ return Object.freeze(n);
29
+ }
30
+
31
+ var fs__namespace = /*#__PURE__*/_interopNamespaceDefault(fs);
32
+ var path__namespace = /*#__PURE__*/_interopNamespaceDefault(path);
33
+
34
+ async function createModule() {
35
+ const argv = getArgv();
36
+ if (argv['--help']) {
37
+ index.printHelp({
38
+ kind: 'module',
39
+ packageManager: argv['--package-manager']?.toLowerCase()
40
+ });
41
+ return;
42
+ }
43
+ const inWorkspace = await packageManager.getInWorkspace(argv);
44
+ const name = await getName(argv);
45
+ const directory = await getDirectory(argv, {
46
+ name
47
+ });
48
+ const entry = await getEntry(argv, {
49
+ name
50
+ });
51
+ const useReact = await getReact(argv);
52
+ const createAsMonorepo = !inWorkspace && (await packageManager.getCreateAsMonorepo(argv, {
53
+ type: 'module',
54
+ default: false
55
+ }));
56
+ const setupExtras = await packageManager.getExtrasToSetup(argv, {
57
+ inWorkspace
58
+ });
59
+ const shouldInstall = await packageManager.getShouldInstall(argv, {
60
+ type: 'module'
61
+ });
62
+ const packageManager$1 = await packageManager.getPackageManager(argv, {
63
+ root: directory
64
+ });
65
+ const partOfMonorepo = inWorkspace || createAsMonorepo;
66
+ const moduleDirectory = createAsMonorepo ? path__namespace.join(directory, 'app') : directory;
67
+ if (fs__namespace.existsSync(directory)) {
68
+ await packageManager.emptyDirectory(directory);
69
+ if (moduleDirectory !== directory) {
70
+ fs__namespace.mkdirSync(moduleDirectory, {
71
+ recursive: true
72
+ });
73
+ }
74
+ } else {
75
+ fs__namespace.mkdirSync(moduleDirectory, {
76
+ recursive: true
77
+ });
78
+ }
79
+ const rootDirectory = inWorkspace ? process.cwd() : directory;
80
+ const outputRoot = packageManager.createOutputTarget(rootDirectory);
81
+ const moduleTemplate = packageManager.loadTemplate('module');
82
+ const workspaceTemplate = packageManager.loadTemplate('workspace');
83
+
84
+ // If we aren’t already in a workspace, copy the workspace files over, which
85
+ // are needed if we are making a monorepo or not.
86
+ if (!inWorkspace) {
87
+ await workspaceTemplate.copy(directory, file => {
88
+ // When this is a single project, we use the project’s Quilt configuration as the base.
89
+ if (file === 'quilt.workspace.ts') return createAsMonorepo;
90
+
91
+ // We need to make some adjustments to the root package.json
92
+ if (file === 'package.json') return false;
93
+ return true;
94
+ });
95
+
96
+ // If we are creating a monorepo, we need to add the root package.json and
97
+ // package manager workspace configuration.
98
+ if (createAsMonorepo) {
99
+ const moduleRelativeToRoot = packageManager.relativeDirectoryForDisplay(path__namespace.relative(directory, moduleDirectory));
100
+ const workspacePackageJson = JSON.parse(await workspaceTemplate.read('package.json'));
101
+ workspacePackageJson.name = packageManager.toValidPackageName(name);
102
+ workspacePackageJson.workspaces = [moduleRelativeToRoot, './packages/*'];
103
+ if (packageManager$1.type === 'pnpm') {
104
+ await outputRoot.write('pnpm-workspace.yaml', await packageManager.format(`
105
+ packages:
106
+ - '${moduleRelativeToRoot}'
107
+ - './packages/*'
108
+ `, {
109
+ as: 'yaml'
110
+ }));
111
+ }
112
+ await outputRoot.write('package.json', await packageManager.format(JSON.stringify(workspacePackageJson), {
113
+ as: 'json-stringify'
114
+ }));
115
+ } else {
116
+ const [projectPackageJson, projectTSConfig, workspacePackageJson] = await Promise.all([moduleTemplate.read('package.json').then(content => JSON.parse(content)), moduleTemplate.read('tsconfig.json').then(content => JSON.parse(content)), workspaceTemplate.read('package.json').then(content => JSON.parse(content))]);
117
+ const combinedPackageJson = packageManager.mergeWorkspaceAndProjectPackageJsons(projectPackageJson, workspacePackageJson);
118
+ adjustPackageJson(combinedPackageJson, {
119
+ name,
120
+ entry,
121
+ react: useReact
122
+ });
123
+ delete combinedPackageJson.workspaces;
124
+ let quiltProject = await moduleTemplate.read('quilt.project.ts');
125
+ quiltProject = quiltProject.replace('quiltModule', 'quiltWorkspace, quiltModule').replace('quiltModule(', 'quiltWorkspace(), quiltModule(');
126
+ if (!useReact) {
127
+ quiltProject = quiltProject.replace('quiltPackage()', 'quiltPackage({react: false})');
128
+ }
129
+ await outputRoot.write('quilt.project.ts', await packageManager.format(quiltProject, {
130
+ as: 'typescript'
131
+ }));
132
+ await outputRoot.write('package.json', await packageManager.format(JSON.stringify(combinedPackageJson), {
133
+ as: 'json-stringify'
134
+ }));
135
+ await outputRoot.write('tsconfig.json', await packageManager.format(JSON.stringify(projectTSConfig), {
136
+ as: 'json'
137
+ }));
138
+ }
139
+ if (setupExtras.has('github')) {
140
+ await packageManager.loadTemplate('github').copy(directory);
141
+ }
142
+ if (setupExtras.has('vscode')) {
143
+ await packageManager.loadTemplate('vscode').copy(directory);
144
+ }
145
+ }
146
+ await moduleTemplate.copy(moduleDirectory, file => {
147
+ // If we are in a monorepo, we can use all the template files as they are
148
+ if (file === 'quilt.project.ts' || file === 'tsconfig.json') {
149
+ return partOfMonorepo;
150
+ }
151
+
152
+ // We will adjust the entry file
153
+ if (file === 'module.ts') {
154
+ return false;
155
+ }
156
+
157
+ // We need to make some adjustments the project’s package.json
158
+ return file !== 'package.json';
159
+ });
160
+ await outputRoot.write(path__namespace.join(moduleDirectory, entry), await moduleTemplate.read('module.ts'));
161
+ if (partOfMonorepo) {
162
+ // Write the app’s package.json (the root one was already created)
163
+ const projectPackageJson = JSON.parse(await moduleTemplate.read('package.json'));
164
+ adjustPackageJson(projectPackageJson, {
165
+ name,
166
+ entry,
167
+ react: useReact
168
+ });
169
+ await outputRoot.write(path__namespace.join(moduleDirectory, 'package.json'), await packageManager.format(JSON.stringify(projectPackageJson), {
170
+ as: 'json-stringify'
171
+ }));
172
+ await Promise.all([packageManager.addToTsConfig(moduleDirectory, outputRoot), packageManager.addToPackageManagerWorkspaces(moduleDirectory, outputRoot, packageManager$1.type)]);
173
+ }
174
+ if (shouldInstall) {
175
+ console.log();
176
+ // TODO: better loading, handle errors
177
+ await packageManager$1.install();
178
+ }
179
+ const commands = [];
180
+ if (!inWorkspace && directory !== process.cwd()) {
181
+ commands.push(`cd ${packageManager.cyan_1(packageManager.relativeDirectoryForDisplay(path__namespace.relative(process.cwd(), directory)))} ${packageManager.dim_1('# Move into your new module’s directory')}`);
182
+ }
183
+ if (!shouldInstall) {
184
+ commands.push(`${packageManager$1.commands.install()} ${packageManager.dim_1('# Install all your dependencies')}`);
185
+ }
186
+ if (commands.length === 0) {
187
+ console.log();
188
+ console.log('Your new module is ready to go!');
189
+ } else {
190
+ const whatsNext = index.stripIndent`
191
+ Your new module is ready to go! There’s just ${commands.length > 1 ? 'a few more steps' : 'one more step'} you’ll need to take
192
+ in order to start developing:
193
+ `;
194
+ console.log();
195
+ console.log(whatsNext);
196
+ console.log();
197
+ console.log(commands.map(command => ` ${command}`).join('\n'));
198
+ }
199
+ const followUp = index.stripIndent`
200
+ Quilt can also help you build, test, lint, and type-check your new module.
201
+ You can learn more about building modules with Quilt by reading the documentation:
202
+ ${packageManager.underline_1(packageManager.magenta_1('https://github.com/lemonmade/quilt/tree/main/documentation'))}
203
+
204
+ Have fun! 🎉
205
+ `;
206
+ console.log();
207
+ console.log(followUp);
208
+ }
209
+
210
+ // Argument handling
211
+
212
+ function getArgv() {
213
+ const argv = index$1.arg_1({
214
+ '--yes': Boolean,
215
+ '-y': '--yes',
216
+ '--name': String,
217
+ '--directory': String,
218
+ '--entry': String,
219
+ '--install': Boolean,
220
+ '--no-install': Boolean,
221
+ '--monorepo': Boolean,
222
+ '--no-monorepo': Boolean,
223
+ '--package-manager': String,
224
+ '--extras': [String],
225
+ '--no-extras': Boolean,
226
+ '--react': Boolean,
227
+ '--no-react': Boolean,
228
+ '--help': Boolean,
229
+ '-h': '--help'
230
+ }, {
231
+ permissive: true
232
+ });
233
+ return argv;
234
+ }
235
+ async function getName(argv) {
236
+ let {
237
+ '--name': name
238
+ } = argv;
239
+ if (name == null) {
240
+ name = await index.prompt({
241
+ type: 'text',
242
+ message: 'What would you like to name your new module?',
243
+ initial: 'my-module'
244
+ });
245
+ }
246
+ return name;
247
+ }
248
+ async function getEntry(argv, {
249
+ name
250
+ }) {
251
+ if (argv['--entry']) {
252
+ return argv['--entry'];
253
+ }
254
+ const entry = await index.prompt({
255
+ type: 'text',
256
+ message: 'What do you want to name your entry file?',
257
+ initial: `${packageManager.toValidPackageName(name)}.ts`
258
+ });
259
+ return entry;
260
+ }
261
+ async function getDirectory(argv, {
262
+ name
263
+ }) {
264
+ let directory = path__namespace.resolve(argv['--directory'] ?? packageManager.toValidPackageName(name));
265
+ while (!argv['--yes']) {
266
+ if (fs__namespace.existsSync(directory) && !(await packageManager.isEmpty(directory))) {
267
+ const relativeDirectory = path__namespace.relative(process.cwd(), directory);
268
+ const empty = await index.prompt({
269
+ type: 'confirm',
270
+ message: `Directory ${packageManager.bold_1(packageManager.relativeDirectoryForDisplay(relativeDirectory))} is not empty, is it safe to empty it?`,
271
+ initial: true
272
+ });
273
+ if (empty) break;
274
+ const promptDirectory = await index.prompt({
275
+ type: 'text',
276
+ message: 'What directory do you want to create your new module in?'
277
+ });
278
+ directory = path__namespace.resolve(promptDirectory);
279
+ } else {
280
+ break;
281
+ }
282
+ }
283
+ return directory;
284
+ }
285
+ async function getReact(args) {
286
+ let useReact;
287
+ if (args['--react'] || args['--yes']) {
288
+ useReact = true;
289
+ } else if (args['--no-react']) {
290
+ useReact = false;
291
+ } else {
292
+ useReact = await index.prompt({
293
+ type: 'confirm',
294
+ message: 'Will this module depend on React?',
295
+ initial: false
296
+ });
297
+ }
298
+ return useReact;
299
+ }
300
+ function adjustPackageJson(packageJson, {
301
+ name,
302
+ entry,
303
+ react
304
+ }) {
305
+ packageJson.name = name;
306
+ packageJson.main = `./${entry}`;
307
+ if (!react) {
308
+ delete packageJson.devDependencies['@types/react'];
309
+ delete packageJson.devDependencies['@types/react-dom'];
310
+ delete packageJson.devDependencies['preact'];
311
+ delete packageJson.devDependencies['react'];
312
+ delete packageJson.devDependencies['react-dom'];
313
+ packageJson.eslintConfig.extends = packageJson.eslintConfig.extends.filter(extend => !extend.includes('react'));
314
+ }
315
+ return packageJson;
316
+ }
317
+
318
+ exports.createModule = createModule;
@@ -376,7 +376,7 @@ async function getRepository(args, {
376
376
  if (!inWorkspace) return;
377
377
  const {
378
378
  globby
379
- } = await Promise.resolve().then(function () { return require('./index4.cjs'); });
379
+ } = await Promise.resolve().then(function () { return require('./index5.cjs'); });
380
380
  const files = await globby('**/package.json', {
381
381
  ignore: ['**/node_modules']
382
382
  });
@@ -122,7 +122,7 @@ async function getPackageRoot() {
122
122
  packageRootPromise = (async () => {
123
123
  const {
124
124
  packageDirectory
125
- } = await Promise.resolve().then(function () { return require('../index2.cjs'); });
125
+ } = await Promise.resolve().then(function () { return require('../index3.cjs'); });
126
126
  return packageDirectory({
127
127
  cwd: path__namespace.dirname(node_url.fileURLToPath((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('shared/package-manager.cjs', document.baseURI).href))))
128
128
  });
@@ -603,7 +603,7 @@ async function addToPackageManagerWorkspaces(directory, output, packageManager)
603
603
  const {
604
604
  parse,
605
605
  stringify
606
- } = await Promise.resolve().then(function () { return require('../index3.cjs'); }).then(function (n) { return n.index; });
606
+ } = await Promise.resolve().then(function () { return require('../index4.cjs'); }).then(function (n) { return n.index; });
607
607
  const workspaceYaml = parse(await output.read('pnpm-workspace.yaml'));
608
608
  workspaceYaml.packages = await addToWorkspaces(path.relative(output.root, directory), workspaceYaml.packages ?? []);
609
609
  await output.write('pnpm-workspace.yaml', await format(stringify(workspaceYaml), {
package/build/esm/app.mjs CHANGED
@@ -1,5 +1,6 @@
1
1
  import * as fs from 'node:fs';
2
2
  import * as path from 'node:path';
3
+ import { a as arg_1 } from './index2.mjs';
3
4
  import { c as cyan_1, b as bold_1, g as getInWorkspace, a as getCreateAsMonorepo, d as getExtrasToSetup, e as getShouldInstall, f as getPackageManager, h as emptyDirectory, r as relativeDirectoryForDisplay, t as toValidPackageName, i as format, m as mergeWorkspaceAndProjectPackageJsons, l as loadTemplate, j as addToTsConfig, k as addToPackageManagerWorkspaces, n as dim_1, u as underline_1, o as magenta_1, p as isEmpty, q as createOutputTarget } from './shared/package-manager.mjs';
4
5
  import { s as stripIndent, p as printHelp, a as prompt } from './index.mjs';
5
6
  import 'node:tty';
@@ -8,202 +9,6 @@ import 'node:url';
8
9
  import 'node:readline';
9
10
  import 'node:events';
10
11
 
11
- const flagSymbol = Symbol('arg flag');
12
-
13
- class ArgError extends Error {
14
- constructor(msg, code) {
15
- super(msg);
16
- this.name = 'ArgError';
17
- this.code = code;
18
-
19
- Object.setPrototypeOf(this, ArgError.prototype);
20
- }
21
- }
22
-
23
- function arg(
24
- opts,
25
- {
26
- argv = process.argv.slice(2),
27
- permissive = false,
28
- stopAtPositional = false
29
- } = {}
30
- ) {
31
- if (!opts) {
32
- throw new ArgError(
33
- 'argument specification object is required',
34
- 'ARG_CONFIG_NO_SPEC'
35
- );
36
- }
37
-
38
- const result = { _: [] };
39
-
40
- const aliases = {};
41
- const handlers = {};
42
-
43
- for (const key of Object.keys(opts)) {
44
- if (!key) {
45
- throw new ArgError(
46
- 'argument key cannot be an empty string',
47
- 'ARG_CONFIG_EMPTY_KEY'
48
- );
49
- }
50
-
51
- if (key[0] !== '-') {
52
- throw new ArgError(
53
- `argument key must start with '-' but found: '${key}'`,
54
- 'ARG_CONFIG_NONOPT_KEY'
55
- );
56
- }
57
-
58
- if (key.length === 1) {
59
- throw new ArgError(
60
- `argument key must have a name; singular '-' keys are not allowed: ${key}`,
61
- 'ARG_CONFIG_NONAME_KEY'
62
- );
63
- }
64
-
65
- if (typeof opts[key] === 'string') {
66
- aliases[key] = opts[key];
67
- continue;
68
- }
69
-
70
- let type = opts[key];
71
- let isFlag = false;
72
-
73
- if (
74
- Array.isArray(type) &&
75
- type.length === 1 &&
76
- typeof type[0] === 'function'
77
- ) {
78
- const [fn] = type;
79
- type = (value, name, prev = []) => {
80
- prev.push(fn(value, name, prev[prev.length - 1]));
81
- return prev;
82
- };
83
- isFlag = fn === Boolean || fn[flagSymbol] === true;
84
- } else if (typeof type === 'function') {
85
- isFlag = type === Boolean || type[flagSymbol] === true;
86
- } else {
87
- throw new ArgError(
88
- `type missing or not a function or valid array type: ${key}`,
89
- 'ARG_CONFIG_VAD_TYPE'
90
- );
91
- }
92
-
93
- if (key[1] !== '-' && key.length > 2) {
94
- throw new ArgError(
95
- `short argument keys (with a single hyphen) must have only one character: ${key}`,
96
- 'ARG_CONFIG_SHORTOPT_TOOLONG'
97
- );
98
- }
99
-
100
- handlers[key] = [type, isFlag];
101
- }
102
-
103
- for (let i = 0, len = argv.length; i < len; i++) {
104
- const wholeArg = argv[i];
105
-
106
- if (stopAtPositional && result._.length > 0) {
107
- result._ = result._.concat(argv.slice(i));
108
- break;
109
- }
110
-
111
- if (wholeArg === '--') {
112
- result._ = result._.concat(argv.slice(i + 1));
113
- break;
114
- }
115
-
116
- if (wholeArg.length > 1 && wholeArg[0] === '-') {
117
- /* eslint-disable operator-linebreak */
118
- const separatedArguments =
119
- wholeArg[1] === '-' || wholeArg.length === 2
120
- ? [wholeArg]
121
- : wholeArg
122
- .slice(1)
123
- .split('')
124
- .map((a) => `-${a}`);
125
- /* eslint-enable operator-linebreak */
126
-
127
- for (let j = 0; j < separatedArguments.length; j++) {
128
- const arg = separatedArguments[j];
129
- const [originalArgName, argStr] =
130
- arg[1] === '-' ? arg.split(/=(.*)/, 2) : [arg, undefined];
131
-
132
- let argName = originalArgName;
133
- while (argName in aliases) {
134
- argName = aliases[argName];
135
- }
136
-
137
- if (!(argName in handlers)) {
138
- if (permissive) {
139
- result._.push(arg);
140
- continue;
141
- } else {
142
- throw new ArgError(
143
- `unknown or unexpected option: ${originalArgName}`,
144
- 'ARG_UNKNOWN_OPTION'
145
- );
146
- }
147
- }
148
-
149
- const [type, isFlag] = handlers[argName];
150
-
151
- if (!isFlag && j + 1 < separatedArguments.length) {
152
- throw new ArgError(
153
- `option requires argument (but was followed by another short argument): ${originalArgName}`,
154
- 'ARG_MISSING_REQUIRED_SHORTARG'
155
- );
156
- }
157
-
158
- if (isFlag) {
159
- result[argName] = type(true, argName, result[argName]);
160
- } else if (argStr === undefined) {
161
- if (
162
- argv.length < i + 2 ||
163
- (argv[i + 1].length > 1 &&
164
- argv[i + 1][0] === '-' &&
165
- !(
166
- argv[i + 1].match(/^-?\d*(\.(?=\d))?\d*$/) &&
167
- (type === Number ||
168
- // eslint-disable-next-line no-undef
169
- (typeof BigInt !== 'undefined' && type === BigInt))
170
- ))
171
- ) {
172
- const extended =
173
- originalArgName === argName ? '' : ` (alias for ${argName})`;
174
- throw new ArgError(
175
- `option requires argument: ${originalArgName}${extended}`,
176
- 'ARG_MISSING_REQUIRED_LONGARG'
177
- );
178
- }
179
-
180
- result[argName] = type(argv[i + 1], argName, result[argName]);
181
- ++i;
182
- } else {
183
- result[argName] = type(argStr, argName, result[argName]);
184
- }
185
- }
186
- } else {
187
- result._.push(wholeArg);
188
- }
189
- }
190
-
191
- return result;
192
- }
193
-
194
- arg.flag = (fn) => {
195
- fn[flagSymbol] = true;
196
- return fn;
197
- };
198
-
199
- // Utility types
200
- arg.COUNT = arg.flag((v, name, existingCount) => (existingCount || 0) + 1);
201
-
202
- // Expose error class
203
- arg.ArgError = ArgError;
204
-
205
- var arg_1 = arg;
206
-
207
12
  async function createApp() {
208
13
  const argv = getArgv();
209
14
  if (argv['--help']) {
@@ -7122,6 +7122,7 @@ function printHelp({
7122
7122
 
7123
7123
  - ${magenta_1('app')}, a web application
7124
7124
  - ${magenta_1('package')}, a shared library of code
7125
+ - ${magenta_1('module')}, a standalone JavaScript module for a browser
7125
7126
 
7126
7127
  You’ll be asked a few additional questions based on the kind you choose.
7127
7128
  `;
@@ -7194,7 +7195,7 @@ function createCommand(explicitPackageManager) {
7194
7195
  }
7195
7196
 
7196
7197
  /* eslint no-console: off */
7197
- const VALID_PROJECT_KINDS = new Set(['app', 'package']);
7198
+ const VALID_PROJECT_KINDS = new Set(['app', 'package', 'module']);
7198
7199
  run().catch(error => {
7199
7200
  if (AbortError.test(error)) return;
7200
7201
  console.error(error);
@@ -7233,6 +7234,9 @@ async function run() {
7233
7234
  choices: [{
7234
7235
  title: 'App',
7235
7236
  value: 'app'
7237
+ }, {
7238
+ title: 'Module',
7239
+ value: 'module'
7236
7240
  }, {
7237
7241
  title: 'Package',
7238
7242
  value: 'package'
@@ -7248,6 +7252,14 @@ async function run() {
7248
7252
  await createApp();
7249
7253
  break;
7250
7254
  }
7255
+ case 'module':
7256
+ {
7257
+ const {
7258
+ createModule
7259
+ } = await import('./module.mjs');
7260
+ await createModule();
7261
+ break;
7262
+ }
7251
7263
  case 'package':
7252
7264
  {
7253
7265
  const {