@apex-stack/core 0.1.15 → 0.1.16
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/{build-MFLFMGGZ.js → build-UDFLTWY5.js} +1 -1
- package/dist/{chunk-D3VZDJ3R.js → chunk-YO4UXWIY.js} +7 -4
- package/dist/cli.js +3 -3
- package/dist/{dev-FS4VVUX2.js → dev-PQRMJ7Z4.js} +1 -1
- package/dist/{server-OXKBXSET.js → server-GFQQABB4.js} +15 -3
- package/dist/{start-BZJZSQHW.js → start-EYEWMZXS.js} +1 -1
- package/package.json +3 -3
|
@@ -165,7 +165,8 @@ async function renderPage(opts) {
|
|
|
165
165
|
scopeId: mod.scopeId,
|
|
166
166
|
loaderData,
|
|
167
167
|
registry: opts.registry,
|
|
168
|
-
stores: storesInitialState(stores)
|
|
168
|
+
stores: storesInitialState(stores),
|
|
169
|
+
authoredDefaults: mod.rootData ? mod.rootData() : void 0
|
|
169
170
|
});
|
|
170
171
|
const doc = shell({
|
|
171
172
|
body: html,
|
|
@@ -173,15 +174,17 @@ async function renderPage(opts) {
|
|
|
173
174
|
css: mod.css + (opts.componentCss ?? ""),
|
|
174
175
|
pageId: opts.pageId,
|
|
175
176
|
clientHref: opts.clientHref,
|
|
176
|
-
storeIds: stores.map((s) => s.id)
|
|
177
|
+
storeIds: stores.map((s) => s.id),
|
|
178
|
+
appCss: opts.appCss
|
|
177
179
|
});
|
|
178
180
|
return opts.transformHtml ? opts.transformHtml(opts.url, doc) : doc;
|
|
179
181
|
}
|
|
180
|
-
function shell({ body, island, css, pageId, clientHref, storeIds = [] }) {
|
|
182
|
+
function shell({ body, island, css, pageId, clientHref, storeIds = [], appCss }) {
|
|
181
183
|
const storeImports = storeIds.map((id, i) => ` import __s${i} from ${JSON.stringify(id)}`).join("\n");
|
|
182
184
|
const storeRegs = storeIds.map((_, i) => ` Alpine.store(__s${i}.name, __s${i}.factory())`).join("\n");
|
|
183
185
|
const clientScript = clientHref ? `<script type="module" src="${clientHref}"></script>` : `<script type="module">
|
|
184
|
-
import
|
|
186
|
+
${appCss ? ` import ${JSON.stringify(appCss)}
|
|
187
|
+
` : ""} import Alpine from 'alpinejs'
|
|
185
188
|
${storeImports ? `${storeImports}
|
|
186
189
|
` : ""} import ${JSON.stringify(pageId)}
|
|
187
190
|
window.Alpine = Alpine
|
package/dist/cli.js
CHANGED
|
@@ -109,9 +109,9 @@ var main = defineCommand2({
|
|
|
109
109
|
},
|
|
110
110
|
subCommands: {
|
|
111
111
|
new: newCommand,
|
|
112
|
-
dev: () => import("./dev-
|
|
113
|
-
build: () => import("./build-
|
|
114
|
-
start: () => import("./start-
|
|
112
|
+
dev: () => import("./dev-PQRMJ7Z4.js").then((m) => m.devCommand),
|
|
113
|
+
build: () => import("./build-UDFLTWY5.js").then((m) => m.buildCommand),
|
|
114
|
+
start: () => import("./start-EYEWMZXS.js").then((m) => m.startCommand),
|
|
115
115
|
make: () => import("./make-62PPHZQY.js").then((m) => m.makeCommand),
|
|
116
116
|
migrate: () => import("./migrate-NOGFOFV2.js").then((m) => m.migrateCommand),
|
|
117
117
|
mcp: () => import("./mcp-DL4J6JFJ.js").then((m) => m.mcpCommand)
|
|
@@ -20,7 +20,7 @@ var devCommand = defineCommand({
|
|
|
20
20
|
process.stdout.write(banner());
|
|
21
21
|
const sp = spinner(`Starting dev server${args.islands ? " (islands mode)" : ""}\u2026`);
|
|
22
22
|
try {
|
|
23
|
-
const { startDevServer } = await import("./server-
|
|
23
|
+
const { startDevServer } = await import("./server-GFQQABB4.js");
|
|
24
24
|
const { port: actual } = await startDevServer({ root, port, islands: Boolean(args.islands) });
|
|
25
25
|
sp.succeed("Dev server ready");
|
|
26
26
|
ready([
|
|
@@ -13,14 +13,15 @@ import {
|
|
|
13
13
|
renderIslandsPage,
|
|
14
14
|
renderPage,
|
|
15
15
|
scanPages
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-YO4UXWIY.js";
|
|
17
17
|
import "./chunk-MZVLRU3R.js";
|
|
18
18
|
|
|
19
19
|
// src/dev/server.ts
|
|
20
|
+
import { existsSync as existsSync2 } from "fs";
|
|
20
21
|
import { createServer as createHttpServer } from "http";
|
|
21
22
|
import { createRequire } from "module";
|
|
22
23
|
import { join } from "path";
|
|
23
|
-
import { fileURLToPath } from "url";
|
|
24
|
+
import { fileURLToPath, pathToFileURL } from "url";
|
|
24
25
|
import { apex } from "@apex-stack/vite";
|
|
25
26
|
import {
|
|
26
27
|
createApp,
|
|
@@ -165,6 +166,16 @@ async function startDevServer(options) {
|
|
|
165
166
|
};
|
|
166
167
|
if (alpine) alias.alpinejs = alpine;
|
|
167
168
|
if (kit) alias["@apex-stack/kit"] = kit;
|
|
169
|
+
const plugins = [apex({ clientRuntime: "@apex-stack/core/client" })];
|
|
170
|
+
try {
|
|
171
|
+
const reqProj = createRequire(join(options.root, "package.json"));
|
|
172
|
+
const twMod = await import(pathToFileURL(reqProj.resolve("@tailwindcss/vite")).href);
|
|
173
|
+
const tw = twMod.default ?? twMod;
|
|
174
|
+
plugins.unshift(tw());
|
|
175
|
+
} catch {
|
|
176
|
+
}
|
|
177
|
+
const appCssRel = ["app.css", "styles/app.css", "src/app.css"].find((p) => existsSync2(join(options.root, p)));
|
|
178
|
+
const appCss = appCssRel ? `/${appCssRel}` : void 0;
|
|
168
179
|
const vite = await createViteServer({
|
|
169
180
|
root: options.root,
|
|
170
181
|
appType: "custom",
|
|
@@ -174,7 +185,7 @@ async function startDevServer(options) {
|
|
|
174
185
|
resolve: { alias },
|
|
175
186
|
// User apps depend on `@apex-stack/core`, so the client module imports the runtime
|
|
176
187
|
// from `@apex-stack/core/client` (a re-export) rather than the internal kit package.
|
|
177
|
-
plugins
|
|
188
|
+
plugins,
|
|
178
189
|
optimizeDeps: { include: ["alpinejs"] }
|
|
179
190
|
});
|
|
180
191
|
const ssrLoad = (id) => {
|
|
@@ -211,6 +222,7 @@ async function startDevServer(options) {
|
|
|
211
222
|
registry,
|
|
212
223
|
componentCss,
|
|
213
224
|
stores,
|
|
225
|
+
appCss,
|
|
214
226
|
transformHtml: (u, doc) => vite.transformIndexHtml(u, doc)
|
|
215
227
|
});
|
|
216
228
|
setResponseHeader(event, "Content-Type", "text/html");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apex-stack/core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.16",
|
|
4
4
|
"description": "The full-stack meta-framework for Alpine.js — CLI and runtime",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
"h3": "^1.13.0",
|
|
46
46
|
"vite": "^6.0.7",
|
|
47
47
|
"zod": "^4.4.3",
|
|
48
|
-
"@apex-stack/kit": "0.1.
|
|
49
|
-
"@apex-stack/vite": "0.1.
|
|
48
|
+
"@apex-stack/kit": "0.1.4",
|
|
49
|
+
"@apex-stack/vite": "0.1.4"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"alpinejs": "^3.14.0"
|