create-windy 0.2.0 → 0.2.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/dist/cli.js +9 -4
- package/package.json +1 -1
- package/template/.windy-template.json +2 -2
- package/template/AGENTS.md +1 -1
- package/template/apps/server/src/request-restriction.ts +8 -5
- package/template/apps/server/src/system/drizzle-system.ts +2 -0
- package/template/apps/server/src/system/routes.test.ts +6 -1
- package/template/packages/database/src/schema/governance.ts +4 -0
- package/template/packages/database/src/schema.test.ts +1 -0
- package/template/packages/modules/src/system-features.ts +2 -0
- package/template/packages/modules/src/system-module-catalog.test.ts +2 -0
package/dist/cli.js
CHANGED
|
@@ -697,7 +697,7 @@ var helpText = `create-windy <项目名> [选项]
|
|
|
697
697
|
选项:
|
|
698
698
|
--profile private-enterprise 单组织、单租户、私有部署 profile
|
|
699
699
|
--skip-install 只生成文件,不执行 bun install
|
|
700
|
-
--verify 安装后执行 typecheck、test 和 build
|
|
700
|
+
--verify 安装后执行 lint(若有)、typecheck、test 和 build
|
|
701
701
|
--keep-on-error 失败时保留新生成目录用于诊断
|
|
702
702
|
--module <key> 增加模块,可重复使用
|
|
703
703
|
--all-modules 选择目录中的全部模块
|
|
@@ -735,11 +735,13 @@ async function runCommand(command, args, cwd) {
|
|
|
735
735
|
});
|
|
736
736
|
});
|
|
737
737
|
}
|
|
738
|
-
async function installAndVerify(targetDirectory, install, verify, execute = runCommand) {
|
|
738
|
+
async function installAndVerify(targetDirectory, install, verify, includeOxc, execute = runCommand) {
|
|
739
739
|
if (install || verify)
|
|
740
740
|
await execute("bun", ["install"], targetDirectory);
|
|
741
741
|
if (!verify)
|
|
742
742
|
return;
|
|
743
|
+
if (includeOxc)
|
|
744
|
+
await execute("bun", ["run", "lint"], targetDirectory);
|
|
743
745
|
await execute("bun", ["run", "typecheck"], targetDirectory);
|
|
744
746
|
await execute("bun", ["run", "test"], targetDirectory);
|
|
745
747
|
await execute("bun", ["run", "build"], targetDirectory);
|
|
@@ -1828,7 +1830,7 @@ async function createProject(options, dependencies = {}) {
|
|
|
1828
1830
|
stage = "检查生成物";
|
|
1829
1831
|
await inspect(options.targetDirectory);
|
|
1830
1832
|
stage = "安装与验证";
|
|
1831
|
-
await installAndVerify(options.targetDirectory, options.install, options.verify, dependencies.commandExecutor);
|
|
1833
|
+
await installAndVerify(options.targetDirectory, options.install, options.verify, options.includeOxc, dependencies.commandExecutor);
|
|
1832
1834
|
} catch (error) {
|
|
1833
1835
|
await rollbackFailedTarget(options, targetState);
|
|
1834
1836
|
throw stageError(stage, error);
|
|
@@ -3741,6 +3743,7 @@ async function restoreUpdateState(projectDirectory, state) {
|
|
|
3741
3743
|
await copyFile2(backup, target);
|
|
3742
3744
|
}
|
|
3743
3745
|
await rm5(join8(projectDirectory, updateStatePath), { force: true });
|
|
3746
|
+
await rm5(state.backupDirectory, { recursive: true, force: true });
|
|
3744
3747
|
}
|
|
3745
3748
|
async function clearUpdateState(projectDirectory) {
|
|
3746
3749
|
await rm5(join8(projectDirectory, updateStatePath), { force: true });
|
|
@@ -3826,7 +3829,9 @@ async function diagnoseProject(projectDirectory, repair = false) {
|
|
|
3826
3829
|
// src/update/recipes.ts
|
|
3827
3830
|
var recipes = [
|
|
3828
3831
|
{ id: "starter-0.1.1-to-0.1.2", from: "0.1.1", to: "0.1.2" },
|
|
3829
|
-
{ id: "starter-0.1.2-to-0.2.0", from: "0.1.2", to: "0.2.0" }
|
|
3832
|
+
{ id: "starter-0.1.2-to-0.2.0", from: "0.1.2", to: "0.2.0" },
|
|
3833
|
+
{ id: "starter-0.2.0-to-0.2.1", from: "0.2.0", to: "0.2.1" },
|
|
3834
|
+
{ id: "starter-0.2.1-to-0.2.2", from: "0.2.1", to: "0.2.2" }
|
|
3830
3835
|
];
|
|
3831
3836
|
function resolveRecipeChain(sourceVersion, targetVersion) {
|
|
3832
3837
|
if (sourceVersion === targetVersion)
|
package/package.json
CHANGED
package/template/AGENTS.md
CHANGED
|
@@ -35,6 +35,6 @@
|
|
|
35
35
|
|
|
36
36
|
- `bun run dev:web`:启动 Web 开发服务。
|
|
37
37
|
- `bun run dev:server`:启动 Server 开发服务。
|
|
38
|
-
- `bun run typecheck`、`bun run test`、`bun run build
|
|
38
|
+
- `bun run lint`、`bun run typecheck`、`bun run test`、`bun run build`:执行基础验证;未选择 Oxc 时没有 lint 脚本。
|
|
39
39
|
- `docs/README.md`:平台架构、模块接入和运维文档入口。
|
|
40
40
|
- `.windy/generation.json`:本次生成器版本、所选模块和选项记录。
|
|
@@ -8,12 +8,15 @@ import {
|
|
|
8
8
|
} from "./license/restriction.js";
|
|
9
9
|
// @windy-module system.license end
|
|
10
10
|
|
|
11
|
+
interface RequestRestrictionRuntime {
|
|
12
|
+
readonly __requestRestrictionRuntime?: never;
|
|
13
|
+
// @windy-module system.license begin
|
|
14
|
+
recordDecisions(decisions: GuardDecision[]): void;
|
|
15
|
+
// @windy-module system.license end
|
|
16
|
+
}
|
|
17
|
+
|
|
11
18
|
export function restrictedRequestResponse(
|
|
12
|
-
runtime:
|
|
13
|
-
// @windy-module system.license begin
|
|
14
|
-
recordDecisions(decisions: GuardDecision[]): void;
|
|
15
|
-
// @windy-module system.license end
|
|
16
|
-
},
|
|
19
|
+
runtime: RequestRestrictionRuntime,
|
|
17
20
|
context: RequestGuardContext,
|
|
18
21
|
request: Request,
|
|
19
22
|
): Response | undefined {
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { describe, expect, test } from "bun:test";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
// @windy-module system.license begin
|
|
4
|
+
entitlementKey,
|
|
5
|
+
// @windy-module system.license end
|
|
6
|
+
type FeatureFlagDefinition,
|
|
7
|
+
} from "@windy/shared";
|
|
3
8
|
import { createFoundationSnapshot } from "../foundation.js";
|
|
4
9
|
import { createServerRuntime, type AuditEventWriter } from "../runtime.js";
|
|
5
10
|
import { FakeRouteApp } from "./route-test-app.js";
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
// @windy-module system.license begin
|
|
1
2
|
import { sql } from "drizzle-orm";
|
|
3
|
+
// @windy-module system.license end
|
|
2
4
|
import {
|
|
3
5
|
boolean,
|
|
4
6
|
index,
|
|
@@ -6,7 +8,9 @@ import {
|
|
|
6
8
|
pgTable,
|
|
7
9
|
text,
|
|
8
10
|
timestamp,
|
|
11
|
+
// @windy-module system.license begin
|
|
9
12
|
uniqueIndex,
|
|
13
|
+
// @windy-module system.license end
|
|
10
14
|
varchar,
|
|
11
15
|
} from "drizzle-orm/pg-core";
|
|
12
16
|
import { auditColumns, idColumn, statusColumn } from "./common.js";
|
|
@@ -48,6 +48,7 @@ import {
|
|
|
48
48
|
|
|
49
49
|
describe("database schema", () => {
|
|
50
50
|
test("feature_flags 保持完整审计和软删除字段", () => {
|
|
51
|
+
expect(getTableConfig(featureFlags).name).toBe("feature_flags");
|
|
51
52
|
expect("createdAt" in featureFlags).toBe(true);
|
|
52
53
|
expect("createdBy" in featureFlags).toBe(true);
|
|
53
54
|
expect("updatedAt" in featureFlags).toBe(true);
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { featureKey, licenseVersionKey } from "@windy/shared";
|
|
2
2
|
import type { ModuleManifest } from "./manifest.js";
|
|
3
3
|
|
|
4
|
+
// @windy-module system.scheduler begin
|
|
4
5
|
const standardAndAdvanced = ["standard", "advanced"].map(licenseVersionKey);
|
|
6
|
+
// @windy-module system.scheduler end
|
|
5
7
|
const advancedOnly = [licenseVersionKey("advanced")];
|
|
6
8
|
|
|
7
9
|
export const systemFeatures: ModuleManifest["features"] = [
|
|
@@ -2,7 +2,9 @@ import { describe, expect, test } from "bun:test";
|
|
|
2
2
|
import { validateModuleComposition } from "./composition.js";
|
|
3
3
|
import { composeModuleMenus } from "./menu-composition.js";
|
|
4
4
|
import {
|
|
5
|
+
// @windy-module system.data-governance begin
|
|
5
6
|
systemModuleManifest,
|
|
7
|
+
// @windy-module system.data-governance end
|
|
6
8
|
systemModuleManifests,
|
|
7
9
|
} from "./system-module-catalog.js";
|
|
8
10
|
import { systemFoundationModule } from "./system-modules.js";
|