@quilted/create 0.1.14 → 0.1.17
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.
- package/CHANGELOG.md +20 -0
- package/build/cjs/_commonjsHelpers.cjs +10 -0
- package/build/cjs/index3.cjs +7578 -49784
- package/build/cjs/package-manager.cjs +8 -3
- package/build/cjs/package.cjs +24 -10
- package/build/cjs/parser-babel.cjs +59 -0
- package/build/cjs/parser-yaml.cjs +182 -0
- package/build/cjs/standalone.cjs +147 -0
- package/build/esm/_commonjsHelpers.mjs +7 -0
- package/build/esm/index3.mjs +7578 -49773
- package/build/esm/package-manager.mjs +8 -3
- package/build/esm/package.mjs +25 -11
- package/build/esm/parser-babel.mjs +57 -0
- package/build/esm/parser-yaml.mjs +180 -0
- package/build/esm/standalone.mjs +145 -0
- package/build/tsconfig.tsbuildinfo +1 -1
- package/build/typescript/package.d.ts.map +1 -1
- package/build/typescript/shared.d.ts.map +1 -1
- package/package.json +1 -1
- package/source/package.ts +46 -12
- package/source/shared.ts +6 -1
- package/build/cjs/index4.cjs +0 -7854
- package/build/esm/index4.mjs +0 -7852
|
@@ -124,13 +124,18 @@ async function format(content, {
|
|
|
124
124
|
}) {
|
|
125
125
|
const [{
|
|
126
126
|
format
|
|
127
|
-
}
|
|
127
|
+
}, {
|
|
128
|
+
default: babel
|
|
129
|
+
}, {
|
|
130
|
+
default: yaml
|
|
131
|
+
}] = await Promise.all([import('./standalone.mjs').then(function (n) { return n.s; }), import('./parser-babel.mjs').then(function (n) { return n.p; }), import('./parser-yaml.mjs').then(function (n) { return n.p; })]);
|
|
128
132
|
return format(content, {
|
|
129
133
|
arrowParens: 'always',
|
|
130
134
|
bracketSpacing: false,
|
|
131
135
|
singleQuote: true,
|
|
132
136
|
trailingComma: 'all',
|
|
133
|
-
parser
|
|
137
|
+
parser,
|
|
138
|
+
plugins: [babel, yaml]
|
|
134
139
|
});
|
|
135
140
|
}
|
|
136
141
|
|
|
@@ -219,7 +224,7 @@ async function addToPackageManagerWorkspaces(directory, output, packageManager)
|
|
|
219
224
|
const {
|
|
220
225
|
parse,
|
|
221
226
|
stringify
|
|
222
|
-
} = await import('./
|
|
227
|
+
} = await import('./index3.mjs').then(function (n) { return n.i; });
|
|
223
228
|
const workspaceYaml = parse(await output.read('pnpm-workspace.yaml'));
|
|
224
229
|
workspaceYaml.packages = await addToWorkspaces(relative(output.root, directory), workspaceYaml.packages ?? []);
|
|
225
230
|
await output.write('pnpm-workspace.yaml', await format(stringify(workspaceYaml), {
|
package/build/esm/package.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as fs from 'fs';
|
|
2
2
|
import * as path from 'path';
|
|
3
3
|
import { execSync } from 'child_process';
|
|
4
|
-
import { s as stripIndent, c as cyan_1, p as printHelp, g as getCreateAsMonorepo, a as getShouldInstall, d as getPackageManager, e as getExtrasToSetup, f as dim_1, u as underline_1, m as magenta_1, h as arg_1, i as prompt
|
|
4
|
+
import { s as stripIndent, c as cyan_1, p as printHelp, g as getCreateAsMonorepo, a as getShouldInstall, d as getPackageManager, e as getExtrasToSetup, b as bold_1, f as dim_1, u as underline_1, m as magenta_1, h as arg_1, i as prompt } from './index.mjs';
|
|
5
5
|
import { t as toValidPackageName, e as emptyDirectory, f as format, l as loadTemplate, a as addToTsConfig, b as addToPackageManagerWorkspaces, r as relativeDirectoryForDisplay, i as isEmpty, c as createOutputTarget } from './package-manager.mjs';
|
|
6
6
|
import 'tty';
|
|
7
7
|
import 'url';
|
|
@@ -166,6 +166,7 @@ async function createPackage() {
|
|
|
166
166
|
if (partOfMonorepo) {
|
|
167
167
|
// Write the package’s package.json (the root one was already created)
|
|
168
168
|
const projectPackageJson = JSON.parse(await packageTemplate.read('package.json'));
|
|
169
|
+
projectPackageJson.repository.directory = path.relative(directory, packageDirectory);
|
|
169
170
|
adjustPackageJson(projectPackageJson, {
|
|
170
171
|
name: toValidPackageName(name),
|
|
171
172
|
react: useReact,
|
|
@@ -175,6 +176,7 @@ async function createPackage() {
|
|
|
175
176
|
await outputRoot.write(path.join(packageDirectory, 'package.json'), await format(JSON.stringify(projectPackageJson), {
|
|
176
177
|
as: 'json-stringify'
|
|
177
178
|
}));
|
|
179
|
+
await outputRoot.write(path.join(packageDirectory, 'quilt.project.ts'), quiltProject);
|
|
178
180
|
await Promise.all([addToTsConfig(packageDirectory, outputRoot), addToPackageManagerWorkspaces(packageDirectory, outputRoot, packageManager)]);
|
|
179
181
|
}
|
|
180
182
|
|
|
@@ -189,6 +191,15 @@ async function createPackage() {
|
|
|
189
191
|
console.log('Installed dependencies.');
|
|
190
192
|
}
|
|
191
193
|
|
|
194
|
+
const packageJsonInstructions = stripIndent`
|
|
195
|
+
Your new package is ready to go! However, before you go too much further,
|
|
196
|
+
you should update the following fields in ${cyan_1(relativeDirectoryForDisplay(path.relative(process.cwd(), path.join(packageDirectory, 'package.json'))))}:
|
|
197
|
+
|
|
198
|
+
- ${bold_1(`"description"`)}, where you provide a description of what your package does
|
|
199
|
+
- ${bold_1(`"repository"`)}, where you should include the ${bold_1(`"url"`)} of your project’s repo
|
|
200
|
+
`;
|
|
201
|
+
console.log();
|
|
202
|
+
console.log(packageJsonInstructions);
|
|
192
203
|
const commands = [];
|
|
193
204
|
|
|
194
205
|
if (!inWorkspace && directory !== process.cwd()) {
|
|
@@ -204,17 +215,20 @@ async function createPackage() {
|
|
|
204
215
|
commands.push(`git init && git add -A && git commit -m "Initial commit" ${dim_1('# Start your git history (optional)')}`);
|
|
205
216
|
}
|
|
206
217
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
218
|
+
if (commands.length > 0) {
|
|
219
|
+
const whatsNext = stripIndent`
|
|
220
|
+
After you update your package.json, there’s ${commands.length > 1 ? 'a few more steps' : 'one more step'} you’ll need to take
|
|
221
|
+
in order to start building:
|
|
222
|
+
`;
|
|
223
|
+
console.log();
|
|
224
|
+
console.log(whatsNext);
|
|
225
|
+
console.log();
|
|
226
|
+
console.log(commands.map(command => ` ${command}`).join('\n'));
|
|
227
|
+
}
|
|
228
|
+
|
|
215
229
|
const followUp = stripIndent`
|
|
216
|
-
Quilt can
|
|
217
|
-
|
|
230
|
+
Quilt can help you build, test, lint, and type-check your new package. You
|
|
231
|
+
can learn more about building packages with Quilt by reading the documentation:
|
|
218
232
|
${underline_1(magenta_1('https://github.com/lemonmade/quilt/tree/main/documentation'))}
|
|
219
233
|
|
|
220
234
|
Have fun! 🎉
|