release: WRNexusJS 0.4.0
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
|
||||
import { copyFileSync, existsSync, mkdirSync } from "node:fs";
|
||||
import { join, resolve } from "node:path";
|
||||
import { uiComponentsDir, uiComponentNames } from "@wrnexus/ui";
|
||||
import { uiComponentNames, uiComponentPath } from "@wrnexus/ui";
|
||||
|
||||
export function runEject(appRoot: string, names: string[]): void {
|
||||
const root = resolve(appRoot);
|
||||
@@ -20,12 +20,17 @@ export function runEject(appRoot: string, names: string[]): void {
|
||||
}
|
||||
|
||||
mkdirSync(dest, { recursive: true });
|
||||
for (const name of names) {
|
||||
if (!available.includes(name)) {
|
||||
console.error(`✗ Unknown component "${name}". Available: ${available.join(", ")}`);
|
||||
for (const requestedName of names) {
|
||||
const name = available.find(
|
||||
(componentName) => componentName.toLowerCase() === requestedName.toLowerCase(),
|
||||
);
|
||||
|
||||
if (!name) {
|
||||
console.error(`✗ Unknown component "${requestedName}". Available: ${available.join(", ")}`);
|
||||
continue;
|
||||
}
|
||||
const src = join(uiComponentsDir(), `${name}.wrn`);
|
||||
|
||||
const src = uiComponentPath(name);
|
||||
const out = join(dest, `${name}.wrn`);
|
||||
if (existsSync(out)) {
|
||||
console.error(`✗ ${name}: app/components/${name}.wrn already exists — skipped`);
|
||||
|
||||
Reference in New Issue
Block a user