@stacksjs/config 0.75.85 → 0.75.87
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/defaults.js +1 -1
- package/dist/features.d.ts +38 -14
- package/dist/features.js +1 -1
- package/dist/index.d.ts +1 -1
- package/package.json +7 -7
package/dist/defaults.js
CHANGED
|
@@ -2,4 +2,4 @@ var {require}=import.meta;import process from"node:process";import{commandsPath,
|
|
|
2
2
|
`,body:`Provide a LONGER description of the change (optional). Use "|" to break new line:
|
|
3
3
|
`,breaking:`List any BREAKING CHANGES (optional). Use "|" to break new line:
|
|
4
4
|
`,footerPrefixesSelect:"Select the ISSUES type of the change list by this change (optional):",customFooterPrefixes:"Input ISSUES prefix:",footer:`List any ISSUES by this change. E.g.: #31, #34:
|
|
5
|
-
`,confirmCommit:"Are you sure you want to proceed with the commit above?"},types:[{value:"feat",name:"feat: \u2728 A new feature",emoji:":sparkles:"},{value:"fix",name:"fix: \uD83D\uDC1B A bug fix",emoji:":bug:"},{value:"docs",name:"docs: \uD83D\uDCDD Documentation only changes",emoji:":memo:"},{value:"style",name:"style: \uD83D\uDC84 Changes that do not affect the meaning of the code",emoji:":lipstick:"},{value:"refactor",name:"refactor: \u267B\uFE0F A code change that neither fixes a bug nor adds a feature",emoji:":recycle:"},{value:"perf",name:"perf: \u26A1\uFE0F A code change that improves performance",emoji:":zap:"},{value:"test",name:"test: \u2705 Adding missing tests or adjusting existing tests",emoji:":white_check_mark:"},{value:"build",name:"build: \uD83D\uDCE6\uFE0F Changes that affect the build system or external dependencies",emoji:":package:"},{value:"ci",name:"ci: \uD83C\uDFA1 Changes to our CI configuration files and scripts",emoji:":ferris_wheel:"},{value:"chore",name:"chore: \uD83D\uDD28 Other changes that don't modify src or test files",emoji:":hammer:"},{value:"revert",name:"revert: \u23EA\uFE0F Reverts a previous commit",emoji:":rewind:"}]},hashing:{driver:"bcrypt",rehashOnLogin:!0,bcrypt:{rounds:12},argon2:{memory:65536,time:2}},images:{social:{enabled:!1,outputDir:"public/social",publicPath:"/social",presets:["og","square","portrait"]},appStore:{enabled:!1,outputDir:"resources/app-store/screenshots"},appIcons:{enabled:!1,outputDir:"resources/app-icons",platforms:["ios","macos"],faviconDir:"public"}},library:{name:"hello-world",owner:"@stacksjs",repository:"stacksjs/stacks",license:"MIT",author:"",contributors:[],defaultLanguage:"en",webComponents:{name:"hello-world-elements",description:"Your framework agnostic web component library description.",keywords:["custom-elements","web-components","library","framework-agnostic","typescript","javascript"],tags:[{name:["HelloWorld","AppHelloWorld"],description:"The Hello World custom element, built via this framework.",attributes:[{name:"greeting",description:"The greeting."}]}]},functions:{name:"hello-world-fx",description:"Your function library description.",keywords:["functions","composables","library","typescript","javascript"],shouldGenerateSourcemap:!1,files:["counter","dark"]}},logging:{logsPath:"storage/logs/stacks.log",deploymentsPath:"storage/logs/deployments.log"},notification:{default:"email"},payment:{driver:"stripe"},server:{proxy:{}},ports:{frontend:3000,backend:3001,admin:3002,library:3003,desktop:3004,email:3005,docs:3006,inspect:3007,api:3008,systemTray:3009,database:3010},queue:{default:"sync",connections:{sync:{driver:"sync"},database:{driver:"database",table:"jobs",queue:"default",retryAfter:90},redis:{driver:"redis",queue:"default",retryAfter:90},sqs:{driver:"sqs",key:"",secret:"",prefix:"",suffix:"",queue:"default",region:FRAMEWORK_DEFAULTS.awsRegion}}},saas:{plans:[{productName:"Stacks Hobby",description:"All the Stacks features.",pricing:[{key:"stacks_hobby_monthly",price:3900,interval:"month",currency:"usd"},{key:"stacks_hobby_yearly",price:37900,interval:"year",currency:"usd"}],metadata:{createdBy:"admin",version:"1.0.0"}},{productName:"Stacks Pro",description:"All the Stacks features, including being able to invite team members.",pricing:[{key:"stacks_pro_monthly",price:5900,interval:"month",currency:"usd"},{key:"stacks_pro_yearly",price:57900,interval:"year",currency:"usd"}],metadata:{createdBy:"admin",version:"1.0.0"}}],webhook:{endpoint:"/webhooks/stripe",secret:""},currencies:["usd"],coupons:[{code:"SUMMER2024",amountOff:500,duration:"once"}],products:[{name:"Stacks Pro",description:"All the Stacks features.",images:["url_to_image"]}]},searchEngine:{driver:"opensearch"},security:{firewall:{enabled:!0,countryCodes:[],ipAddresses:[],queryString:[],httpHeaders:[],rateLimitPerMinute:1000,useIpReputationLists:!0,useKnownBadInputsRuleSet:!0}},services:{aws:{accountId:"",appId:"",apiKey:"",region:FRAMEWORK_DEFAULTS.awsRegion},algolia:{appId:"",apiKey:""},meilisearch:{appId:"",apiKey:""},stripe:{appId:"",apiKey:""}},filesystems:{driver:"local"},team:{name:"",members:{}},ui:{shortcuts:[["btn","inline-flex items-center px-4 py-2 ml-2 border border-transparent shadow-sm text-base font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 cursor-pointer"]],safelist:"prose prose-sm m-auto text-left",trigger:":stx:",classPrefix:"stx-",reset:"tailwind",icons:["hugeicons"],fonts:{email:{title:"Mona",text:"Hubot"},desktop:{title:"Mona",text:"Hubot"},mobile:{title:"Mona",text:"Hubot"},web:{title:"Mona",text:"Hubot"}}}};export default defaults;
|
|
5
|
+
`,confirmCommit:"Are you sure you want to proceed with the commit above?"},types:[{value:"feat",name:"feat: \u2728 A new feature",emoji:":sparkles:"},{value:"fix",name:"fix: \uD83D\uDC1B A bug fix",emoji:":bug:"},{value:"docs",name:"docs: \uD83D\uDCDD Documentation only changes",emoji:":memo:"},{value:"style",name:"style: \uD83D\uDC84 Changes that do not affect the meaning of the code",emoji:":lipstick:"},{value:"refactor",name:"refactor: \u267B\uFE0F A code change that neither fixes a bug nor adds a feature",emoji:":recycle:"},{value:"perf",name:"perf: \u26A1\uFE0F A code change that improves performance",emoji:":zap:"},{value:"test",name:"test: \u2705 Adding missing tests or adjusting existing tests",emoji:":white_check_mark:"},{value:"build",name:"build: \uD83D\uDCE6\uFE0F Changes that affect the build system or external dependencies",emoji:":package:"},{value:"ci",name:"ci: \uD83C\uDFA1 Changes to our CI configuration files and scripts",emoji:":ferris_wheel:"},{value:"chore",name:"chore: \uD83D\uDD28 Other changes that don't modify src or test files",emoji:":hammer:"},{value:"revert",name:"revert: \u23EA\uFE0F Reverts a previous commit",emoji:":rewind:"}]},hashing:{driver:"bcrypt",rehashOnLogin:!0,bcrypt:{rounds:12},argon2:{memory:65536,time:2}},images:{social:{enabled:!1,outputDir:"public/social",publicPath:"/social",presets:["og","square","portrait"]},appStore:{enabled:!1,outputDir:"resources/app-store/screenshots"},appIcons:{enabled:!1,outputDir:"resources/app-icons",platforms:["ios","macos"],faviconDir:"public"}},library:{name:"hello-world",owner:"@stacksjs",repository:"stacksjs/stacks",license:"MIT",author:"",contributors:[],defaultLanguage:"en",webComponents:{name:"hello-world-elements",description:"Your framework agnostic web component library description.",keywords:["custom-elements","web-components","library","framework-agnostic","typescript","javascript"],tags:[{name:["HelloWorld","AppHelloWorld"],description:"The Hello World custom element, built via this framework.",attributes:[{name:"greeting",description:"The greeting."}]}]},functions:{name:"hello-world-fx",description:"Your function library description.",keywords:["functions","composables","library","typescript","javascript"],shouldGenerateSourcemap:!1,files:["counter","dark"]}},logging:{logsPath:"storage/logs/stacks.log",deploymentsPath:"storage/logs/deployments.log"},notification:{default:"email"},payment:{driver:"stripe"},server:{proxy:{}},ports:{frontend:3000,backend:3001,admin:3002,library:3003,desktop:3004,email:3005,docs:3006,inspect:3007,api:3008,systemTray:3009,database:3010},queue:{default:"sync",connections:{sync:{driver:"sync"},database:{driver:"database",table:"jobs",queue:"default",retryAfter:90},redis:{driver:"redis",queue:"default",retryAfter:90},sqs:{driver:"sqs",key:"",secret:"",prefix:"",suffix:"",queue:"default",region:FRAMEWORK_DEFAULTS.awsRegion}}},saas:{plans:[{productName:"Stacks Hobby",description:"All the Stacks features.",pricing:[{key:"stacks_hobby_monthly",price:3900,interval:"month",currency:"usd"},{key:"stacks_hobby_yearly",price:37900,interval:"year",currency:"usd"}],metadata:{createdBy:"admin",version:"1.0.0"}},{productName:"Stacks Pro",description:"All the Stacks features, including being able to invite team members.",pricing:[{key:"stacks_pro_monthly",price:5900,interval:"month",currency:"usd"},{key:"stacks_pro_yearly",price:57900,interval:"year",currency:"usd"}],metadata:{createdBy:"admin",version:"1.0.0"}}],webhook:{endpoint:"/webhooks/stripe",secret:""},currencies:["usd"],coupons:[{code:"SUMMER2024",amountOff:500,duration:"once"}],products:[{name:"Stacks Pro",description:"All the Stacks features.",images:["url_to_image"]}]},searchEngine:{driver:"opensearch"},security:{api:{rowScoping:"deny",models:"all"},firewall:{enabled:!0,countryCodes:[],ipAddresses:[],queryString:[],httpHeaders:[],rateLimitPerMinute:1000,useIpReputationLists:!0,useKnownBadInputsRuleSet:!0}},services:{aws:{accountId:"",appId:"",apiKey:"",region:FRAMEWORK_DEFAULTS.awsRegion},algolia:{appId:"",apiKey:""},meilisearch:{appId:"",apiKey:""},stripe:{appId:"",apiKey:""}},filesystems:{driver:"local"},team:{name:"",members:{}},ui:{shortcuts:[["btn","inline-flex items-center px-4 py-2 ml-2 border border-transparent shadow-sm text-base font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 cursor-pointer"]],safelist:"prose prose-sm m-auto text-left",trigger:":stx:",classPrefix:"stx-",reset:"tailwind",icons:["hugeicons"],fonts:{email:{title:"Mona",text:"Hubot"},desktop:{title:"Mona",text:"Hubot"},mobile:{title:"Mona",text:"Hubot"},web:{title:"Mona",text:"Hubot"}}}};export default defaults;
|
package/dist/features.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { type FeatureName } from '@stacksjs/features/names';
|
|
2
|
-
export declare function feature(name:
|
|
2
|
+
export declare function feature(name: FeatureFlag): boolean;
|
|
3
3
|
/**
|
|
4
4
|
* Force-enable a feature in the running process. Intended for tests and
|
|
5
5
|
* staged rollouts; production code should prefer config-file overrides.
|
|
6
6
|
*/
|
|
7
|
-
export declare function enableFeature(name:
|
|
7
|
+
export declare function enableFeature(name: FeatureFlag): void;
|
|
8
8
|
/**
|
|
9
9
|
* Force-disable a feature in the running process.
|
|
10
10
|
*/
|
|
11
|
-
export declare function disableFeature(name:
|
|
11
|
+
export declare function disableFeature(name: FeatureFlag): void;
|
|
12
12
|
/**
|
|
13
13
|
* Drop a runtime override and fall back to the config-driven value.
|
|
14
14
|
*/
|
|
15
|
-
export declare function resetFeature(name:
|
|
15
|
+
export declare function resetFeature(name: FeatureFlag): void;
|
|
16
16
|
/**
|
|
17
17
|
* Snapshot of the live flag set — useful for `/__features` debug endpoints
|
|
18
18
|
* and CLI commands that print the active configuration. Iterates the known
|
|
@@ -20,7 +20,24 @@ export declare function resetFeature(name: string): void;
|
|
|
20
20
|
*/
|
|
21
21
|
export declare function listFeatures(): Record<string, boolean>;
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
23
|
+
* Flags an app defines for itself - a ramp switched with `enableFeature`, or
|
|
24
|
+
* a `config/<name>.ts` with an `enabled` field. Declare them here so
|
|
25
|
+
* `feature()` accepts them; anything else is a compile error, which is what
|
|
26
|
+
* keeps `feature('commrce')` from being a silent `false`:
|
|
27
|
+
*
|
|
28
|
+
* ```ts
|
|
29
|
+
* declare module '@stacksjs/config' {
|
|
30
|
+
* interface AppFeatureFlags {
|
|
31
|
+
* 'new-checkout': true
|
|
32
|
+
* }
|
|
33
|
+
* }
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
// eslint-disable-next-line ts/no-empty-object-type
|
|
37
|
+
export declare interface AppFeatureFlags {}
|
|
38
|
+
/**
|
|
39
|
+
* Every name `feature()` answers for: the installable bundles, plus two gates
|
|
40
|
+
* that are config sections rather than bundles.
|
|
24
41
|
*
|
|
25
42
|
* Derived rather than restated. The bundles were spelled out here as well as in
|
|
26
43
|
* `@stacksjs/features`, and nothing related the two lists, so a feature added
|
|
@@ -34,13 +51,20 @@ export declare function listFeatures(): Record<string, boolean>;
|
|
|
34
51
|
* `@stacksjs/path` for them, which costs about a millisecond on a path every
|
|
35
52
|
* process walks before anything else. The names module imports nothing.
|
|
36
53
|
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
* `
|
|
44
|
-
* `
|
|
54
|
+
* The two gates have no install command, because there is nothing to install:
|
|
55
|
+
*
|
|
56
|
+
* - `auth` (`config/auth.ts`) decides whether `@stacksjs/orm` loads the
|
|
57
|
+
* framework's account-family models - `Team`, `TeamMember`, `Referral`,
|
|
58
|
+
* `SocialAccount`, `Subscriber`, `Subscription`, `Site`, `MagicLinkToken`,
|
|
59
|
+
* `GdprRequest` and the rest of its manifest's `'auth'` rows. It does NOT
|
|
60
|
+
* mount the auth routes. `config/auth.ts` ships enabled in every app, so
|
|
61
|
+
* gating `/login`, `/register` and `/auth/tokens` on it would mount them
|
|
62
|
+
* into every app running with `dashboard` off; route selection is explicit,
|
|
63
|
+
* through `STACKS_DEFAULT_ROUTES` (see `router/src/route-loader.ts`).
|
|
64
|
+
* - `email` (`config/email.ts`) gates the `email` route bundle - the provider
|
|
65
|
+
* webhooks - when an app has not named its bundles. It was a name only the
|
|
66
|
+
* router knew, so canonical mode did not force it on.
|
|
45
67
|
*/
|
|
46
|
-
export type StacksFeature = FeatureName | 'auth';
|
|
68
|
+
export type StacksFeature = FeatureName | 'auth' | 'email';
|
|
69
|
+
/** A name `feature()` accepts: the framework's, or one the app declared. */
|
|
70
|
+
export type FeatureFlag = StacksFeature | Extract<keyof AppFeatureFlags, string>;
|
package/dist/features.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{FEATURE_NAMES as INSTALLABLE_FEATURES}from"@stacksjs/features/names";import{config}from"./runtime";const FEATURE_NAMES=[...INSTALLABLE_FEATURES,"auth"],FEATURE_DEFAULTS={dashboard:!0},overrides=new Map;function configFor(name){const raw=config[name];return raw&&typeof raw==="object"?raw:void 0}function canonicalFeatures(){return process.env.STACKS_CANONICAL_FEATURES==="1"}export function feature(name){if(overrides.has(name))return overrides.get(name);if(canonicalFeatures()&&FEATURE_NAMES.includes(name))return!0;const cfg=configFor(name);if(cfg){const enabledField=cfg.enabled;if(enabledField===!1)return!1;if(Array.isArray(cfg.env)&&cfg.env.length>0){const currentEnv=(config.app?.env??"").toString();if(!cfg.env.includes(currentEnv))return!1}if(enabledField!==void 0)return!!enabledField;return!0}return FEATURE_DEFAULTS[name]??!1}export function enableFeature(name){overrides.set(name,!0)}export function disableFeature(name){overrides.set(name,!1)}export function resetFeature(name){overrides.delete(name)}export function listFeatures(){const out={};for(const name of FEATURE_NAMES)out[name]=feature(name);for(const name of overrides.keys())out[name]=feature(name);return out}
|
|
1
|
+
import{FEATURE_NAMES as INSTALLABLE_FEATURES}from"@stacksjs/features/names";import{config}from"./runtime";const FEATURE_NAMES=[...INSTALLABLE_FEATURES,"auth","email"],FEATURE_DEFAULTS={dashboard:!0},overrides=new Map;function configFor(name){const raw=config[name];return raw&&typeof raw==="object"?raw:void 0}function canonicalFeatures(){return process.env.STACKS_CANONICAL_FEATURES==="1"}export function feature(name){if(overrides.has(name))return overrides.get(name);if(canonicalFeatures()&&FEATURE_NAMES.includes(name))return!0;const cfg=configFor(name);if(cfg){const enabledField=cfg.enabled;if(enabledField===!1)return!1;if(Array.isArray(cfg.env)&&cfg.env.length>0){const currentEnv=(config.app?.env??"").toString();if(!cfg.env.includes(currentEnv))return!1}if(enabledField!==void 0)return!!enabledField;return!0}return FEATURE_DEFAULTS[name]??!1}export function enableFeature(name){overrides.set(name,!0)}export function disableFeature(name){overrides.set(name,!1)}export function resetFeature(name){overrides.delete(name)}export function listFeatures(){const out={};for(const name of FEATURE_NAMES)out[name]=feature(name);for(const name of overrides.keys())out[name]=feature(name);return out}
|
package/dist/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
export * from './config';
|
|
12
12
|
export { FRAMEWORK_DEFAULTS } from './defaults';
|
|
13
13
|
export { validateConfig, reportConfigIssues, type ConfigValidationIssue } from './validators';
|
|
14
|
-
export { feature, enableFeature, disableFeature, resetFeature, listFeatures } from './features';
|
|
14
|
+
export { feature, enableFeature, disableFeature, resetFeature, listFeatures, type AppFeatureFlags, type FeatureFlag, type StacksFeature } from './features';
|
|
15
15
|
export { packageComponentRoots, packageJobRoots, packageMigrationRoots, packageModelRoots, packageViewRoots, type PackageResourceOptions, type PackageResourceRoot } from './discovered-resources';
|
|
16
16
|
export { DEFAULT_VIEW_ROUTE_BUNDLES, DEFAULT_VIEW_TEMPLATES, DEFAULT_VIEWS_ALWAYS, resolveViewPatterns, withheldDefaultViews, type DefaultViewsSetting, type ViewPatternResolution } from './views';
|
|
17
17
|
export {
|
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.
|
|
5
|
+
"version": "0.75.87",
|
|
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.
|
|
59
|
-
"@stacksjs/features": "0.75.
|
|
60
|
-
"@stacksjs/path": "0.75.
|
|
61
|
-
"@stacksjs/tunnel": "0.75.
|
|
58
|
+
"@stacksjs/events": "0.75.87",
|
|
59
|
+
"@stacksjs/features": "0.75.87",
|
|
60
|
+
"@stacksjs/path": "0.75.87",
|
|
61
|
+
"@stacksjs/tunnel": "0.75.87",
|
|
62
62
|
"ts-pantry": "^0.11.69"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
|
-
"@stacksjs/alias": "0.75.
|
|
66
|
-
"@stacksjs/types": "0.75.
|
|
65
|
+
"@stacksjs/alias": "0.75.87",
|
|
66
|
+
"@stacksjs/types": "0.75.87",
|
|
67
67
|
"better-dx": "^0.2.24"
|
|
68
68
|
}
|
|
69
69
|
}
|