@stacksjs/config 0.75.90 → 0.75.91

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/views.d.ts CHANGED
@@ -32,6 +32,7 @@ export declare function resolveViewPatterns(userViewsPath: string, defaultViewsP
32
32
  * three checkout steps to `/api/checkout/{contact,shipping,place}`, and
33
33
  * `/orders/{id}` is where `place` lands. `dashboard/index.stx` is the stub
34
34
  * `/dashboard` renders on the views server, meaningless without the bundle.
35
+ * `feedback/{token}` posts to `/api/feedback/{token}` from the same file.
35
36
  *
36
37
  * Served with every bundle mounted, withheld without it: an app answering 200
37
38
  * on `/login` whose form posts into a 404 is worse than an app answering 404.
package/dist/views.js CHANGED
@@ -1 +1 @@
1
- import{existsSync}from"node:fs";import{join}from"node:path";import{packageViewRoots}from"./discovered-resources";export const DEFAULT_VIEW_ROUTE_BUNDLES={auth:["login.stx","register.stx","forgot-password.stx","password","auth"],dashboard:["cart.stx","checkout","orders","dashboard"]},DEFAULT_VIEW_TEMPLATES=["cms"],DEFAULT_VIEWS_ALWAYS=["index.stx","coming-soon.stx","errors","emails"];export function withheldDefaultViews(mountedBundles){const withheld=[];for(const[bundle,views]of Object.entries(DEFAULT_VIEW_ROUTE_BUNDLES))if(!mountedBundles.has(bundle))withheld.push(...views);withheld.push(...DEFAULT_VIEW_TEMPLATES);return withheld}export function resolveViewPatterns(userViewsPath,defaultViewsPath,setting,exists=existsSync,packageViews=packageViewRoots({exists}),mountedBundles=new Set){const fromPackages=packageViews.map((root)=>root.dir);if(setting===void 0){const withheld=withheldDefaultViews(mountedBundles);return{patterns:[userViewsPath,defaultViewsPath,...fromPackages],missing:[],exclude:withheld.map((name)=>join(defaultViewsPath,name)),withheld}}if(setting===!0)return{patterns:[userViewsPath,defaultViewsPath,...fromPackages],missing:[],exclude:[],withheld:[]};if(setting===!1)return{patterns:[userViewsPath,...fromPackages],missing:[],exclude:[],withheld:[]};if(!Array.isArray(setting))return{patterns:[userViewsPath,defaultViewsPath,...fromPackages],missing:[],exclude:[],withheld:[]};const patterns=[userViewsPath],missing=[];for(const name of setting){const cleaned=String(name).replace(/^[/\\]+/,"");if(!cleaned||cleaned.split(/[/\\]/).includes(".."))continue;const candidate=join(defaultViewsPath,cleaned);if(exists(candidate))patterns.push(candidate);else missing.push(cleaned)}patterns.push(...fromPackages);return{patterns,missing,exclude:[],withheld:[]}}
1
+ import{existsSync}from"node:fs";import{join}from"node:path";import{packageViewRoots}from"./discovered-resources";export const DEFAULT_VIEW_ROUTE_BUNDLES={auth:["login.stx","register.stx","forgot-password.stx","password","auth"],dashboard:["cart.stx","checkout","orders","dashboard","feedback"]},DEFAULT_VIEW_TEMPLATES=["cms"],DEFAULT_VIEWS_ALWAYS=["index.stx","coming-soon.stx","errors","emails"];export function withheldDefaultViews(mountedBundles){const withheld=[];for(const[bundle,views]of Object.entries(DEFAULT_VIEW_ROUTE_BUNDLES))if(!mountedBundles.has(bundle))withheld.push(...views);withheld.push(...DEFAULT_VIEW_TEMPLATES);return withheld}export function resolveViewPatterns(userViewsPath,defaultViewsPath,setting,exists=existsSync,packageViews=packageViewRoots({exists}),mountedBundles=new Set){const fromPackages=packageViews.map((root)=>root.dir);if(setting===void 0){const withheld=withheldDefaultViews(mountedBundles);return{patterns:[userViewsPath,defaultViewsPath,...fromPackages],missing:[],exclude:withheld.map((name)=>join(defaultViewsPath,name)),withheld}}if(setting===!0)return{patterns:[userViewsPath,defaultViewsPath,...fromPackages],missing:[],exclude:[],withheld:[]};if(setting===!1)return{patterns:[userViewsPath,...fromPackages],missing:[],exclude:[],withheld:[]};if(!Array.isArray(setting))return{patterns:[userViewsPath,defaultViewsPath,...fromPackages],missing:[],exclude:[],withheld:[]};const patterns=[userViewsPath],missing=[];for(const name of setting){const cleaned=String(name).replace(/^[/\\]+/,"");if(!cleaned||cleaned.split(/[/\\]/).includes(".."))continue;const candidate=join(defaultViewsPath,cleaned);if(exists(candidate))patterns.push(candidate);else missing.push(cleaned)}patterns.push(...fromPackages);return{patterns,missing,exclude:[],withheld:[]}}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@stacksjs/config",
3
3
  "type": "module",
4
4
  "sideEffects": false,
5
- "version": "0.75.90",
5
+ "version": "0.75.91",
6
6
  "description": "The Stacks config helper methods.",
7
7
  "author": "Chris Breuer",
8
8
  "contributors": [
@@ -55,15 +55,15 @@
55
55
  "prepublishOnly": "bun run build"
56
56
  },
57
57
  "dependencies": {
58
- "@stacksjs/events": "0.75.90",
59
- "@stacksjs/features": "0.75.90",
60
- "@stacksjs/path": "0.75.90",
61
- "@stacksjs/tunnel": "0.75.90",
58
+ "@stacksjs/events": "0.75.91",
59
+ "@stacksjs/features": "0.75.91",
60
+ "@stacksjs/path": "0.75.91",
61
+ "@stacksjs/tunnel": "0.75.91",
62
62
  "ts-pantry": "^0.11.69"
63
63
  },
64
64
  "devDependencies": {
65
- "@stacksjs/alias": "0.75.90",
66
- "@stacksjs/types": "0.75.90",
65
+ "@stacksjs/alias": "0.75.91",
66
+ "@stacksjs/types": "0.75.91",
67
67
  "better-dx": "^0.2.24"
68
68
  }
69
69
  }