zard-cli 1.0.1 → 1.0.2
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/commands/add/component-installer.d.ts +1 -1
- package/commands/add/component-installer.js +1 -1
- package/commands/add/component-selector.js +1 -1
- package/commands/add/dark-mode-setup.js +1 -1
- package/commands/add/index.js +9 -9
- package/commands/add/wizard.d.ts +1 -1
- package/commands/init/config-prompter.d.ts +1 -1
- package/commands/init/config-prompter.js +1 -1
- package/commands/init/dependencies.js +2 -2
- package/commands/init/index.js +4 -4
- package/commands/init/library-peers.js +1 -1
- package/commands/init/steps.js +7 -7
- package/commands/init/tailwind-setup.js +1 -1
- package/commands/init/wizard.d.ts +3 -3
- package/commands/init/wizard.js +2 -2
- package/core/themes/index.d.ts +1 -1
- package/core/themes/index.js +1 -1
- package/package.json +1 -1
- package/ui/text-input.d.ts +1 -1
- package/utils/config.js +2 -2
- package/utils/http-client.js +2 -2
- package/utils/icon-catalog.js +4 -4
- package/utils/package-manager.js +2 -2
- package/utils/registry.d.ts +1 -1
- package/utils/registry.js +5 -5
- package/utils/schema-version.js +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Config } from '../../utils/config';
|
|
1
|
+
import { Config } from '../../utils/config.js';
|
|
2
2
|
export declare function validateTargetPath(targetDir: string, projectRoot: string): void;
|
|
3
3
|
export declare function installComponent(componentName: string, targetDir: string, config: Config & {
|
|
4
4
|
resolvedPaths: any;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isPublishableLibrary } from '
|
|
1
|
+
import { isPublishableLibrary } from '../init/library-peers.js';
|
|
2
2
|
import { CliError, InstallError } from '../../utils/errors.js';
|
|
3
3
|
import { logger } from '../../utils/logger.js';
|
|
4
4
|
import { fetchComponent, relativizeImports } from '../../utils/registry.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isPublishableLibrary } from '
|
|
1
|
+
import { isPublishableLibrary } from '../init/library-peers.js';
|
|
2
2
|
import { logger } from '../../utils/logger.js';
|
|
3
3
|
import { withImport } from '../../utils/source-file.js';
|
|
4
4
|
import { existsSync } from 'fs';
|
package/commands/add/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { installComponent, validateTargetPath } from '
|
|
2
|
-
import { selectComponents } from '
|
|
3
|
-
import { updateProvideZardWithDarkMode } from '
|
|
4
|
-
import { getAllInstallableNames, getTargetDir, resolveDependencies, } from '
|
|
5
|
-
import { setupTypeset, setupUtilities } from '
|
|
6
|
-
import { runAddWizard } from '
|
|
7
|
-
import { syncLibraryPeerDependencies } from '
|
|
8
|
-
import { indexHtmlFor } from '
|
|
9
|
-
import { injectThemeScript } from '
|
|
1
|
+
import { installComponent, validateTargetPath } from './component-installer.js';
|
|
2
|
+
import { selectComponents } from './component-selector.js';
|
|
3
|
+
import { updateProvideZardWithDarkMode } from './dark-mode-setup.js';
|
|
4
|
+
import { getAllInstallableNames, getTargetDir, resolveDependencies, } from './dependency-resolver.js';
|
|
5
|
+
import { setupTypeset, setupUtilities } from './stylesheet-setup.js';
|
|
6
|
+
import { runAddWizard } from './wizard.js';
|
|
7
|
+
import { syncLibraryPeerDependencies } from '../init/library-peers.js';
|
|
8
|
+
import { indexHtmlFor } from '../init/project-kind.js';
|
|
9
|
+
import { injectThemeScript } from '../init/theme-loader.js';
|
|
10
10
|
import { isInteractive, printReport, WizardCancelledError } from '../../ui/index.js';
|
|
11
11
|
import { pinAllForAngular } from '../../utils/angular-compat.js';
|
|
12
12
|
import { getConfig, resolveConfigPaths } from '../../utils/config.js';
|
package/commands/add/wizard.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ComponentMeta } from '
|
|
1
|
+
import { type ComponentMeta } from './dependency-resolver.js';
|
|
2
2
|
import { type LogRecord } from '../../ui/index.js';
|
|
3
3
|
export interface AddWizardOptions {
|
|
4
4
|
/** Components already given on the command line — they skip selection. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ProjectKind } from '
|
|
1
|
+
import { type ProjectKind } from './project-kind.js';
|
|
2
2
|
import { type Config } from '../../utils/config.js';
|
|
3
3
|
import { type ProjectInfo } from '../../utils/get-project-info.js';
|
|
4
4
|
import { z } from 'zod';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { candidateProjects, detectProjectKind, fallbackRootFor, isLibraryKind, libraryBaseUrl, libraryStylesPath, } from '
|
|
1
|
+
import { candidateProjects, detectProjectKind, fallbackRootFor, isLibraryKind, libraryBaseUrl, libraryStylesPath, } from './project-kind.js';
|
|
2
2
|
import { SOURCE_ICON_FAMILY } from '../../core/icons/index.js';
|
|
3
3
|
import { existsSync } from 'node:fs';
|
|
4
4
|
import { readFile } from 'node:fs/promises';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { syncLibraryPeerDependencies } from '
|
|
2
|
-
import { bundlerFor, isLibraryKind } from '
|
|
1
|
+
import { syncLibraryPeerDependencies } from './library-peers.js';
|
|
2
|
+
import { bundlerFor, isLibraryKind } from './project-kind.js';
|
|
3
3
|
import { iconPackagesFor } from '../../core/icons/index.js';
|
|
4
4
|
import { pinAllForAngular } from '../../utils/angular-compat.js';
|
|
5
5
|
import { getProjectInfo } from '../../utils/get-project-info.js';
|
package/commands/init/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { buildConfig, defaultAnswers, inspectCssFile, withPresets, } from '
|
|
2
|
-
import { candidateProjects, detectProjectKind, isLibraryKind, PROJECT_KINDS, } from '
|
|
3
|
-
import { buildInitSteps } from '
|
|
4
|
-
import { runInitWizard } from '
|
|
1
|
+
import { buildConfig, defaultAnswers, inspectCssFile, withPresets, } from './config-prompter.js';
|
|
2
|
+
import { candidateProjects, detectProjectKind, isLibraryKind, PROJECT_KINDS, } from './project-kind.js';
|
|
3
|
+
import { buildInitSteps } from './steps.js';
|
|
4
|
+
import { runInitWizard } from './wizard.js';
|
|
5
5
|
import { isInteractive, printReport, WizardCancelledError } from '../../ui/index.js';
|
|
6
6
|
import { CliError } from '../../utils/errors.js';
|
|
7
7
|
import { getProjectInfo } from '../../utils/get-project-info.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isLibraryKind, projectRootOf } from '
|
|
1
|
+
import { isLibraryKind, projectRootOf } from './project-kind.js';
|
|
2
2
|
import { logger } from '../../utils/logger.js';
|
|
3
3
|
import { existsSync } from 'node:fs';
|
|
4
4
|
import { readFile, writeFile } from 'node:fs/promises';
|
package/commands/init/steps.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { installComponent } from '
|
|
2
|
-
import { installDependencies } from '
|
|
3
|
-
import { bundlerFor, isLibraryKind, projectRootOf, tsconfigFileFor } from '
|
|
4
|
-
import { applyThemeToStyles, createPostCssConfig } from '
|
|
5
|
-
import { updateTsConfig } from '
|
|
6
|
-
import { updateAngularConfig } from '
|
|
7
|
-
import { setupVitePlugin } from '
|
|
1
|
+
import { installComponent } from '../add/component-installer.js';
|
|
2
|
+
import { installDependencies } from './dependencies.js';
|
|
3
|
+
import { bundlerFor, isLibraryKind, projectRootOf, tsconfigFileFor } from './project-kind.js';
|
|
4
|
+
import { applyThemeToStyles, createPostCssConfig } from './tailwind-setup.js';
|
|
5
|
+
import { updateTsConfig } from './tsconfig-updater.js';
|
|
6
|
+
import { updateAngularConfig } from './update-angular-config.js';
|
|
7
|
+
import { setupVitePlugin } from './vite-setup.js';
|
|
8
8
|
import { iconFamily } from '../../core/icons/index.js';
|
|
9
9
|
import { resolveConfigPaths } from '../../utils/config.js';
|
|
10
10
|
import { iconCatalog } from '../../utils/icon-catalog.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isLibraryKind } from '
|
|
1
|
+
import { isLibraryKind } from './project-kind.js';
|
|
2
2
|
import { resolveAliasToPath } from '../../utils/config.js';
|
|
3
3
|
import { getThemeContent } from '../../utils/theme-selector.js';
|
|
4
4
|
import { mkdir, writeFile } from 'node:fs/promises';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type PresetAnswers } from '
|
|
2
|
-
import { type ProjectKind } from '
|
|
3
|
-
import { type InitStep } from '
|
|
1
|
+
import { type PresetAnswers } from './config-prompter.js';
|
|
2
|
+
import { type ProjectKind } from './project-kind.js';
|
|
3
|
+
import { type InitStep } from './steps.js';
|
|
4
4
|
import { type LogRecord } from '../../ui/index.js';
|
|
5
5
|
import { type Config } from '../../utils/config.js';
|
|
6
6
|
import { type ProjectInfo } from '../../utils/get-project-info.js';
|
package/commands/init/wizard.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { buildConfig, defaultAnswers, inspectCssFile, withPresets, } from '
|
|
2
|
-
import { candidateProjects, isLibraryKind, PROJECT_KINDS } from '
|
|
1
|
+
import { buildConfig, defaultAnswers, inspectCssFile, withPresets, } from './config-prompter.js';
|
|
2
|
+
import { candidateProjects, isLibraryKind, PROJECT_KINDS } from './project-kind.js';
|
|
3
3
|
import { answeredLine, brandBanner, choiceList, commandHeader, confirmField, controls, hint, page, progress, question, resultPanel, editInput, runWizard, screen, spacer, startInput, taskHeader, taskList, text, textField, warning, } from '../../ui/index.js';
|
|
4
4
|
import { getAvailableThemes, getThemeDisplayName } from '../../utils/theme-selector.js';
|
|
5
5
|
const OVERWRITE_STEP = {
|
package/core/themes/index.d.ts
CHANGED
package/core/themes/index.js
CHANGED
package/package.json
CHANGED
package/ui/text-input.d.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* retype it. Here the cursor is real: it moves, inserts in the middle, and
|
|
9
9
|
* deletes in both directions.
|
|
10
10
|
*/
|
|
11
|
-
import type { KeyEvent } from '
|
|
11
|
+
import type { KeyEvent } from './engine/index.js';
|
|
12
12
|
export interface TextInput {
|
|
13
13
|
readonly value: string;
|
|
14
14
|
/** Cursor position, in characters — never outside `[0, length]`. */
|
package/utils/config.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SOURCE_ICON_FAMILY } from '../core/icons/index.js';
|
|
2
|
-
import { ConfigError } from '
|
|
2
|
+
import { ConfigError } from './errors.js';
|
|
3
3
|
import { access, readFile } from 'node:fs/promises';
|
|
4
4
|
import * as path from 'node:path';
|
|
5
5
|
import { z } from 'zod';
|
|
@@ -91,7 +91,7 @@ export async function getConfig(cwd) {
|
|
|
91
91
|
const configJson = await readJson(configPath);
|
|
92
92
|
const config = configSchema.parse(configJson);
|
|
93
93
|
if (config.registryUrl) {
|
|
94
|
-
const { validateRegistryUrl } = await import('
|
|
94
|
+
const { validateRegistryUrl } = await import('./registry.js');
|
|
95
95
|
validateRegistryUrl(config.registryUrl);
|
|
96
96
|
}
|
|
97
97
|
return config;
|
package/utils/http-client.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { NetworkError } from '
|
|
2
|
-
import { logger } from '
|
|
1
|
+
import { NetworkError } from './errors.js';
|
|
2
|
+
import { logger } from './logger.js';
|
|
3
3
|
const DEFAULT_TIMEOUT = 30_000;
|
|
4
4
|
const DEFAULT_RETRIES = 3;
|
|
5
5
|
const DEFAULT_BACKOFF_BASE = 1_000;
|
package/utils/icon-catalog.js
CHANGED
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
* anything to decide about it.
|
|
14
14
|
*/
|
|
15
15
|
import { LOCAL_ICON_CATALOG } from '../core/icons/index.js';
|
|
16
|
-
import { CliError, SchemaVersionError } from '
|
|
17
|
-
import { fetchJson } from '
|
|
18
|
-
import { logger } from '
|
|
19
|
-
import { assertSupportedSchema } from '
|
|
16
|
+
import { CliError, SchemaVersionError } from './errors.js';
|
|
17
|
+
import { fetchJson } from './http-client.js';
|
|
18
|
+
import { logger } from './logger.js';
|
|
19
|
+
import { assertSupportedSchema } from './schema-version.js';
|
|
20
20
|
let current = LOCAL_ICON_CATALOG;
|
|
21
21
|
/** The loaded catalog, or the local copy while nobody has loaded one. */
|
|
22
22
|
export function iconCatalog() {
|
package/utils/package-manager.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { detect } from '@antfu/ni';
|
|
2
2
|
import { isCapturing } from '../ui/log-sink.js';
|
|
3
|
-
import { getConfig } from '
|
|
4
|
-
import { logger } from '
|
|
3
|
+
import { getConfig } from './config.js';
|
|
4
|
+
import { logger } from './logger.js';
|
|
5
5
|
import { existsSync } from 'node:fs';
|
|
6
6
|
import { readFile } from 'node:fs/promises';
|
|
7
7
|
import * as path from 'node:path';
|
package/utils/registry.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type IconFamily } from '../core/icons/index.js';
|
|
2
|
-
import type { Config } from '
|
|
2
|
+
import type { Config } from './config.js';
|
|
3
3
|
export declare const DEFAULT_REGISTRY_URL: string;
|
|
4
4
|
/**
|
|
5
5
|
* The icons a component draws, as the registry publishes them.
|
package/utils/registry.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { DEFAULT_REGISTRY_URL as BUILD_REGISTRY_URL } from '../config/registry-config.js';
|
|
2
2
|
import { isIconFamily, retargetIcons, SOURCE_ICON_FAMILY } from '../core/icons/index.js';
|
|
3
|
-
import { ConfigError } from '
|
|
4
|
-
import { fetchJson } from '
|
|
5
|
-
import { iconCatalog } from '
|
|
6
|
-
import { logger } from '
|
|
7
|
-
import { assertSupportedSchema } from '
|
|
3
|
+
import { ConfigError } from './errors.js';
|
|
4
|
+
import { fetchJson } from './http-client.js';
|
|
5
|
+
import { iconCatalog } from './icon-catalog.js';
|
|
6
|
+
import { logger } from './logger.js';
|
|
7
|
+
import { assertSupportedSchema } from './schema-version.js';
|
|
8
8
|
import * as path from 'node:path';
|
|
9
9
|
export const DEFAULT_REGISTRY_URL = process.env['ZARD_REGISTRY_URL'] ||
|
|
10
10
|
(BUILD_REGISTRY_URL !== '__REGISTRY_URL__' ? BUILD_REGISTRY_URL : 'https://zardui.com/r');
|
package/utils/schema-version.js
CHANGED