@yamada-ui/cli 2.0.0-dev-20250816063232 → 2.0.0-dev-20250816072830
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.js +72 -75
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5445,79 +5445,6 @@ async function addWorkspace(cwd$2, workspacePath) {
|
|
|
5445
5445
|
}
|
|
5446
5446
|
}
|
|
5447
5447
|
|
|
5448
|
-
//#endregion
|
|
5449
|
-
//#region src/constant.ts
|
|
5450
|
-
const CONFIG_FILE_NAME = "ui.json";
|
|
5451
|
-
const DEFAULT_PACKAGE_NAME = "@workspaces/ui";
|
|
5452
|
-
const REGISTRY_URL = "https://v2.yamada-ui.com/registry/v2";
|
|
5453
|
-
const DEFAULT_PATH = {
|
|
5454
|
-
components: "./components",
|
|
5455
|
-
hooks: "./hooks",
|
|
5456
|
-
monorepo: "./workspaces/ui",
|
|
5457
|
-
polyrepo: "./ui",
|
|
5458
|
-
providers: "./providers"
|
|
5459
|
-
};
|
|
5460
|
-
const SECTION_NAMES = [
|
|
5461
|
-
"components",
|
|
5462
|
-
"hooks",
|
|
5463
|
-
"providers"
|
|
5464
|
-
];
|
|
5465
|
-
const DEFAULT_SECTION_CONFIG = {
|
|
5466
|
-
components: { overwrite: true },
|
|
5467
|
-
hooks: { overwrite: true },
|
|
5468
|
-
providers: { overwrite: true }
|
|
5469
|
-
};
|
|
5470
|
-
const REQUIRED_DEPENDENCIES = [
|
|
5471
|
-
"react@^19",
|
|
5472
|
-
"react-dom@^19",
|
|
5473
|
-
"@yamada-ui/react@^2"
|
|
5474
|
-
];
|
|
5475
|
-
const REQUIRED_DEV_DEPENDENCIES = ["@types/react@^19", "@types/react-dom@^19"];
|
|
5476
|
-
const DEFAULT_PACKAGE_JSON = {
|
|
5477
|
-
version: "1.0.0",
|
|
5478
|
-
type: "module",
|
|
5479
|
-
private: true,
|
|
5480
|
-
scripts: {},
|
|
5481
|
-
exports: {
|
|
5482
|
-
".": "./src/index.ts",
|
|
5483
|
-
"./components/*": "./src/components/*/index.ts",
|
|
5484
|
-
"./hooks/*": "./src/hooks/*/index.ts",
|
|
5485
|
-
"./providers/*": "./src/providers/*/index.ts"
|
|
5486
|
-
},
|
|
5487
|
-
dependencies: Object.fromEntries(REQUIRED_DEPENDENCIES.map((dependency) => splitVersion(dependency))),
|
|
5488
|
-
devDependencies: Object.fromEntries(REQUIRED_DEV_DEPENDENCIES.map((dependency) => splitVersion(dependency)))
|
|
5489
|
-
};
|
|
5490
|
-
const TSCONFIG_JSON = {
|
|
5491
|
-
compilerOptions: {
|
|
5492
|
-
target: "ESNext",
|
|
5493
|
-
module: "ESNext",
|
|
5494
|
-
lib: [
|
|
5495
|
-
"DOM",
|
|
5496
|
-
"DOM.Iterable",
|
|
5497
|
-
"ESNext"
|
|
5498
|
-
],
|
|
5499
|
-
moduleResolution: "Bundler",
|
|
5500
|
-
moduleDetection: "force",
|
|
5501
|
-
jsx: "preserve",
|
|
5502
|
-
strict: true,
|
|
5503
|
-
declaration: true,
|
|
5504
|
-
declarationMap: true,
|
|
5505
|
-
esModuleInterop: true,
|
|
5506
|
-
isolatedModules: true,
|
|
5507
|
-
resolveJsonModule: true,
|
|
5508
|
-
incremental: false,
|
|
5509
|
-
noEmit: true,
|
|
5510
|
-
skipLibCheck: true,
|
|
5511
|
-
allowJs: true,
|
|
5512
|
-
allowSyntheticDefaultImports: true,
|
|
5513
|
-
noUncheckedSideEffectImports: true,
|
|
5514
|
-
noFallthroughCasesInSwitch: true,
|
|
5515
|
-
noUncheckedIndexedAccess: true
|
|
5516
|
-
},
|
|
5517
|
-
include: ["src/**/*.ts", "src/**/*.tsx"],
|
|
5518
|
-
exclude: ["node_modules"]
|
|
5519
|
-
};
|
|
5520
|
-
|
|
5521
5448
|
//#endregion
|
|
5522
5449
|
//#region src/utils/config.ts
|
|
5523
5450
|
async function getConfig(cwd$2, configPath) {
|
|
@@ -5792,6 +5719,75 @@ function replaceIndex(generatedNames, content, { getSection }) {
|
|
|
5792
5719
|
return content;
|
|
5793
5720
|
}
|
|
5794
5721
|
|
|
5722
|
+
//#endregion
|
|
5723
|
+
//#region src/constant.ts
|
|
5724
|
+
const CONFIG_FILE_NAME = "ui.json";
|
|
5725
|
+
const DEFAULT_PACKAGE_NAME = "@workspaces/ui";
|
|
5726
|
+
const REGISTRY_URL = "https://v2.yamada-ui.com/registry/v2";
|
|
5727
|
+
const DEFAULT_PATH = {
|
|
5728
|
+
components: "./components",
|
|
5729
|
+
hooks: "./hooks",
|
|
5730
|
+
monorepo: "./workspaces/ui",
|
|
5731
|
+
polyrepo: "./ui",
|
|
5732
|
+
providers: "./providers"
|
|
5733
|
+
};
|
|
5734
|
+
const SECTION_NAMES = [
|
|
5735
|
+
"components",
|
|
5736
|
+
"hooks",
|
|
5737
|
+
"providers"
|
|
5738
|
+
];
|
|
5739
|
+
const DEFAULT_SECTION_CONFIG = {
|
|
5740
|
+
components: { overwrite: true },
|
|
5741
|
+
hooks: { overwrite: true },
|
|
5742
|
+
providers: { overwrite: true }
|
|
5743
|
+
};
|
|
5744
|
+
const REQUIRED_DEPENDENCIES = ["react@^19", "react-dom@^19"];
|
|
5745
|
+
const REQUIRED_DEV_DEPENDENCIES = ["@types/react@^19", "@types/react-dom@^19"];
|
|
5746
|
+
const DEFAULT_PACKAGE_JSON = {
|
|
5747
|
+
version: "1.0.0",
|
|
5748
|
+
type: "module",
|
|
5749
|
+
private: true,
|
|
5750
|
+
scripts: {},
|
|
5751
|
+
exports: {
|
|
5752
|
+
".": "./src/index.ts",
|
|
5753
|
+
"./components/*": "./src/components/*/index.ts",
|
|
5754
|
+
"./hooks/*": "./src/hooks/*/index.ts",
|
|
5755
|
+
"./providers/*": "./src/providers/*/index.ts"
|
|
5756
|
+
},
|
|
5757
|
+
dependencies: Object.fromEntries(REQUIRED_DEPENDENCIES.map((dependency) => splitVersion(dependency))),
|
|
5758
|
+
devDependencies: Object.fromEntries(REQUIRED_DEV_DEPENDENCIES.map((dependency) => splitVersion(dependency)))
|
|
5759
|
+
};
|
|
5760
|
+
const TSCONFIG_JSON = {
|
|
5761
|
+
compilerOptions: {
|
|
5762
|
+
target: "ESNext",
|
|
5763
|
+
module: "ESNext",
|
|
5764
|
+
lib: [
|
|
5765
|
+
"DOM",
|
|
5766
|
+
"DOM.Iterable",
|
|
5767
|
+
"ESNext"
|
|
5768
|
+
],
|
|
5769
|
+
moduleResolution: "Bundler",
|
|
5770
|
+
moduleDetection: "force",
|
|
5771
|
+
jsx: "preserve",
|
|
5772
|
+
strict: true,
|
|
5773
|
+
declaration: true,
|
|
5774
|
+
declarationMap: true,
|
|
5775
|
+
esModuleInterop: true,
|
|
5776
|
+
isolatedModules: true,
|
|
5777
|
+
resolveJsonModule: true,
|
|
5778
|
+
incremental: false,
|
|
5779
|
+
noEmit: true,
|
|
5780
|
+
skipLibCheck: true,
|
|
5781
|
+
allowJs: true,
|
|
5782
|
+
allowSyntheticDefaultImports: true,
|
|
5783
|
+
noUncheckedSideEffectImports: true,
|
|
5784
|
+
noFallthroughCasesInSwitch: true,
|
|
5785
|
+
noUncheckedIndexedAccess: true
|
|
5786
|
+
},
|
|
5787
|
+
include: ["src/**/*.ts", "src/**/*.tsx"],
|
|
5788
|
+
exclude: ["node_modules"]
|
|
5789
|
+
};
|
|
5790
|
+
|
|
5795
5791
|
//#endregion
|
|
5796
5792
|
//#region src/commands/add/index.ts
|
|
5797
5793
|
const add = new Command("add").description("Add a component to your project").argument("[components...]", "Components to add").option("--cwd <path>", "Current working directory", process.cwd()).option("-c, --config <path>", "Path to the config file", CONFIG_FILE_NAME).option("-o, --overwrite", "overwrite existing files.", false).option("-a, --all", "Add all available components").option("-i, --install", "Install dependencies", false).action(async function(componentNames, { all = !componentNames.length, config: configPath, cwd: cwd$2, install, overwrite }) {
|
|
@@ -6123,7 +6119,7 @@ const init = new Command("init").description("Initialize your project and instal
|
|
|
6123
6119
|
const tasks = new Listr([{
|
|
6124
6120
|
task: async (_, task) => {
|
|
6125
6121
|
const packageJson$2 = await getPackageJson(cwd$2);
|
|
6126
|
-
notInstalledDependencies.push(...getNotInstalledDependencies(packageJson$2, REQUIRED_DEPENDENCIES));
|
|
6122
|
+
notInstalledDependencies.push(...getNotInstalledDependencies(packageJson$2, [...REQUIRED_DEPENDENCIES, "@yamada-ui/react@dev"]));
|
|
6127
6123
|
notInstalledDevDependencies.push(...getNotInstalledDependencies(packageJson$2, REQUIRED_DEV_DEPENDENCIES));
|
|
6128
6124
|
task.title = `Checked ${c.cyan("package.json")} dependencies`;
|
|
6129
6125
|
},
|
|
@@ -6160,9 +6156,10 @@ const init = new Command("init").description("Initialize your project and instal
|
|
|
6160
6156
|
cwd: cwd$2,
|
|
6161
6157
|
dev: true
|
|
6162
6158
|
});
|
|
6159
|
+
if (monorepo) installDependencies(["@yamada-ui/react@dev"], { cwd: outdirPath });
|
|
6163
6160
|
spinner.succeed("Installed dependencies");
|
|
6164
6161
|
}
|
|
6165
|
-
if (
|
|
6162
|
+
if (monorepo) {
|
|
6166
6163
|
const packageManager = getPackageManager();
|
|
6167
6164
|
const command = packageAddCommand(packageManager);
|
|
6168
6165
|
console.log(boxen(`Run ${c.cyan(`${command} "${packageName}@workspace:*"`)} in your application.`, {
|