@plumix/core 0.1.2 → 0.1.4
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/admin-bar/i18n.d.ts +6 -0
- package/dist/admin-bar/i18n.d.ts.map +1 -1
- package/dist/admin-bar/i18n.js +1 -1
- package/dist/admin-bar/i18n.js.map +1 -1
- package/dist/auth/authenticator.d.ts +20 -0
- package/dist/auth/authenticator.d.ts.map +1 -1
- package/dist/auth/authenticator.js +21 -0
- package/dist/auth/authenticator.js.map +1 -1
- package/dist/cli/worker-codegen.d.ts.map +1 -1
- package/dist/cli/worker-codegen.js +6 -0
- package/dist/cli/worker-codegen.js.map +1 -1
- package/dist/config.d.ts +9 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +1 -0
- package/dist/config.js.map +1 -1
- package/dist/context/app.d.ts +8 -0
- package/dist/context/app.d.ts.map +1 -1
- package/dist/context/app.js +1 -0
- package/dist/context/app.js.map +1 -1
- package/dist/debug-bar/collect.d.ts +13 -0
- package/dist/debug-bar/collect.d.ts.map +1 -0
- package/dist/debug-bar/collect.js +36 -0
- package/dist/debug-bar/collect.js.map +1 -0
- package/dist/debug-bar/component.d.ts +13 -0
- package/dist/debug-bar/component.d.ts.map +1 -0
- package/dist/debug-bar/component.js +23 -0
- package/dist/debug-bar/component.js.map +1 -0
- package/dist/debug-bar/config.d.ts +17 -0
- package/dist/debug-bar/config.d.ts.map +1 -0
- package/dist/debug-bar/config.js +13 -0
- package/dist/debug-bar/config.js.map +1 -0
- package/dist/debug-bar/core-panels.d.ts +8 -0
- package/dist/debug-bar/core-panels.d.ts.map +1 -0
- package/dist/debug-bar/core-panels.js +10 -0
- package/dist/debug-bar/core-panels.js.map +1 -0
- package/dist/debug-bar/panels/request.d.ts +7 -0
- package/dist/debug-bar/panels/request.d.ts.map +1 -0
- package/dist/debug-bar/panels/request.js +22 -0
- package/dist/debug-bar/panels/request.js.map +1 -0
- package/dist/debug-bar/primitives.d.ts +15 -0
- package/dist/debug-bar/primitives.d.ts.map +1 -0
- package/dist/debug-bar/primitives.js +5 -0
- package/dist/debug-bar/primitives.js.map +1 -0
- package/dist/debug-bar/styles.d.ts +2 -0
- package/dist/debug-bar/styles.d.ts.map +1 -0
- package/dist/debug-bar/styles.js +155 -0
- package/dist/debug-bar/styles.js.map +1 -0
- package/dist/debug-bar/types.d.ts +22 -0
- package/dist/debug-bar/types.d.ts.map +1 -0
- package/dist/debug-bar/types.js +1 -0
- package/dist/debug-bar/types.js.map +1 -0
- package/dist/route/render/render-template.d.ts.map +1 -1
- package/dist/route/render/render-template.js +9 -1
- package/dist/route/render/render-template.js.map +1 -1
- package/dist/rpc/procedures/auth/session.d.ts.map +1 -1
- package/dist/rpc/procedures/auth/session.js +18 -22
- package/dist/rpc/procedures/auth/session.js.map +1 -1
- package/dist/runtime/adapter.d.ts +10 -0
- package/dist/runtime/adapter.d.ts.map +1 -1
- package/dist/runtime/app.d.ts.map +1 -1
- package/dist/runtime/app.js +7 -0
- package/dist/runtime/app.js.map +1 -1
- package/dist/runtime/dispatcher.d.ts.map +1 -1
- package/dist/runtime/dispatcher.js +19 -0
- package/dist/runtime/dispatcher.js.map +1 -1
- package/dist/runtime/load-user-for-public-request.d.ts.map +1 -1
- package/dist/runtime/load-user-for-public-request.js +5 -2
- package/dist/runtime/load-user-for-public-request.js.map +1 -1
- package/dist/test/playwright/playwright-config.d.ts +22 -13
- package/dist/test/playwright/playwright-config.d.ts.map +1 -1
- package/dist/test/playwright/playwright-config.js +9 -7
- package/dist/test/playwright/playwright-config.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load-user-for-public-request.js","sourceRoot":"","sources":["../../src/runtime/load-user-for-public-request.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"load-user-for-public-request.js","sourceRoot":"","sources":["../../src/runtime/load-user-for-public-request.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAC5C,GAAe;IAEf,0EAA0E;IAC1E,6EAA6E;IAC7E,iDAAiD;IACjD,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,aAAa,EAAE,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;QACvD,OAAO,GAAG,CAAC;IACb,CAAC;IACD,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,aAAa,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC;IACzE,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;QACpB,OAAO,GAAG,CAAC;IACb,CAAC;IACD,OAAO,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,WAAW,IAAI,IAAI,CAAC,CAAC;AAChE,CAAC"}
|
|
@@ -21,12 +21,21 @@ export interface PlumixE2EConfigOptions {
|
|
|
21
21
|
/**
|
|
22
22
|
* Optional path to a playground workspace (relative to the playwright
|
|
23
23
|
* config file). When set, `definePlumixE2EConfig` bakes the standard
|
|
24
|
-
* worker-driven webServer setup: wipe `.wrangler/state` →
|
|
25
|
-
* migrations →
|
|
26
|
-
* `
|
|
27
|
-
*
|
|
24
|
+
* worker-driven webServer setup: wipe `.wrangler/state` → generate
|
|
25
|
+
* migrations → apply them (unless `applyMigrations: false`) → run
|
|
26
|
+
* `plumix dev`.
|
|
27
|
+
* Also auto-wires `globalSetup.ts` and `storageState.json` by convention.
|
|
28
|
+
* Mutually exclusive with an explicit `webServerCommand`.
|
|
28
29
|
*/
|
|
29
30
|
readonly playground?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Whether the baked command applies the generated migrations to the
|
|
33
|
+
* playground's database before starting the worker. Defaults to `true`.
|
|
34
|
+
* Set `false` when there is no database to migrate up front — e.g. one
|
|
35
|
+
* created per session at runtime, which applies its own schema. Migrations
|
|
36
|
+
* are still generated either way. Only meaningful when `playground` is set.
|
|
37
|
+
*/
|
|
38
|
+
readonly applyMigrations?: boolean;
|
|
30
39
|
/** Directory passed through to playwright's `testDir`. Defaults to `'.'`. */
|
|
31
40
|
readonly testDir?: string;
|
|
32
41
|
/**
|
|
@@ -48,11 +57,11 @@ export interface PlumixE2EConfigOptions {
|
|
|
48
57
|
*/
|
|
49
58
|
readonly webServerPort?: number;
|
|
50
59
|
/**
|
|
51
|
-
* Optional shell step to run inside the baked playground command,
|
|
52
|
-
*
|
|
53
|
-
* Use for fixture seeds that need to live in
|
|
54
|
-
* comes up (e.g. `wrangler d1 execute <db> --local
|
|
55
|
-
* Only meaningful when `playground` is set.
|
|
60
|
+
* Optional shell step to run inside the baked playground command, after
|
|
61
|
+
* migrations are generated and applied, and before `plumix dev` starts.
|
|
62
|
+
* Use for fixture seeds that need to live in the database before the
|
|
63
|
+
* worker comes up (e.g. `wrangler d1 execute <db> --local
|
|
64
|
+
* --file=seed.sql`). Only meaningful when `playground` is set.
|
|
56
65
|
*/
|
|
57
66
|
readonly extraSetup?: string;
|
|
58
67
|
/**
|
|
@@ -72,10 +81,10 @@ export interface PlumixE2EConfigOptions {
|
|
|
72
81
|
* the build/preview command — as parameters.
|
|
73
82
|
*
|
|
74
83
|
* When `playground` is set, the helper bakes a worker-driven webServer
|
|
75
|
-
* (wipe state →
|
|
76
|
-
* `globalSetup.ts` / `storageState.json`
|
|
77
|
-
* worker-driven plugin e2e pattern. Otherwise the
|
|
78
|
-
* `webServerCommand` directly.
|
|
84
|
+
* (wipe state → generate migrations → apply them unless
|
|
85
|
+
* `applyMigrations: false` → `plumix dev`) and wires the `globalSetup.ts` / `storageState.json`
|
|
86
|
+
* convention used by the worker-driven plugin e2e pattern. Otherwise the
|
|
87
|
+
* caller supplies `webServerCommand` directly.
|
|
79
88
|
*
|
|
80
89
|
* Used by `packages/admin/playwright.config.ts` and each
|
|
81
90
|
* `packages/plugins/<plugin>/e2e/playwright.config.ts`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playwright-config.d.ts","sourceRoot":"","sources":["../../../src/test/playwright/playwright-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAG7D,MAAM,WAAW,sBAAsB;IACrC;;;;;;;OAOG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB;;;;;;;OAOG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC
|
|
1
|
+
{"version":3,"file":"playwright-config.d.ts","sourceRoot":"","sources":["../../../src/test/playwright/playwright-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAG7D,MAAM,WAAW,sBAAsB;IACrC;;;;;;;OAOG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB;;;;;;;OAOG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC;;;;;;;;OAQG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B;;;;;;OAMG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC;IACnC,6EAA6E;IAC7E,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B;;;OAGG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B;;;OAGG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC;;;;;;OAMG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC;;;;;;OAMG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B;;;;;;OAMG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC;CACrC;AAgCD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,sBAAsB,GAC9B,oBAAoB,CA2EtB"}
|
|
@@ -2,13 +2,15 @@ import { defineConfig, devices } from "@playwright/test";
|
|
|
2
2
|
const ADMIN_BASE = "/_plumix/admin";
|
|
3
3
|
const DEFAULT_BINDING = "DB";
|
|
4
4
|
const DEFAULT_PORT = 5173;
|
|
5
|
-
function bakePlaygroundCommand(playground, port, inspectorPort, extraSetup) {
|
|
5
|
+
function bakePlaygroundCommand(playground, port, inspectorPort, extraSetup, applyMigrations) {
|
|
6
6
|
const steps = [
|
|
7
7
|
`cd ${playground}`,
|
|
8
8
|
"rm -rf .wrangler/state",
|
|
9
9
|
"pnpm exec plumix migrate generate",
|
|
10
|
-
`pnpm exec wrangler d1 migrations apply ${DEFAULT_BINDING} --local`,
|
|
11
10
|
];
|
|
11
|
+
if (applyMigrations) {
|
|
12
|
+
steps.push(`pnpm exec wrangler d1 migrations apply ${DEFAULT_BINDING} --local`);
|
|
13
|
+
}
|
|
12
14
|
if (extraSetup)
|
|
13
15
|
steps.push(extraSetup);
|
|
14
16
|
const devFlags = [`--port ${String(port)}`];
|
|
@@ -26,10 +28,10 @@ function bakePlaygroundCommand(playground, port, inspectorPort, extraSetup) {
|
|
|
26
28
|
* the build/preview command — as parameters.
|
|
27
29
|
*
|
|
28
30
|
* When `playground` is set, the helper bakes a worker-driven webServer
|
|
29
|
-
* (wipe state →
|
|
30
|
-
* `globalSetup.ts` / `storageState.json`
|
|
31
|
-
* worker-driven plugin e2e pattern. Otherwise the
|
|
32
|
-
* `webServerCommand` directly.
|
|
31
|
+
* (wipe state → generate migrations → apply them unless
|
|
32
|
+
* `applyMigrations: false` → `plumix dev`) and wires the `globalSetup.ts` / `storageState.json`
|
|
33
|
+
* convention used by the worker-driven plugin e2e pattern. Otherwise the
|
|
34
|
+
* caller supplies `webServerCommand` directly.
|
|
33
35
|
*
|
|
34
36
|
* Used by `packages/admin/playwright.config.ts` and each
|
|
35
37
|
* `packages/plugins/<plugin>/e2e/playwright.config.ts`.
|
|
@@ -53,7 +55,7 @@ export function definePlumixE2EConfig(options) {
|
|
|
53
55
|
const seedAdmin = isPlayground && options.seedAdminSession !== false;
|
|
54
56
|
const webServerCommand = options.webServerCommand ??
|
|
55
57
|
(options.playground !== undefined
|
|
56
|
-
? bakePlaygroundCommand(options.playground, port, options.inspectorPort, options.extraSetup)
|
|
58
|
+
? bakePlaygroundCommand(options.playground, port, options.inspectorPort, options.extraSetup, options.applyMigrations !== false)
|
|
57
59
|
: "");
|
|
58
60
|
return defineConfig({
|
|
59
61
|
testDir: options.testDir ?? ".",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playwright-config.js","sourceRoot":"","sources":["../../../src/test/playwright/playwright-config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"playwright-config.js","sourceRoot":"","sources":["../../../src/test/playwright/playwright-config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AA6EzD,MAAM,UAAU,GAAG,gBAAgB,CAAC;AACpC,MAAM,eAAe,GAAG,IAAI,CAAC;AAC7B,MAAM,YAAY,GAAG,IAAI,CAAC;AAE1B,SAAS,qBAAqB,CAC5B,UAAkB,EAClB,IAAY,EACZ,aAAiC,EACjC,UAA8B,EAC9B,eAAwB;IAExB,MAAM,KAAK,GAAG;QACZ,MAAM,UAAU,EAAE;QAClB,wBAAwB;QACxB,mCAAmC;KACpC,CAAC;IACF,IAAI,eAAe,EAAE,CAAC;QACpB,KAAK,CAAC,IAAI,CACR,0CAA0C,eAAe,UAAU,CACpE,CAAC;IACJ,CAAC;IACD,IAAI,UAAU;QAAE,KAAK,CAAC,IAAI,CAAC,UAAU,C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C,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,EAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC,EAAE,EAAE,CAAC;QACvE,SAAS,EAAE;YACT,OAAO,EAAE,gBAAgB;YACzB,GAAG,CAAC,OAAO,CAAC,aAAa,KAAK,SAAS;gBACrC,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,aAAa,EAAE;gBACjC,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC;YACrB,mBAAmB,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;YACpC,MAAM,EAAE,MAAM;YACd,MAAM,EAAE,MAAM;YACd,OAAO,EAAE,OAAO;SACjB;KACF,CAAC,CAAC;AACL,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plumix/core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Plumix core: runtime, auth, data model, and plugin system",
|
|
6
6
|
"license": "MIT",
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
"drizzle-valibot": "^0.4.2",
|
|
98
98
|
"fishery": "^2.4.0",
|
|
99
99
|
"valibot": "^1.4.2",
|
|
100
|
-
"@plumix/blocks": "0.1.
|
|
100
|
+
"@plumix/blocks": "0.1.4"
|
|
101
101
|
},
|
|
102
102
|
"peerDependencies": {
|
|
103
103
|
"@playwright/test": "^1.61.1",
|
|
@@ -144,7 +144,7 @@
|
|
|
144
144
|
"i18n:compile": "plumix-compile-catalogs --dts",
|
|
145
145
|
"lint": "eslint",
|
|
146
146
|
"publint": "publint",
|
|
147
|
-
"test": "vitest run",
|
|
147
|
+
"test:unit": "vitest run",
|
|
148
148
|
"typecheck": "tsc --noEmit --emitDeclarationOnly false"
|
|
149
149
|
}
|
|
150
150
|
}
|