noofpi 2.0.0 → 2.0.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.
@@ -3,7 +3,7 @@ import {
3
3
  createViteConfig,
4
4
  finishPresetBuild,
5
5
  resolveFonts
6
- } from "./chunk-LL3NO5EI.js";
6
+ } from "./chunk-NHBXVKEQ.js";
7
7
  import "./chunk-IE3WF5XF.js";
8
8
  import "./chunk-MTXQR32N.js";
9
9
  import "./chunk-PPUFFGCH.js";
@@ -563,8 +563,11 @@ function presetEntryCode(preset, config) {
563
563
  case "cloudflare-pages":
564
564
  return [
565
565
  HANDLER,
566
- // Pages serves static files through the ASSETS binding; everything else is a page or an API call
567
- `const isFile = (request) => (request.method === 'GET' || request.method === 'HEAD') && /\\.[a-z0-9]+$/i.test(new URL(request.url).pathname);`,
566
+ // Pages serves static files through the ASSETS binding; everything else is a page or an API call.
567
+ // API and proxy paths end in the endpoint name (`/_noofpi/proxy/doofpi.me.getMe`), which looks like a file extension
568
+ `const apiRoot = mod.config.doofpi.root;`,
569
+ `const isApiPath = (pathname) => pathname.startsWith('/_noofpi/') || pathname === apiRoot || pathname.startsWith(apiRoot + '.') || pathname.startsWith(apiRoot + '/');`,
570
+ `const isFile = (request) => { const { pathname } = new URL(request.url); return (request.method === 'GET' || request.method === 'HEAD') && /\\.[a-z0-9]+$/i.test(pathname) && !isApiPath(pathname); };`,
568
571
  `export default { fetch: (request, env) => isFile(request) && env.ASSETS ? env.ASSETS.fetch(request) : handler(request, env) };`
569
572
  ].join("\n");
570
573
  default:
@@ -1067,6 +1070,8 @@ function autoImportPlugins() {
1067
1070
  "app/utils/*/index.{ts,js}"
1068
1071
  ],
1069
1072
  include: [/\.[jt]sx?$/, /\.vue$/, /\.vue\?vue/],
1073
+ // Without it a util used only in a template compiles to `_ctx.name` and is undefined at runtime
1074
+ vueTemplate: true,
1070
1075
  dts: ".noofpi/auto-imports.d.ts"
1071
1076
  }),
1072
1077
  Components({
package/dist/cli.js CHANGED
@@ -150,7 +150,7 @@ async function main() {
150
150
  await loadEnvFiles(root, mode);
151
151
  const config = await loadConfig(root);
152
152
  if (command === "dev") {
153
- const { startDev } = await import("./dev-HTWUY27O.js");
153
+ const { startDev } = await import("./dev-OAGCOGHA.js");
154
154
  await startDev(root, config, overrides);
155
155
  } else if (command === "build" || command === "preview") {
156
156
  const preset = args.preset ? assertBuildPreset(args.preset, "--preset") : void 0;
@@ -161,17 +161,17 @@ async function main() {
161
161
  `[noofpi] preview can not run the "${target}" preset (use ${PREVIEW_PRESETS.join(" | ")}, or build it and serve .output/ with its own tooling)`
162
162
  );
163
163
  }
164
- const { buildApp } = await import("./build-PFCGDPPJ.js");
164
+ const { buildApp } = await import("./build-WPHZ7TYZ.js");
165
165
  await buildApp(root, config, preset);
166
166
  if (command === "preview") {
167
- const { startProd } = await import("./start-AJKNZRJQ.js");
167
+ const { startProd } = await import("./start-ITRND3BY.js");
168
168
  await startProd(root, config, overrides);
169
169
  }
170
170
  } else if (command === "start") {
171
- const { startProd } = await import("./start-AJKNZRJQ.js");
171
+ const { startProd } = await import("./start-ITRND3BY.js");
172
172
  await startProd(root, config, overrides);
173
173
  } else {
174
- const { prepareApp } = await import("./prepare-KKQ2AEBW.js");
174
+ const { prepareApp } = await import("./prepare-BN7NMCVQ.js");
175
175
  await prepareApp(root, config);
176
176
  if (command === "prepare") {
177
177
  console.log("noofpi: generated .noofpi/");
@@ -16,7 +16,7 @@ import {
16
16
  resolveCss,
17
17
  resolveFonts,
18
18
  startPlatformProxy
19
- } from "./chunk-LL3NO5EI.js";
19
+ } from "./chunk-NHBXVKEQ.js";
20
20
  import "./chunk-OKNF6XDO.js";
21
21
  import "./chunk-IE3WF5XF.js";
22
22
  import {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createViteConfig
3
- } from "./chunk-LL3NO5EI.js";
3
+ } from "./chunk-NHBXVKEQ.js";
4
4
  import "./chunk-IE3WF5XF.js";
5
5
  import "./chunk-MTXQR32N.js";
6
6
  import "./chunk-PPUFFGCH.js";
@@ -47,6 +47,10 @@ async function mount() {
47
47
  const { app, router, payload, error, log, loaders, i18n } = createNoofpiApp({
48
48
  server: false
49
49
  });
50
+ const navigated = router.isReady().then(
51
+ () => void 0,
52
+ (failure) => ({ failure })
53
+ );
50
54
  await i18n?.ready;
51
55
  if (import.meta.env.DEV && publicConfig.devtools) {
52
56
  const { mountDevtools } = await import("../devtools-PLUN2DYV.js");
@@ -65,9 +69,8 @@ async function mount() {
65
69
  }
66
70
  });
67
71
  }
68
- await router.isReady().catch((failure) => {
69
- if (!error.value) throw failure;
70
- });
72
+ const outcome = await navigated;
73
+ if (outcome && !error.value) throw outcome.failure;
71
74
  app.mount("#app");
72
75
  listenForPrefetch(loaders.prefetch);
73
76
  payload.data = {};
@@ -5,7 +5,7 @@ import {
5
5
  } from "./chunk-RUNIVVFH.js";
6
6
  import {
7
7
  OUTPUT_DIR
8
- } from "./chunk-LL3NO5EI.js";
8
+ } from "./chunk-NHBXVKEQ.js";
9
9
  import "./chunk-OKNF6XDO.js";
10
10
  import "./chunk-IE3WF5XF.js";
11
11
  import {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "noofpi",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "A minimal Vue + Vite full-stack framework built around doofpi",
5
5
  "license": "MIT",
6
6
  "author": "Lior Cohen",
@@ -106,7 +106,7 @@
106
106
  },
107
107
  "devDependencies": {
108
108
  "@tailwindcss/vite": "^4.3.5",
109
- "@types/node": "^24.19.2",
109
+ "@types/node": "^24.19.4",
110
110
  "doofpi": "^1.3.1",
111
111
  "sharp": "^0.35.5",
112
112
  "tailwindcss": "^4.3.5",
@@ -114,6 +114,6 @@
114
114
  "prettier": "^3.10.1",
115
115
  "tsup": "^9.0.0",
116
116
  "typescript": "~6.0.3",
117
- "vitest": "^4.1.12"
117
+ "vitest": "^5.1.2"
118
118
  }
119
119
  }