@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.
@@ -146,13 +146,18 @@ async function format(content, {
146
146
  }) {
147
147
  const [{
148
148
  format
149
- }] = await Promise.all([Promise.resolve().then(function () { return require('./index3.cjs'); }).then(function (n) { return n.index; })]);
149
+ }, {
150
+ default: babel
151
+ }, {
152
+ default: yaml
153
+ }] = await Promise.all([Promise.resolve().then(function () { return require('./standalone.cjs'); }).then(function (n) { return n.standalone; }), Promise.resolve().then(function () { return require('./parser-babel.cjs'); }).then(function (n) { return n.parserBabel; }), Promise.resolve().then(function () { return require('./parser-yaml.cjs'); }).then(function (n) { return n.parserYaml; })]);
150
154
  return format(content, {
151
155
  arrowParens: 'always',
152
156
  bracketSpacing: false,
153
157
  singleQuote: true,
154
158
  trailingComma: 'all',
155
- parser
159
+ parser,
160
+ plugins: [babel, yaml]
156
161
  });
157
162
  }
158
163
 
@@ -241,7 +246,7 @@ async function addToPackageManagerWorkspaces(directory, output, packageManager)
241
246
  const {
242
247
  parse,
243
248
  stringify
244
- } = await Promise.resolve().then(function () { return require('./index4.cjs'); }).then(function (n) { return n.index; });
249
+ } = await Promise.resolve().then(function () { return require('./index3.cjs'); }).then(function (n) { return n.index; });
245
250
  const workspaceYaml = parse(await output.read('pnpm-workspace.yaml'));
246
251
  workspaceYaml.packages = await addToWorkspaces(path.relative(output.root, directory), workspaceYaml.packages ?? []);
247
252
  await output.write('pnpm-workspace.yaml', await format(stringify(workspaceYaml), {
@@ -189,6 +189,7 @@ async function createPackage() {
189
189
  if (partOfMonorepo) {
190
190
  // Write the package’s package.json (the root one was already created)
191
191
  const projectPackageJson = JSON.parse(await packageTemplate.read('package.json'));
192
+ projectPackageJson.repository.directory = path__namespace.relative(directory, packageDirectory);
192
193
  adjustPackageJson(projectPackageJson, {
193
194
  name: packageManager.toValidPackageName(name),
194
195
  react: useReact,
@@ -198,6 +199,7 @@ async function createPackage() {
198
199
  await outputRoot.write(path__namespace.join(packageDirectory, 'package.json'), await packageManager.format(JSON.stringify(projectPackageJson), {
199
200
  as: 'json-stringify'
200
201
  }));
202
+ await outputRoot.write(path__namespace.join(packageDirectory, 'quilt.project.ts'), quiltProject);
201
203
  await Promise.all([packageManager.addToTsConfig(packageDirectory, outputRoot), packageManager.addToPackageManagerWorkspaces(packageDirectory, outputRoot, packageManager$1)]);
202
204
  }
203
205
 
@@ -212,6 +214,15 @@ async function createPackage() {
212
214
  console.log('Installed dependencies.');
213
215
  }
214
216
 
217
+ const packageJsonInstructions = index.stripIndent`
218
+ Your new package is ready to go! However, before you go too much further,
219
+ you should update the following fields in ${index.cyan_1(packageManager.relativeDirectoryForDisplay(path__namespace.relative(process.cwd(), path__namespace.join(packageDirectory, 'package.json'))))}:
220
+
221
+ - ${index.bold_1(`"description"`)}, where you provide a description of what your package does
222
+ - ${index.bold_1(`"repository"`)}, where you should include the ${index.bold_1(`"url"`)} of your project’s repo
223
+ `;
224
+ console.log();
225
+ console.log(packageJsonInstructions);
215
226
  const commands = [];
216
227
 
217
228
  if (!inWorkspace && directory !== process.cwd()) {
@@ -227,17 +238,20 @@ async function createPackage() {
227
238
  commands.push(`git init && git add -A && git commit -m "Initial commit" ${index.dim_1('# Start your git history (optional)')}`);
228
239
  }
229
240
 
230
- const whatsNext = index.stripIndent`
231
- Your new package is ready to go! There’s just ${commands.length > 1 ? 'a few more steps' : 'one more step'} you’ll need to take
232
- in order to start building:
233
- `;
234
- console.log();
235
- console.log(whatsNext);
236
- console.log();
237
- console.log(commands.map(command => ` ${command}`).join('\n'));
241
+ if (commands.length > 0) {
242
+ const whatsNext = index.stripIndent`
243
+ After you update your package.json, there’s ${commands.length > 1 ? 'a few more steps' : 'one more step'} you’ll need to take
244
+ in order to start building:
245
+ `;
246
+ console.log();
247
+ console.log(whatsNext);
248
+ console.log();
249
+ console.log(commands.map(command => ` ${command}`).join('\n'));
250
+ }
251
+
238
252
  const followUp = index.stripIndent`
239
- Quilt can also help you build, test, lint, and type-check your new package.
240
- You can learn more about building packages with Quilt by reading the documentation:
253
+ Quilt can help you build, test, lint, and type-check your new package. You
254
+ can learn more about building packages with Quilt by reading the documentation:
241
255
  ${index.underline_1(index.magenta_1('https://github.com/lemonmade/quilt/tree/main/documentation'))}
242
256
 
243
257
  Have fun! 🎉