@weme-ui/weme-ui 0.1.5 → 0.2.1
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/CHANGELOG.md +13 -0
- package/README.md +19 -11
- package/dist/add-DESSspHh.js +56 -0
- package/dist/add-DESSspHh.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +58 -0
- package/dist/index.js.map +1 -0
- package/dist/init-DZjeMuf3.js +219 -0
- package/dist/init-DZjeMuf3.js.map +1 -0
- package/dist/project-BZkWl9YJ.js +685 -0
- package/dist/project-BZkWl9YJ.js.map +1 -0
- package/package.json +72 -48
- package/LICENSE +0 -21
- package/dist/add-5ZrkTNC3.mjs +0 -53
- package/dist/add-5ZrkTNC3.mjs.map +0 -1
- package/dist/build-DAAgZct5.mjs +0 -23
- package/dist/build-DAAgZct5.mjs.map +0 -1
- package/dist/index.d.mts +0 -1
- package/dist/index.mjs +0 -31
- package/dist/index.mjs.map +0 -1
- package/dist/info-BBRg1Z-t.mjs +0 -41
- package/dist/info-BBRg1Z-t.mjs.map +0 -1
- package/dist/init-BlbSgl_W.mjs +0 -64
- package/dist/init-BlbSgl_W.mjs.map +0 -1
- package/dist/manifest-DtYvp2uU.mjs +0 -77
- package/dist/manifest-DtYvp2uU.mjs.map +0 -1
- package/dist/package-DPYgVv-f.mjs +0 -85
- package/dist/package-DPYgVv-f.mjs.map +0 -1
- package/dist/project-BpqIQqfR.mjs +0 -361
- package/dist/project-BpqIQqfR.mjs.map +0 -1
- package/dist/project-COPHBstt.mjs +0 -58
- package/dist/project-COPHBstt.mjs.map +0 -1
- package/dist/project-kIk5Kz3k.mjs +0 -148
- package/dist/project-kIk5Kz3k.mjs.map +0 -1
- package/dist/registry-CU5Ejwes.mjs +0 -82
- package/dist/registry-CU5Ejwes.mjs.map +0 -1
- package/dist/registry-DtG09FVz.mjs +0 -147
- package/dist/registry-DtG09FVz.mjs.map +0 -1
- package/dist/registry-NSadym2Q.mjs +0 -8
- package/dist/registry-NSadym2Q.mjs.map +0 -1
- package/dist/registry-bjxXghAl.mjs +0 -355
- package/dist/registry-bjxXghAl.mjs.map +0 -1
- package/dist/registry-item-B_neG4VO.mjs +0 -143
- package/dist/registry-item-B_neG4VO.mjs.map +0 -1
- package/dist/verify-CXBxJkzK.mjs +0 -78
- package/dist/verify-CXBxJkzK.mjs.map +0 -1
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# @weme-ui/weme-ui
|
|
2
|
+
|
|
3
|
+
## 0.2.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 发布到 npm 时把 `workspace:*` 依赖解析成真实版本,修复安装失败。
|
|
8
|
+
|
|
9
|
+
## 0.2.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [`b64df64`](https://github.com/weme-ui/weme-ui/commit/b64df6466c7e51212ec15cff0728a117ec6c831a) Thanks [@moujinet](https://github.com/moujinet)! - 在 monorepo 中重写 CLI:`init` 初始化项目,`add` 从 registry 安装 item,并支持按 file / doc 等 kinds 过滤。
|
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<img align="center" src="https://raw.githubusercontent.com/moujinet/assets/main/weme-ui/png/circle-128.png" height="128" />
|
|
2
|
+
<img align="center" src="https://raw.githubusercontent.com/moujinet/assets/main/weme-ui/png/circle-128.png" alt="Weme UI" height="128" />
|
|
3
3
|
<h1 align="center">
|
|
4
4
|
Weme UI <sup style="color: #4CBBA5">CLI</sup>
|
|
5
5
|
</h1>
|
|
@@ -7,19 +7,29 @@
|
|
|
7
7
|
|
|
8
8
|
[![npm version][npm-version-src]][npm-version-href]
|
|
9
9
|
[![License][license-src]][license-href]
|
|
10
|
+
[![code style][code-style-src]][code-style-href]
|
|
10
11
|
|
|
11
12
|
<p align="center">
|
|
12
13
|
Re-usable UI components with Reka UI and UnoCSS.
|
|
13
14
|
</p>
|
|
14
15
|
|
|
15
|
-
|
|
16
|
+
<p align="center">
|
|
17
|
+
⚠️ Do not use in production. This project is still in early development.
|
|
18
|
+
</p>
|
|
19
|
+
|
|
20
|
+
## 如何开始
|
|
21
|
+
|
|
22
|
+
### 初始化
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
pnpm dlx @weme-ui/weme-ui init
|
|
26
|
+
```
|
|
16
27
|
|
|
17
|
-
|
|
28
|
+
### 添加组件
|
|
18
29
|
|
|
19
|
-
|
|
20
|
-
-
|
|
21
|
-
|
|
22
|
-
- [shadcn/ui][shadcn-href]
|
|
30
|
+
```bash
|
|
31
|
+
pnpm dlx @weme-ui/weme-ui add weme-ui/slim/button
|
|
32
|
+
```
|
|
23
33
|
|
|
24
34
|
## 许可证
|
|
25
35
|
|
|
@@ -30,7 +40,5 @@
|
|
|
30
40
|
[license-src]: https://img.shields.io/github/license/weme-ui/weme-ui.svg?style=flat&colorA=1d2129&colorB=4CBBA5
|
|
31
41
|
[license-href]: https://github.com/weme-ui/weme-ui/blob/main/LICENSE
|
|
32
42
|
[github-href]: https://github.com/weme-ui/weme-ui
|
|
33
|
-
[
|
|
34
|
-
[
|
|
35
|
-
[radix-href]: https://www.radix-ui.com
|
|
36
|
-
[shadcn-href]: https://ui.shadcn.com
|
|
43
|
+
[code-style-src]: https://antfu.me/badge-code-style.svg
|
|
44
|
+
[code-style-href]: https://github.com/antfu/eslint-config
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { n as callWhen, o as randomColor, s as unwrapError, t as Project } from "./project-BZkWl9YJ.js";
|
|
2
|
+
import { defineCommand } from "citty";
|
|
3
|
+
import { resolve } from "node:path/posix";
|
|
4
|
+
import { cwd, exit } from "node:process";
|
|
5
|
+
import ora from "ora";
|
|
6
|
+
|
|
7
|
+
// src/commands/add/index.ts
|
|
8
|
+
/**
|
|
9
|
+
* 添加组件
|
|
10
|
+
*/
|
|
11
|
+
var add_default = defineCommand({
|
|
12
|
+
meta: {
|
|
13
|
+
name: "add",
|
|
14
|
+
description: "Add items to your project"
|
|
15
|
+
},
|
|
16
|
+
args: {
|
|
17
|
+
cwd: {
|
|
18
|
+
type: "string",
|
|
19
|
+
description: "Change working directory to the project root.",
|
|
20
|
+
default: cwd()
|
|
21
|
+
},
|
|
22
|
+
kinds: {
|
|
23
|
+
type: "string",
|
|
24
|
+
description: "The kinds of items to add. Available values: file, doc, example, test",
|
|
25
|
+
default: "file,doc"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
async run({ args }) {
|
|
29
|
+
const items = args._;
|
|
30
|
+
if (items.length === 0) throw new Error("No items to add");
|
|
31
|
+
const cwd = resolve(args.cwd);
|
|
32
|
+
const kinds = args.kinds.split(",").map((kind) => kind.trim()) || ["file", "doc"];
|
|
33
|
+
try {
|
|
34
|
+
const project = new Project(cwd);
|
|
35
|
+
if (await project.isInitialized() === false) throw new Error("Project is not initialized");
|
|
36
|
+
let count = 0;
|
|
37
|
+
const spinner = ora({ text: "Adding items..." }).start();
|
|
38
|
+
for (const item of items) await callWhen(await project.hasAddedItem(item) === false, async () => {
|
|
39
|
+
spinner.text = `Adding ${item}...`;
|
|
40
|
+
spinner.color = randomColor();
|
|
41
|
+
if (await project.addItem(item, kinds)) count++;
|
|
42
|
+
});
|
|
43
|
+
if (count === 0) {
|
|
44
|
+
spinner.fail("No items added");
|
|
45
|
+
exit(1);
|
|
46
|
+
}
|
|
47
|
+
spinner.succeed("Items added successfully");
|
|
48
|
+
} catch (err) {
|
|
49
|
+
console.error(unwrapError(err));
|
|
50
|
+
exit(1);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
export { add_default as default };
|
|
56
|
+
//# sourceMappingURL=add-DESSspHh.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-DESSspHh.js","names":[],"sources":["../src/commands/add/index.ts"],"sourcesContent":["import type { RegistryItemFileKind } from '../../types'\nimport { resolve } from 'node:path/posix'\nimport { cwd, exit } from 'node:process'\nimport { defineCommand } from 'citty'\nimport ora from 'ora'\nimport { callWhen, Project, randomColor, unwrapError } from '../../utils'\n\n/**\n * 添加组件\n */\nexport default defineCommand({\n meta: {\n name: 'add',\n description: 'Add items to your project',\n },\n\n args: {\n cwd: {\n type: 'string',\n description: 'Change working directory to the project root.',\n default: cwd(),\n },\n kinds: {\n type: 'string',\n description: 'The kinds of items to add. Available values: file, doc, example, test',\n default: 'file,doc',\n },\n },\n\n async run({ args }) {\n const items = args._\n\n if (items.length === 0) {\n throw new Error('No items to add')\n }\n\n const cwd = resolve(args.cwd)\n const kinds = (args.kinds.split(',').map(kind => kind.trim()) || ['file', 'doc']) as RegistryItemFileKind[]\n\n try {\n const project = new Project(cwd)\n\n if (await project.isInitialized() === false) {\n throw new Error('Project is not initialized')\n }\n\n let count = 0\n const spinner = ora({ text: 'Adding items...' }).start()\n\n for (const item of items) {\n await callWhen(\n await project.hasAddedItem(item) === false,\n async () => {\n spinner.text = `Adding ${item}...`\n spinner.color = randomColor()\n\n if (await project.addItem(item, kinds)) {\n count++\n }\n },\n )\n }\n\n if (count === 0) {\n spinner.fail('No items added')\n exit(1)\n }\n\n spinner.succeed('Items added successfully')\n }\n catch (err) {\n console.error(unwrapError(err))\n exit(1)\n }\n },\n})\n"],"mappings":";;;;;;;;;;AAUA,kBAAe,cAAc;CAC3B,MAAM;EACJ,MAAM;EACN,aAAa;CACf;CAEA,MAAM;EACJ,KAAK;GACH,MAAM;GACN,aAAa;GACb,SAAS,IAAI;EACf;EACA,OAAO;GACL,MAAM;GACN,aAAa;GACb,SAAS;EACX;CACF;CAEA,MAAM,IAAI,EAAE,QAAQ;EAClB,MAAM,QAAQ,KAAK;EAEnB,IAAI,MAAM,WAAW,GACnB,MAAM,IAAI,MAAM,iBAAiB;EAGnC,MAAM,MAAM,QAAQ,KAAK,GAAG;EAC5B,MAAM,QAAS,KAAK,MAAM,MAAM,GAAG,CAAC,CAAC,KAAI,SAAQ,KAAK,KAAK,CAAC,KAAK,CAAC,QAAQ,KAAK;EAE/E,IAAI;GACF,MAAM,UAAU,IAAI,QAAQ,GAAG;GAE/B,IAAI,MAAM,QAAQ,cAAc,MAAM,OACpC,MAAM,IAAI,MAAM,4BAA4B;GAG9C,IAAI,QAAQ;GACZ,MAAM,UAAU,IAAI,EAAE,MAAM,kBAAkB,CAAC,CAAC,CAAC,MAAM;GAEvD,KAAK,MAAM,QAAQ,OACjB,MAAM,SACJ,MAAM,QAAQ,aAAa,IAAI,MAAM,OACrC,YAAY;IACV,QAAQ,OAAO,UAAU,KAAK;IAC9B,QAAQ,QAAQ,YAAY;IAE5B,IAAI,MAAM,QAAQ,QAAQ,MAAM,KAAK,GACnC;GAEJ,CACF;GAGF,IAAI,UAAU,GAAG;IACf,QAAQ,KAAK,gBAAgB;IAC7B,KAAK,CAAC;GACR;GAEA,QAAQ,QAAQ,0BAA0B;EAC5C,SACO,KAAK;GACV,QAAQ,MAAM,YAAY,GAAG,CAAC;GAC9B,KAAK,CAAC;EACR;CACF;AACF,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { defineCommand, runMain } from "citty";
|
|
3
|
+
|
|
4
|
+
// package.json
|
|
5
|
+
var version = "0.2.1";
|
|
6
|
+
var description = "A CLI to manage Weme UI projects.";
|
|
7
|
+
|
|
8
|
+
// src/constants.ts
|
|
9
|
+
const CLI_NAME = "weme-cli";
|
|
10
|
+
const CLI_VERSION = version;
|
|
11
|
+
const CLI_DESCRIPTION = description;
|
|
12
|
+
const CLI_TMP_DIR = ".weme";
|
|
13
|
+
const PROJECT_CONFIG_FILENAME = "weme.config.json";
|
|
14
|
+
const PROJECT_LOCKFILE_FILENAME = "weme.lock.json";
|
|
15
|
+
const DEFAULT_REGISTRY_NAME = "weme-ui/slim";
|
|
16
|
+
const DEFAULT_REGISTRY_BRANCH = "main";
|
|
17
|
+
const DEFAULT_REGISTRIES = [{ registry: DEFAULT_REGISTRY_NAME }];
|
|
18
|
+
const DEFAULT_PATHS = {
|
|
19
|
+
"~": "src",
|
|
20
|
+
"component": "~/components",
|
|
21
|
+
"composable": "~/composables",
|
|
22
|
+
"block": "~/blocks",
|
|
23
|
+
"layout": "~/layouts",
|
|
24
|
+
"page": "~/pages",
|
|
25
|
+
"util": "~/utils",
|
|
26
|
+
"theme": "~/themes"
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
// src/cli.ts
|
|
30
|
+
const cli = defineCommand({
|
|
31
|
+
meta: {
|
|
32
|
+
name: CLI_NAME,
|
|
33
|
+
version: CLI_VERSION,
|
|
34
|
+
description: CLI_DESCRIPTION
|
|
35
|
+
},
|
|
36
|
+
subCommands: {
|
|
37
|
+
/**
|
|
38
|
+
* 初始化项目
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```bunx @weme-ui/weme-ui init```
|
|
42
|
+
*/
|
|
43
|
+
init: () => import("./init-DZjeMuf3.js").then((r) => r.default),
|
|
44
|
+
/**
|
|
45
|
+
* 添加组件
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```bunx @weme-ui/weme-ui add weme-ui/slim/button```
|
|
49
|
+
*/
|
|
50
|
+
add: () => import("./add-DESSspHh.js").then((r) => r.default)
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
// src/index.ts
|
|
55
|
+
runMain(cli);
|
|
56
|
+
|
|
57
|
+
export { DEFAULT_REGISTRY_NAME as a, DEFAULT_REGISTRY_BRANCH as i, DEFAULT_PATHS as n, PROJECT_CONFIG_FILENAME as o, DEFAULT_REGISTRIES as r, PROJECT_LOCKFILE_FILENAME as s, CLI_TMP_DIR as t };
|
|
58
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../package.json","../src/constants.ts","../src/cli.ts","../src/index.ts"],"sourcesContent":["","import type { ProjectAddedRegistry } from './types'\nimport { description, version } from '../package.json'\n\nexport const CLI_NAME = 'weme-cli'\nexport const CLI_VERSION = version\nexport const CLI_DESCRIPTION = description\n\nexport const CLI_TMP_DIR = '.weme'\n\nexport const PROJECT_CONFIG_FILENAME = 'weme.config.json'\nexport const PROJECT_LOCKFILE_FILENAME = 'weme.lock.json'\n\nexport const DEFAULT_REGISTRY_NAME = 'weme-ui/slim'\nexport const DEFAULT_REGISTRY_BRANCH = 'main'\n\nexport const DEFAULT_REGISTRIES: ProjectAddedRegistry[] = [\n { registry: DEFAULT_REGISTRY_NAME },\n]\n\nexport const DEFAULT_PATHS = {\n '~': 'src',\n 'component': '~/components',\n 'composable': '~/composables',\n 'block': '~/blocks',\n 'layout': '~/layouts',\n 'page': '~/pages',\n 'util': '~/utils',\n 'theme': '~/themes',\n} as const\n","import { defineCommand } from 'citty'\nimport { CLI_DESCRIPTION, CLI_NAME, CLI_VERSION } from './constants'\n\nconst cli = defineCommand({\n meta: {\n name: CLI_NAME,\n version: CLI_VERSION,\n description: CLI_DESCRIPTION,\n },\n\n subCommands: {\n /**\n * 初始化项目\n *\n * @example\n * ```bunx @weme-ui/weme-ui init```\n */\n init: () => import('./commands/init').then(r => r.default),\n\n /**\n * 添加组件\n *\n * @example\n * ```bunx @weme-ui/weme-ui add weme-ui/slim/button```\n */\n add: () => import('./commands/add').then(r => r.default),\n },\n})\n\nexport {\n cli,\n}\n","#!/usr/bin/env node\nimport { runMain } from 'citty'\nimport { cli } from './cli'\n\nrunMain(cli)\n"],"mappings":";;;;;;;;ACGA,MAAa,WAAW;AACxB,MAAa,cAAc;AAC3B,MAAa,kBAAkB;AAE/B,MAAa,cAAc;AAE3B,MAAa,0BAA0B;AACvC,MAAa,4BAA4B;AAEzC,MAAa,wBAAwB;AACrC,MAAa,0BAA0B;AAEvC,MAAa,qBAA6C,CACxD,EAAE,UAAU,sBAAsB,CACpC;AAEA,MAAa,gBAAgB;CAC3B,KAAK;CACL,aAAa;CACb,cAAc;CACd,SAAS;CACT,UAAU;CACV,QAAQ;CACR,QAAQ;CACR,SAAS;AACX;;;ACzBA,MAAM,MAAM,cAAc;CACxB,MAAM;EACJ,MAAM;EACN,SAAS;EACT,aAAa;CACf;CAEA,aAAa;;;;;;;EAOX,YAAY,OAAO,qBAAkB,CAAC,MAAK,MAAK,EAAE,OAAO;;;;;;;EAQzD,WAAW,OAAO,oBAAiB,CAAC,MAAK,MAAK,EAAE,OAAO;CACzD;AACF,CAAC;;;ACvBD,QAAQ,GAAG"}
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import { n as DEFAULT_PATHS, o as PROJECT_CONFIG_FILENAME, r as DEFAULT_REGISTRIES, t as CLI_TMP_DIR } from "./index.js";
|
|
2
|
+
import { a as parseRepoURL, c as writeFile, i as existsFile, l as useRegistry, n as callWhen, o as randomColor, r as ensureDir, s as unwrapError, t as Project } from "./project-BZkWl9YJ.js";
|
|
3
|
+
import { defineCommand } from "citty";
|
|
4
|
+
import { dirname, join, resolve } from "node:path/posix";
|
|
5
|
+
import { cwd, exit } from "node:process";
|
|
6
|
+
import ora from "ora";
|
|
7
|
+
import { CONFIG_SCHEMA_URL, ProjectConfigSchema } from "@weme-ui/schema";
|
|
8
|
+
import { installDependencies } from "nypm";
|
|
9
|
+
import * as v from "valibot";
|
|
10
|
+
import { existsSync } from "node:fs";
|
|
11
|
+
import { copyFile } from "node:fs/promises";
|
|
12
|
+
import { x } from "tinyexec";
|
|
13
|
+
import { glob } from "tinyglobby";
|
|
14
|
+
|
|
15
|
+
// src/commands/init/config.ts
|
|
16
|
+
/**
|
|
17
|
+
* Generate the default config for the project.
|
|
18
|
+
*
|
|
19
|
+
* @param root - The root directory of the project.
|
|
20
|
+
* @returns Whether the default config was generated successfully.
|
|
21
|
+
* @throws If the default config fails to generate.
|
|
22
|
+
*/
|
|
23
|
+
async function generateDefaultConfig(root, repo) {
|
|
24
|
+
const { name } = parseRepoURL(repo);
|
|
25
|
+
const registries = repo ? [{
|
|
26
|
+
registry: name,
|
|
27
|
+
repo
|
|
28
|
+
}] : DEFAULT_REGISTRIES;
|
|
29
|
+
const schema = v.safeParse(ProjectConfigSchema, {
|
|
30
|
+
$schema: CONFIG_SCHEMA_URL,
|
|
31
|
+
registries,
|
|
32
|
+
paths: DEFAULT_PATHS
|
|
33
|
+
});
|
|
34
|
+
if (!schema.success) throw new Error("Failed to generate default config");
|
|
35
|
+
return await writeFile(root, PROJECT_CONFIG_FILENAME, JSON.stringify(schema.output, null, 2));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// src/commands/init/template.ts
|
|
39
|
+
/**
|
|
40
|
+
* Initialize the project template.
|
|
41
|
+
*
|
|
42
|
+
* @param cwd - The current working directory.
|
|
43
|
+
* @param template - The template to initialize.
|
|
44
|
+
* @throws If the template is not found.
|
|
45
|
+
*/
|
|
46
|
+
async function initProjectTemplate(cwd, template = "vite") {
|
|
47
|
+
const templatePath = join(cwd, CLI_TMP_DIR, "repository", "templates", template);
|
|
48
|
+
if (!existsSync(templatePath)) throw new Error(`Template ${template} not found`);
|
|
49
|
+
const files = await glob("**", {
|
|
50
|
+
cwd: templatePath,
|
|
51
|
+
onlyFiles: true
|
|
52
|
+
});
|
|
53
|
+
for (const file of files) {
|
|
54
|
+
const filePath = join(cwd, file);
|
|
55
|
+
const fileDir = dirname(filePath);
|
|
56
|
+
if (!existsSync(fileDir)) ensureDir(fileDir);
|
|
57
|
+
if (!await existsFile(cwd, file)) await copyFile(join(templatePath, file), filePath);
|
|
58
|
+
}
|
|
59
|
+
await cleanTemplateRepository(cwd);
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Clone the template repository.
|
|
63
|
+
*
|
|
64
|
+
* @returns The result of the clone operation.
|
|
65
|
+
* @throws If the clone operation fails.
|
|
66
|
+
*/
|
|
67
|
+
async function cloneTemplateRepository(cwd) {
|
|
68
|
+
const repositoryPath = join(cwd, CLI_TMP_DIR, "repository");
|
|
69
|
+
await cleanTemplateRepository(cwd);
|
|
70
|
+
const result = await x("git", [
|
|
71
|
+
"clone",
|
|
72
|
+
"--depth",
|
|
73
|
+
"1",
|
|
74
|
+
"https://github.com/weme-ui/weme-ui.git",
|
|
75
|
+
repositoryPath
|
|
76
|
+
]);
|
|
77
|
+
if (result.exitCode !== 0) throw new Error(`Failed to clone template repository: ${result.stderr}`);
|
|
78
|
+
return result.stdout;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Clean the template repository.
|
|
82
|
+
*
|
|
83
|
+
* @param cwd - The current working directory.
|
|
84
|
+
* @returns The result of the clean operation.
|
|
85
|
+
* @throws If the clean operation fails.
|
|
86
|
+
*/
|
|
87
|
+
async function cleanTemplateRepository(cwd) {
|
|
88
|
+
const repositoryPath = join(cwd, CLI_TMP_DIR, "repository");
|
|
89
|
+
if (existsSync(repositoryPath)) await x("rm", ["-rf", repositoryPath]);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// src/commands/init/unocss.ts
|
|
93
|
+
const baseUnoConfig = `import type { Theme } from '@weme-ui/unocss-preset/types'
|
|
94
|
+
import { defineConfig } from 'unocss'
|
|
95
|
+
|
|
96
|
+
export default defineConfig<Theme>({
|
|
97
|
+
// Configure the content pipeline to include *.style.ts files in the project.
|
|
98
|
+
content: {
|
|
99
|
+
pipeline: {
|
|
100
|
+
include: [
|
|
101
|
+
/\\.(vue|[jt]sx|style\\.[jt]s|vine\\.[jt]s|mdx?|astro|elm|php|phtml|html)($|\\?)/,
|
|
102
|
+
],
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
})
|
|
106
|
+
`;
|
|
107
|
+
const unoConfig = `import type { ProjectConfigSchema } from '@weme-ui/schema'
|
|
108
|
+
import type { Theme } from '@weme-ui/unocss-preset/types'
|
|
109
|
+
import type { InferInput } from 'valibot'
|
|
110
|
+
import { presetWemeUI } from '@weme-ui/unocss-preset'
|
|
111
|
+
import { mergeConfigs } from 'unocss'
|
|
112
|
+
import baseConfig from './${CLI_TMP_DIR}/uno.config'
|
|
113
|
+
import wemeConfigJson from './${PROJECT_CONFIG_FILENAME}' with { type: 'json' }
|
|
114
|
+
|
|
115
|
+
const wemeConfig = wemeConfigJson as InferInput<typeof ProjectConfigSchema>
|
|
116
|
+
|
|
117
|
+
export default mergeConfigs<Theme>([
|
|
118
|
+
baseConfig,
|
|
119
|
+
{
|
|
120
|
+
presets: [
|
|
121
|
+
presetWemeUI({
|
|
122
|
+
colors: wemeConfig.unocss?.colors || {},
|
|
123
|
+
cssVars: wemeConfig.unocss?.cssVars || {},
|
|
124
|
+
}),
|
|
125
|
+
],
|
|
126
|
+
},
|
|
127
|
+
])
|
|
128
|
+
`;
|
|
129
|
+
async function generateDefaultUnoCSSConfigs(root) {
|
|
130
|
+
const createdBaseConfig = await writeFile(join(root, CLI_TMP_DIR), "uno.config.ts", baseUnoConfig.trim());
|
|
131
|
+
const createdUnoConfig = await writeFile(root, "uno.config.ts", unoConfig.trim());
|
|
132
|
+
return createdBaseConfig && createdUnoConfig;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// src/commands/init/index.ts
|
|
136
|
+
/**
|
|
137
|
+
* 初始化项目
|
|
138
|
+
*/
|
|
139
|
+
var init_default = defineCommand({
|
|
140
|
+
meta: {
|
|
141
|
+
name: "init",
|
|
142
|
+
description: "Initialize a new Weme UI project"
|
|
143
|
+
},
|
|
144
|
+
args: {
|
|
145
|
+
cwd: {
|
|
146
|
+
type: "positional",
|
|
147
|
+
description: "Change working directory to the project root.",
|
|
148
|
+
default: cwd()
|
|
149
|
+
},
|
|
150
|
+
repo: {
|
|
151
|
+
type: "string",
|
|
152
|
+
description: "Specify the registry repository of the project.",
|
|
153
|
+
valueHint: "weme-ui/slim"
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
async run({ args }) {
|
|
157
|
+
const cwd = resolve(args.cwd);
|
|
158
|
+
try {
|
|
159
|
+
const project = new Project(cwd);
|
|
160
|
+
if (await project.isInitialized()) throw new Error("Project already initialized");
|
|
161
|
+
const spinner = ora({ text: "Initializing project..." }).start();
|
|
162
|
+
const { name, branch } = parseRepoURL(args.repo);
|
|
163
|
+
await callWhen(!await project.hasPackageJson(), async () => {
|
|
164
|
+
spinner.color = randomColor();
|
|
165
|
+
spinner.text = "Cloning template repository...";
|
|
166
|
+
await cloneTemplateRepository(cwd);
|
|
167
|
+
spinner.text = "Initializing project structure...";
|
|
168
|
+
spinner.color = randomColor();
|
|
169
|
+
await initProjectTemplate(cwd);
|
|
170
|
+
});
|
|
171
|
+
await callWhen(!await project.hasProjectConfig(), async () => {
|
|
172
|
+
spinner.text = "Generating project config file...";
|
|
173
|
+
spinner.color = randomColor();
|
|
174
|
+
await generateDefaultConfig(cwd, args.repo);
|
|
175
|
+
});
|
|
176
|
+
await callWhen(!await project.hasUnoConfig(), async () => {
|
|
177
|
+
spinner.color = randomColor();
|
|
178
|
+
spinner.text = "Generating UnoCSS config file...";
|
|
179
|
+
await generateDefaultUnoCSSConfigs(cwd);
|
|
180
|
+
});
|
|
181
|
+
await callWhen(await project.hasPackageJson(), async () => {
|
|
182
|
+
spinner.text = "Install dependencies...";
|
|
183
|
+
spinner.color = randomColor();
|
|
184
|
+
await installDependencies({
|
|
185
|
+
cwd,
|
|
186
|
+
silent: true
|
|
187
|
+
});
|
|
188
|
+
});
|
|
189
|
+
await callWhen(await project.hasPackageJson(), async () => {
|
|
190
|
+
const registry = useRegistry(name, branch);
|
|
191
|
+
spinner.text = "Adding dependencies to the project...";
|
|
192
|
+
spinner.color = randomColor();
|
|
193
|
+
const dependencies = await registry.dependencies();
|
|
194
|
+
if (dependencies.length > 0) await project.addDependencies(dependencies);
|
|
195
|
+
spinner.text = "Adding dev dependencies to the project...";
|
|
196
|
+
spinner.color = randomColor();
|
|
197
|
+
const devDependencies = await registry.devDependencies();
|
|
198
|
+
if (devDependencies.length > 0) await project.addDevDependencies(devDependencies);
|
|
199
|
+
});
|
|
200
|
+
await callWhen(await project.hasPackageJson(), async () => {
|
|
201
|
+
const registry = useRegistry(name, branch);
|
|
202
|
+
spinner.text = "Adding `on-init` items to the project...";
|
|
203
|
+
spinner.color = randomColor();
|
|
204
|
+
const onInitItems = await registry.getItems((item) => item.when === "on-init");
|
|
205
|
+
if (onInitItems.length > 0) for (const item of onInitItems) {
|
|
206
|
+
const itemName = `${name}/${item.name}`;
|
|
207
|
+
if (await project.hasAddedItem(itemName) === false) await project.addItem(itemName);
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
spinner.succeed("Project initialized successfully");
|
|
211
|
+
} catch (err) {
|
|
212
|
+
console.error(unwrapError(err));
|
|
213
|
+
exit(1);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
export { init_default as default };
|
|
219
|
+
//# sourceMappingURL=init-DZjeMuf3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init-DZjeMuf3.js","names":[],"sources":["../src/commands/init/config.ts","../src/commands/init/template.ts","../src/commands/init/unocss.ts","../src/commands/init/index.ts"],"sourcesContent":["import { CONFIG_SCHEMA_URL, ProjectConfigSchema } from '@weme-ui/schema'\nimport * as v from 'valibot'\nimport { DEFAULT_PATHS, DEFAULT_REGISTRIES, PROJECT_CONFIG_FILENAME } from '../../constants'\nimport { parseRepoURL, writeFile } from '../../utils'\n\n/**\n * Generate the default config for the project.\n *\n * @param root - The root directory of the project.\n * @returns Whether the default config was generated successfully.\n * @throws If the default config fails to generate.\n */\nexport async function generateDefaultConfig(root: string, repo?: string) {\n const { name } = parseRepoURL(repo)\n\n const registries = repo\n ? [{ registry: name, repo }]\n : DEFAULT_REGISTRIES\n\n const schema = v.safeParse(ProjectConfigSchema, {\n $schema: CONFIG_SCHEMA_URL,\n registries,\n paths: DEFAULT_PATHS,\n })\n\n if (!schema.success) {\n throw new Error('Failed to generate default config')\n }\n\n return await writeFile(\n root,\n PROJECT_CONFIG_FILENAME,\n JSON.stringify(schema.output, null, 2),\n )\n}\n","import { existsSync } from 'node:fs'\nimport { copyFile } from 'node:fs/promises'\nimport { dirname, join } from 'node:path/posix'\nimport { x } from 'tinyexec'\nimport { glob } from 'tinyglobby'\nimport { CLI_TMP_DIR } from '../../constants'\nimport { ensureDir, existsFile } from '../../utils'\n\n/**\n * Initialize the project template.\n *\n * @param cwd - The current working directory.\n * @param template - The template to initialize.\n * @throws If the template is not found.\n */\nexport async function initProjectTemplate(cwd: string, template: string = 'vite') {\n const templatePath = join(cwd, CLI_TMP_DIR, 'repository', 'templates', template)\n\n if (!existsSync(templatePath)) {\n throw new Error(`Template ${template} not found`)\n }\n\n const files = await glob('**', { cwd: templatePath, onlyFiles: true })\n\n for (const file of files) {\n const filePath = join(cwd, file)\n const fileDir = dirname(filePath)\n\n if (!existsSync(fileDir)) {\n ensureDir(fileDir)\n }\n\n if (!await existsFile(cwd, file)) {\n await copyFile(join(templatePath, file), filePath)\n }\n }\n\n // Clean the template repository finally.\n await cleanTemplateRepository(cwd)\n}\n\n/**\n * Clone the template repository.\n *\n * @returns The result of the clone operation.\n * @throws If the clone operation fails.\n */\nexport async function cloneTemplateRepository(cwd: string) {\n const repositoryPath = join(cwd, CLI_TMP_DIR, 'repository')\n\n await cleanTemplateRepository(cwd)\n\n const result = await x('git', ['clone', '--depth', '1', 'https://github.com/weme-ui/weme-ui.git', repositoryPath])\n\n if (result.exitCode !== 0) {\n throw new Error(`Failed to clone template repository: ${result.stderr}`)\n }\n\n return result.stdout\n}\n\n/**\n * Clean the template repository.\n *\n * @param cwd - The current working directory.\n * @returns The result of the clean operation.\n * @throws If the clean operation fails.\n */\nexport async function cleanTemplateRepository(cwd: string) {\n const repositoryPath = join(cwd, CLI_TMP_DIR, 'repository')\n\n if (existsSync(repositoryPath)) {\n await x('rm', ['-rf', repositoryPath])\n }\n}\n","import { join } from 'node:path/posix'\nimport { CLI_TMP_DIR, PROJECT_CONFIG_FILENAME } from '../../constants'\nimport { writeFile } from '../../utils'\n\nconst baseUnoConfig = `import type { Theme } from '@weme-ui/unocss-preset/types'\nimport { defineConfig } from 'unocss'\n\nexport default defineConfig<Theme>({\n // Configure the content pipeline to include *.style.ts files in the project.\n content: {\n pipeline: {\n include: [\n /\\\\.(vue|[jt]sx|style\\\\.[jt]s|vine\\\\.[jt]s|mdx?|astro|elm|php|phtml|html)($|\\\\?)/,\n ],\n },\n },\n})\n`\nconst unoConfig = `import type { ProjectConfigSchema } from '@weme-ui/schema'\nimport type { Theme } from '@weme-ui/unocss-preset/types'\nimport type { InferInput } from 'valibot'\nimport { presetWemeUI } from '@weme-ui/unocss-preset'\nimport { mergeConfigs } from 'unocss'\nimport baseConfig from './${CLI_TMP_DIR}/uno.config'\nimport wemeConfigJson from './${PROJECT_CONFIG_FILENAME}' with { type: 'json' }\n\nconst wemeConfig = wemeConfigJson as InferInput<typeof ProjectConfigSchema>\n\nexport default mergeConfigs<Theme>([\n baseConfig,\n {\n presets: [\n presetWemeUI({\n colors: wemeConfig.unocss?.colors || {},\n cssVars: wemeConfig.unocss?.cssVars || {},\n }),\n ],\n },\n])\n`\n\nexport async function generateDefaultUnoCSSConfigs(root: string) {\n const createdBaseConfig = await writeFile(join(root, CLI_TMP_DIR), 'uno.config.ts', baseUnoConfig.trim())\n const createdUnoConfig = await writeFile(root, 'uno.config.ts', unoConfig.trim())\n\n return createdBaseConfig && createdUnoConfig\n}\n","import { resolve } from 'node:path/posix'\nimport { cwd, exit } from 'node:process'\nimport { defineCommand } from 'citty'\nimport { installDependencies } from 'nypm'\nimport ora from 'ora'\nimport { callWhen, parseRepoURL, Project, randomColor, unwrapError, useRegistry } from '../../utils'\nimport { generateDefaultConfig } from './config'\nimport { cloneTemplateRepository, initProjectTemplate } from './template'\nimport { generateDefaultUnoCSSConfigs } from './unocss'\n\n/**\n * 初始化项目\n */\nexport default defineCommand({\n meta: {\n name: 'init',\n description: 'Initialize a new Weme UI project',\n },\n\n args: {\n cwd: {\n type: 'positional',\n description: 'Change working directory to the project root.',\n default: cwd(),\n },\n repo: {\n type: 'string',\n description: 'Specify the registry repository of the project.',\n valueHint: 'weme-ui/slim',\n },\n },\n\n async run({ args }) {\n const cwd = resolve(args.cwd)\n\n try {\n const project = new Project(cwd)\n\n if (await project.isInitialized()) {\n throw new Error('Project already initialized')\n }\n\n const spinner = ora({ text: 'Initializing project...' }).start()\n\n const {\n name,\n branch,\n } = parseRepoURL(args.repo)\n\n // 1. Initialize project from clone template repository\n await callWhen(\n !(await project.hasPackageJson()),\n async () => {\n spinner.color = randomColor()\n spinner.text = 'Cloning template repository...'\n await cloneTemplateRepository(cwd)\n\n spinner.text = 'Initializing project structure...'\n spinner.color = randomColor()\n await initProjectTemplate(cwd)\n },\n )\n\n // 2. Generate the default project config file\n await callWhen(\n !(await project.hasProjectConfig()),\n async () => {\n spinner.text = 'Generating project config file...'\n spinner.color = randomColor()\n await generateDefaultConfig(cwd, args.repo)\n },\n )\n\n // 3. Generate the default UnoCSS config file\n await callWhen(\n !(await project.hasUnoConfig()),\n async () => {\n spinner.color = randomColor()\n spinner.text = 'Generating UnoCSS config file...'\n await generateDefaultUnoCSSConfigs(cwd)\n },\n )\n\n // 4. Install dependencies\n await callWhen(\n await project.hasPackageJson(),\n async () => {\n spinner.text = 'Install dependencies...'\n spinner.color = randomColor()\n await installDependencies({\n cwd,\n silent: true,\n })\n },\n )\n\n // 5. Add dependencies to the project\n await callWhen(\n await project.hasPackageJson(),\n async () => {\n const registry = useRegistry(name, branch)\n\n spinner.text = 'Adding dependencies to the project...'\n spinner.color = randomColor()\n const dependencies = await registry.dependencies()\n if (dependencies.length > 0) {\n await project.addDependencies(dependencies)\n }\n\n spinner.text = 'Adding dev dependencies to the project...'\n spinner.color = randomColor()\n const devDependencies = await registry.devDependencies()\n if (devDependencies.length > 0) {\n await project.addDevDependencies(devDependencies)\n }\n },\n )\n\n // 6. Add `on-init` items to the project\n await callWhen(\n await project.hasPackageJson(),\n async () => {\n const registry = useRegistry(name, branch)\n\n spinner.text = 'Adding `on-init` items to the project...'\n spinner.color = randomColor()\n const onInitItems = await registry.getItems(item => item.when === 'on-init')\n if (onInitItems.length > 0) {\n for (const item of onInitItems) {\n const itemName = `${name}/${item.name}`\n if (await project.hasAddedItem(itemName) === false) {\n await project.addItem(itemName)\n }\n }\n }\n },\n )\n\n spinner.succeed('Project initialized successfully')\n }\n catch (err) {\n console.error(unwrapError(err))\n exit(1)\n }\n },\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAYA,eAAsB,sBAAsB,MAAc,MAAe;CACvE,MAAM,EAAE,SAAS,aAAa,IAAI;CAElC,MAAM,aAAa,OACf,CAAC;EAAE,UAAU;EAAM;CAAK,CAAC,IACzB;CAEJ,MAAM,SAAS,EAAE,UAAU,qBAAqB;EAC9C,SAAS;EACT;EACA,OAAO;CACT,CAAC;CAED,IAAI,CAAC,OAAO,SACV,MAAM,IAAI,MAAM,mCAAmC;CAGrD,OAAO,MAAM,UACX,MACA,yBACA,KAAK,UAAU,OAAO,QAAQ,MAAM,CAAC,CACvC;AACF;;;;;;;;;;ACnBA,eAAsB,oBAAoB,KAAa,WAAmB,QAAQ;CAChF,MAAM,eAAe,KAAK,KAAK,aAAa,cAAc,aAAa,QAAQ;CAE/E,IAAI,CAAC,WAAW,YAAY,GAC1B,MAAM,IAAI,MAAM,YAAY,SAAS,WAAW;CAGlD,MAAM,QAAQ,MAAM,KAAK,MAAM;EAAE,KAAK;EAAc,WAAW;CAAK,CAAC;CAErE,KAAK,MAAM,QAAQ,OAAO;EACxB,MAAM,WAAW,KAAK,KAAK,IAAI;EAC/B,MAAM,UAAU,QAAQ,QAAQ;EAEhC,IAAI,CAAC,WAAW,OAAO,GACrB,UAAU,OAAO;EAGnB,IAAI,CAAC,MAAM,WAAW,KAAK,IAAI,GAC7B,MAAM,SAAS,KAAK,cAAc,IAAI,GAAG,QAAQ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