create-weapp-vite 2.0.76 → 2.0.78
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/README.md +16 -0
- package/dist/cli.js +28 -5
- package/dist/index.d.ts +5 -2
- package/dist/index.js +1 -1
- package/dist/{src-BhGRh_fC.js → src-CCWjAwFU.js} +67 -12
- package/package.json +3 -3
- package/templates/default/.vscode/settings.json +69 -0
- package/templates/default/project.config.json +1 -1
- package/templates/default/src/components/HelloWorld/HelloWorld.ts +4 -2
- package/templates/default/src/pages/index/index.ts +4 -2
- package/templates/default/src/pages/layouts/index.ts +3 -2
- package/templates/lib/.vscode/settings.json +69 -0
- package/templates/lib/package.json +1 -1
- package/templates/lib/src/components/HelloWorld/HelloWorld.ts +4 -2
- package/templates/lib/src/pages/index/index.ts +4 -2
- package/templates/lib/src/pages/layouts/index.ts +3 -2
- package/templates/tailwindcss/.vscode/settings.json +69 -0
- package/templates/tailwindcss/project.config.json +1 -1
- package/templates/tailwindcss/src/components/HelloWorld/HelloWorld.ts +4 -2
- package/templates/tailwindcss/src/pages/index/index.ts +4 -3
- package/templates/tailwindcss/src/pages/layouts/index.ts +3 -2
- package/templates/tdesign/.vscode/settings.json +69 -0
- package/templates/tdesign/src/components/HelloWorld/HelloWorld.ts +4 -2
- package/templates/tdesign/src/pages/index/index.ts +4 -3
- package/templates/tdesign/src/pages/layouts/index.ts +3 -2
- package/templates/vant/.vscode/settings.json +69 -0
- package/templates/vant/project.config.json +1 -1
- package/templates/vant/src/components/HelloWorld/HelloWorld.ts +4 -2
- package/templates/vant/src/pages/index/index.ts +4 -3
- package/templates/vant/src/pages/layouts/index.scss +1 -1
- package/templates/vant/src/pages/layouts/index.ts +3 -2
- package/templates/vant/src/pages/layouts/index.wxml +17 -5
- package/templates/wevu/.vscode/settings.json +69 -0
- package/templates/wevu/project.config.json +1 -1
- package/templates/wevu/src/app.vue +10 -7
- package/templates/wevu-tdesign/.vscode/settings.json +69 -0
- package/templates/wevu-tdesign/project.config.json +1 -1
- package/templates/wevu-tdesign/src/app.vue +6 -3
- package/templates/wevu-tdesign/src/components/FilterBar/index.vue +3 -2
- package/templates/wevu-tdesign/src/hooks/usePullDownRefresh.ts +6 -5
- package/templates/wevu-tdesign/src/pages/ability/index.vue +59 -55
- package/templates/wevu-tdesign/src/pages/data/index.vue +3 -2
- package/templates/wevu-tdesign/src/pages/form/index.vue +2 -20
- package/templates/wevu-tdesign/src/pages/index/index.vue +4 -3
- package/templates/wevu-tdesign/src/pages/layouts/index.vue +5 -4
- package/templates/wevu-tdesign/src/subpackages/ability/index.vue +4 -7
- package/templates/wevu-tdesign/src/subpackages/lab/class-binding/index.vue +5 -24
- package/templates/wevu-tdesign/src/subpackages/lab/index.vue +12 -10
- package/templates/wevu-tdesign/src/utils/changeEvent.ts +53 -0
package/README.md
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
- 内置多种模板(默认、Wevu、Tailwindcss、TDesign、Vant 等)
|
|
11
11
|
- 自动对齐 `weapp-vite` 与 `wevu` 版本
|
|
12
12
|
- 自动处理 `.gitignore` 写入
|
|
13
|
+
- 可选安装推荐的 AI skills(`sonofmagic/skills`)
|
|
13
14
|
|
|
14
15
|
## 安装
|
|
15
16
|
|
|
@@ -31,10 +32,24 @@ npx create-weapp-vite
|
|
|
31
32
|
pnpm create weapp-vite
|
|
32
33
|
```
|
|
33
34
|
|
|
35
|
+
交互流程会默认询问是否安装推荐的 AI skills,并提示将执行:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npx skills add sonofmagic/skills
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
如果你暂时不想安装,也可以先跳过,后面再手动执行上面的命令。
|
|
42
|
+
|
|
34
43
|
非交互式创建:
|
|
35
44
|
|
|
36
45
|
```bash
|
|
37
46
|
pnpm create weapp-vite my-app wevu
|
|
47
|
+
|
|
48
|
+
# 显式安装推荐 skills
|
|
49
|
+
pnpm create weapp-vite my-app wevu --install-skills
|
|
50
|
+
|
|
51
|
+
# 显式跳过推荐 skills 安装
|
|
52
|
+
pnpm create weapp-vite my-app wevu --no-install-skills
|
|
38
53
|
```
|
|
39
54
|
|
|
40
55
|
在代码中使用:
|
|
@@ -43,6 +58,7 @@ pnpm create weapp-vite my-app wevu
|
|
|
43
58
|
import { createProject, TemplateName } from 'create-weapp-vite'
|
|
44
59
|
|
|
45
60
|
await createProject('my-app', TemplateName.wevu)
|
|
61
|
+
await createProject('my-app', TemplateName.wevu, { installSkills: true })
|
|
46
62
|
```
|
|
47
63
|
|
|
48
64
|
## 配置
|
package/dist/cli.js
CHANGED
|
@@ -1,13 +1,33 @@
|
|
|
1
|
-
import { n as TemplateName, t as createProject } from "./src-
|
|
1
|
+
import { n as RECOMMENDED_SKILLS_INSTALL_COMMAND, r as TemplateName, t as createProject } from "./src-CCWjAwFU.js";
|
|
2
2
|
import logger from "@weapp-core/logger";
|
|
3
|
-
import fs from "
|
|
4
|
-
import path from "node:path";
|
|
3
|
+
import { fs } from "@weapp-core/shared";
|
|
5
4
|
import process from "node:process";
|
|
5
|
+
import path from "node:path";
|
|
6
6
|
import { confirm, input, select } from "@inquirer/prompts";
|
|
7
7
|
//#region src/cli.ts
|
|
8
8
|
const cwd = process.cwd();
|
|
9
|
+
function parseCliArgs(argv) {
|
|
10
|
+
const positionals = [];
|
|
11
|
+
let installSkills;
|
|
12
|
+
for (const arg of argv) {
|
|
13
|
+
if (arg === "--install-skills") {
|
|
14
|
+
installSkills = true;
|
|
15
|
+
continue;
|
|
16
|
+
}
|
|
17
|
+
if (arg === "--no-install-skills") {
|
|
18
|
+
installSkills = false;
|
|
19
|
+
continue;
|
|
20
|
+
}
|
|
21
|
+
positionals.push(arg);
|
|
22
|
+
}
|
|
23
|
+
return {
|
|
24
|
+
targetDir: positionals[0],
|
|
25
|
+
templateName: positionals[1],
|
|
26
|
+
installSkills
|
|
27
|
+
};
|
|
28
|
+
}
|
|
9
29
|
async function run() {
|
|
10
|
-
const
|
|
30
|
+
const { targetDir: argTarget, templateName: argTemplate, installSkills: argInstallSkills } = parseCliArgs(process.argv.slice(2));
|
|
11
31
|
const isArgMode = Boolean(argTarget);
|
|
12
32
|
const targetDir = isArgMode ? argTarget : await input({
|
|
13
33
|
message: "创建应用的目录",
|
|
@@ -53,7 +73,10 @@ async function run() {
|
|
|
53
73
|
}
|
|
54
74
|
],
|
|
55
75
|
default: TemplateName.default
|
|
56
|
-
})
|
|
76
|
+
}), { installSkills: isArgMode ? argInstallSkills ?? false : await confirm({
|
|
77
|
+
message: `是否安装推荐的 AI skills?将执行 \`${RECOMMENDED_SKILLS_INSTALL_COMMAND}\`,也可稍后手动执行`,
|
|
78
|
+
default: true
|
|
79
|
+
}) });
|
|
57
80
|
}
|
|
58
81
|
/**
|
|
59
82
|
* @description CLI 主入口执行 Promise(便于测试或外部调用)
|
package/dist/index.d.ts
CHANGED
|
@@ -10,9 +10,12 @@ declare enum TemplateName {
|
|
|
10
10
|
}
|
|
11
11
|
//#endregion
|
|
12
12
|
//#region src/createProject.d.ts
|
|
13
|
+
interface CreateProjectOptions {
|
|
14
|
+
installSkills?: boolean;
|
|
15
|
+
}
|
|
13
16
|
/**
|
|
14
17
|
* @description 根据模板创建项目
|
|
15
18
|
*/
|
|
16
|
-
declare function createProject(targetDir?: string, templateName?: TemplateName): Promise<void>;
|
|
19
|
+
declare function createProject(targetDir?: string, templateName?: TemplateName, options?: CreateProjectOptions): Promise<void>;
|
|
17
20
|
//#endregion
|
|
18
|
-
export { TemplateName, createProject };
|
|
21
|
+
export { type CreateProjectOptions, TemplateName, createProject };
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { r as TemplateName, t as createProject } from "./src-CCWjAwFU.js";
|
|
2
2
|
export { TemplateName, createProject };
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import { fileURLToPath } from "node:url";
|
|
2
2
|
import logger from "@weapp-core/logger";
|
|
3
|
-
import fs from "
|
|
3
|
+
import { fs } from "@weapp-core/shared";
|
|
4
4
|
import path from "pathe";
|
|
5
5
|
import https from "node:https";
|
|
6
|
+
import { spawn } from "node:child_process";
|
|
7
|
+
import process from "node:process";
|
|
6
8
|
//#region ../../packages-runtime/weapi/package.json
|
|
7
|
-
var version$2 = "0.2.
|
|
9
|
+
var version$2 = "0.2.3";
|
|
8
10
|
//#endregion
|
|
9
11
|
//#region ../../packages-runtime/wevu/package.json
|
|
10
|
-
var version$1 = "6.
|
|
12
|
+
var version$1 = "6.14.0";
|
|
11
13
|
//#endregion
|
|
12
14
|
//#region ../weapp-vite/package.json
|
|
13
|
-
var version = "6.
|
|
15
|
+
var version = "6.14.0";
|
|
14
16
|
//#endregion
|
|
15
17
|
//#region src/enums.ts
|
|
16
18
|
let TemplateName = /* @__PURE__ */ function(TemplateName) {
|
|
@@ -51,9 +53,17 @@ function createAgentsGuidelines(templateName) {
|
|
|
51
53
|
"- Prefer project scripts such as `pnpm dev`, `pnpm build`, `pnpm open`, and `pnpm g` before ad-hoc shell commands.",
|
|
52
54
|
"- Use `weapp-vite prepare` or `wv prepare` when managed support files under `.weapp-vite/` need to be refreshed.",
|
|
53
55
|
"- Prefer `weapp-vite screenshot` or `wv screenshot` for mini-program screenshot acceptance.",
|
|
56
|
+
"- Prefer `weapp-vite compare` or `wv compare` for mini-program screenshot diff, baseline comparison, and visual regression checks.",
|
|
54
57
|
"- Prefer `weapp-vite ide logs --open` or `wv ide logs --open` for DevTools terminal log bridging.",
|
|
55
58
|
"- Do not default to generic browser screenshot tools when the target is the mini-program runtime in WeChat DevTools.",
|
|
56
59
|
"",
|
|
60
|
+
"## AI Intent Routing",
|
|
61
|
+
"",
|
|
62
|
+
"- When the request mentions screenshot, 截图, 页面快照, runtime screenshot, or capture the current mini-program page, default to `weapp-vite screenshot` / `wv screenshot`.",
|
|
63
|
+
"- When the request mentions screenshot compare, 截图对比, diff, baseline, visual regression, 像素对比, or acceptance comparison, default to `weapp-vite compare` / `wv compare`.",
|
|
64
|
+
"- Treat these commands as the primary screenshot contract for AI workflows in this project.",
|
|
65
|
+
"- Only fall back to generic browser screenshot tools when the target is explicitly the web runtime instead of WeChat DevTools.",
|
|
66
|
+
"",
|
|
57
67
|
"## Weapp-vite Workflow",
|
|
58
68
|
"",
|
|
59
69
|
"- Keep `vite.config.ts` as the source of truth for `weapp` config, output behavior, and IDE/MCP automation.",
|
|
@@ -71,9 +81,9 @@ function createAgentsGuidelines(templateName) {
|
|
|
71
81
|
"",
|
|
72
82
|
"- Recommend installing shared skills with `npx skills add sonofmagic/skills`.",
|
|
73
83
|
"- In Codex/Claude environments, prefer these skills first when available:",
|
|
74
|
-
" - `$weapp-vite-best-practices` for config, build, subpackage, route,
|
|
84
|
+
" - `$weapp-vite-best-practices` for config, build, subpackage, route, DevTools CLI orchestration, and screenshot/compare command work.",
|
|
75
85
|
" - `$weapp-vite-vue-sfc-best-practices` for `.vue` SFC macros, JSON blocks, and template compatibility.",
|
|
76
|
-
" - `$
|
|
86
|
+
" - `$release-and-changeset-best-practices` for issue delivery, changesets, release decisions, and PR workflow.",
|
|
77
87
|
" - `$docs-and-website-sync` when documentation or AI guidance must be refreshed together with code changes."
|
|
78
88
|
];
|
|
79
89
|
if (supportsWevu(templateName)) lines.push(" - `$wevu-best-practices` for `wevu` runtime lifecycle, state, store, and event contracts.", "", "## Wevu Authoring", "", "- Import runtime APIs from `wevu` in business code.", "- Register lifecycle hooks synchronously in `setup()` and avoid hook registration after `await`.", "- Prefer `ref`, `reactive`, `computed`, and explicit event contracts over large opaque state writes.", "- Use `storeToRefs` when destructuring store state/getters.", "- Treat mini-program runtime constraints as primary; do not assume Vue web-only behavior.");
|
|
@@ -105,12 +115,10 @@ const TEMPLATE_CATALOG = {
|
|
|
105
115
|
"class-variance-authority": "^0.7.1",
|
|
106
116
|
"comment-json": "^4.6.2",
|
|
107
117
|
"estree-walker": "^3.0.3",
|
|
108
|
-
"fs-extra": "^11.3.4",
|
|
109
118
|
"gm-crypto": "^0.1.12",
|
|
110
119
|
"lru-cache": "^11.2.7",
|
|
111
120
|
"magic-string": "^0.30.21",
|
|
112
121
|
"miniprogram-api-typings": "^5.1.2",
|
|
113
|
-
"object-hash": "^3.0.0",
|
|
114
122
|
"oxc-parser": "^0.123.0",
|
|
115
123
|
"oxc-walker": "^0.7.0",
|
|
116
124
|
"pkg-types": "^2.3.0",
|
|
@@ -196,6 +204,37 @@ async function latestVersion(packageName, prefix = "^", fetch = getLatestVersion
|
|
|
196
204
|
}
|
|
197
205
|
}
|
|
198
206
|
//#endregion
|
|
207
|
+
//#region src/skills.ts
|
|
208
|
+
const RECOMMENDED_SKILLS_SOURCE = "sonofmagic/skills";
|
|
209
|
+
const RECOMMENDED_SKILLS_INSTALL_COMMAND = `npx skills add ${RECOMMENDED_SKILLS_SOURCE}`;
|
|
210
|
+
function resolveNpxCommand() {
|
|
211
|
+
return process.platform === "win32" ? "npx.cmd" : "npx";
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* @description 安装推荐的 AI skills。
|
|
215
|
+
*/
|
|
216
|
+
async function installRecommendedSkills(cwd) {
|
|
217
|
+
const command = resolveNpxCommand();
|
|
218
|
+
await new Promise((resolve, reject) => {
|
|
219
|
+
const child = spawn(command, [
|
|
220
|
+
"skills",
|
|
221
|
+
"add",
|
|
222
|
+
RECOMMENDED_SKILLS_SOURCE
|
|
223
|
+
], {
|
|
224
|
+
cwd,
|
|
225
|
+
stdio: "inherit"
|
|
226
|
+
});
|
|
227
|
+
child.on("error", reject);
|
|
228
|
+
child.on("exit", (code) => {
|
|
229
|
+
if (code === 0) {
|
|
230
|
+
resolve();
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
233
|
+
reject(/* @__PURE__ */ new Error(`skills install exited with code ${code ?? "unknown"}`));
|
|
234
|
+
});
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
//#endregion
|
|
199
238
|
//#region src/gitignore.ts
|
|
200
239
|
const DEFAULT_GITIGNORE = `# dependencies
|
|
201
240
|
node_modules
|
|
@@ -333,6 +372,7 @@ async function updateGitIgnore(options) {
|
|
|
333
372
|
//#region src/createProject.ts
|
|
334
373
|
const DIGIT_RE = /\d/;
|
|
335
374
|
const CRLF_RE = /\r\n/g;
|
|
375
|
+
const WINDOWS_VERBATIM_PATH_RE = /^\\\\\?\\/;
|
|
336
376
|
const moduleDir = path.dirname(fileURLToPath(import.meta.url));
|
|
337
377
|
const TEMPLATE_DIR_MAP = {
|
|
338
378
|
[TemplateName.default]: "weapp-vite-template",
|
|
@@ -349,9 +389,12 @@ function resolveWorkspaceTemplateDir(templateName) {
|
|
|
349
389
|
const templateDirName = TEMPLATE_DIR_MAP[templateName];
|
|
350
390
|
return templateDirName ? path.resolve(moduleDir, "../../../templates", templateDirName) : path.resolve(moduleDir, "../../../templates", templateName);
|
|
351
391
|
}
|
|
392
|
+
function normalizeTemplatePath(value) {
|
|
393
|
+
return value.replace(WINDOWS_VERBATIM_PATH_RE, "").split("\\").join("/");
|
|
394
|
+
}
|
|
352
395
|
function normalizeTemplateRelativePath(relativePath) {
|
|
353
396
|
if (!relativePath || relativePath === ".") return "";
|
|
354
|
-
return relativePath
|
|
397
|
+
return normalizeTemplatePath(relativePath);
|
|
355
398
|
}
|
|
356
399
|
async function resolveTemplateDirs(templateName) {
|
|
357
400
|
const packagedTemplateDir = path.resolve(moduleDir, "../templates", templateName);
|
|
@@ -363,7 +406,7 @@ async function resolveTemplateDirs(templateName) {
|
|
|
363
406
|
};
|
|
364
407
|
}
|
|
365
408
|
function shouldSkipTemplateFile(filePath, templateRoot) {
|
|
366
|
-
const relativePath = normalizeTemplateRelativePath(path.relative(templateRoot, filePath));
|
|
409
|
+
const relativePath = normalizeTemplateRelativePath(path.relative(normalizeTemplatePath(templateRoot), normalizeTemplatePath(filePath)));
|
|
367
410
|
if (!relativePath) return false;
|
|
368
411
|
return relativePath === "node_modules" || relativePath.startsWith("node_modules/") || relativePath.includes("/node_modules/") || relativePath === ".weapp-vite" || relativePath.startsWith(".weapp-vite/") || relativePath.includes("/.weapp-vite/") || relativePath === "vite.config.ts.timestamp" || relativePath.endsWith("/vite.config.ts.timestamp") || relativePath === "dist" || relativePath.startsWith("dist/") || relativePath.includes("/dist/") || relativePath === "CHANGELOG.md" || relativePath.endsWith("/CHANGELOG.md") || relativePath === ".turbo" || relativePath.startsWith(".turbo/") || relativePath.includes("/.turbo/") || relativePath === ".DS_Store" || relativePath.endsWith("/.DS_Store");
|
|
369
412
|
}
|
|
@@ -465,7 +508,7 @@ function normalizeTemplateDependencySpecs(pkgJson) {
|
|
|
465
508
|
/**
|
|
466
509
|
* @description 根据模板创建项目
|
|
467
510
|
*/
|
|
468
|
-
async function createProject(targetDir = "", templateName = TemplateName.default) {
|
|
511
|
+
async function createProject(targetDir = "", templateName = TemplateName.default, options = {}) {
|
|
469
512
|
const { preferredTemplateDir, workspaceTemplateDir } = await resolveTemplateDirs(templateName);
|
|
470
513
|
const dotGitignorePath = path.resolve(targetDir, ".gitignore");
|
|
471
514
|
const existingGitignore = await fs.pathExists(dotGitignorePath) ? await fs.readFile(dotGitignorePath, "utf8") : null;
|
|
@@ -494,7 +537,19 @@ async function createProject(targetDir = "", templateName = TemplateName.default
|
|
|
494
537
|
root: targetDir,
|
|
495
538
|
write: true
|
|
496
539
|
});
|
|
540
|
+
if (options.installSkills) {
|
|
541
|
+
logger.info(`🤖 即将安装 AI skills:${RECOMMENDED_SKILLS_INSTALL_COMMAND}`);
|
|
542
|
+
logger.info("如果你更想手动执行,也可以在项目创建后自行运行上面的命令。");
|
|
543
|
+
try {
|
|
544
|
+
await installRecommendedSkills(targetDir);
|
|
545
|
+
logger.log("✨ 已安装推荐的 AI skills!");
|
|
546
|
+
} catch (error) {
|
|
547
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
548
|
+
logger.warn(`安装 AI skills 失败:${message}`);
|
|
549
|
+
logger.warn(`你可以稍后手动执行:${RECOMMENDED_SKILLS_INSTALL_COMMAND}`);
|
|
550
|
+
}
|
|
551
|
+
}
|
|
497
552
|
logger.log("✨ 创建模板成功!");
|
|
498
553
|
}
|
|
499
554
|
//#endregion
|
|
500
|
-
export {
|
|
555
|
+
export { RECOMMENDED_SKILLS_INSTALL_COMMAND as n, TemplateName as r, createProject as t };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-weapp-vite",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.78",
|
|
5
5
|
"description": "create-weapp-vite",
|
|
6
6
|
"author": "ice breaker <1324318532@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -48,10 +48,10 @@
|
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@inquirer/prompts": "^8.3.2",
|
|
51
|
-
"fs-extra": "^11.3.4",
|
|
52
51
|
"pathe": "^2.0.3",
|
|
53
52
|
"pkg-types": "^2.3.0",
|
|
54
|
-
"@weapp-core/logger": "^3.1.1"
|
|
53
|
+
"@weapp-core/logger": "^3.1.1",
|
|
54
|
+
"@weapp-core/shared": "^3.0.3"
|
|
55
55
|
},
|
|
56
56
|
"scripts": {
|
|
57
57
|
"catalog:sync": "node --import tsx scripts/generate-template-catalog.ts",
|
|
@@ -1,4 +1,73 @@
|
|
|
1
1
|
{
|
|
2
|
+
"prettier.enable": false,
|
|
3
|
+
"editor.formatOnSave": false,
|
|
4
|
+
"editor.codeActionsOnSave": {
|
|
5
|
+
"source.fixAll.eslint": "explicit",
|
|
6
|
+
"source.organizeImports": "never"
|
|
7
|
+
},
|
|
8
|
+
"eslint.rules.customizations": [
|
|
9
|
+
{
|
|
10
|
+
"rule": "format/*",
|
|
11
|
+
"severity": "off"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"rule": "*-indent",
|
|
15
|
+
"severity": "off"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"rule": "*-spacing",
|
|
19
|
+
"severity": "off"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"rule": "*-spaces",
|
|
23
|
+
"severity": "off"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"rule": "*-order",
|
|
27
|
+
"severity": "off"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"rule": "*-dangle",
|
|
31
|
+
"severity": "off"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"rule": "*-newline",
|
|
35
|
+
"severity": "off"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"rule": "*quotes",
|
|
39
|
+
"severity": "off"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"rule": "*semi",
|
|
43
|
+
"severity": "off"
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
"eslint.validate": [
|
|
47
|
+
"javascript",
|
|
48
|
+
"javascriptreact",
|
|
49
|
+
"typescript",
|
|
50
|
+
"typescriptreact",
|
|
51
|
+
"vue",
|
|
52
|
+
"html",
|
|
53
|
+
"markdown",
|
|
54
|
+
"json",
|
|
55
|
+
"jsonc",
|
|
56
|
+
"yaml",
|
|
57
|
+
"toml",
|
|
58
|
+
"xml",
|
|
59
|
+
"gql",
|
|
60
|
+
"graphql",
|
|
61
|
+
"astro",
|
|
62
|
+
"css",
|
|
63
|
+
"less",
|
|
64
|
+
"scss",
|
|
65
|
+
"pcss",
|
|
66
|
+
"postcss"
|
|
67
|
+
],
|
|
68
|
+
"css.validate": false,
|
|
69
|
+
"less.validate": false,
|
|
70
|
+
"scss.validate": false,
|
|
2
71
|
"files.associations": {
|
|
3
72
|
"*.wxml": "html",
|
|
4
73
|
"*.wxss": "css"
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { wpi } from '@wevu/api'
|
|
2
|
+
|
|
1
3
|
interface HelloWorldLink {
|
|
2
4
|
text: string
|
|
3
5
|
url: string
|
|
@@ -45,8 +47,8 @@ Component({
|
|
|
45
47
|
}
|
|
46
48
|
|
|
47
49
|
try {
|
|
48
|
-
await
|
|
49
|
-
|
|
50
|
+
await wpi.setClipboardData({ data: url })
|
|
51
|
+
await wpi.showToast({
|
|
50
52
|
title: '链接已复制',
|
|
51
53
|
icon: 'success',
|
|
52
54
|
duration: 1500,
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { wpi } from '@wevu/api'
|
|
2
|
+
|
|
1
3
|
Page({
|
|
2
4
|
data: {
|
|
3
5
|
hello: {
|
|
@@ -21,8 +23,8 @@ Page({
|
|
|
21
23
|
// eslint-disable-next-line no-console
|
|
22
24
|
console.log('on click')
|
|
23
25
|
},
|
|
24
|
-
goToLayouts() {
|
|
25
|
-
|
|
26
|
+
async goToLayouts() {
|
|
27
|
+
await wpi.navigateTo({
|
|
26
28
|
url: '/pages/layouts/index',
|
|
27
29
|
})
|
|
28
30
|
},
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { wpi } from '@wevu/api'
|
|
1
2
|
import { setPageLayout } from 'weapp-vite/runtime'
|
|
2
3
|
|
|
3
4
|
Page({
|
|
@@ -36,7 +37,7 @@ Page({
|
|
|
36
37
|
this.setData({ currentLayout: 'none' })
|
|
37
38
|
setPageLayout(false)
|
|
38
39
|
},
|
|
39
|
-
backHome() {
|
|
40
|
-
|
|
40
|
+
async backHome() {
|
|
41
|
+
await wpi.navigateTo({ url: '/pages/index/index' })
|
|
41
42
|
},
|
|
42
43
|
})
|
|
@@ -1,4 +1,73 @@
|
|
|
1
1
|
{
|
|
2
|
+
"prettier.enable": false,
|
|
3
|
+
"editor.formatOnSave": false,
|
|
4
|
+
"editor.codeActionsOnSave": {
|
|
5
|
+
"source.fixAll.eslint": "explicit",
|
|
6
|
+
"source.organizeImports": "never"
|
|
7
|
+
},
|
|
8
|
+
"eslint.rules.customizations": [
|
|
9
|
+
{
|
|
10
|
+
"rule": "format/*",
|
|
11
|
+
"severity": "off"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"rule": "*-indent",
|
|
15
|
+
"severity": "off"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"rule": "*-spacing",
|
|
19
|
+
"severity": "off"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"rule": "*-spaces",
|
|
23
|
+
"severity": "off"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"rule": "*-order",
|
|
27
|
+
"severity": "off"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"rule": "*-dangle",
|
|
31
|
+
"severity": "off"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"rule": "*-newline",
|
|
35
|
+
"severity": "off"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"rule": "*quotes",
|
|
39
|
+
"severity": "off"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"rule": "*semi",
|
|
43
|
+
"severity": "off"
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
"eslint.validate": [
|
|
47
|
+
"javascript",
|
|
48
|
+
"javascriptreact",
|
|
49
|
+
"typescript",
|
|
50
|
+
"typescriptreact",
|
|
51
|
+
"vue",
|
|
52
|
+
"html",
|
|
53
|
+
"markdown",
|
|
54
|
+
"json",
|
|
55
|
+
"jsonc",
|
|
56
|
+
"yaml",
|
|
57
|
+
"toml",
|
|
58
|
+
"xml",
|
|
59
|
+
"gql",
|
|
60
|
+
"graphql",
|
|
61
|
+
"astro",
|
|
62
|
+
"css",
|
|
63
|
+
"less",
|
|
64
|
+
"scss",
|
|
65
|
+
"pcss",
|
|
66
|
+
"postcss"
|
|
67
|
+
],
|
|
68
|
+
"css.validate": false,
|
|
69
|
+
"less.validate": false,
|
|
70
|
+
"scss.validate": false,
|
|
2
71
|
"files.associations": {
|
|
3
72
|
"*.wxml": "html",
|
|
4
73
|
"*.wxss": "css"
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { wpi } from '@wevu/api'
|
|
2
|
+
|
|
1
3
|
interface HelloWorldLink {
|
|
2
4
|
text: string
|
|
3
5
|
url: string
|
|
@@ -45,8 +47,8 @@ Component({
|
|
|
45
47
|
}
|
|
46
48
|
|
|
47
49
|
try {
|
|
48
|
-
await
|
|
49
|
-
|
|
50
|
+
await wpi.setClipboardData({ data: url })
|
|
51
|
+
await wpi.showToast({
|
|
50
52
|
title: '链接已复制',
|
|
51
53
|
icon: 'success',
|
|
52
54
|
duration: 1500,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { wpi } from '@wevu/api'
|
|
1
2
|
import { setPageLayout } from 'weapp-vite/runtime'
|
|
2
3
|
|
|
3
4
|
Page({
|
|
@@ -36,8 +37,8 @@ Page({
|
|
|
36
37
|
this.setData({ currentLayout: 'none' })
|
|
37
38
|
setPageLayout(false)
|
|
38
39
|
},
|
|
39
|
-
backHome() {
|
|
40
|
-
|
|
40
|
+
async backHome() {
|
|
41
|
+
await wpi.navigateTo({
|
|
41
42
|
url: '/pages/index/index',
|
|
42
43
|
})
|
|
43
44
|
},
|
|
@@ -1,4 +1,73 @@
|
|
|
1
1
|
{
|
|
2
|
+
"prettier.enable": false,
|
|
3
|
+
"editor.formatOnSave": false,
|
|
4
|
+
"editor.codeActionsOnSave": {
|
|
5
|
+
"source.fixAll.eslint": "explicit",
|
|
6
|
+
"source.organizeImports": "never"
|
|
7
|
+
},
|
|
8
|
+
"eslint.rules.customizations": [
|
|
9
|
+
{
|
|
10
|
+
"rule": "format/*",
|
|
11
|
+
"severity": "off"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"rule": "*-indent",
|
|
15
|
+
"severity": "off"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"rule": "*-spacing",
|
|
19
|
+
"severity": "off"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"rule": "*-spaces",
|
|
23
|
+
"severity": "off"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"rule": "*-order",
|
|
27
|
+
"severity": "off"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"rule": "*-dangle",
|
|
31
|
+
"severity": "off"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"rule": "*-newline",
|
|
35
|
+
"severity": "off"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"rule": "*quotes",
|
|
39
|
+
"severity": "off"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"rule": "*semi",
|
|
43
|
+
"severity": "off"
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
"eslint.validate": [
|
|
47
|
+
"javascript",
|
|
48
|
+
"javascriptreact",
|
|
49
|
+
"typescript",
|
|
50
|
+
"typescriptreact",
|
|
51
|
+
"vue",
|
|
52
|
+
"html",
|
|
53
|
+
"markdown",
|
|
54
|
+
"json",
|
|
55
|
+
"jsonc",
|
|
56
|
+
"yaml",
|
|
57
|
+
"toml",
|
|
58
|
+
"xml",
|
|
59
|
+
"gql",
|
|
60
|
+
"graphql",
|
|
61
|
+
"astro",
|
|
62
|
+
"css",
|
|
63
|
+
"less",
|
|
64
|
+
"scss",
|
|
65
|
+
"pcss",
|
|
66
|
+
"postcss"
|
|
67
|
+
],
|
|
68
|
+
"css.validate": false,
|
|
69
|
+
"less.validate": false,
|
|
70
|
+
"scss.validate": false,
|
|
2
71
|
"files.associations": {
|
|
3
72
|
"*.wxml": "html",
|
|
4
73
|
"*.wxss": "css"
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { wpi } from '@wevu/api'
|
|
2
|
+
|
|
1
3
|
interface HelloWorldLink {
|
|
2
4
|
text: string
|
|
3
5
|
url: string
|
|
@@ -45,8 +47,8 @@ Component({
|
|
|
45
47
|
}
|
|
46
48
|
|
|
47
49
|
try {
|
|
48
|
-
await
|
|
49
|
-
|
|
50
|
+
await wpi.setClipboardData({ data: url })
|
|
51
|
+
await wpi.showToast({
|
|
50
52
|
title: '链接已复制',
|
|
51
53
|
icon: 'success',
|
|
52
54
|
duration: 1500,
|