create-krispya 0.3.0 → 0.4.0

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/dist/index.cjs CHANGED
@@ -437,17 +437,24 @@ function generateOxfmt(generator, options) {
437
437
  bracketSpacing: defaultFormatterConfig.bracketSpacing,
438
438
  arrowParens: defaultFormatterConfig.arrowParens
439
439
  };
440
- generator.addFile(".oxfmt.json", {
440
+ generator.addFile(".config/oxfmt.json", {
441
441
  type: "text",
442
442
  content: JSON.stringify(oxfmtConfig, null, 2)
443
443
  });
444
- generator.addScript("format", "oxfmt --write .");
444
+ generator.addScript("format", "oxfmt -c .config/oxfmt.json --write .");
445
445
  generator.inject(
446
446
  "readme-tools",
447
447
  "[Oxfmt](https://oxc.rs/docs/guide/usage/formatter) - Fast Prettier-compatible code formatter"
448
448
  );
449
449
  generator.inject("vscode-extension-suggestion", "oxc.oxc-vscode");
450
450
  generator.addVscodeSetting("editor.defaultFormatter", "oxc.oxc-vscode");
451
+ generator.addVscodeSetting("oxc.fmt.configPath", ".config/oxfmt.json");
452
+ generator.addVscodeSetting("[json]", {
453
+ "editor.defaultFormatter": "vscode.json-language-features"
454
+ });
455
+ generator.addVscodeSetting("[jsonc]", {
456
+ "editor.defaultFormatter": "vscode.json-language-features"
457
+ });
451
458
  }
452
459
 
453
460
  function toOxlintLevel(level) {
@@ -465,7 +472,7 @@ function generateOxlint(generator, options) {
465
472
  plugins.push("react");
466
473
  }
467
474
  const oxlintConfig = {
468
- $schema: "./node_modules/oxlint/configuration_schema.json",
475
+ $schema: "../node_modules/oxlint/configuration_schema.json",
469
476
  plugins,
470
477
  rules: {
471
478
  "no-unused-vars": [
@@ -484,17 +491,18 @@ function generateOxlint(generator, options) {
484
491
  },
485
492
  ignorePatterns: defaultLinterConfig.ignorePatterns
486
493
  };
487
- generator.addFile("oxlint.json", {
494
+ generator.addFile(".config/oxlint.json", {
488
495
  type: "text",
489
496
  content: JSON.stringify(oxlintConfig, null, 2)
490
497
  });
491
- generator.addScript("lint", "oxlint");
498
+ generator.addScript("lint", "oxlint -c .config/oxlint.json");
492
499
  generator.inject(
493
500
  "readme-tools",
494
501
  "[Oxlint](https://oxc.rs/docs/guide/usage/linter) - A fast linter for JavaScript and TypeScript"
495
502
  );
496
503
  generator.inject("vscode-extension-suggestion", "oxc.oxc-vscode");
497
504
  generator.addVscodeSetting("oxc.enable", true);
505
+ generator.addVscodeSetting("oxc.configPath", ".config/oxlint.json");
498
506
  }
499
507
 
500
508
  function generatePostprocessing(generator, options) {
@@ -857,11 +865,11 @@ function generateUnbuild(generator) {
857
865
  }
858
866
  buildConfigLines.push(` },`);
859
867
  buildConfigLines.push(`})`);
860
- generator.addFile(`build.config.${ext}`, {
868
+ generator.addFile(`.config/build.config.${ext}`, {
861
869
  type: "text",
862
870
  content: buildConfigLines.join("\n")
863
871
  });
864
- generator.addScript("build", "unbuild");
872
+ generator.addScript("build", `unbuild --config .config/build.config.${ext}`);
865
873
  generator.inject(
866
874
  "readme-libraries",
867
875
  "[unbuild](https://github.com/unjs/unbuild) - Unified JavaScript build system"
package/dist/index.mjs CHANGED
@@ -431,17 +431,24 @@ function generateOxfmt(generator, options) {
431
431
  bracketSpacing: defaultFormatterConfig.bracketSpacing,
432
432
  arrowParens: defaultFormatterConfig.arrowParens
433
433
  };
434
- generator.addFile(".oxfmt.json", {
434
+ generator.addFile(".config/oxfmt.json", {
435
435
  type: "text",
436
436
  content: JSON.stringify(oxfmtConfig, null, 2)
437
437
  });
438
- generator.addScript("format", "oxfmt --write .");
438
+ generator.addScript("format", "oxfmt -c .config/oxfmt.json --write .");
439
439
  generator.inject(
440
440
  "readme-tools",
441
441
  "[Oxfmt](https://oxc.rs/docs/guide/usage/formatter) - Fast Prettier-compatible code formatter"
442
442
  );
443
443
  generator.inject("vscode-extension-suggestion", "oxc.oxc-vscode");
444
444
  generator.addVscodeSetting("editor.defaultFormatter", "oxc.oxc-vscode");
445
+ generator.addVscodeSetting("oxc.fmt.configPath", ".config/oxfmt.json");
446
+ generator.addVscodeSetting("[json]", {
447
+ "editor.defaultFormatter": "vscode.json-language-features"
448
+ });
449
+ generator.addVscodeSetting("[jsonc]", {
450
+ "editor.defaultFormatter": "vscode.json-language-features"
451
+ });
445
452
  }
446
453
 
447
454
  function toOxlintLevel(level) {
@@ -459,7 +466,7 @@ function generateOxlint(generator, options) {
459
466
  plugins.push("react");
460
467
  }
461
468
  const oxlintConfig = {
462
- $schema: "./node_modules/oxlint/configuration_schema.json",
469
+ $schema: "../node_modules/oxlint/configuration_schema.json",
463
470
  plugins,
464
471
  rules: {
465
472
  "no-unused-vars": [
@@ -478,17 +485,18 @@ function generateOxlint(generator, options) {
478
485
  },
479
486
  ignorePatterns: defaultLinterConfig.ignorePatterns
480
487
  };
481
- generator.addFile("oxlint.json", {
488
+ generator.addFile(".config/oxlint.json", {
482
489
  type: "text",
483
490
  content: JSON.stringify(oxlintConfig, null, 2)
484
491
  });
485
- generator.addScript("lint", "oxlint");
492
+ generator.addScript("lint", "oxlint -c .config/oxlint.json");
486
493
  generator.inject(
487
494
  "readme-tools",
488
495
  "[Oxlint](https://oxc.rs/docs/guide/usage/linter) - A fast linter for JavaScript and TypeScript"
489
496
  );
490
497
  generator.inject("vscode-extension-suggestion", "oxc.oxc-vscode");
491
498
  generator.addVscodeSetting("oxc.enable", true);
499
+ generator.addVscodeSetting("oxc.configPath", ".config/oxlint.json");
492
500
  }
493
501
 
494
502
  function generatePostprocessing(generator, options) {
@@ -851,11 +859,11 @@ function generateUnbuild(generator) {
851
859
  }
852
860
  buildConfigLines.push(` },`);
853
861
  buildConfigLines.push(`})`);
854
- generator.addFile(`build.config.${ext}`, {
862
+ generator.addFile(`.config/build.config.${ext}`, {
855
863
  type: "text",
856
864
  content: buildConfigLines.join("\n")
857
865
  });
858
- generator.addScript("build", "unbuild");
866
+ generator.addScript("build", `unbuild --config .config/build.config.${ext}`);
859
867
  generator.inject(
860
868
  "readme-libraries",
861
869
  "[unbuild](https://github.com/unjs/unbuild) - Unified JavaScript build system"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-krispya",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "🌹 CLI for creating web projects with (my) sensible defaults",
5
5
  "keywords": [
6
6
  "cli",