create-krispya 0.12.0 → 0.13.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/cli.cjs CHANGED
@@ -9,7 +9,7 @@ const node_module = require('node:module');
9
9
  const node_path = require('node:path');
10
10
  const node_process = require('node:process');
11
11
  const undici = require('undici');
12
- const workspace = require('./shared/create-krispya.FNrYi_5V.cjs');
12
+ const workspace = require('./shared/create-krispya.CiGwBdQ3.cjs');
13
13
  const Conf = require('conf');
14
14
  const promises = require('fs/promises');
15
15
  const fs = require('fs');
@@ -51,8 +51,9 @@ function formatConfigSummary(options, inherited) {
51
51
  const projectType = options.projectType ?? "app";
52
52
  const baseTemplate = options.template ? workspace.getBaseTemplate(options.template) : "vanilla";
53
53
  if (baseTemplate === "react") {
54
- lines.push(formatRow("Framework", "React"));
55
- lines.push(formatRow("\u21B3 React compiler", workspace.shouldEnableReactCompiler(options) ? "yes" : "no"));
54
+ lines.push(
55
+ formatRow("Framework", workspace.shouldEnableReactCompiler(options) ? "React + compiler" : "React")
56
+ );
56
57
  } else if (baseTemplate === "r3f") {
57
58
  lines.push(formatRow("Framework", "React Three Fiber"));
58
59
  }
@@ -1688,6 +1689,9 @@ async function getExpectedPackageDevDependencies(root, config, pkg) {
1688
1689
  addMissingDevDependency(pkg, nextDevDependencies, "@babel/core");
1689
1690
  addMissingDevDependency(pkg, nextDevDependencies, "@rolldown/plugin-babel");
1690
1691
  addMissingDevDependency(pkg, nextDevDependencies, "babel-plugin-react-compiler");
1692
+ if (config.linter === "oxlint") {
1693
+ addMissingDevDependency(pkg, nextDevDependencies, "eslint-plugin-react-hooks");
1694
+ }
1691
1695
  if (await detectTypeScriptPackage(root, pkg)) {
1692
1696
  addMissingDevDependency(pkg, nextDevDependencies, "@types/babel__core");
1693
1697
  }
@@ -1742,6 +1746,8 @@ function planSinglePackageOxlintConfig(config) {
1742
1746
  const path = isStealth ? ".config/oxlint.json" : "oxlint.json";
1743
1747
  const oxlintConfig = workspace.renderOxlintConfig({
1744
1748
  schemaPath: isStealth ? "../node_modules/oxlint/configuration_schema.json" : "./node_modules/oxlint/configuration_schema.json",
1749
+ react: config.viteTemplate === "react" || config.viteTemplate === "r3f",
1750
+ reactCompiler: config.viteTemplate === "react",
1745
1751
  typescript: true
1746
1752
  });
1747
1753
  return {
package/dist/cli.mjs CHANGED
@@ -7,7 +7,7 @@ import { createRequire } from 'node:module';
7
7
  import { resolve, join as join$1, dirname } from 'node:path';
8
8
  import { cwd } from 'node:process';
9
9
  import { fetch } from 'undici';
10
- import { t as getEngineName, a as getBaseTemplate, s as shouldEnableReactCompiler, b as getLanguageFromTemplate, x as getPackageManagerName, g as generateRandomName, A as ALL_AI_PLATFORMS, y as AI_PLATFORM_LABELS, z as AI_PLATFORM_HINTS, d as detectTooling, B as parsePackageManager, C as parseEngine, p as parseWorkspaceYamlContent, D as renderTypescriptConfigPackage, E as renderOxlintConfigPackage, F as renderEslintConfigPackage, G as renderOxfmtConfigPackage, H as renderPrettierConfigPackage, I as resolveMonorepoRootPackageVersions, J as getResolvedPackageVersion, K as renderVscodeFiles, L as renderAiFiles, M as renderVscodeFiles$1, N as renderEditorConfig, O as renderGitignore, P as toPrettierIgnoreContent, Q as mergePackageJsonScripts, R as renderViteConfig, S as packageJsonScripts, T as resolveDefaultPackageJsonScripts, U as formatResolvedPackageVersion, V as renderOxlintConfig, l as planProject, r as resolveProjectPlanInput, v as validatePackageName, q as resolveWorkspacePlanInput, n as planWorkspace } from './shared/create-krispya.DZWMfM2v.mjs';
10
+ import { t as getEngineName, a as getBaseTemplate, s as shouldEnableReactCompiler, b as getLanguageFromTemplate, x as getPackageManagerName, g as generateRandomName, A as ALL_AI_PLATFORMS, y as AI_PLATFORM_LABELS, z as AI_PLATFORM_HINTS, d as detectTooling, B as parsePackageManager, C as parseEngine, p as parseWorkspaceYamlContent, D as renderTypescriptConfigPackage, E as renderOxlintConfigPackage, F as renderEslintConfigPackage, G as renderOxfmtConfigPackage, H as renderPrettierConfigPackage, I as resolveMonorepoRootPackageVersions, J as getResolvedPackageVersion, K as renderVscodeFiles, L as renderAiFiles, M as renderVscodeFiles$1, N as renderEditorConfig, O as renderGitignore, P as toPrettierIgnoreContent, Q as mergePackageJsonScripts, R as renderViteConfig, S as packageJsonScripts, T as resolveDefaultPackageJsonScripts, U as formatResolvedPackageVersion, V as renderOxlintConfig, l as planProject, r as resolveProjectPlanInput, v as validatePackageName, q as resolveWorkspacePlanInput, n as planWorkspace } from './shared/create-krispya.B2px1YOh.mjs';
11
11
  import Conf from 'conf';
12
12
  import { access, constants, readFile as readFile$1, mkdir as mkdir$1, writeFile as writeFile$1 } from 'fs/promises';
13
13
  import { constants as constants$2 } from 'fs';
@@ -30,8 +30,9 @@ function formatConfigSummary(options, inherited) {
30
30
  const projectType = options.projectType ?? "app";
31
31
  const baseTemplate = options.template ? getBaseTemplate(options.template) : "vanilla";
32
32
  if (baseTemplate === "react") {
33
- lines.push(formatRow("Framework", "React"));
34
- lines.push(formatRow("\u21B3 React compiler", shouldEnableReactCompiler(options) ? "yes" : "no"));
33
+ lines.push(
34
+ formatRow("Framework", shouldEnableReactCompiler(options) ? "React + compiler" : "React")
35
+ );
35
36
  } else if (baseTemplate === "r3f") {
36
37
  lines.push(formatRow("Framework", "React Three Fiber"));
37
38
  }
@@ -1667,6 +1668,9 @@ async function getExpectedPackageDevDependencies(root, config, pkg) {
1667
1668
  addMissingDevDependency(pkg, nextDevDependencies, "@babel/core");
1668
1669
  addMissingDevDependency(pkg, nextDevDependencies, "@rolldown/plugin-babel");
1669
1670
  addMissingDevDependency(pkg, nextDevDependencies, "babel-plugin-react-compiler");
1671
+ if (config.linter === "oxlint") {
1672
+ addMissingDevDependency(pkg, nextDevDependencies, "eslint-plugin-react-hooks");
1673
+ }
1670
1674
  if (await detectTypeScriptPackage(root, pkg)) {
1671
1675
  addMissingDevDependency(pkg, nextDevDependencies, "@types/babel__core");
1672
1676
  }
@@ -1721,6 +1725,8 @@ function planSinglePackageOxlintConfig(config) {
1721
1725
  const path = isStealth ? ".config/oxlint.json" : "oxlint.json";
1722
1726
  const oxlintConfig = renderOxlintConfig({
1723
1727
  schemaPath: isStealth ? "../node_modules/oxlint/configuration_schema.json" : "./node_modules/oxlint/configuration_schema.json",
1728
+ react: config.viteTemplate === "react" || config.viteTemplate === "r3f",
1729
+ reactCompiler: config.viteTemplate === "react",
1724
1730
  typescript: true
1725
1731
  });
1726
1732
  return {
package/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const workspace = require('./shared/create-krispya.FNrYi_5V.cjs');
3
+ const workspace = require('./shared/create-krispya.CiGwBdQ3.cjs');
4
4
  require('fs/promises');
5
5
  require('fs');
6
6
  require('path');
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { d as detectTooling, g as generateRandomName, a as getBaseTemplate, b as getLanguageFromTemplate, c as getLatestNodeVersion, e as getLatestNpmCliVersion, f as getLatestNpmMajorVersion, h as getLatestNpmMajorVersionAtOrBelow, i as getLatestNpmVersion, j as getLatestPnpmVersion, k as getLatestYarnVersion, m as merge, p as parseWorkspaceYamlContent, l as planProject, n as planWorkspace, o as projectPlanInputToOptions, r as resolveProjectPlanInput, q as resolveWorkspacePlanInput, s as shouldEnableReactCompiler, u as unique, v as validatePackageName, w as workspacePlanInputToMonorepoParams } from './shared/create-krispya.DZWMfM2v.mjs';
1
+ export { d as detectTooling, g as generateRandomName, a as getBaseTemplate, b as getLanguageFromTemplate, c as getLatestNodeVersion, e as getLatestNpmCliVersion, f as getLatestNpmMajorVersion, h as getLatestNpmMajorVersionAtOrBelow, i as getLatestNpmVersion, j as getLatestPnpmVersion, k as getLatestYarnVersion, m as merge, p as parseWorkspaceYamlContent, l as planProject, n as planWorkspace, o as projectPlanInputToOptions, r as resolveProjectPlanInput, q as resolveWorkspacePlanInput, s as shouldEnableReactCompiler, u as unique, v as validatePackageName, w as workspacePlanInputToMonorepoParams } from './shared/create-krispya.B2px1YOh.mjs';
2
2
  import 'fs/promises';
3
3
  import 'fs';
4
4
  import 'path';
@@ -546,7 +546,7 @@ const PACKAGE_VERSION_DEFINITIONS = {
546
546
  "@vitejs/plugin-react": { fallbackVersion: "6.0.1" },
547
547
  "@viverse/cli": { fallbackVersion: "0.9.5-beta.8" },
548
548
  eslint: { fallbackVersion: "9.17.0" },
549
- "eslint-plugin-react-hooks": { fallbackVersion: "5.1.0" },
549
+ "eslint-plugin-react-hooks": { fallbackVersion: "7.1.1" },
550
550
  "babel-plugin-react-compiler": { fallbackVersion: "1.0.0" },
551
551
  jsdom: { fallbackVersion: "26.0.0" },
552
552
  koota: { fallbackVersion: "0.4.0" },
@@ -833,6 +833,9 @@ function collectProjectPackageNames(options) {
833
833
  if (isTypescript) {
834
834
  addPackageName(packageNames, explicitVersions, "oxlint-tsgolint");
835
835
  }
836
+ if (useReactCompiler) {
837
+ addPackageName(packageNames, explicitVersions, "eslint-plugin-react-hooks");
838
+ }
836
839
  }
837
840
  } else if (linter === "biome") {
838
841
  addPackageName(packageNames, explicitVersions, "@biomejs/biome");
@@ -1904,6 +1907,27 @@ const defaultLinterMetaConfig = {
1904
1907
  }
1905
1908
  };
1906
1909
 
1910
+ const REACT_HOOKS_JS_PLUGIN = {
1911
+ name: "react-hooks-js",
1912
+ specifier: "eslint-plugin-react-hooks"
1913
+ };
1914
+ const REACT_COMPILER_RULES = {
1915
+ "react-hooks-js/component-hook-factories": "error",
1916
+ "react-hooks-js/config": "error",
1917
+ "react-hooks-js/error-boundaries": "error",
1918
+ "react-hooks-js/gating": "error",
1919
+ "react-hooks-js/globals": "error",
1920
+ "react-hooks-js/immutability": "error",
1921
+ "react-hooks-js/incompatible-library": "warn",
1922
+ "react-hooks-js/preserve-manual-memoization": "warn",
1923
+ "react-hooks-js/purity": "error",
1924
+ "react-hooks-js/refs": "error",
1925
+ "react-hooks-js/set-state-in-effect": "error",
1926
+ "react-hooks-js/set-state-in-render": "error",
1927
+ "react-hooks-js/static-components": "error",
1928
+ "react-hooks-js/unsupported-syntax": "warn",
1929
+ "react-hooks-js/use-memo": "error"
1930
+ };
1907
1931
  function renderOxlintConfig(params) {
1908
1932
  const config = params.config ?? defaultLinterMetaConfig;
1909
1933
  const { rules } = config;
@@ -1914,6 +1938,7 @@ function renderOxlintConfig(params) {
1914
1938
  return {
1915
1939
  $schema: params.schemaPath,
1916
1940
  plugins,
1941
+ ...params.reactCompiler === true ? { jsPlugins: [REACT_HOOKS_JS_PLUGIN] } : {},
1917
1942
  ...params.typescript === true ? { options: { typeAware: true } } : {},
1918
1943
  rules: {
1919
1944
  "no-unused-vars": [
@@ -1928,7 +1953,8 @@ function renderOxlintConfig(params) {
1928
1953
  "no-unused-expressions": [
1929
1954
  rules.noUnusedExpressions.level,
1930
1955
  { allowShortCircuit: rules.noUnusedExpressions.allowShortCircuit }
1931
- ]
1956
+ ],
1957
+ ...params.reactCompiler === true ? REACT_COMPILER_RULES : {}
1932
1958
  },
1933
1959
  ignorePatterns: config.ignorePatterns
1934
1960
  };
@@ -2872,6 +2898,7 @@ function planOxlint(builder, options) {
2872
2898
  const baseTemplate = getBaseTemplate(template);
2873
2899
  const isTypescript = getLanguageFromTemplate(template) === "typescript";
2874
2900
  const isReact = baseTemplate === "react" || baseTemplate === "r3f";
2901
+ const useReactCompiler = shouldEnableReactCompiler(builder.options);
2875
2902
  const isMonorepo = builder.options.workspaceRoot != null;
2876
2903
  if (isMonorepo) {
2877
2904
  builder.addDevDependency("@config/oxlint", { version: "workspace:*" });
@@ -2882,10 +2909,14 @@ function planOxlint(builder, options) {
2882
2909
  if (isTypescript) {
2883
2910
  builder.addDevDependency("oxlint-tsgolint");
2884
2911
  }
2912
+ if (useReactCompiler) {
2913
+ builder.addDevDependency("eslint-plugin-react-hooks");
2914
+ }
2885
2915
  const isStealth = builder.isStealthConfig();
2886
2916
  const oxlintConfig = renderOxlintConfig({
2887
2917
  schemaPath: isStealth ? "../node_modules/oxlint/configuration_schema.json" : "./node_modules/oxlint/configuration_schema.json",
2888
2918
  react: isReact,
2919
+ reactCompiler: useReactCompiler,
2889
2920
  typescript: isTypescript,
2890
2921
  config: options.config
2891
2922
  });
@@ -552,7 +552,7 @@ const PACKAGE_VERSION_DEFINITIONS = {
552
552
  "@vitejs/plugin-react": { fallbackVersion: "6.0.1" },
553
553
  "@viverse/cli": { fallbackVersion: "0.9.5-beta.8" },
554
554
  eslint: { fallbackVersion: "9.17.0" },
555
- "eslint-plugin-react-hooks": { fallbackVersion: "5.1.0" },
555
+ "eslint-plugin-react-hooks": { fallbackVersion: "7.1.1" },
556
556
  "babel-plugin-react-compiler": { fallbackVersion: "1.0.0" },
557
557
  jsdom: { fallbackVersion: "26.0.0" },
558
558
  koota: { fallbackVersion: "0.4.0" },
@@ -839,6 +839,9 @@ function collectProjectPackageNames(options) {
839
839
  if (isTypescript) {
840
840
  addPackageName(packageNames, explicitVersions, "oxlint-tsgolint");
841
841
  }
842
+ if (useReactCompiler) {
843
+ addPackageName(packageNames, explicitVersions, "eslint-plugin-react-hooks");
844
+ }
842
845
  }
843
846
  } else if (linter === "biome") {
844
847
  addPackageName(packageNames, explicitVersions, "@biomejs/biome");
@@ -1910,6 +1913,27 @@ const defaultLinterMetaConfig = {
1910
1913
  }
1911
1914
  };
1912
1915
 
1916
+ const REACT_HOOKS_JS_PLUGIN = {
1917
+ name: "react-hooks-js",
1918
+ specifier: "eslint-plugin-react-hooks"
1919
+ };
1920
+ const REACT_COMPILER_RULES = {
1921
+ "react-hooks-js/component-hook-factories": "error",
1922
+ "react-hooks-js/config": "error",
1923
+ "react-hooks-js/error-boundaries": "error",
1924
+ "react-hooks-js/gating": "error",
1925
+ "react-hooks-js/globals": "error",
1926
+ "react-hooks-js/immutability": "error",
1927
+ "react-hooks-js/incompatible-library": "warn",
1928
+ "react-hooks-js/preserve-manual-memoization": "warn",
1929
+ "react-hooks-js/purity": "error",
1930
+ "react-hooks-js/refs": "error",
1931
+ "react-hooks-js/set-state-in-effect": "error",
1932
+ "react-hooks-js/set-state-in-render": "error",
1933
+ "react-hooks-js/static-components": "error",
1934
+ "react-hooks-js/unsupported-syntax": "warn",
1935
+ "react-hooks-js/use-memo": "error"
1936
+ };
1913
1937
  function renderOxlintConfig(params) {
1914
1938
  const config = params.config ?? defaultLinterMetaConfig;
1915
1939
  const { rules } = config;
@@ -1920,6 +1944,7 @@ function renderOxlintConfig(params) {
1920
1944
  return {
1921
1945
  $schema: params.schemaPath,
1922
1946
  plugins,
1947
+ ...params.reactCompiler === true ? { jsPlugins: [REACT_HOOKS_JS_PLUGIN] } : {},
1923
1948
  ...params.typescript === true ? { options: { typeAware: true } } : {},
1924
1949
  rules: {
1925
1950
  "no-unused-vars": [
@@ -1934,7 +1959,8 @@ function renderOxlintConfig(params) {
1934
1959
  "no-unused-expressions": [
1935
1960
  rules.noUnusedExpressions.level,
1936
1961
  { allowShortCircuit: rules.noUnusedExpressions.allowShortCircuit }
1937
- ]
1962
+ ],
1963
+ ...params.reactCompiler === true ? REACT_COMPILER_RULES : {}
1938
1964
  },
1939
1965
  ignorePatterns: config.ignorePatterns
1940
1966
  };
@@ -2878,6 +2904,7 @@ function planOxlint(builder, options) {
2878
2904
  const baseTemplate = getBaseTemplate(template);
2879
2905
  const isTypescript = getLanguageFromTemplate(template) === "typescript";
2880
2906
  const isReact = baseTemplate === "react" || baseTemplate === "r3f";
2907
+ const useReactCompiler = shouldEnableReactCompiler(builder.options);
2881
2908
  const isMonorepo = builder.options.workspaceRoot != null;
2882
2909
  if (isMonorepo) {
2883
2910
  builder.addDevDependency("@config/oxlint", { version: "workspace:*" });
@@ -2888,10 +2915,14 @@ function planOxlint(builder, options) {
2888
2915
  if (isTypescript) {
2889
2916
  builder.addDevDependency("oxlint-tsgolint");
2890
2917
  }
2918
+ if (useReactCompiler) {
2919
+ builder.addDevDependency("eslint-plugin-react-hooks");
2920
+ }
2891
2921
  const isStealth = builder.isStealthConfig();
2892
2922
  const oxlintConfig = renderOxlintConfig({
2893
2923
  schemaPath: isStealth ? "../node_modules/oxlint/configuration_schema.json" : "./node_modules/oxlint/configuration_schema.json",
2894
2924
  react: isReact,
2925
+ reactCompiler: useReactCompiler,
2895
2926
  typescript: isTypescript,
2896
2927
  config: options.config
2897
2928
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-krispya",
3
- "version": "0.12.0",
3
+ "version": "0.13.0",
4
4
  "description": "🌹 CLI for creating web projects with (my) sensible defaults",
5
5
  "keywords": [
6
6
  "cli",
@@ -28,26 +28,26 @@
28
28
  "dist"
29
29
  ],
30
30
  "dependencies": {
31
- "@clack/prompts": "^0.11.0",
32
- "chalk": "^5.4.1",
33
- "commander": "^13.1.0",
34
- "conf": "^13.0.0",
35
- "ora": "^8.2.0",
36
- "undici": "^5.28.4"
31
+ "@clack/prompts": "^1.4.0",
32
+ "chalk": "^5.6.2",
33
+ "commander": "^14.0.3",
34
+ "conf": "^15.1.0",
35
+ "ora": "^9.4.0",
36
+ "undici": "^8.2.0"
37
37
  },
38
38
  "devDependencies": {
39
- "@types/node": "^25.3.5",
40
- "oxlint": "^1.51.0",
39
+ "@types/node": "^25.7.0",
40
+ "oxlint": "^1.64.0",
41
41
  "oxlint-tsgolint": "^0.22.1",
42
- "prettier": "^3.8.1",
42
+ "prettier": "^3.8.3",
43
43
  "tsx": "^4.21.0",
44
- "typescript": "^5.9.3",
45
- "unbuild": "^3.5.0",
46
- "vitest": "^4.0.18"
44
+ "typescript": "^6.0.3",
45
+ "unbuild": "^3.6.1",
46
+ "vitest": "^4.1.6"
47
47
  },
48
48
  "engines": {
49
49
  "pnpm": ">=10.0.0",
50
- "node": ">=25.0.0"
50
+ "node": ">=26.0.0"
51
51
  },
52
52
  "scripts": {
53
53
  "dev": "tsx src/cli.ts",