@stardeck-customer-apps/compose 0.1.0

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.
@@ -0,0 +1,24 @@
1
+ /**
2
+ * The single implementation of the Module enablement rule.
3
+ *
4
+ * Two call sites must stay in lockstep with this function until PR C makes the
5
+ * emitted registry import it directly (plan D6 (a)):
6
+ *
7
+ * 1. the `isModuleEnabled` body emitted into `apps/web/src/modules.gen.ts` by
8
+ * `emitModulesGenTs` (`server/module-rail/composition-artifacts.ts`), which
9
+ * is what a deployed app evaluates at runtime;
10
+ * 2. `reconcileCompositionArtifacts`, which decides at compose time which
11
+ * Modules produce registry entries, contributions, i18n, init, data-store
12
+ * bindings and route/endpoint stubs.
13
+ *
14
+ * `modules-gen-runtime.test.ts` executes the emitted body against this function
15
+ * over the same truth table, so a change to one without the other goes red.
16
+ *
17
+ * Semantics are deliberately exactly the emitted body's — no trimming, no
18
+ * rejection of unknown names. Both would change behaviour for already-deployed
19
+ * apps; unknown-name rejection belongs to the writers (the Modules PATCH route,
20
+ * project duplication, the compose CLI), not to this reader.
21
+ */
22
+ declare function isModuleEnabledByList(raw: string | undefined, name: string, kindOf: (name: string) => string | undefined): boolean;
23
+
24
+ export { isModuleEnabledByList };
@@ -0,0 +1,24 @@
1
+ /**
2
+ * The single implementation of the Module enablement rule.
3
+ *
4
+ * Two call sites must stay in lockstep with this function until PR C makes the
5
+ * emitted registry import it directly (plan D6 (a)):
6
+ *
7
+ * 1. the `isModuleEnabled` body emitted into `apps/web/src/modules.gen.ts` by
8
+ * `emitModulesGenTs` (`server/module-rail/composition-artifacts.ts`), which
9
+ * is what a deployed app evaluates at runtime;
10
+ * 2. `reconcileCompositionArtifacts`, which decides at compose time which
11
+ * Modules produce registry entries, contributions, i18n, init, data-store
12
+ * bindings and route/endpoint stubs.
13
+ *
14
+ * `modules-gen-runtime.test.ts` executes the emitted body against this function
15
+ * over the same truth table, so a change to one without the other goes red.
16
+ *
17
+ * Semantics are deliberately exactly the emitted body's — no trimming, no
18
+ * rejection of unknown names. Both would change behaviour for already-deployed
19
+ * apps; unknown-name rejection belongs to the writers (the Modules PATCH route,
20
+ * project duplication, the compose CLI), not to this reader.
21
+ */
22
+ declare function isModuleEnabledByList(raw: string | undefined, name: string, kindOf: (name: string) => string | undefined): boolean;
23
+
24
+ export { isModuleEnabledByList };
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/runtime.ts
21
+ var runtime_exports = {};
22
+ __export(runtime_exports, {
23
+ isModuleEnabledByList: () => isModuleEnabledByList
24
+ });
25
+ module.exports = __toCommonJS(runtime_exports);
26
+
27
+ // ../../packages/lib/src/shared/module-enablement.ts
28
+ function isModuleEnabledByList(raw, name, kindOf) {
29
+ if (!raw) return true;
30
+ const kind = kindOf(name);
31
+ if (kind != null && kind !== "feature") return true;
32
+ return raw.split(",").includes(name);
33
+ }
34
+ // Annotate the CommonJS export names for ESM import in node:
35
+ 0 && (module.exports = {
36
+ isModuleEnabledByList
37
+ });
@@ -0,0 +1,10 @@
1
+ // ../../packages/lib/src/shared/module-enablement.ts
2
+ function isModuleEnabledByList(raw, name, kindOf) {
3
+ if (!raw) return true;
4
+ const kind = kindOf(name);
5
+ if (kind != null && kind !== "feature") return true;
6
+ return raw.split(",").includes(name);
7
+ }
8
+ export {
9
+ isModuleEnabledByList
10
+ };
package/package.json ADDED
@@ -0,0 +1,65 @@
1
+ {
2
+ "name": "@stardeck-customer-apps/compose",
3
+ "version": "0.1.0",
4
+ "description": "Regenerates a Stardeck app's Module-rail artifacts — the five src/*.gen.ts registries and every route/endpoint stub — from src/modules/*/module.json",
5
+ "main": "dist/index.js",
6
+ "module": "dist/index.mjs",
7
+ "types": "dist/index.d.ts",
8
+ "bin": {
9
+ "stardeck-compose": "./dist/cli.js"
10
+ },
11
+ "publishConfig": {
12
+ "registry": "https://registry.npmjs.org/",
13
+ "access": "public"
14
+ },
15
+ "files": [
16
+ "dist",
17
+ "SKILL.md"
18
+ ],
19
+ "exports": {
20
+ ".": {
21
+ "types": "./dist/index.d.ts",
22
+ "import": "./dist/index.mjs",
23
+ "require": "./dist/index.js",
24
+ "default": "./dist/index.mjs"
25
+ },
26
+ "./runtime": {
27
+ "types": "./dist/runtime.d.ts",
28
+ "import": "./dist/runtime.mjs",
29
+ "require": "./dist/runtime.js",
30
+ "default": "./dist/runtime.mjs"
31
+ }
32
+ },
33
+ "scripts": {
34
+ "build": "rm -rf dist && tsup",
35
+ "dev": "tsup --watch",
36
+ "format": "prettier --write . && eslint . --fix",
37
+ "typecheck": "tsc -p tsconfig.test.json",
38
+ "lint": "eslint src/",
39
+ "test": "vitest run",
40
+ "test:watch": "vitest"
41
+ },
42
+ "keywords": [
43
+ "stardeck",
44
+ "modules",
45
+ "compose",
46
+ "codegen"
47
+ ],
48
+ "author": "Stardeck",
49
+ "license": "MIT",
50
+ "dependencies": {
51
+ "zod": "^4.3.5"
52
+ },
53
+ "peerDependencies": {
54
+ "typescript": ">=5.0.0"
55
+ },
56
+ "devDependencies": {
57
+ "@eslint/js": "^9.0.0",
58
+ "@stardeck-customer-apps/tsconfig": "*",
59
+ "@types/node": "^24.10.1",
60
+ "tsup": "^8.0.0",
61
+ "typescript": "^5.0.0",
62
+ "typescript-eslint": "^8.0.0",
63
+ "vitest": "^3.2.4"
64
+ }
65
+ }