@reliverse/dler 2.1.6 → 2.1.8

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.
Files changed (35) hide show
  1. package/package.json +12 -12
  2. package/dist/cmds/init/cmd.d.ts +0 -2
  3. package/dist/cmds/init/cmd.js +0 -50
  4. package/dist/cmds/init/impl/config.d.ts +0 -45
  5. package/dist/cmds/init/impl/config.js +0 -99
  6. package/dist/cmds/init/impl/generators.d.ts +0 -6
  7. package/dist/cmds/init/impl/generators.js +0 -178
  8. package/dist/cmds/init/impl/prompts.d.ts +0 -2
  9. package/dist/cmds/init/impl/prompts.js +0 -98
  10. package/dist/cmds/init/impl/types.d.ts +0 -22
  11. package/dist/cmds/init/impl/types.js +0 -0
  12. package/dist/cmds/init/impl/utils.d.ts +0 -4
  13. package/dist/cmds/init/impl/utils.js +0 -11
  14. package/dist/cmds/init/impl/validators.d.ts +0 -4
  15. package/dist/cmds/init/impl/validators.js +0 -42
  16. package/dist/cmds/integrate/cmd.d.ts +0 -2
  17. package/dist/cmds/integrate/cmd.js +0 -66
  18. package/dist/cmds/integrate/impl.d.ts +0 -7
  19. package/dist/cmds/integrate/impl.js +0 -127
  20. package/dist/cmds/integrate/integrations/base.d.ts +0 -13
  21. package/dist/cmds/integrate/integrations/base.js +0 -41
  22. package/dist/cmds/integrate/integrations/nextjs.d.ts +0 -16
  23. package/dist/cmds/integrate/integrations/nextjs.js +0 -166
  24. package/dist/cmds/integrate/integrations/registry.d.ts +0 -7
  25. package/dist/cmds/integrate/integrations/registry.js +0 -31
  26. package/dist/cmds/integrate/integrations/ultracite.d.ts +0 -11
  27. package/dist/cmds/integrate/integrations/ultracite.js +0 -40
  28. package/dist/cmds/integrate/types.d.ts +0 -39
  29. package/dist/cmds/integrate/types.js +0 -0
  30. package/dist/cmds/integrate/utils/biome.d.ts +0 -4
  31. package/dist/cmds/integrate/utils/biome.js +0 -140
  32. package/dist/cmds/integrate/utils/context.d.ts +0 -3
  33. package/dist/cmds/integrate/utils/context.js +0 -116
  34. package/dist/cmds/integrate/utils/temp.d.ts +0 -3
  35. package/dist/cmds/integrate/utils/temp.js +0 -36
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@reliverse/dler",
3
3
  "description": "@reliverse/dler is a framework which helps TypeScript and JavaScript developers create their libraries and CLI tools. It provides ready-to-use primitives, so you don't have to write them from scratch.",
4
4
  "author": "reliverse",
5
- "version": "2.1.6",
5
+ "version": "2.1.8",
6
6
  "private": false,
7
7
  "type": "module",
8
8
  "bin": {
@@ -13,17 +13,17 @@
13
13
  "semver": "^7.7.3",
14
14
  "lookpath": "^1.2.3",
15
15
  "clipboardy": "^5.0.0",
16
- "@reliverse/dler-escaper": "2.1.6",
17
- "@reliverse/dler-publish": "2.1.6",
18
- "@reliverse/dler-bump": "2.1.6",
19
- "@reliverse/dler-build": "2.1.6",
20
- "@reliverse/dler-logger": "2.1.6",
21
- "@reliverse/dler-matcher": "2.1.6",
22
- "@reliverse/dler-launcher": "2.1.6",
23
- "@reliverse/dler-prompt": "2.1.6",
24
- "@reliverse/dler-helpers": "2.1.6",
25
- "@reliverse/dler-pkg-tsc": "2.1.6",
26
- "@reliverse/dler-mapper": "2.1.6"
16
+ "@reliverse/dler-escaper": "2.1.8",
17
+ "@reliverse/dler-publish": "2.1.8",
18
+ "@reliverse/dler-bump": "2.1.8",
19
+ "@reliverse/dler-build": "2.1.8",
20
+ "@reliverse/dler-logger": "2.1.8",
21
+ "@reliverse/dler-matcher": "2.1.8",
22
+ "@reliverse/dler-launcher": "2.1.8",
23
+ "@reliverse/dler-prompt": "2.1.8",
24
+ "@reliverse/dler-helpers": "2.1.8",
25
+ "@reliverse/dler-pkg-tsc": "2.1.8",
26
+ "@reliverse/dler-mapper": "2.1.8"
27
27
  },
