create-krispya 0.11.0 → 0.12.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 +23 -3
- package/dist/cli.d.cts +1 -1
- package/dist/cli.d.mts +1 -1
- package/dist/cli.d.ts +1 -1
- package/dist/cli.mjs +23 -3
- package/dist/index.cjs +3 -1
- package/dist/index.d.cts +7 -3
- package/dist/index.d.mts +7 -3
- package/dist/index.d.ts +7 -3
- package/dist/index.mjs +1 -1
- package/dist/shared/{create-krispya.to8NBxeJ.d.ts → create-krispya.CcQTepKu.d.cts} +2 -1
- package/dist/shared/{create-krispya.to8NBxeJ.d.cts → create-krispya.CcQTepKu.d.mts} +2 -1
- package/dist/shared/{create-krispya.to8NBxeJ.d.mts → create-krispya.CcQTepKu.d.ts} +2 -1
- package/dist/shared/{create-krispya.DblF9gKc.mjs → create-krispya.DZWMfM2v.mjs} +75 -17
- package/dist/shared/{create-krispya.8KaGuRpu.cjs → create-krispya.FNrYi_5V.cjs} +76 -16
- package/package.json +1 -1
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.
|
|
12
|
+
const workspace = require('./shared/create-krispya.FNrYi_5V.cjs');
|
|
13
13
|
const Conf = require('conf');
|
|
14
14
|
const promises = require('fs/promises');
|
|
15
15
|
const fs = require('fs');
|
|
@@ -52,6 +52,7 @@ function formatConfigSummary(options, inherited) {
|
|
|
52
52
|
const baseTemplate = options.template ? workspace.getBaseTemplate(options.template) : "vanilla";
|
|
53
53
|
if (baseTemplate === "react") {
|
|
54
54
|
lines.push(formatRow("Framework", "React"));
|
|
55
|
+
lines.push(formatRow("\u21B3 React compiler", workspace.shouldEnableReactCompiler(options) ? "yes" : "no"));
|
|
55
56
|
} else if (baseTemplate === "r3f") {
|
|
56
57
|
lines.push(formatRow("Framework", "React Three Fiber"));
|
|
57
58
|
}
|
|
@@ -1259,12 +1260,18 @@ function detectViteTemplate(pkg) {
|
|
|
1259
1260
|
}
|
|
1260
1261
|
function renderExpectedViteConfig(template) {
|
|
1261
1262
|
const isReact = template === "react" || template === "r3f";
|
|
1262
|
-
const
|
|
1263
|
+
const useReactCompiler = template === "react";
|
|
1264
|
+
const codeSnippets = isReact ? {
|
|
1265
|
+
"vite-config-import": [
|
|
1266
|
+
useReactCompiler ? "import react, { reactCompilerPreset } from '@vitejs/plugin-react';" : "import react from '@vitejs/plugin-react';",
|
|
1267
|
+
...useReactCompiler ? ["import babel from '@rolldown/plugin-babel';"] : []
|
|
1268
|
+
]
|
|
1269
|
+
} : {};
|
|
1263
1270
|
const viteConfig = {
|
|
1264
1271
|
base: "./"
|
|
1265
1272
|
};
|
|
1266
1273
|
if (isReact) {
|
|
1267
|
-
viteConfig.plugins = ["$raw:react()"];
|
|
1274
|
+
viteConfig.plugins = useReactCompiler ? ["$raw:react()", "$raw:babel({ presets: [reactCompilerPreset()] })"] : ["$raw:react()"];
|
|
1268
1275
|
}
|
|
1269
1276
|
if (template === "r3f") {
|
|
1270
1277
|
viteConfig.resolve = { dedupe: ["three"] };
|
|
@@ -1610,6 +1617,11 @@ function hasPackage(pkg, name) {
|
|
|
1610
1617
|
function sortPackageMap(packageMap) {
|
|
1611
1618
|
return Object.fromEntries(Object.entries(packageMap).sort(([a], [b]) => a.localeCompare(b)));
|
|
1612
1619
|
}
|
|
1620
|
+
function addMissingDevDependency(pkg, devDependencies, name) {
|
|
1621
|
+
if (!hasPackage(pkg, name)) {
|
|
1622
|
+
devDependencies[name] = workspace.formatResolvedPackageVersion({}, name);
|
|
1623
|
+
}
|
|
1624
|
+
}
|
|
1613
1625
|
async function detectTypeScriptPackage(root, pkg) {
|
|
1614
1626
|
if (hasPackage(pkg, "typescript")) return true;
|
|
1615
1627
|
return await fileExists(path.join(root, "tsconfig.json")) || await fileExists(path.join(root, "tsconfig.app.json")) || await fileExists(path.join(root, ".config/tsconfig.app.json"));
|
|
@@ -1672,6 +1684,14 @@ async function getExpectedPackageDevDependencies(root, config, pkg) {
|
|
|
1672
1684
|
if (shouldAddOxlintTypeAwareBackend) {
|
|
1673
1685
|
nextDevDependencies["oxlint-tsgolint"] = workspace.formatResolvedPackageVersion({}, "oxlint-tsgolint");
|
|
1674
1686
|
}
|
|
1687
|
+
if (!config.isMonorepo && config.viteTemplate === "react") {
|
|
1688
|
+
addMissingDevDependency(pkg, nextDevDependencies, "@babel/core");
|
|
1689
|
+
addMissingDevDependency(pkg, nextDevDependencies, "@rolldown/plugin-babel");
|
|
1690
|
+
addMissingDevDependency(pkg, nextDevDependencies, "babel-plugin-react-compiler");
|
|
1691
|
+
if (await detectTypeScriptPackage(root, pkg)) {
|
|
1692
|
+
addMissingDevDependency(pkg, nextDevDependencies, "@types/babel__core");
|
|
1693
|
+
}
|
|
1694
|
+
}
|
|
1675
1695
|
return sortPackageMap(nextDevDependencies);
|
|
1676
1696
|
}
|
|
1677
1697
|
async function getPackageJsonScriptUpdates(root, config) {
|
package/dist/cli.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { P as ProjectType, e as LibraryBundler, Q as Template, p as PackageManagerName, I as Ide } from './shared/create-krispya.
|
|
2
|
+
import { P as ProjectType, e as LibraryBundler, Q as Template, p as PackageManagerName, I as Ide } from './shared/create-krispya.CcQTepKu.cjs';
|
|
3
3
|
|
|
4
4
|
interface CliOptions {
|
|
5
5
|
type?: ProjectType;
|
package/dist/cli.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { P as ProjectType, e as LibraryBundler, Q as Template, p as PackageManagerName, I as Ide } from './shared/create-krispya.
|
|
2
|
+
import { P as ProjectType, e as LibraryBundler, Q as Template, p as PackageManagerName, I as Ide } from './shared/create-krispya.CcQTepKu.mjs';
|
|
3
3
|
|
|
4
4
|
interface CliOptions {
|
|
5
5
|
type?: ProjectType;
|
package/dist/cli.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { P as ProjectType, e as LibraryBundler, Q as Template, p as PackageManagerName, I as Ide } from './shared/create-krispya.
|
|
2
|
+
import { P as ProjectType, e as LibraryBundler, Q as Template, p as PackageManagerName, I as Ide } from './shared/create-krispya.CcQTepKu.js';
|
|
3
3
|
|
|
4
4
|
interface CliOptions {
|
|
5
5
|
type?: ProjectType;
|
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 {
|
|
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';
|
|
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';
|
|
@@ -31,6 +31,7 @@ function formatConfigSummary(options, inherited) {
|
|
|
31
31
|
const baseTemplate = options.template ? getBaseTemplate(options.template) : "vanilla";
|
|
32
32
|
if (baseTemplate === "react") {
|
|
33
33
|
lines.push(formatRow("Framework", "React"));
|
|
34
|
+
lines.push(formatRow("\u21B3 React compiler", shouldEnableReactCompiler(options) ? "yes" : "no"));
|
|
34
35
|
} else if (baseTemplate === "r3f") {
|
|
35
36
|
lines.push(formatRow("Framework", "React Three Fiber"));
|
|
36
37
|
}
|
|
@@ -1238,12 +1239,18 @@ function detectViteTemplate(pkg) {
|
|
|
1238
1239
|
}
|
|
1239
1240
|
function renderExpectedViteConfig(template) {
|
|
1240
1241
|
const isReact = template === "react" || template === "r3f";
|
|
1241
|
-
const
|
|
1242
|
+
const useReactCompiler = template === "react";
|
|
1243
|
+
const codeSnippets = isReact ? {
|
|
1244
|
+
"vite-config-import": [
|
|
1245
|
+
useReactCompiler ? "import react, { reactCompilerPreset } from '@vitejs/plugin-react';" : "import react from '@vitejs/plugin-react';",
|
|
1246
|
+
...useReactCompiler ? ["import babel from '@rolldown/plugin-babel';"] : []
|
|
1247
|
+
]
|
|
1248
|
+
} : {};
|
|
1242
1249
|
const viteConfig = {
|
|
1243
1250
|
base: "./"
|
|
1244
1251
|
};
|
|
1245
1252
|
if (isReact) {
|
|
1246
|
-
viteConfig.plugins = ["$raw:react()"];
|
|
1253
|
+
viteConfig.plugins = useReactCompiler ? ["$raw:react()", "$raw:babel({ presets: [reactCompilerPreset()] })"] : ["$raw:react()"];
|
|
1247
1254
|
}
|
|
1248
1255
|
if (template === "r3f") {
|
|
1249
1256
|
viteConfig.resolve = { dedupe: ["three"] };
|
|
@@ -1589,6 +1596,11 @@ function hasPackage(pkg, name) {
|
|
|
1589
1596
|
function sortPackageMap(packageMap) {
|
|
1590
1597
|
return Object.fromEntries(Object.entries(packageMap).sort(([a], [b]) => a.localeCompare(b)));
|
|
1591
1598
|
}
|
|
1599
|
+
function addMissingDevDependency(pkg, devDependencies, name) {
|
|
1600
|
+
if (!hasPackage(pkg, name)) {
|
|
1601
|
+
devDependencies[name] = formatResolvedPackageVersion({}, name);
|
|
1602
|
+
}
|
|
1603
|
+
}
|
|
1592
1604
|
async function detectTypeScriptPackage(root, pkg) {
|
|
1593
1605
|
if (hasPackage(pkg, "typescript")) return true;
|
|
1594
1606
|
return await fileExists(join(root, "tsconfig.json")) || await fileExists(join(root, "tsconfig.app.json")) || await fileExists(join(root, ".config/tsconfig.app.json"));
|
|
@@ -1651,6 +1663,14 @@ async function getExpectedPackageDevDependencies(root, config, pkg) {
|
|
|
1651
1663
|
if (shouldAddOxlintTypeAwareBackend) {
|
|
1652
1664
|
nextDevDependencies["oxlint-tsgolint"] = formatResolvedPackageVersion({}, "oxlint-tsgolint");
|
|
1653
1665
|
}
|
|
1666
|
+
if (!config.isMonorepo && config.viteTemplate === "react") {
|
|
1667
|
+
addMissingDevDependency(pkg, nextDevDependencies, "@babel/core");
|
|
1668
|
+
addMissingDevDependency(pkg, nextDevDependencies, "@rolldown/plugin-babel");
|
|
1669
|
+
addMissingDevDependency(pkg, nextDevDependencies, "babel-plugin-react-compiler");
|
|
1670
|
+
if (await detectTypeScriptPackage(root, pkg)) {
|
|
1671
|
+
addMissingDevDependency(pkg, nextDevDependencies, "@types/babel__core");
|
|
1672
|
+
}
|
|
1673
|
+
}
|
|
1654
1674
|
return sortPackageMap(nextDevDependencies);
|
|
1655
1675
|
}
|
|
1656
1676
|
async function getPackageJsonScriptUpdates(root, config) {
|
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const workspace = require('./shared/create-krispya.
|
|
3
|
+
const workspace = require('./shared/create-krispya.FNrYi_5V.cjs');
|
|
4
4
|
require('fs/promises');
|
|
5
5
|
require('fs');
|
|
6
6
|
require('path');
|
|
@@ -44,6 +44,7 @@ exports.getLanguageFromTemplate = workspace.getLanguageFromTemplate;
|
|
|
44
44
|
exports.getLatestNodeVersion = workspace.getLatestNodeVersion;
|
|
45
45
|
exports.getLatestNpmCliVersion = workspace.getLatestNpmCliVersion;
|
|
46
46
|
exports.getLatestNpmMajorVersion = workspace.getLatestNpmMajorVersion;
|
|
47
|
+
exports.getLatestNpmMajorVersionAtOrBelow = workspace.getLatestNpmMajorVersionAtOrBelow;
|
|
47
48
|
exports.getLatestNpmVersion = workspace.getLatestNpmVersion;
|
|
48
49
|
exports.getLatestPnpmVersion = workspace.getLatestPnpmVersion;
|
|
49
50
|
exports.getLatestYarnVersion = workspace.getLatestYarnVersion;
|
|
@@ -54,6 +55,7 @@ exports.planWorkspace = workspace.planWorkspace;
|
|
|
54
55
|
exports.projectPlanInputToOptions = workspace.projectPlanInputToOptions;
|
|
55
56
|
exports.resolveProjectPlanInput = workspace.resolveProjectPlanInput;
|
|
56
57
|
exports.resolveWorkspacePlanInput = workspace.resolveWorkspacePlanInput;
|
|
58
|
+
exports.shouldEnableReactCompiler = workspace.shouldEnableReactCompiler;
|
|
57
59
|
exports.unique = workspace.unique;
|
|
58
60
|
exports.validatePackageName = workspace.validatePackageName;
|
|
59
61
|
exports.workspacePlanInputToMonorepoParams = workspace.workspacePlanInputToMonorepoParams;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { F as FormatterMetaConfig, L as LinterMetaConfig, V as VirtualFileMap, C as CodeInjectionLocation, P as ProjectType, a as ConfigStrategy, E as EngineSpec, b as PackageVersions, c as Linter, d as Formatter, T as Testing, e as LibraryBundler, I as Ide, f as PackageManagerSpec, g as ProjectPlanInput, h as ProjectOptions, A as AiPlatform, W as WorkspacePlanInput } from './shared/create-krispya.
|
|
2
|
-
export { i as AiAgentsMetaConfig, B as BaseTemplate, D as DependencyVersionOptions, j as EditorMetaConfig, k as EngineName, l as FeatureSelections, m as FileRenderer, n as LibraryBundlerMetaConfig, o as PackageManagerMetaConfig, p as PackageManagerName, q as PlanBuilder, r as PlanDreiOptions, s as PlanFiberOptions, t as PlanGithubPagesOptions, u as PlanHandleOptions, v as PlanKootaOptions, w as PlanLevaOptions, x as PlanOffscreenOptions, y as PlanPostprocessingOptions, z as PlanRapierOptions, G as PlanTriplexOptions, H as PlanUikitOptions, J as PlanViverseOptions, K as PlanXrOptions, M as PlanZustandOptions, N as ProjectMetaConfig, O as ProjectPlanContext, Q as Template, R as TestingMetaConfig, S as ToolConfig, U as TypeScriptMetaConfig, X as VersionRangePrefix, Y as VirtualFile, Z as WorkspacePlanContext, _ as getBaseTemplate, $ as getLanguageFromTemplate } from './shared/create-krispya.
|
|
1
|
+
import { F as FormatterMetaConfig, L as LinterMetaConfig, V as VirtualFileMap, C as CodeInjectionLocation, P as ProjectType, a as ConfigStrategy, E as EngineSpec, b as PackageVersions, c as Linter, d as Formatter, T as Testing, e as LibraryBundler, I as Ide, f as PackageManagerSpec, g as ProjectPlanInput, h as ProjectOptions, A as AiPlatform, W as WorkspacePlanInput } from './shared/create-krispya.CcQTepKu.cjs';
|
|
2
|
+
export { i as AiAgentsMetaConfig, B as BaseTemplate, D as DependencyVersionOptions, j as EditorMetaConfig, k as EngineName, l as FeatureSelections, m as FileRenderer, n as LibraryBundlerMetaConfig, o as PackageManagerMetaConfig, p as PackageManagerName, q as PlanBuilder, r as PlanDreiOptions, s as PlanFiberOptions, t as PlanGithubPagesOptions, u as PlanHandleOptions, v as PlanKootaOptions, w as PlanLevaOptions, x as PlanOffscreenOptions, y as PlanPostprocessingOptions, z as PlanRapierOptions, G as PlanTriplexOptions, H as PlanUikitOptions, J as PlanViverseOptions, K as PlanXrOptions, M as PlanZustandOptions, N as ProjectMetaConfig, O as ProjectPlanContext, Q as Template, R as TestingMetaConfig, S as ToolConfig, U as TypeScriptMetaConfig, X as VersionRangePrefix, Y as VirtualFile, Z as WorkspacePlanContext, _ as getBaseTemplate, $ as getLanguageFromTemplate, a0 as shouldEnableReactCompiler } from './shared/create-krispya.CcQTepKu.cjs';
|
|
3
3
|
|
|
4
4
|
type MetaConfig = {
|
|
5
5
|
formatter: FormatterMetaConfig;
|
|
@@ -118,6 +118,10 @@ declare function getLatestNpmVersion(packageName: string, fallback: string): Pro
|
|
|
118
118
|
* Fetches the latest npm version within a specific major version.
|
|
119
119
|
*/
|
|
120
120
|
declare function getLatestNpmMajorVersion(packageName: string, majorVersion: string, fallback: string): Promise<string>;
|
|
121
|
+
/**
|
|
122
|
+
* Fetches the latest npm version within the requested major, falling back to lower majors.
|
|
123
|
+
*/
|
|
124
|
+
declare function getLatestNpmMajorVersionAtOrBelow(packageName: string, majorVersion: string, fallback: string): Promise<string>;
|
|
121
125
|
declare function getLatestPnpmVersion(): Promise<string>;
|
|
122
126
|
declare function getLatestYarnVersion(): Promise<string>;
|
|
123
127
|
declare function getLatestNpmCliVersion(): Promise<string>;
|
|
@@ -125,5 +129,5 @@ declare function getLatestNodeVersion(): Promise<string>;
|
|
|
125
129
|
|
|
126
130
|
declare function parseWorkspaceYamlContent(content: string): string[];
|
|
127
131
|
|
|
128
|
-
export { AiPlatform, CodeInjectionLocation, ConfigStrategy, EngineSpec, Formatter, FormatterMetaConfig, Ide, LibraryBundler, Linter, LinterMetaConfig, PackageManagerSpec, PackageVersions, ProjectOptions, ProjectPlanInput, ProjectType, Testing, VirtualFileMap, WorkspacePlanInput, detectTooling, generateRandomName, getLatestNodeVersion, getLatestNpmCliVersion, getLatestNpmMajorVersion, getLatestNpmVersion, getLatestPnpmVersion, getLatestYarnVersion, merge, mergePartialPlans, parseWorkspaceYamlContent, planProject, planWorkspace, projectPlanInputToOptions, resolveProjectPlanInput, resolveWorkspacePlanInput, unique, validatePackageName, workspacePlanInputToMonorepoParams };
|
|
132
|
+
export { AiPlatform, CodeInjectionLocation, ConfigStrategy, EngineSpec, Formatter, FormatterMetaConfig, Ide, LibraryBundler, Linter, LinterMetaConfig, PackageManagerSpec, PackageVersions, ProjectOptions, ProjectPlanInput, ProjectType, Testing, VirtualFileMap, WorkspacePlanInput, detectTooling, generateRandomName, getLatestNodeVersion, getLatestNpmCliVersion, getLatestNpmMajorVersion, getLatestNpmMajorVersionAtOrBelow, getLatestNpmVersion, getLatestPnpmVersion, getLatestYarnVersion, merge, mergePartialPlans, parseWorkspaceYamlContent, planProject, planWorkspace, projectPlanInputToOptions, resolveProjectPlanInput, resolveWorkspacePlanInput, unique, validatePackageName, workspacePlanInputToMonorepoParams };
|
|
129
133
|
export type { DetectedTooling, MetaConfig, PartialPlan, ProjectContext, ProjectPlan, ToolSelections };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { F as FormatterMetaConfig, L as LinterMetaConfig, V as VirtualFileMap, C as CodeInjectionLocation, P as ProjectType, a as ConfigStrategy, E as EngineSpec, b as PackageVersions, c as Linter, d as Formatter, T as Testing, e as LibraryBundler, I as Ide, f as PackageManagerSpec, g as ProjectPlanInput, h as ProjectOptions, A as AiPlatform, W as WorkspacePlanInput } from './shared/create-krispya.
|
|
2
|
-
export { i as AiAgentsMetaConfig, B as BaseTemplate, D as DependencyVersionOptions, j as EditorMetaConfig, k as EngineName, l as FeatureSelections, m as FileRenderer, n as LibraryBundlerMetaConfig, o as PackageManagerMetaConfig, p as PackageManagerName, q as PlanBuilder, r as PlanDreiOptions, s as PlanFiberOptions, t as PlanGithubPagesOptions, u as PlanHandleOptions, v as PlanKootaOptions, w as PlanLevaOptions, x as PlanOffscreenOptions, y as PlanPostprocessingOptions, z as PlanRapierOptions, G as PlanTriplexOptions, H as PlanUikitOptions, J as PlanViverseOptions, K as PlanXrOptions, M as PlanZustandOptions, N as ProjectMetaConfig, O as ProjectPlanContext, Q as Template, R as TestingMetaConfig, S as ToolConfig, U as TypeScriptMetaConfig, X as VersionRangePrefix, Y as VirtualFile, Z as WorkspacePlanContext, _ as getBaseTemplate, $ as getLanguageFromTemplate } from './shared/create-krispya.
|
|
1
|
+
import { F as FormatterMetaConfig, L as LinterMetaConfig, V as VirtualFileMap, C as CodeInjectionLocation, P as ProjectType, a as ConfigStrategy, E as EngineSpec, b as PackageVersions, c as Linter, d as Formatter, T as Testing, e as LibraryBundler, I as Ide, f as PackageManagerSpec, g as ProjectPlanInput, h as ProjectOptions, A as AiPlatform, W as WorkspacePlanInput } from './shared/create-krispya.CcQTepKu.mjs';
|
|
2
|
+
export { i as AiAgentsMetaConfig, B as BaseTemplate, D as DependencyVersionOptions, j as EditorMetaConfig, k as EngineName, l as FeatureSelections, m as FileRenderer, n as LibraryBundlerMetaConfig, o as PackageManagerMetaConfig, p as PackageManagerName, q as PlanBuilder, r as PlanDreiOptions, s as PlanFiberOptions, t as PlanGithubPagesOptions, u as PlanHandleOptions, v as PlanKootaOptions, w as PlanLevaOptions, x as PlanOffscreenOptions, y as PlanPostprocessingOptions, z as PlanRapierOptions, G as PlanTriplexOptions, H as PlanUikitOptions, J as PlanViverseOptions, K as PlanXrOptions, M as PlanZustandOptions, N as ProjectMetaConfig, O as ProjectPlanContext, Q as Template, R as TestingMetaConfig, S as ToolConfig, U as TypeScriptMetaConfig, X as VersionRangePrefix, Y as VirtualFile, Z as WorkspacePlanContext, _ as getBaseTemplate, $ as getLanguageFromTemplate, a0 as shouldEnableReactCompiler } from './shared/create-krispya.CcQTepKu.mjs';
|
|
3
3
|
|
|
4
4
|
type MetaConfig = {
|
|
5
5
|
formatter: FormatterMetaConfig;
|
|
@@ -118,6 +118,10 @@ declare function getLatestNpmVersion(packageName: string, fallback: string): Pro
|
|
|
118
118
|
* Fetches the latest npm version within a specific major version.
|
|
119
119
|
*/
|
|
120
120
|
declare function getLatestNpmMajorVersion(packageName: string, majorVersion: string, fallback: string): Promise<string>;
|
|
121
|
+
/**
|
|
122
|
+
* Fetches the latest npm version within the requested major, falling back to lower majors.
|
|
123
|
+
*/
|
|
124
|
+
declare function getLatestNpmMajorVersionAtOrBelow(packageName: string, majorVersion: string, fallback: string): Promise<string>;
|
|
121
125
|
declare function getLatestPnpmVersion(): Promise<string>;
|
|
122
126
|
declare function getLatestYarnVersion(): Promise<string>;
|
|
123
127
|
declare function getLatestNpmCliVersion(): Promise<string>;
|
|
@@ -125,5 +129,5 @@ declare function getLatestNodeVersion(): Promise<string>;
|
|
|
125
129
|
|
|
126
130
|
declare function parseWorkspaceYamlContent(content: string): string[];
|
|
127
131
|
|
|
128
|
-
export { AiPlatform, CodeInjectionLocation, ConfigStrategy, EngineSpec, Formatter, FormatterMetaConfig, Ide, LibraryBundler, Linter, LinterMetaConfig, PackageManagerSpec, PackageVersions, ProjectOptions, ProjectPlanInput, ProjectType, Testing, VirtualFileMap, WorkspacePlanInput, detectTooling, generateRandomName, getLatestNodeVersion, getLatestNpmCliVersion, getLatestNpmMajorVersion, getLatestNpmVersion, getLatestPnpmVersion, getLatestYarnVersion, merge, mergePartialPlans, parseWorkspaceYamlContent, planProject, planWorkspace, projectPlanInputToOptions, resolveProjectPlanInput, resolveWorkspacePlanInput, unique, validatePackageName, workspacePlanInputToMonorepoParams };
|
|
132
|
+
export { AiPlatform, CodeInjectionLocation, ConfigStrategy, EngineSpec, Formatter, FormatterMetaConfig, Ide, LibraryBundler, Linter, LinterMetaConfig, PackageManagerSpec, PackageVersions, ProjectOptions, ProjectPlanInput, ProjectType, Testing, VirtualFileMap, WorkspacePlanInput, detectTooling, generateRandomName, getLatestNodeVersion, getLatestNpmCliVersion, getLatestNpmMajorVersion, getLatestNpmMajorVersionAtOrBelow, getLatestNpmVersion, getLatestPnpmVersion, getLatestYarnVersion, merge, mergePartialPlans, parseWorkspaceYamlContent, planProject, planWorkspace, projectPlanInputToOptions, resolveProjectPlanInput, resolveWorkspacePlanInput, unique, validatePackageName, workspacePlanInputToMonorepoParams };
|
|
129
133
|
export type { DetectedTooling, MetaConfig, PartialPlan, ProjectContext, ProjectPlan, ToolSelections };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { F as FormatterMetaConfig, L as LinterMetaConfig, V as VirtualFileMap, C as CodeInjectionLocation, P as ProjectType, a as ConfigStrategy, E as EngineSpec, b as PackageVersions, c as Linter, d as Formatter, T as Testing, e as LibraryBundler, I as Ide, f as PackageManagerSpec, g as ProjectPlanInput, h as ProjectOptions, A as AiPlatform, W as WorkspacePlanInput } from './shared/create-krispya.
|
|
2
|
-
export { i as AiAgentsMetaConfig, B as BaseTemplate, D as DependencyVersionOptions, j as EditorMetaConfig, k as EngineName, l as FeatureSelections, m as FileRenderer, n as LibraryBundlerMetaConfig, o as PackageManagerMetaConfig, p as PackageManagerName, q as PlanBuilder, r as PlanDreiOptions, s as PlanFiberOptions, t as PlanGithubPagesOptions, u as PlanHandleOptions, v as PlanKootaOptions, w as PlanLevaOptions, x as PlanOffscreenOptions, y as PlanPostprocessingOptions, z as PlanRapierOptions, G as PlanTriplexOptions, H as PlanUikitOptions, J as PlanViverseOptions, K as PlanXrOptions, M as PlanZustandOptions, N as ProjectMetaConfig, O as ProjectPlanContext, Q as Template, R as TestingMetaConfig, S as ToolConfig, U as TypeScriptMetaConfig, X as VersionRangePrefix, Y as VirtualFile, Z as WorkspacePlanContext, _ as getBaseTemplate, $ as getLanguageFromTemplate } from './shared/create-krispya.
|
|
1
|
+
import { F as FormatterMetaConfig, L as LinterMetaConfig, V as VirtualFileMap, C as CodeInjectionLocation, P as ProjectType, a as ConfigStrategy, E as EngineSpec, b as PackageVersions, c as Linter, d as Formatter, T as Testing, e as LibraryBundler, I as Ide, f as PackageManagerSpec, g as ProjectPlanInput, h as ProjectOptions, A as AiPlatform, W as WorkspacePlanInput } from './shared/create-krispya.CcQTepKu.js';
|
|
2
|
+
export { i as AiAgentsMetaConfig, B as BaseTemplate, D as DependencyVersionOptions, j as EditorMetaConfig, k as EngineName, l as FeatureSelections, m as FileRenderer, n as LibraryBundlerMetaConfig, o as PackageManagerMetaConfig, p as PackageManagerName, q as PlanBuilder, r as PlanDreiOptions, s as PlanFiberOptions, t as PlanGithubPagesOptions, u as PlanHandleOptions, v as PlanKootaOptions, w as PlanLevaOptions, x as PlanOffscreenOptions, y as PlanPostprocessingOptions, z as PlanRapierOptions, G as PlanTriplexOptions, H as PlanUikitOptions, J as PlanViverseOptions, K as PlanXrOptions, M as PlanZustandOptions, N as ProjectMetaConfig, O as ProjectPlanContext, Q as Template, R as TestingMetaConfig, S as ToolConfig, U as TypeScriptMetaConfig, X as VersionRangePrefix, Y as VirtualFile, Z as WorkspacePlanContext, _ as getBaseTemplate, $ as getLanguageFromTemplate, a0 as shouldEnableReactCompiler } from './shared/create-krispya.CcQTepKu.js';
|
|
3
3
|
|
|
4
4
|
type MetaConfig = {
|
|
5
5
|
formatter: FormatterMetaConfig;
|
|
@@ -118,6 +118,10 @@ declare function getLatestNpmVersion(packageName: string, fallback: string): Pro
|
|
|
118
118
|
* Fetches the latest npm version within a specific major version.
|
|
119
119
|
*/
|
|
120
120
|
declare function getLatestNpmMajorVersion(packageName: string, majorVersion: string, fallback: string): Promise<string>;
|
|
121
|
+
/**
|
|
122
|
+
* Fetches the latest npm version within the requested major, falling back to lower majors.
|
|
123
|
+
*/
|
|
124
|
+
declare function getLatestNpmMajorVersionAtOrBelow(packageName: string, majorVersion: string, fallback: string): Promise<string>;
|
|
121
125
|
declare function getLatestPnpmVersion(): Promise<string>;
|
|
122
126
|
declare function getLatestYarnVersion(): Promise<string>;
|
|
123
127
|
declare function getLatestNpmCliVersion(): Promise<string>;
|
|
@@ -125,5 +129,5 @@ declare function getLatestNodeVersion(): Promise<string>;
|
|
|
125
129
|
|
|
126
130
|
declare function parseWorkspaceYamlContent(content: string): string[];
|
|
127
131
|
|
|
128
|
-
export { AiPlatform, CodeInjectionLocation, ConfigStrategy, EngineSpec, Formatter, FormatterMetaConfig, Ide, LibraryBundler, Linter, LinterMetaConfig, PackageManagerSpec, PackageVersions, ProjectOptions, ProjectPlanInput, ProjectType, Testing, VirtualFileMap, WorkspacePlanInput, detectTooling, generateRandomName, getLatestNodeVersion, getLatestNpmCliVersion, getLatestNpmMajorVersion, getLatestNpmVersion, getLatestPnpmVersion, getLatestYarnVersion, merge, mergePartialPlans, parseWorkspaceYamlContent, planProject, planWorkspace, projectPlanInputToOptions, resolveProjectPlanInput, resolveWorkspacePlanInput, unique, validatePackageName, workspacePlanInputToMonorepoParams };
|
|
132
|
+
export { AiPlatform, CodeInjectionLocation, ConfigStrategy, EngineSpec, Formatter, FormatterMetaConfig, Ide, LibraryBundler, Linter, LinterMetaConfig, PackageManagerSpec, PackageVersions, ProjectOptions, ProjectPlanInput, ProjectType, Testing, VirtualFileMap, WorkspacePlanInput, detectTooling, generateRandomName, getLatestNodeVersion, getLatestNpmCliVersion, getLatestNpmMajorVersion, getLatestNpmMajorVersionAtOrBelow, getLatestNpmVersion, getLatestPnpmVersion, getLatestYarnVersion, merge, mergePartialPlans, parseWorkspaceYamlContent, planProject, planWorkspace, projectPlanInputToOptions, resolveProjectPlanInput, resolveWorkspacePlanInput, unique, validatePackageName, workspacePlanInputToMonorepoParams };
|
|
129
133
|
export type { DetectedTooling, MetaConfig, PartialPlan, ProjectContext, ProjectPlan, ToolSelections };
|
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
|
|
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';
|
|
2
2
|
import 'fs/promises';
|
|
3
3
|
import 'fs';
|
|
4
4
|
import 'path';
|
|
@@ -232,6 +232,7 @@ type PlanBuilder = {
|
|
|
232
232
|
};
|
|
233
233
|
declare function getLanguageFromTemplate(template: Template): 'javascript' | 'typescript';
|
|
234
234
|
declare function getBaseTemplate(template: Template): BaseTemplate;
|
|
235
|
+
declare function shouldEnableReactCompiler(options: Pick<ProjectOptions, 'projectType' | 'template'>): boolean;
|
|
235
236
|
|
|
236
|
-
export { getLanguageFromTemplate as $, getBaseTemplate as _ };
|
|
237
|
+
export { getLanguageFromTemplate as $, getBaseTemplate as _, shouldEnableReactCompiler as a0 };
|
|
237
238
|
export type { AiPlatform as A, BaseTemplate as B, CodeInjectionLocation as C, DependencyVersionOptions as D, EngineSpec as E, FormatterMetaConfig as F, PlanTriplexOptions as G, PlanUikitOptions as H, Ide as I, PlanViverseOptions as J, PlanXrOptions as K, LinterMetaConfig as L, PlanZustandOptions as M, ProjectMetaConfig as N, ProjectPlanContext as O, ProjectType as P, Template as Q, TestingMetaConfig as R, ToolConfig as S, Testing as T, TypeScriptMetaConfig as U, VirtualFileMap as V, WorkspacePlanInput as W, VersionRangePrefix as X, VirtualFile as Y, WorkspacePlanContext as Z, ConfigStrategy as a, PackageVersions as b, Linter as c, Formatter as d, LibraryBundler as e, PackageManagerSpec as f, ProjectPlanInput as g, ProjectOptions as h, AiAgentsMetaConfig as i, EditorMetaConfig as j, EngineName as k, FeatureSelections as l, FileRenderer as m, LibraryBundlerMetaConfig as n, PackageManagerMetaConfig as o, PackageManagerName as p, PlanBuilder as q, PlanDreiOptions as r, PlanFiberOptions as s, PlanGithubPagesOptions as t, PlanHandleOptions as u, PlanKootaOptions as v, PlanLevaOptions as w, PlanOffscreenOptions as x, PlanPostprocessingOptions as y, PlanRapierOptions as z };
|
|
@@ -232,6 +232,7 @@ type PlanBuilder = {
|
|
|
232
232
|
};
|
|
233
233
|
declare function getLanguageFromTemplate(template: Template): 'javascript' | 'typescript';
|
|
234
234
|
declare function getBaseTemplate(template: Template): BaseTemplate;
|
|
235
|
+
declare function shouldEnableReactCompiler(options: Pick<ProjectOptions, 'projectType' | 'template'>): boolean;
|
|
235
236
|
|
|
236
|
-
export { getLanguageFromTemplate as $, getBaseTemplate as _ };
|
|
237
|
+
export { getLanguageFromTemplate as $, getBaseTemplate as _, shouldEnableReactCompiler as a0 };
|
|
237
238
|
export type { AiPlatform as A, BaseTemplate as B, CodeInjectionLocation as C, DependencyVersionOptions as D, EngineSpec as E, FormatterMetaConfig as F, PlanTriplexOptions as G, PlanUikitOptions as H, Ide as I, PlanViverseOptions as J, PlanXrOptions as K, LinterMetaConfig as L, PlanZustandOptions as M, ProjectMetaConfig as N, ProjectPlanContext as O, ProjectType as P, Template as Q, TestingMetaConfig as R, ToolConfig as S, Testing as T, TypeScriptMetaConfig as U, VirtualFileMap as V, WorkspacePlanInput as W, VersionRangePrefix as X, VirtualFile as Y, WorkspacePlanContext as Z, ConfigStrategy as a, PackageVersions as b, Linter as c, Formatter as d, LibraryBundler as e, PackageManagerSpec as f, ProjectPlanInput as g, ProjectOptions as h, AiAgentsMetaConfig as i, EditorMetaConfig as j, EngineName as k, FeatureSelections as l, FileRenderer as m, LibraryBundlerMetaConfig as n, PackageManagerMetaConfig as o, PackageManagerName as p, PlanBuilder as q, PlanDreiOptions as r, PlanFiberOptions as s, PlanGithubPagesOptions as t, PlanHandleOptions as u, PlanKootaOptions as v, PlanLevaOptions as w, PlanOffscreenOptions as x, PlanPostprocessingOptions as y, PlanRapierOptions as z };
|
|
@@ -232,6 +232,7 @@ type PlanBuilder = {
|
|
|
232
232
|
};
|
|
233
233
|
declare function getLanguageFromTemplate(template: Template): 'javascript' | 'typescript';
|
|
234
234
|
declare function getBaseTemplate(template: Template): BaseTemplate;
|
|
235
|
+
declare function shouldEnableReactCompiler(options: Pick<ProjectOptions, 'projectType' | 'template'>): boolean;
|
|
235
236
|
|
|
236
|
-
export { getLanguageFromTemplate as $, getBaseTemplate as _ };
|
|
237
|
+
export { getLanguageFromTemplate as $, getBaseTemplate as _, shouldEnableReactCompiler as a0 };
|
|
237
238
|
export type { AiPlatform as A, BaseTemplate as B, CodeInjectionLocation as C, DependencyVersionOptions as D, EngineSpec as E, FormatterMetaConfig as F, PlanTriplexOptions as G, PlanUikitOptions as H, Ide as I, PlanViverseOptions as J, PlanXrOptions as K, LinterMetaConfig as L, PlanZustandOptions as M, ProjectMetaConfig as N, ProjectPlanContext as O, ProjectType as P, Template as Q, TestingMetaConfig as R, ToolConfig as S, Testing as T, TypeScriptMetaConfig as U, VirtualFileMap as V, WorkspacePlanInput as W, VersionRangePrefix as X, VirtualFile as Y, WorkspacePlanContext as Z, ConfigStrategy as a, PackageVersions as b, Linter as c, Formatter as d, LibraryBundler as e, PackageManagerSpec as f, ProjectPlanInput as g, ProjectOptions as h, AiAgentsMetaConfig as i, EditorMetaConfig as j, EngineName as k, FeatureSelections as l, FileRenderer as m, LibraryBundlerMetaConfig as n, PackageManagerMetaConfig as o, PackageManagerName as p, PlanBuilder as q, PlanDreiOptions as r, PlanFiberOptions as s, PlanGithubPagesOptions as t, PlanHandleOptions as u, PlanKootaOptions as v, PlanLevaOptions as w, PlanOffscreenOptions as x, PlanPostprocessingOptions as y, PlanRapierOptions as z };
|
|
@@ -177,6 +177,10 @@ function getLanguageFromTemplate(template) {
|
|
|
177
177
|
function getBaseTemplate(template) {
|
|
178
178
|
return template.replace("-js", "");
|
|
179
179
|
}
|
|
180
|
+
function shouldEnableReactCompiler(options) {
|
|
181
|
+
const template = options.template ?? "vanilla";
|
|
182
|
+
return getBaseTemplate(template) === "react" && (options.projectType ?? "app") === "app";
|
|
183
|
+
}
|
|
180
184
|
|
|
181
185
|
function unique(...array) {
|
|
182
186
|
const set = /* @__PURE__ */ new Set();
|
|
@@ -439,16 +443,41 @@ function compareNumericSemver(a, b) {
|
|
|
439
443
|
}
|
|
440
444
|
return 0;
|
|
441
445
|
}
|
|
446
|
+
function getLatestMatchingMajorVersion(versions, majorVersion) {
|
|
447
|
+
return [...versions].filter((version) => version.split(".")[0] === majorVersion).sort((a, b) => compareNumericSemver(b, a))[0];
|
|
448
|
+
}
|
|
442
449
|
async function getLatestNpmMajorVersion(packageName, majorVersion, fallback) {
|
|
443
450
|
try {
|
|
444
451
|
const response = await fetch(`https://registry.npmjs.org/${packageName}`);
|
|
445
452
|
const data = await response.json();
|
|
446
|
-
const latestMatchingVersion =
|
|
453
|
+
const latestMatchingVersion = getLatestMatchingMajorVersion(
|
|
454
|
+
Object.keys(data.versions ?? {}),
|
|
455
|
+
majorVersion
|
|
456
|
+
);
|
|
447
457
|
return latestMatchingVersion ?? fallback;
|
|
448
458
|
} catch {
|
|
449
459
|
return fallback;
|
|
450
460
|
}
|
|
451
461
|
}
|
|
462
|
+
async function getLatestNpmMajorVersionAtOrBelow(packageName, majorVersion, fallback) {
|
|
463
|
+
try {
|
|
464
|
+
const response = await fetch(`https://registry.npmjs.org/${packageName}`);
|
|
465
|
+
const data = await response.json();
|
|
466
|
+
const versions = Object.keys(data.versions ?? {});
|
|
467
|
+
const requestedMajor = Number.parseInt(majorVersion, 10);
|
|
468
|
+
if (Number.isFinite(requestedMajor)) {
|
|
469
|
+
for (let major = requestedMajor; major >= 0; major -= 1) {
|
|
470
|
+
const latestMatchingVersion = getLatestMatchingMajorVersion(versions, String(major));
|
|
471
|
+
if (latestMatchingVersion != null) {
|
|
472
|
+
return latestMatchingVersion;
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
return fallback;
|
|
477
|
+
} catch {
|
|
478
|
+
return fallback;
|
|
479
|
+
}
|
|
480
|
+
}
|
|
452
481
|
async function getLatestPnpmVersion() {
|
|
453
482
|
return getLatestNpmVersion("pnpm", "10.11.0");
|
|
454
483
|
}
|
|
@@ -495,6 +524,7 @@ function parseWorkspaceYamlContent(content) {
|
|
|
495
524
|
}
|
|
496
525
|
|
|
497
526
|
const PACKAGE_VERSION_DEFINITIONS = {
|
|
527
|
+
"@babel/core": { fallbackVersion: "7.29.0" },
|
|
498
528
|
"@biomejs/biome": { fallbackVersion: "2.0.0" },
|
|
499
529
|
"@react-three/drei": { fallbackVersion: "10.0.0" },
|
|
500
530
|
"@react-three/fiber": { fallbackVersion: "9.0.0" },
|
|
@@ -504,16 +534,20 @@ const PACKAGE_VERSION_DEFINITIONS = {
|
|
|
504
534
|
"@react-three/rapier": { fallbackVersion: "2.1.0" },
|
|
505
535
|
"@react-three/uikit": { fallbackVersion: "0.8.15" },
|
|
506
536
|
"@react-three/xr": { fallbackVersion: "6.6.16" },
|
|
537
|
+
"@rolldown/plugin-babel": { fallbackVersion: "0.2.3" },
|
|
507
538
|
"@testing-library/dom": { fallbackVersion: "10.4.0" },
|
|
508
539
|
"@testing-library/react": { fallbackVersion: "16.2.0" },
|
|
540
|
+
"@types/babel__core": { fallbackVersion: "7.20.5" },
|
|
541
|
+
"@types/node": { fallbackVersion: "25.3.5" },
|
|
509
542
|
"@types/react": { fallbackVersion: "19.0.0" },
|
|
510
543
|
"@types/react-dom": { fallbackVersion: "19.0.0" },
|
|
511
544
|
"@types/three": { fallbackVersion: "0.175.0", prefix: "~" },
|
|
512
545
|
"@vitejs/plugin-basic-ssl": { fallbackVersion: "2.0.0" },
|
|
513
|
-
"@vitejs/plugin-react": { fallbackVersion: "
|
|
546
|
+
"@vitejs/plugin-react": { fallbackVersion: "6.0.1" },
|
|
514
547
|
"@viverse/cli": { fallbackVersion: "0.9.5-beta.8" },
|
|
515
548
|
eslint: { fallbackVersion: "9.17.0" },
|
|
516
549
|
"eslint-plugin-react-hooks": { fallbackVersion: "5.1.0" },
|
|
550
|
+
"babel-plugin-react-compiler": { fallbackVersion: "1.0.0" },
|
|
517
551
|
jsdom: { fallbackVersion: "26.0.0" },
|
|
518
552
|
koota: { fallbackVersion: "0.4.0" },
|
|
519
553
|
leva: { fallbackVersion: "0.10.0" },
|
|
@@ -528,7 +562,7 @@ const PACKAGE_VERSION_DEFINITIONS = {
|
|
|
528
562
|
typescript: { fallbackVersion: "5.9.3" },
|
|
529
563
|
"typescript-eslint": { fallbackVersion: "8.18.0" },
|
|
530
564
|
unbuild: { fallbackVersion: "3.5.0" },
|
|
531
|
-
vite: { fallbackVersion: "
|
|
565
|
+
vite: { fallbackVersion: "8.0.12" },
|
|
532
566
|
vitest: { fallbackVersion: "4.0.0" },
|
|
533
567
|
zustand: { fallbackVersion: "5.0.3" }
|
|
534
568
|
};
|
|
@@ -622,17 +656,12 @@ async function resolveEngine(options) {
|
|
|
622
656
|
}
|
|
623
657
|
return engine;
|
|
624
658
|
}
|
|
625
|
-
function formatNodeTypesVersion(versions = {},
|
|
659
|
+
function formatNodeTypesVersion(versions = {}, _engine) {
|
|
626
660
|
const resolvedVersion = versions["@types/node"];
|
|
627
661
|
if (resolvedVersion != null) {
|
|
628
662
|
return `^${resolvedVersion}`;
|
|
629
663
|
}
|
|
630
|
-
|
|
631
|
-
if (engineSpec.name === "node" && engineSpec.version) {
|
|
632
|
-
const majorVersion = engineSpec.version.split(".")[0];
|
|
633
|
-
return `^${majorVersion}.0.0`;
|
|
634
|
-
}
|
|
635
|
-
return "^22.0.0";
|
|
664
|
+
return formatResolvedPackageVersion(versions, "@types/node");
|
|
636
665
|
}
|
|
637
666
|
async function resolveNodeTypesVersion(engine, versions = {}) {
|
|
638
667
|
if (versions["@types/node"] != null) {
|
|
@@ -644,7 +673,11 @@ async function resolveNodeTypesVersion(engine, versions = {}) {
|
|
|
644
673
|
}
|
|
645
674
|
const nodeVersion = engineSpec.version ?? await getLatestNodeVersion();
|
|
646
675
|
const majorVersion = nodeVersion.split(".")[0];
|
|
647
|
-
return
|
|
676
|
+
return getLatestNpmMajorVersionAtOrBelow(
|
|
677
|
+
"@types/node",
|
|
678
|
+
majorVersion,
|
|
679
|
+
getPackageFallbackVersion("@types/node")
|
|
680
|
+
);
|
|
648
681
|
}
|
|
649
682
|
async function resolvePackageVersions(packageNames, existingVersions = {}) {
|
|
650
683
|
const versions = { ...existingVersions };
|
|
@@ -699,6 +732,7 @@ function collectProjectPackageNames(options) {
|
|
|
699
732
|
const isReact = baseTemplate === "react" || baseTemplate === "r3f";
|
|
700
733
|
const isR3f = baseTemplate === "r3f";
|
|
701
734
|
const isTypescript = language === "typescript";
|
|
735
|
+
const useReactCompiler = shouldEnableReactCompiler(options);
|
|
702
736
|
const inWorkspace = options.workspaceRoot != null;
|
|
703
737
|
const testing = options.testing ?? (isLibrary ? "vitest" : "none");
|
|
704
738
|
const linter = options.linter ?? "oxlint";
|
|
@@ -720,10 +754,18 @@ function collectProjectPackageNames(options) {
|
|
|
720
754
|
addPackageName(packageNames, explicitVersions, "react");
|
|
721
755
|
addPackageName(packageNames, explicitVersions, "react-dom");
|
|
722
756
|
addPackageName(packageNames, explicitVersions, "@vitejs/plugin-react");
|
|
757
|
+
if (useReactCompiler) {
|
|
758
|
+
addPackageName(packageNames, explicitVersions, "@babel/core");
|
|
759
|
+
addPackageName(packageNames, explicitVersions, "@rolldown/plugin-babel");
|
|
760
|
+
addPackageName(packageNames, explicitVersions, "babel-plugin-react-compiler");
|
|
761
|
+
}
|
|
723
762
|
}
|
|
724
763
|
if (isTypescript) {
|
|
725
764
|
addPackageName(packageNames, explicitVersions, "@types/react");
|
|
726
765
|
addPackageName(packageNames, explicitVersions, "@types/react-dom");
|
|
766
|
+
if (useReactCompiler) {
|
|
767
|
+
addPackageName(packageNames, explicitVersions, "@types/babel__core");
|
|
768
|
+
}
|
|
727
769
|
}
|
|
728
770
|
}
|
|
729
771
|
if (isR3f) {
|
|
@@ -840,7 +882,7 @@ function renderTypescriptConfig(baseTemplateOrParams) {
|
|
|
840
882
|
const devDependencies = {};
|
|
841
883
|
assignResolvedPackageVersion(devDependencies, versions, "typescript");
|
|
842
884
|
if (getEngineName(engine) === "node") {
|
|
843
|
-
devDependencies["@types/node"] = formatNodeTypesVersion(versions
|
|
885
|
+
devDependencies["@types/node"] = formatNodeTypesVersion(versions);
|
|
844
886
|
} else {
|
|
845
887
|
devDependencies["@types/node"] = "^22.0.0";
|
|
846
888
|
}
|
|
@@ -2274,7 +2316,7 @@ function renderMonorepo(params) {
|
|
|
2274
2316
|
const isPnpm = packageManager.name === "pnpm";
|
|
2275
2317
|
const devDependencies = {};
|
|
2276
2318
|
if (engine?.name === "node" && engine.version) {
|
|
2277
|
-
devDependencies["@types/node"] = formatNodeTypesVersion(versions
|
|
2319
|
+
devDependencies["@types/node"] = formatNodeTypesVersion(versions);
|
|
2278
2320
|
} else {
|
|
2279
2321
|
devDependencies["@types/node"] = "^22.0.0";
|
|
2280
2322
|
}
|
|
@@ -3559,6 +3601,7 @@ function createProjectPlan(planInput) {
|
|
|
3559
3601
|
const isReact = baseTemplate === "react";
|
|
3560
3602
|
const isR3f = baseTemplate === "r3f";
|
|
3561
3603
|
const isLibrary = clonedOptions.projectType === "library";
|
|
3604
|
+
const useReactCompiler = shouldEnableReactCompiler(clonedOptions);
|
|
3562
3605
|
const libraryBundler = planInput.libraryBundler.tool;
|
|
3563
3606
|
const ide = planInput.ide.tool;
|
|
3564
3607
|
const files = {
|
|
@@ -3582,6 +3625,11 @@ function createProjectPlan(planInput) {
|
|
|
3582
3625
|
assignResolvedPackageVersion(dependencies, versions, "react");
|
|
3583
3626
|
assignResolvedPackageVersion(dependencies, versions, "react-dom");
|
|
3584
3627
|
assignResolvedPackageVersion(devDependencies, versions, "@vitejs/plugin-react");
|
|
3628
|
+
if (useReactCompiler) {
|
|
3629
|
+
assignResolvedPackageVersion(devDependencies, versions, "@babel/core");
|
|
3630
|
+
assignResolvedPackageVersion(devDependencies, versions, "@rolldown/plugin-babel");
|
|
3631
|
+
assignResolvedPackageVersion(devDependencies, versions, "babel-plugin-react-compiler");
|
|
3632
|
+
}
|
|
3585
3633
|
}
|
|
3586
3634
|
}
|
|
3587
3635
|
if (isR3f) {
|
|
@@ -3603,12 +3651,20 @@ function createProjectPlan(planInput) {
|
|
|
3603
3651
|
});
|
|
3604
3652
|
Object.assign(files, tsResult.files);
|
|
3605
3653
|
Object.assign(devDependencies, tsResult.devDependencies);
|
|
3654
|
+
if (useReactCompiler) {
|
|
3655
|
+
assignResolvedPackageVersion(devDependencies, versions, "@types/babel__core");
|
|
3656
|
+
}
|
|
3606
3657
|
}
|
|
3607
3658
|
const codeSnippets = {};
|
|
3608
3659
|
const vscodeSettings = {};
|
|
3609
3660
|
const scripts = {};
|
|
3610
3661
|
if (!isLibrary && (isReact || isR3f)) {
|
|
3611
|
-
codeSnippets["vite-config-import"] = [
|
|
3662
|
+
codeSnippets["vite-config-import"] = [
|
|
3663
|
+
useReactCompiler ? "import react, { reactCompilerPreset } from '@vitejs/plugin-react';" : "import react from '@vitejs/plugin-react';"
|
|
3664
|
+
];
|
|
3665
|
+
if (useReactCompiler) {
|
|
3666
|
+
codeSnippets["vite-config-import"].push("import babel from '@rolldown/plugin-babel';");
|
|
3667
|
+
}
|
|
3612
3668
|
}
|
|
3613
3669
|
if (!isLibrary && isR3f) {
|
|
3614
3670
|
codeSnippets["import"] = [`import { Canvas } from "@react-three/fiber"`];
|
|
@@ -3619,7 +3675,7 @@ function createProjectPlan(planInput) {
|
|
|
3619
3675
|
base: "./"
|
|
3620
3676
|
};
|
|
3621
3677
|
if (!isLibrary && (isReact || isR3f)) {
|
|
3622
|
-
viteConfig.plugins = ["$raw:react()"];
|
|
3678
|
+
viteConfig.plugins = useReactCompiler ? ["$raw:react()", "$raw:babel({ presets: [reactCompilerPreset()] })"] : ["$raw:react()"];
|
|
3623
3679
|
}
|
|
3624
3680
|
if (!isLibrary && isR3f) {
|
|
3625
3681
|
viteConfig.resolve = { dedupe: ["three"] };
|
|
@@ -3724,7 +3780,9 @@ function createProjectPlan(planInput) {
|
|
|
3724
3780
|
} else if (planInput.formatter.tool === "oxfmt") {
|
|
3725
3781
|
planOxfmt(builder, planInput.formatter);
|
|
3726
3782
|
} else if (planInput.formatter.tool === "biome" && planInput.linter.tool !== "biome") {
|
|
3727
|
-
planBiome(builder, {
|
|
3783
|
+
planBiome(builder, {
|
|
3784
|
+
formatter: planInput.formatter
|
|
3785
|
+
});
|
|
3728
3786
|
}
|
|
3729
3787
|
for (const { code, location } of clonedOptions.injections ?? []) {
|
|
3730
3788
|
builder.inject(location, code);
|
|
@@ -3850,4 +3908,4 @@ async function planWorkspace(input) {
|
|
|
3850
3908
|
};
|
|
3851
3909
|
}
|
|
3852
3910
|
|
|
3853
|
-
export { ALL_AI_PLATFORMS as A,
|
|
3911
|
+
export { ALL_AI_PLATFORMS as A, parsePackageManager as B, parseEngine as C, renderTypescriptConfigPackage as D, renderOxlintConfigPackage as E, renderEslintConfigPackage as F, renderOxfmtConfigPackage as G, renderPrettierConfigPackage as H, resolveMonorepoRootPackageVersions as I, getResolvedPackageVersion as J, renderVscodeFiles as K, renderAiFiles as L, renderVscodeFiles$1 as M, renderEditorConfig as N, renderGitignore as O, toPrettierIgnoreContent as P, mergePackageJsonScripts as Q, renderViteConfig as R, packageJsonScripts as S, resolveDefaultPackageJsonScripts as T, formatResolvedPackageVersion as U, renderOxlintConfig as V, getBaseTemplate as a, getLanguageFromTemplate as b, getLatestNodeVersion as c, detectTooling as d, getLatestNpmCliVersion as e, getLatestNpmMajorVersion as f, generateRandomName as g, getLatestNpmMajorVersionAtOrBelow as h, getLatestNpmVersion as i, getLatestPnpmVersion as j, getLatestYarnVersion as k, planProject as l, merge as m, planWorkspace as n, projectPlanInputToOptions as o, parseWorkspaceYamlContent as p, resolveWorkspacePlanInput as q, resolveProjectPlanInput as r, shouldEnableReactCompiler as s, getEngineName as t, unique as u, validatePackageName as v, workspacePlanInputToMonorepoParams as w, getPackageManagerName as x, AI_PLATFORM_LABELS as y, AI_PLATFORM_HINTS as z };
|
|
@@ -183,6 +183,10 @@ function getLanguageFromTemplate(template) {
|
|
|
183
183
|
function getBaseTemplate(template) {
|
|
184
184
|
return template.replace("-js", "");
|
|
185
185
|
}
|
|
186
|
+
function shouldEnableReactCompiler(options) {
|
|
187
|
+
const template = options.template ?? "vanilla";
|
|
188
|
+
return getBaseTemplate(template) === "react" && (options.projectType ?? "app") === "app";
|
|
189
|
+
}
|
|
186
190
|
|
|
187
191
|
function unique(...array) {
|
|
188
192
|
const set = /* @__PURE__ */ new Set();
|
|
@@ -445,16 +449,41 @@ function compareNumericSemver(a, b) {
|
|
|
445
449
|
}
|
|
446
450
|
return 0;
|
|
447
451
|
}
|
|
452
|
+
function getLatestMatchingMajorVersion(versions, majorVersion) {
|
|
453
|
+
return [...versions].filter((version) => version.split(".")[0] === majorVersion).sort((a, b) => compareNumericSemver(b, a))[0];
|
|
454
|
+
}
|
|
448
455
|
async function getLatestNpmMajorVersion(packageName, majorVersion, fallback) {
|
|
449
456
|
try {
|
|
450
457
|
const response = await fetch(`https://registry.npmjs.org/${packageName}`);
|
|
451
458
|
const data = await response.json();
|
|
452
|
-
const latestMatchingVersion =
|
|
459
|
+
const latestMatchingVersion = getLatestMatchingMajorVersion(
|
|
460
|
+
Object.keys(data.versions ?? {}),
|
|
461
|
+
majorVersion
|
|
462
|
+
);
|
|
453
463
|
return latestMatchingVersion ?? fallback;
|
|
454
464
|
} catch {
|
|
455
465
|
return fallback;
|
|
456
466
|
}
|
|
457
467
|
}
|
|
468
|
+
async function getLatestNpmMajorVersionAtOrBelow(packageName, majorVersion, fallback) {
|
|
469
|
+
try {
|
|
470
|
+
const response = await fetch(`https://registry.npmjs.org/${packageName}`);
|
|
471
|
+
const data = await response.json();
|
|
472
|
+
const versions = Object.keys(data.versions ?? {});
|
|
473
|
+
const requestedMajor = Number.parseInt(majorVersion, 10);
|
|
474
|
+
if (Number.isFinite(requestedMajor)) {
|
|
475
|
+
for (let major = requestedMajor; major >= 0; major -= 1) {
|
|
476
|
+
const latestMatchingVersion = getLatestMatchingMajorVersion(versions, String(major));
|
|
477
|
+
if (latestMatchingVersion != null) {
|
|
478
|
+
return latestMatchingVersion;
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
return fallback;
|
|
483
|
+
} catch {
|
|
484
|
+
return fallback;
|
|
485
|
+
}
|
|
486
|
+
}
|
|
458
487
|
async function getLatestPnpmVersion() {
|
|
459
488
|
return getLatestNpmVersion("pnpm", "10.11.0");
|
|
460
489
|
}
|
|
@@ -501,6 +530,7 @@ function parseWorkspaceYamlContent(content) {
|
|
|
501
530
|
}
|
|
502
531
|
|
|
503
532
|
const PACKAGE_VERSION_DEFINITIONS = {
|
|
533
|
+
"@babel/core": { fallbackVersion: "7.29.0" },
|
|
504
534
|
"@biomejs/biome": { fallbackVersion: "2.0.0" },
|
|
505
535
|
"@react-three/drei": { fallbackVersion: "10.0.0" },
|
|
506
536
|
"@react-three/fiber": { fallbackVersion: "9.0.0" },
|
|
@@ -510,16 +540,20 @@ const PACKAGE_VERSION_DEFINITIONS = {
|
|
|
510
540
|
"@react-three/rapier": { fallbackVersion: "2.1.0" },
|
|
511
541
|
"@react-three/uikit": { fallbackVersion: "0.8.15" },
|
|
512
542
|
"@react-three/xr": { fallbackVersion: "6.6.16" },
|
|
543
|
+
"@rolldown/plugin-babel": { fallbackVersion: "0.2.3" },
|
|
513
544
|
"@testing-library/dom": { fallbackVersion: "10.4.0" },
|
|
514
545
|
"@testing-library/react": { fallbackVersion: "16.2.0" },
|
|
546
|
+
"@types/babel__core": { fallbackVersion: "7.20.5" },
|
|
547
|
+
"@types/node": { fallbackVersion: "25.3.5" },
|
|
515
548
|
"@types/react": { fallbackVersion: "19.0.0" },
|
|
516
549
|
"@types/react-dom": { fallbackVersion: "19.0.0" },
|
|
517
550
|
"@types/three": { fallbackVersion: "0.175.0", prefix: "~" },
|
|
518
551
|
"@vitejs/plugin-basic-ssl": { fallbackVersion: "2.0.0" },
|
|
519
|
-
"@vitejs/plugin-react": { fallbackVersion: "
|
|
552
|
+
"@vitejs/plugin-react": { fallbackVersion: "6.0.1" },
|
|
520
553
|
"@viverse/cli": { fallbackVersion: "0.9.5-beta.8" },
|
|
521
554
|
eslint: { fallbackVersion: "9.17.0" },
|
|
522
555
|
"eslint-plugin-react-hooks": { fallbackVersion: "5.1.0" },
|
|
556
|
+
"babel-plugin-react-compiler": { fallbackVersion: "1.0.0" },
|
|
523
557
|
jsdom: { fallbackVersion: "26.0.0" },
|
|
524
558
|
koota: { fallbackVersion: "0.4.0" },
|
|
525
559
|
leva: { fallbackVersion: "0.10.0" },
|
|
@@ -534,7 +568,7 @@ const PACKAGE_VERSION_DEFINITIONS = {
|
|
|
534
568
|
typescript: { fallbackVersion: "5.9.3" },
|
|
535
569
|
"typescript-eslint": { fallbackVersion: "8.18.0" },
|
|
536
570
|
unbuild: { fallbackVersion: "3.5.0" },
|
|
537
|
-
vite: { fallbackVersion: "
|
|
571
|
+
vite: { fallbackVersion: "8.0.12" },
|
|
538
572
|
vitest: { fallbackVersion: "4.0.0" },
|
|
539
573
|
zustand: { fallbackVersion: "5.0.3" }
|
|
540
574
|
};
|
|
@@ -628,17 +662,12 @@ async function resolveEngine(options) {
|
|
|
628
662
|
}
|
|
629
663
|
return engine;
|
|
630
664
|
}
|
|
631
|
-
function formatNodeTypesVersion(versions = {},
|
|
665
|
+
function formatNodeTypesVersion(versions = {}, _engine) {
|
|
632
666
|
const resolvedVersion = versions["@types/node"];
|
|
633
667
|
if (resolvedVersion != null) {
|
|
634
668
|
return `^${resolvedVersion}`;
|
|
635
669
|
}
|
|
636
|
-
|
|
637
|
-
if (engineSpec.name === "node" && engineSpec.version) {
|
|
638
|
-
const majorVersion = engineSpec.version.split(".")[0];
|
|
639
|
-
return `^${majorVersion}.0.0`;
|
|
640
|
-
}
|
|
641
|
-
return "^22.0.0";
|
|
670
|
+
return formatResolvedPackageVersion(versions, "@types/node");
|
|
642
671
|
}
|
|
643
672
|
async function resolveNodeTypesVersion(engine, versions = {}) {
|
|
644
673
|
if (versions["@types/node"] != null) {
|
|
@@ -650,7 +679,11 @@ async function resolveNodeTypesVersion(engine, versions = {}) {
|
|
|
650
679
|
}
|
|
651
680
|
const nodeVersion = engineSpec.version ?? await getLatestNodeVersion();
|
|
652
681
|
const majorVersion = nodeVersion.split(".")[0];
|
|
653
|
-
return
|
|
682
|
+
return getLatestNpmMajorVersionAtOrBelow(
|
|
683
|
+
"@types/node",
|
|
684
|
+
majorVersion,
|
|
685
|
+
getPackageFallbackVersion("@types/node")
|
|
686
|
+
);
|
|
654
687
|
}
|
|
655
688
|
async function resolvePackageVersions(packageNames, existingVersions = {}) {
|
|
656
689
|
const versions = { ...existingVersions };
|
|
@@ -705,6 +738,7 @@ function collectProjectPackageNames(options) {
|
|
|
705
738
|
const isReact = baseTemplate === "react" || baseTemplate === "r3f";
|
|
706
739
|
const isR3f = baseTemplate === "r3f";
|
|
707
740
|
const isTypescript = language === "typescript";
|
|
741
|
+
const useReactCompiler = shouldEnableReactCompiler(options);
|
|
708
742
|
const inWorkspace = options.workspaceRoot != null;
|
|
709
743
|
const testing = options.testing ?? (isLibrary ? "vitest" : "none");
|
|
710
744
|
const linter = options.linter ?? "oxlint";
|
|
@@ -726,10 +760,18 @@ function collectProjectPackageNames(options) {
|
|
|
726
760
|
addPackageName(packageNames, explicitVersions, "react");
|
|
727
761
|
addPackageName(packageNames, explicitVersions, "react-dom");
|
|
728
762
|
addPackageName(packageNames, explicitVersions, "@vitejs/plugin-react");
|
|
763
|
+
if (useReactCompiler) {
|
|
764
|
+
addPackageName(packageNames, explicitVersions, "@babel/core");
|
|
765
|
+
addPackageName(packageNames, explicitVersions, "@rolldown/plugin-babel");
|
|
766
|
+
addPackageName(packageNames, explicitVersions, "babel-plugin-react-compiler");
|
|
767
|
+
}
|
|
729
768
|
}
|
|
730
769
|
if (isTypescript) {
|
|
731
770
|
addPackageName(packageNames, explicitVersions, "@types/react");
|
|
732
771
|
addPackageName(packageNames, explicitVersions, "@types/react-dom");
|
|
772
|
+
if (useReactCompiler) {
|
|
773
|
+
addPackageName(packageNames, explicitVersions, "@types/babel__core");
|
|
774
|
+
}
|
|
733
775
|
}
|
|
734
776
|
}
|
|
735
777
|
if (isR3f) {
|
|
@@ -846,7 +888,7 @@ function renderTypescriptConfig(baseTemplateOrParams) {
|
|
|
846
888
|
const devDependencies = {};
|
|
847
889
|
assignResolvedPackageVersion(devDependencies, versions, "typescript");
|
|
848
890
|
if (getEngineName(engine) === "node") {
|
|
849
|
-
devDependencies["@types/node"] = formatNodeTypesVersion(versions
|
|
891
|
+
devDependencies["@types/node"] = formatNodeTypesVersion(versions);
|
|
850
892
|
} else {
|
|
851
893
|
devDependencies["@types/node"] = "^22.0.0";
|
|
852
894
|
}
|
|
@@ -2280,7 +2322,7 @@ function renderMonorepo(params) {
|
|
|
2280
2322
|
const isPnpm = packageManager.name === "pnpm";
|
|
2281
2323
|
const devDependencies = {};
|
|
2282
2324
|
if (engine?.name === "node" && engine.version) {
|
|
2283
|
-
devDependencies["@types/node"] = formatNodeTypesVersion(versions
|
|
2325
|
+
devDependencies["@types/node"] = formatNodeTypesVersion(versions);
|
|
2284
2326
|
} else {
|
|
2285
2327
|
devDependencies["@types/node"] = "^22.0.0";
|
|
2286
2328
|
}
|
|
@@ -3565,6 +3607,7 @@ function createProjectPlan(planInput) {
|
|
|
3565
3607
|
const isReact = baseTemplate === "react";
|
|
3566
3608
|
const isR3f = baseTemplate === "r3f";
|
|
3567
3609
|
const isLibrary = clonedOptions.projectType === "library";
|
|
3610
|
+
const useReactCompiler = shouldEnableReactCompiler(clonedOptions);
|
|
3568
3611
|
const libraryBundler = planInput.libraryBundler.tool;
|
|
3569
3612
|
const ide = planInput.ide.tool;
|
|
3570
3613
|
const files = {
|
|
@@ -3588,6 +3631,11 @@ function createProjectPlan(planInput) {
|
|
|
3588
3631
|
assignResolvedPackageVersion(dependencies, versions, "react");
|
|
3589
3632
|
assignResolvedPackageVersion(dependencies, versions, "react-dom");
|
|
3590
3633
|
assignResolvedPackageVersion(devDependencies, versions, "@vitejs/plugin-react");
|
|
3634
|
+
if (useReactCompiler) {
|
|
3635
|
+
assignResolvedPackageVersion(devDependencies, versions, "@babel/core");
|
|
3636
|
+
assignResolvedPackageVersion(devDependencies, versions, "@rolldown/plugin-babel");
|
|
3637
|
+
assignResolvedPackageVersion(devDependencies, versions, "babel-plugin-react-compiler");
|
|
3638
|
+
}
|
|
3591
3639
|
}
|
|
3592
3640
|
}
|
|
3593
3641
|
if (isR3f) {
|
|
@@ -3609,12 +3657,20 @@ function createProjectPlan(planInput) {
|
|
|
3609
3657
|
});
|
|
3610
3658
|
Object.assign(files, tsResult.files);
|
|
3611
3659
|
Object.assign(devDependencies, tsResult.devDependencies);
|
|
3660
|
+
if (useReactCompiler) {
|
|
3661
|
+
assignResolvedPackageVersion(devDependencies, versions, "@types/babel__core");
|
|
3662
|
+
}
|
|
3612
3663
|
}
|
|
3613
3664
|
const codeSnippets = {};
|
|
3614
3665
|
const vscodeSettings = {};
|
|
3615
3666
|
const scripts = {};
|
|
3616
3667
|
if (!isLibrary && (isReact || isR3f)) {
|
|
3617
|
-
codeSnippets["vite-config-import"] = [
|
|
3668
|
+
codeSnippets["vite-config-import"] = [
|
|
3669
|
+
useReactCompiler ? "import react, { reactCompilerPreset } from '@vitejs/plugin-react';" : "import react from '@vitejs/plugin-react';"
|
|
3670
|
+
];
|
|
3671
|
+
if (useReactCompiler) {
|
|
3672
|
+
codeSnippets["vite-config-import"].push("import babel from '@rolldown/plugin-babel';");
|
|
3673
|
+
}
|
|
3618
3674
|
}
|
|
3619
3675
|
if (!isLibrary && isR3f) {
|
|
3620
3676
|
codeSnippets["import"] = [`import { Canvas } from "@react-three/fiber"`];
|
|
@@ -3625,7 +3681,7 @@ function createProjectPlan(planInput) {
|
|
|
3625
3681
|
base: "./"
|
|
3626
3682
|
};
|
|
3627
3683
|
if (!isLibrary && (isReact || isR3f)) {
|
|
3628
|
-
viteConfig.plugins = ["$raw:react()"];
|
|
3684
|
+
viteConfig.plugins = useReactCompiler ? ["$raw:react()", "$raw:babel({ presets: [reactCompilerPreset()] })"] : ["$raw:react()"];
|
|
3629
3685
|
}
|
|
3630
3686
|
if (!isLibrary && isR3f) {
|
|
3631
3687
|
viteConfig.resolve = { dedupe: ["three"] };
|
|
@@ -3730,7 +3786,9 @@ function createProjectPlan(planInput) {
|
|
|
3730
3786
|
} else if (planInput.formatter.tool === "oxfmt") {
|
|
3731
3787
|
planOxfmt(builder, planInput.formatter);
|
|
3732
3788
|
} else if (planInput.formatter.tool === "biome" && planInput.linter.tool !== "biome") {
|
|
3733
|
-
planBiome(builder, {
|
|
3789
|
+
planBiome(builder, {
|
|
3790
|
+
formatter: planInput.formatter
|
|
3791
|
+
});
|
|
3734
3792
|
}
|
|
3735
3793
|
for (const { code, location } of clonedOptions.injections ?? []) {
|
|
3736
3794
|
builder.inject(location, code);
|
|
@@ -3868,6 +3926,7 @@ exports.getLanguageFromTemplate = getLanguageFromTemplate;
|
|
|
3868
3926
|
exports.getLatestNodeVersion = getLatestNodeVersion;
|
|
3869
3927
|
exports.getLatestNpmCliVersion = getLatestNpmCliVersion;
|
|
3870
3928
|
exports.getLatestNpmMajorVersion = getLatestNpmMajorVersion;
|
|
3929
|
+
exports.getLatestNpmMajorVersionAtOrBelow = getLatestNpmMajorVersionAtOrBelow;
|
|
3871
3930
|
exports.getLatestNpmVersion = getLatestNpmVersion;
|
|
3872
3931
|
exports.getLatestPnpmVersion = getLatestPnpmVersion;
|
|
3873
3932
|
exports.getLatestYarnVersion = getLatestYarnVersion;
|
|
@@ -3898,6 +3957,7 @@ exports.resolveDefaultPackageJsonScripts = resolveDefaultPackageJsonScripts;
|
|
|
3898
3957
|
exports.resolveMonorepoRootPackageVersions = resolveMonorepoRootPackageVersions;
|
|
3899
3958
|
exports.resolveProjectPlanInput = resolveProjectPlanInput;
|
|
3900
3959
|
exports.resolveWorkspacePlanInput = resolveWorkspacePlanInput;
|
|
3960
|
+
exports.shouldEnableReactCompiler = shouldEnableReactCompiler;
|
|
3901
3961
|
exports.toPrettierIgnoreContent = toPrettierIgnoreContent;
|
|
3902
3962
|
exports.unique = unique;
|
|
3903
3963
|
exports.validatePackageName = validatePackageName;
|