miaoda-game-devkit 0.1.0 → 0.1.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/README.md +2 -2
- package/bin/miaoda-game-lint.js +1 -1
- package/dist/cli/lint.js +1 -1
- package/dist/lint/contracts.config.mjs +34 -0
- package/dist/lint/gameplay-contract.contract.mjs +849 -0
- package/dist/lint/phaser-headless.contract.mjs +1098 -0
- package/dist/lint/phaser-text-assertions.contract.mjs +30 -0
- package/dist/lint/resource-import-plugin.contract.mjs +97 -0
- package/dist/lint/vitest-config.contract.mjs +113 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
开发工具包自行维护工具版本,并从自身依赖中解析可执行文件,使用方不需要重复声明
|
|
34
34
|
Biome、Oxlint 或 tsgo。仓库中保留稳定的命令入口,因此 `dist/` 尚未生成时,pnpm
|
|
35
35
|
也能正确建立命令链接;工作区开发状态下由 Nx 在模板检查前构建开发工具包,发布包则
|
|
36
|
-
直接携带运行时 `dist
|
|
37
|
-
|
|
36
|
+
直接携带运行时 `dist/`。开发工具包内部的 `*.test.*` 测试不会进入 npm 包;随包运行的
|
|
37
|
+
通用契约测试以 `*.contract.mjs` 形式发布。
|
|
38
38
|
|
|
39
39
|
monorepo 中的模板可以放置只包含 `extends: ["miaoda-game-devkit/biome"]` 的薄配置,
|
|
40
40
|
用于让 Biome 从模板 package.json 判断依赖声明。规则本身仍由本开发工具包维护;生成后的
|
package/bin/miaoda-game-lint.js
CHANGED
package/dist/cli/lint.js
CHANGED
|
@@ -43,7 +43,7 @@ async function runContracts() {
|
|
|
43
43
|
"vitest",
|
|
44
44
|
"vitest",
|
|
45
45
|
"vitest",
|
|
46
|
-
["run", "--config", (0, import_node_path.join)(devkitRoot, "dist/lint/
|
|
46
|
+
["run", "--config", (0, import_node_path.join)(devkitRoot, "dist/lint/contracts.config.mjs")]
|
|
47
47
|
);
|
|
48
48
|
}
|
|
49
49
|
async function runAllChecks() {
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// src/lint/vitest.config.ts
|
|
2
|
+
import { dirname, resolve } from "path";
|
|
3
|
+
import { fileURLToPath } from "url";
|
|
4
|
+
import { defineConfig } from "vitest/config";
|
|
5
|
+
var phaserPackageRoot = dirname(fileURLToPath(import.meta.resolve("phaser/package.json")));
|
|
6
|
+
var vitest_config_default = defineConfig({
|
|
7
|
+
resolve: {
|
|
8
|
+
alias: {
|
|
9
|
+
phaser: resolve(phaserPackageRoot, "dist/phaser.js")
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
test: {
|
|
13
|
+
server: {
|
|
14
|
+
deps: {
|
|
15
|
+
inline: [/miaoda-game-/]
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
environment: "jsdom",
|
|
19
|
+
environmentOptions: {
|
|
20
|
+
jsdom: {
|
|
21
|
+
url: "http://localhost/"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
include: [resolve(import.meta.dirname, "*.contract.mjs")],
|
|
25
|
+
// Published contracts live under the consumer's node_modules directory.
|
|
26
|
+
exclude: [],
|
|
27
|
+
setupFiles: [resolve(import.meta.dirname, "setup.mjs")],
|
|
28
|
+
restoreMocks: true,
|
|
29
|
+
clearMocks: true
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
export {
|
|
33
|
+
vitest_config_default as default
|
|
34
|
+
};
|