28
28
  "keywords": [
29
29
  "dler",
@@ -1,2 +0,0 @@
1
- declare const _default: any;
2
- export default _default;
@@ -1,50 +0,0 @@
1
- import { defineArgs, defineCommand } from "@reliverse/dler-launcher";
2
- import { logger } from "@reliverse/dler-logger";
3
- import { $ } from "bun";
4
- import {
5
- generateAllPackages,
6
- generateRootFiles,
7
- generateRootPackageJson
8
- } from "./impl/generators.js";
9
- import { promptMonorepoConfig } from "./impl/prompts.js";
10
- function getCurrentWorkingDirectory() {
11
- return process.cwd();
12
- }
13
- export default defineCommand({
14
- meta: {
15
- name: "init",
16
- description: "Initialize a new monorepo"
17
- },
18
- args: defineArgs({
19
- name: {
20
- type: "string",
21
- description: "Current working directory",
22
- default: getCurrentWorkingDirectory()
23
- }
24
- }),
25
- run: async () => {
26
- try {
27
- const config = await promptMonorepoConfig();
28
- logger.info("\n\u{1F528} Generating monorepo structure...\n");
29
- await generateRootPackageJson(config);
30
- await generateRootFiles(config);
31
- await generateAllPackages(config);
32
- logger.info("\n\u{1F4E6} Installing dependencies...\n");
33
- await $`bun install`.cwd(config.rootPath);
34
- logger.success("\n\u2705 Monorepo created successfully!");
35
- logger.success(`
36
- \u{1F4C1} Location: ${config.rootPath}`);
37
- logger.success("\nTo get started:");
38
- logger.log(` cd ${config.rootPath}`);
39
- logger.log(" bun --filter '*' dev\n");
40
- } catch (error) {
41
- logger.error("\n\u274C Error creating monorepo:");
42
- if (error instanceof Error) {
43
- logger.error(error.message);
44
- } else {
45
- logger.error(String(error));
46
- }
47
- process.exit(1);
48
- }
49
- }
50
- });
@@ -1,45 +0,0 @@
1
- import type { CatalogDependency } from "./types.js";
2
- export declare const DEFAULT_VERSION = "0.1.0";
3
- export declare const DEFAULT_LICENSE = "MIT";
4
- export declare const WORKSPACES: {
5
- readonly PACKAGES: "packages";
6
- readonly TSCONFIG: "packages/tsconfig";
7
- };
8
- export declare const DEFAULT_CATALOG: readonly CatalogDependency[];
9
- export declare const TSCONFIG_PRESETS: {
10
- readonly base: {
11
- readonly $schema: "https://json.schemastore.org/tsconfig";
12
- readonly compilerOptions: {
13
- readonly lib: readonly ["ESNext"];
14
- readonly target: "ESNext";
15
- readonly module: "ESNext";
16
- readonly moduleDetection: "force";
17
- readonly allowJs: true;
18
- readonly moduleResolution: "Bundler";
19
- readonly allowImportingTsExtensions: true;
20
- readonly verbatimModuleSyntax: true;
21
- readonly noEmit: true;
22
- readonly strict: true;
23
- readonly skipLibCheck: true;
24
- readonly noFallthroughCasesInSwitch: true;
25
- readonly noUnusedLocals: false;
26
- readonly noUnusedParameters: false;
27
- readonly noPropertyAccessFromIndexSignature: false;
28
- readonly esModuleInterop: true;
29
- readonly isolatedModules: true;
30
- };
31
- };
32
- readonly strict: {
33
- readonly $schema: "https://json.schemastore.org/tsconfig";
34
- readonly extends: "./base.json";
35
- readonly compilerOptions: {
36
- readonly noUncheckedIndexedAccess: true;
37
- readonly noUnusedLocals: true;
38
- readonly noUnusedParameters: true;
39
- };
40
- };
41
- };
42
- export declare const ROOT_FILES: {
43
- readonly GITIGNORE: "# Dependencies\nnode_modules/\n\n# Build outputs\ndist/\nout/\n*.tsbuildinfo\n\n# Environment\n.env\n.env*.local\n\n# IDE\n.vscode/\n.idea/\n*.swp\n*.swo\n*~\n\n# OS\n.DS_Store\nThumbs.db\n\n# Logs\n*.log\n";
44
- readonly README: (name: string) => string;
45
- };
@@ -1,99 +0,0 @@
1
- export const DEFAULT_VERSION = "0.1.0";
2
- export const DEFAULT_LICENSE = "MIT";
3
- export const WORKSPACES = {
4
- PACKAGES: "packages",
5
- TSCONFIG: "packages/tsconfig"
6
- };
7
- export const DEFAULT_CATALOG = [
8
- { name: "typescript", version: "^5.7.2" },
9
- { name: "@types/bun", version: "^1.3.0" }
10
- ];
11
- export const TSCONFIG_PRESETS = {
12
- base: {
13
- $schema: "https://json.schemastore.org/tsconfig",
14
- compilerOptions: {
15
- lib: ["ESNext"],
16
- target: "ESNext",
17
- module: "ESNext",
18
- moduleDetection: "force",
19
- allowJs: true,
20
- moduleResolution: "Bundler",
21
- allowImportingTsExtensions: true,
22
- verbatimModuleSyntax: true,
23
- noEmit: true,
24
- strict: true,
25
- skipLibCheck: true,
26
- noFallthroughCasesInSwitch: true,
27
- noUnusedLocals: false,
28
- noUnusedParameters: false,
29
- noPropertyAccessFromIndexSignature: false,
30
- esModuleInterop: true,
31
- isolatedModules: true
32
- }
33
- },
34
- strict: {
35
- $schema: "https://json.schemastore.org/tsconfig",
36
- extends: "./base.json",
37
- compilerOptions: {
38
- noUncheckedIndexedAccess: true,
39
- noUnusedLocals: true,
40
- noUnusedParameters: true
41
- }
42
- }
43
- };
44
- export const ROOT_FILES = {
45
- GITIGNORE: `# Dependencies
46
- node_modules/
47
-
48
- # Build outputs
49
- dist/
50
- out/
51
- *.tsbuildinfo
52
-
53
- # Environment
54
- .env
55
- .env*.local
56
-
57
- # IDE
58
- .vscode/
59
- .idea/
60
- *.swp
61
- *.swo
62
- *~
63
-
64
- # OS
65
- .DS_Store
66
- Thumbs.db
67
-
68
- # Logs
69
- *.log
70
- `,
71
- README: (name) => `# ${name}
72
-
73
- A Bun monorepo created with the monorepo bootstrapper.
74
-
75
- ## Getting Started
76
-
77
- \`\`\`bash
78
- bun install
79
- \`\`\`
80
-
81
- ## Workspaces
82
-
83
- This monorepo was generated by dler init. It uses bun workspaces to manage multiple packages.
84
-
85
- ## Scripts
86
-
87
- Run scripts across all workspaces:
88
-
89
- \`\`\`bash
90
- bun --filter '*' <script>
91
- \`\`\`
92
-
93
- Run scripts for specific packages:
94
-
95
- \`\`\`bash
96
- bun --filter <package-name> <script>
97
- \`\`\`
98
- `
99
- };
@@ -1,6 +0,0 @@
1
- import type { MonorepoConfig, PackageInfo } from "./types.js";
2
- export declare const generateRootPackageJson: (config: MonorepoConfig) => Promise<void>;
3
- export declare const generateRootFiles: (config: MonorepoConfig) => Promise<void>;
4
- export declare const generateTsconfigPackage: (config: MonorepoConfig) => Promise<void>;
5
- export declare const generatePackage: (config: MonorepoConfig, pkg: PackageInfo) => Promise<void>;
6
- export declare const generateAllPackages: (config: MonorepoConfig) => Promise<void>;
@@ -1,178 +0,0 @@
1
- import { writeJsonFile, writeTextFile } from "@reliverse/dler-helpers";
2
- import { logger } from "@reliverse/dler-logger";
3
- import {
4
- DEFAULT_CATALOG,
5
- ROOT_FILES,
6
- TSCONFIG_PRESETS,
7
- WORKSPACES
8
- } from "./config.js";
9
- import {
10
- createFullPath,
11
- ensureDir,
12
- fileExists,
13
- getWorkspaceScope
14
- } from "./utils.js";
15
- export const generateRootPackageJson = async (config) => {
16
- const packageJsonPath = createFullPath(config.rootPath, "package.json");
17
- const alreadyExists = await fileExists(packageJsonPath);
18
- if (alreadyExists) {
19
- logger.info("\u{1F4DD} Updating existing root package.json...");
20
- const existingContent = await Bun.file(packageJsonPath).json();
21
- const workspaces = /* @__PURE__ */ new Set([
22
- ...existingContent.workspaces?.packages || [],
23
- ...getWorkspacePatterns(config)
24
- ]);
25
- const catalog = {
26
- ...existingContent.workspaces?.catalog || {},
27
- ...Object.fromEntries(
28
- DEFAULT_CATALOG.map((dep) => [dep.name, dep.version])
29
- )
30
- };
31
- const updatedPackageJson = {
32
- ...existingContent,
33
- // Persist core metadata from current config (overwrite with user's latest answers)
34
- name: config.name,
35
- version: config.version,
36
- description: config.description,
37
- ...config.author && { author: config.author },
38
- ...config.license && { license: config.license },
39
- workspaces: {
40
- ...existingContent.workspaces,
41
- packages: Array.from(workspaces).sort(),
42
- catalog
43
- }
44
- };
45
- await writeJsonFile(packageJsonPath, updatedPackageJson);
46
- } else {
47
- logger.info("\u{1F4DD} Creating root package.json...");
48
- const packageJson = {
49
- name: config.name,
50
- version: config.version,
51
- description: config.description,
52
- private: true,
53
- workspaces: {
54
- packages: getWorkspacePatterns(config),
55
- catalog: Object.fromEntries(
56
- DEFAULT_CATALOG.map((dep) => [dep.name, dep.version])
57
- )
58
- },
59
- scripts: {
60
- check: "bun typecheck && bun lint && bun format",
61
- typecheck: "tsc --noEmit",
62
- lint: "biome check .",
63
- "lint:fix": "biome check --write .",
64
- format: "biome format --write ."
65
- },
66
- devDependencies: {
67
- "@biomejs/biome": "catalog:",
68
- typescript: "catalog:",
69
- "@types/bun": "catalog:"
70
- },
71
- ...config.author && { author: config.author },
72
- ...config.license && { license: config.license }
73
- };
74
- await writeJsonFile(packageJsonPath, packageJson);
75
- }
76
- };
77
- const getWorkspacePatterns = (config) => {
78
- const patterns = /* @__PURE__ */ new Set();
79
- for (const pkg of config.packages) {
80
- patterns.add(`${pkg.workspace}/*`);
81
- }
82
- return Array.from(patterns).sort();
83
- };
84
- export const generateRootFiles = async (config) => {
85
- logger.info("\u{1F4C4} Creating root files...");
86
- const gitignorePath = createFullPath(config.rootPath, ".gitignore");
87
- if (!await fileExists(gitignorePath)) {
88
- await writeTextFile(gitignorePath, ROOT_FILES.GITIGNORE);
89
- }
90
- const readmePath = createFullPath(config.rootPath, "README.md");
91
- if (!await fileExists(readmePath)) {
92
- await writeTextFile(readmePath, ROOT_FILES.README(config.name));
93
- }
94
- };
95
- export const generateTsconfigPackage = async (config) => {
96
- logger.info("\u{1F4E6} Creating tsconfig package...");
97
- const tsconfigPath = createFullPath(config.rootPath, WORKSPACES.TSCONFIG);
98
- await ensureDir(tsconfigPath);
99
- const packageJsonPath = createFullPath(tsconfigPath, "package.json");
100
- if (!await fileExists(packageJsonPath)) {
101
- const scope = getWorkspaceScope(WORKSPACES.PACKAGES);
102
- const packageJson = {
103
- name: `${scope}tsconfig`,
104
- version: "0.0.0",
105
- private: true,
106
- description: "Shared TypeScript configuration"
107
- };
108
- await writeJsonFile(packageJsonPath, packageJson);
109
- }
110
- for (const [name, content] of Object.entries(TSCONFIG_PRESETS)) {
111
- const presetPath = createFullPath(tsconfigPath, `${name}.json`);
112
- if (!await fileExists(presetPath)) {
113
- await writeJsonFile(presetPath, content);
114
- }
115
- }
116
- };
117
- export const generatePackage = async (config, pkg) => {
118
- const packagePath = createFullPath(config.rootPath, pkg.workspace, pkg.name);
119
- logger.info(`\u{1F4E6} Creating package ${pkg.scope}${pkg.name}...`);
120
- await ensureDir(packagePath);
121
- const packageJsonPath = createFullPath(packagePath, "package.json");
122
- if (!await fileExists(packageJsonPath)) {
123
- const tsconfigScope = getWorkspaceScope(WORKSPACES.PACKAGES);
124
- const packageJson = {
125
- name: `${pkg.scope}${pkg.name}`,
126
- version: "0.1.0",
127
- private: true,
128
- type: "module",
129
- exports: {
130
- ".": {
131
- types: "./src/mod.ts",
132
- default: "./src/mod.ts"
133
- }
134
- },
135
- scripts: {
136
- dev: "bun src/mod.ts"
137
- },
138
- devDependencies: {
139
- [`${tsconfigScope}tsconfig`]: "workspace:*",
140
- typescript: "catalog:",
141
- "@types/bun": "catalog:"
142
- }
143
- };
144
- await writeJsonFile(packageJsonPath, packageJson);
145
- }
146
- const tsconfigPath = createFullPath(packagePath, "tsconfig.json");
147
- if (!await fileExists(tsconfigPath)) {
148
- const tsconfigScope = getWorkspaceScope(WORKSPACES.PACKAGES);
149
- const tsconfig = {
150
- extends: `${tsconfigScope}tsconfig/strict.json`,
151
- compilerOptions: {
152
- rootDir: ".",
153
- outDir: "./dist"
154
- },
155
- include: ["src/**/*"],
156
- exclude: ["node_modules", "dist"]
157
- };
158
- await writeJsonFile(tsconfigPath, tsconfig);
159
- }
160
- const srcPath = createFullPath(packagePath, "src");
161
- await ensureDir(srcPath);
162
- const indexPath = createFullPath(srcPath, "index.ts");
163
- if (!await fileExists(indexPath)) {
164
- const indexContent = `export const hello = (): string => {
165
- return "Hello from ${pkg.scope}${pkg.name}!";
166
- };
167
-
168
- console.log(hello());
169
- `;
170
- await writeTextFile(indexPath, indexContent);
171
- }
172
- };
173
- export const generateAllPackages = async (config) => {
174
- await generateTsconfigPackage(config);
175
- for (const pkg of config.packages) {
176
- await generatePackage(config, pkg);
177
- }
178
- };
@@ -1,2 +0,0 @@
1
- import type { MonorepoConfig } from "./types.js";
2
- export declare const promptMonorepoConfig: () => Promise<MonorepoConfig>;
@@ -1,98 +0,0 @@
1
- import { logger } from "@reliverse/dler-logger";
2
- import { askQuestion } from "@reliverse/dler-prompt";
3
- import { DEFAULT_LICENSE, DEFAULT_VERSION, WORKSPACES } from "./config.js";
4
- import { createFullPath, fileExists, getWorkspaceScope } from "./utils.js";
5
- import {
6
- validateMonorepoName,
7
- validatePackageName,
8
- validateVersion
9
- } from "./validators.js";
10
- export const promptMonorepoConfig = async () => {
11
- logger.info("\u{1F680} Bun Monorepo Bootstrapper\n");
12
- const rootPath = process.cwd();
13
- const rootPackageJsonPath = createFullPath(rootPath, "package.json");
14
- const hasRootPackageJson = await fileExists(rootPackageJsonPath);
15
- const existingRoot = hasRootPackageJson ? await Bun.file(rootPackageJsonPath).json().catch(() => null) : null;
16
- let name = "";
17
- let isValidName = false;
18
- if (existingRoot && typeof existingRoot.name === "string") {
19
- name = existingRoot.name;
20
- isValidName = true;
21
- } else {
22
- while (!isValidName) {
23
- name = await askQuestion("Monorepo name", "my-monorepo");
24
- const validation = validateMonorepoName(name);
25
- if (!validation.valid) {
26
- logger.error(`\u274C ${validation.error}`);
27
- continue;
28
- }
29
- isValidName = true;
30
- }
31
- }
32
- const description = existingRoot && typeof existingRoot.description === "string" ? existingRoot.description : await askQuestion("Description", "A Bun monorepo project");
33
- let version = "";
34
- let isValidVersion = false;
35
- if (existingRoot && typeof existingRoot.version === "string") {
36
- version = existingRoot.version;
37
- isValidVersion = true;
38
- } else {
39
- while (!isValidVersion) {
40
- version = await askQuestion("Version", DEFAULT_VERSION);
41
- const validation = validateVersion(version);
42
- if (!validation.valid) {
43
- logger.error(`\u274C ${validation.error}`);
44
- continue;
45
- }
46
- isValidVersion = true;
47
- }
48
- }
49
- const author = existingRoot && typeof existingRoot.author === "string" ? existingRoot.author : await askQuestion("Author", "");
50
- const license = existingRoot && typeof existingRoot.license === "string" ? existingRoot.license : await askQuestion("License", DEFAULT_LICENSE);
51
- const packages = await promptPackages();
52
- return {
53
- name,
54
- description,
55
- version,
56
- author,
57
- license,
58
- packages,
59
- rootPath
60
- };
61
- };
62
- const promptPackages = async () => {
63
- const packages = [];
64
- logger.info("\n\u{1F4E6} Package Configuration");
65
- logger.info(
66
- "Enter package names (one per prompt). Press Enter with empty input to finish.\n"
67
- );
68
- let continueAdding = true;
69
- let packageIndex = 1;
70
- while (continueAdding) {
71
- const packageName = await askQuestion(
72
- `Package ${packageIndex} name (or press Enter to finish)`
73
- );
74
- if (!packageName) {
75
- continueAdding = false;
76
- continue;
77
- }
78
- const validation = validatePackageName(packageName);
79
- if (!validation.valid) {
80
- logger.error(`\u274C ${validation.error}`);
81
- continue;
82
- }
83
- const workspace = await askQuestion(
84
- "Workspace directory",
85
- WORKSPACES.PACKAGES
86
- );
87
- const scope = getWorkspaceScope(workspace);
88
- packages.push({
89
- name: packageName,
90
- workspace,
91
- scope
92
- });
93
- logger.success(`\u2705 Added ${scope}${packageName}
94
- `);
95
- packageIndex++;
96
- }
97
- return packages;
98
- };
@@ -1,22 +0,0 @@
1
- export type PackageInfo = {
2
- name: string;
3
- workspace: string;
4
- scope: string;
5
- };
6
- export type MonorepoConfig = {
7
- name: string;
8
- description: string;
9
- version: string;
10
- author: string;
11
- license: string;
12
- packages: PackageInfo[];
13
- rootPath: string;
14
- };
15
- export type CatalogDependency = {
16
- name: string;
17
- version: string;
18
- };
19
- export type ValidationResult = {
20
- valid: boolean;
21
- error?: string;
22
- };
File without changes
@@ -1,4 +0,0 @@
1
- export declare const getWorkspaceScope: (workspace: string) => string;
2
- export declare const ensureDir: (path: string) => Promise<void>;
3
- export declare const fileExists: (path: string) => Promise<boolean>;
4
- export declare const createFullPath: (...paths: string[]) => string;
@@ -1,11 +0,0 @@
1
- import { exists, mkdir } from "node:fs/promises";
2
- import { join } from "node:path";
3
- export const getWorkspaceScope = (workspace) => `@${workspace.charAt(0)}/`;
4
- export const ensureDir = async (path) => {
5
- const dirExists = await exists(path);
6
- if (!dirExists) {
7
- await mkdir(path, { recursive: true });
8
- }
9
- };
10
- export const fileExists = async (path) => exists(path);
11
- export const createFullPath = (...paths) => join(...paths);
@@ -1,4 +0,0 @@
1
- import type { ValidationResult } from "./types.js";
2
- export declare const validatePackageName: (name: string) => ValidationResult;
3
- export declare const validateMonorepoName: (name: string) => ValidationResult;
4
- export declare const validateVersion: (version: string) => ValidationResult;
@@ -1,42 +0,0 @@
1
- export const validatePackageName = (name) => {
2
- if (!name || name.trim().length === 0) {
3
- return { valid: false, error: "Package name cannot be empty" };
4
- }
5
- if (!/^[a-z0-9-]+$/.test(name)) {
6
- return {
7
- valid: false,
8
- error: "Package name must contain only lowercase letters, numbers, and hyphens"
9
- };
10
- }
11
- if (name.startsWith("-") || name.endsWith("-")) {
12
- return {
13
- valid: false,
14
- error: "Package name cannot start or end with a hyphen"
15
- };
16
- }
17
- return { valid: true };
18
- };
19
- export const validateMonorepoName = (name) => {
20
- if (!name || name.trim().length === 0) {
21
- return { valid: false, error: "Monorepo name cannot be empty" };
22
- }
23
- if (!/^[a-z0-9-]+$/.test(name)) {
24
- return {
25
- valid: false,
26
- error: "Monorepo name must contain only lowercase letters, numbers, and hyphens"
27
- };
28
- }
29
- return { valid: true };
30
- };
31
- export const validateVersion = (version) => {
32
- if (!version || version.trim().length === 0) {
33
- return { valid: false, error: "Version cannot be empty" };
34
- }
35
- if (!/^\d+\.\d+\.\d+(-[a-z0-9.-]+)?$/.test(version)) {
36
- return {
37
- valid: false,
38
- error: "Version must follow semantic versioning (e.g., 1.0.0)"
39
- };
40
- }
41
- return { valid: true };
42
- };
@@ -1,2 +0,0 @@
1
- declare const _default: any;
2
- export default _default;