@stacksjs/features 0.75.81 → 0.75.82

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/index.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import { FEATURE_NAMES, type FeatureName } from './names';
2
+ export type { FeatureName } from './names';
1
3
  /**
2
4
  * Parse a migration filename like `0000000045-create-posts-table.sql` or
3
5
  * `0000000085-alter-posts-author_id.sql` to extract the table name it
@@ -25,7 +27,6 @@ export declare function migrationFeature(filename: string): FeatureName | null;
25
27
  * the gate.
26
28
  */
27
29
  export declare function appModelClaimsTable(table: string, root?: string): boolean;
28
- export declare const FEATURE_NAMES: readonly ['dashboard', 'commerce', 'cms', 'forms', 'marketing', 'monitoring', 'realtime', 'queue'];
29
30
  /**
30
31
  * Per-feature stamped file/directory manifest. Paths are relative to the
31
32
  * project root and mirror the layout that `./buddy new` lays down. Entries
@@ -97,4 +98,7 @@ export declare const FEATURE_FILES: Record<FeatureName, readonly string[]>;
97
98
  * ```
98
99
  */
99
100
  export declare const FEATURE_TABLES: Record<FeatureName, readonly string[]>;
100
- export type FeatureName = (typeof FEATURE_NAMES)[number];
101
+ // Re-exported, so the package's surface is unchanged. They live in their own
102
+ // import-free module because `@stacksjs/config` needs only the names and is
103
+ // imported far too early to pay for this file's `node:fs` and path graph.
104
+ export { FEATURE_NAMES } from './names';
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{existsSync as c,readdirSync as d,readFileSync as l}from"fs";import{join as t}from"path";import{projectPath as m}from"@stacksjs/path";var n=["dashboard","commerce","cms","forms","marketing","monitoring","realtime","queue"],u={forms:["app/Models/Forms/"],cms:["app/Actions/Cms/","app/Actions/Dashboard/Content/","app/Actions/Dashboard/dashboard-response.ts","app/Models/Content/","app/Models/Tag.ts","app/Models/Comment.ts","resources/views/dashboard/content/"],commerce:["app/Actions/Commerce/","app/Actions/Dashboard/Commerce/","app/Actions/Dashboard/dashboard-response.ts","app/Models/commerce/","app/Models/PaymentMethod.ts","app/Models/PaymentProduct.ts","app/Models/PaymentTransaction.ts","app/Models/Subscriber.ts","app/Models/SubscriberEmail.ts","app/Models/Subscription.ts","resources/components/Dashboard/Commerce/","resources/views/dashboard/commerce/"],dashboard:["app/Actions/Dashboard/","app/Models/Board.ts","app/Models/BoardColumn.ts","app/Models/Card.ts","app/Models/CardComment.ts","app/Models/Label.ts","app/Models/Log.ts","app/Models/Request.ts","resources/components/Dashboard/","resources/views/dashboard/","routes/dashboard.ts","routes/dashboard-api.ts"],marketing:["app/Actions/Dashboard/Marketing/","app/Actions/Dashboard/dashboard-response.ts","app/Models/Campaign.ts","app/Models/CampaignSend.ts","app/Models/CampaignVariant.ts","app/Models/EmailList.ts","app/Models/EmailListSubscriber.ts","app/Models/MailPreference.ts","app/Models/SocialPost.ts","resources/components/Marketing/","resources/views/dashboard/marketing/"],monitoring:["app/Actions/Monitoring/","app/Actions/TestErrorAction.ts","app/Models/Error.ts","functions/monitoring/","resources/views/dashboard/monitoring/","resources/views/dashboard/errors/"],realtime:["app/Actions/Realtime/","app/Actions/Dashboard/Realtime/","app/Actions/Dashboard/dashboard-response.ts","app/Models/realtime/","app/Broadcasts/","functions/realtime/","resources/views/dashboard/realtime/"],queue:["app/Actions/Queue/","app/Actions/Dashboard/Jobs/","app/Actions/Dashboard/dashboard-response.ts","app/Jobs/","app/Models/Job.ts","app/Models/FailedJob.ts","functions/jobs.ts","resources/views/dashboard/queue/","resources/views/dashboard/jobs/"]},b={forms:["forms","form_fields","form_submissions"],cms:["posts","pages","comments","tags","authors","taggable_models","commentables","page_revisions","redirects","menus","menu_items"],commerce:["categories","products","product_variants","product_units","manufacturers","orders","order_items","order_idempotency","carts","cart_items","payments","payment_methods","payment_products","payment_transactions","payment_webhook_events","customers","subscribers","subscriber_emails","subscriptions","gift_cards","coupons","transactions","reviews","couriers","courier_pings","delivery_routes","delivery_stops","digital_deliveries","shipping_methods","shipping_rates","shipping_zones","license_keys","loyalty_points","loyalty_rewards","print_devices","receipts","tax_rates","waitlist_products","waitlist_restaurants","auctions","auction_items","bids","pledges"],dashboard:["boards","board_columns","cards","card_labels","card_assignees","card_comments","labels","ci_run_states","ci_runner_samples","ci_runner_alert_states","requests","logs"],marketing:["campaigns","campaign_sends","email_lists","email_list_subscribers","social_posts","mail_preferences","campaign_variants"],monitoring:["errors"],realtime:["websockets"],queue:["jobs","failed_jobs"]};function _(a){let o=a.match(/-in-([a-z0-9_]+)\.sql$/i);if(o)return o[1]??null;let s=a.match(/-create-([a-z0-9_]+)-table\.sql$/i);if(s)return s[1]??null;let r=a.match(/-alter-([a-z0-9_]+)-/i);if(r)return r[1]??null;return null}function f(a){let o=_(a);if(!o)return null;for(let s of n)if(b[s].includes(o))return s;return null}function y(a,o=m()){let s=t(o,"app/Models");if(!c(s))return!1;let r=new Set(n.flatMap((e)=>u[e]).filter((e)=>e.startsWith("app/Models/")&&!e.endsWith("/"))),i=a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),p=new RegExp(`\\btable\\s*:\\s*['"]${i}['"]`);for(let e of d(s,{withFileTypes:!0})){if(!e.isFile()||!/\.[cm]?[jt]s$/.test(e.name))continue;if(r.has(`app/Models/${e.name}`))continue;if(p.test(l(t(s,e.name),"utf8")))return!0}return!1}export{u as FEATURE_FILES,n as FEATURE_NAMES,b as FEATURE_TABLES,y as appModelClaimsTable,f as migrationFeature,_ as migrationTable};
2
+ import{existsSync as c,readdirSync as d,readFileSync as l}from"fs";import{join as n}from"path";import{projectPath as m}from"@stacksjs/path";var t=["dashboard","commerce","cms","forms","marketing","monitoring","realtime","queue"];var u={forms:["app/Models/Forms/"],cms:["app/Actions/Cms/","app/Actions/Dashboard/Content/","app/Actions/Dashboard/dashboard-response.ts","app/Models/Content/","app/Models/Tag.ts","app/Models/Comment.ts","resources/views/dashboard/content/"],commerce:["app/Actions/Commerce/","app/Actions/Dashboard/Commerce/","app/Actions/Dashboard/dashboard-response.ts","app/Models/commerce/","app/Models/PaymentMethod.ts","app/Models/PaymentProduct.ts","app/Models/PaymentTransaction.ts","app/Models/Subscriber.ts","app/Models/SubscriberEmail.ts","app/Models/Subscription.ts","resources/components/Dashboard/Commerce/","resources/views/dashboard/commerce/"],dashboard:["app/Actions/Dashboard/","app/Models/Board.ts","app/Models/BoardColumn.ts","app/Models/Card.ts","app/Models/CardComment.ts","app/Models/Label.ts","app/Models/Log.ts","app/Models/Request.ts","resources/components/Dashboard/","resources/views/dashboard/","routes/dashboard.ts","routes/dashboard-api.ts"],marketing:["app/Actions/Dashboard/Marketing/","app/Actions/Dashboard/dashboard-response.ts","app/Models/Campaign.ts","app/Models/CampaignSend.ts","app/Models/CampaignVariant.ts","app/Models/EmailList.ts","app/Models/EmailListSubscriber.ts","app/Models/MailPreference.ts","app/Models/SocialPost.ts","resources/components/Marketing/","resources/views/dashboard/marketing/"],monitoring:["app/Actions/Monitoring/","app/Actions/TestErrorAction.ts","app/Models/Error.ts","functions/monitoring/","resources/views/dashboard/monitoring/","resources/views/dashboard/errors/"],realtime:["app/Actions/Realtime/","app/Actions/Dashboard/Realtime/","app/Actions/Dashboard/dashboard-response.ts","app/Models/realtime/","app/Broadcasts/","functions/realtime/","resources/views/dashboard/realtime/"],queue:["app/Actions/Queue/","app/Actions/Dashboard/Jobs/","app/Actions/Dashboard/dashboard-response.ts","app/Jobs/","app/Models/Job.ts","app/Models/FailedJob.ts","functions/jobs.ts","resources/views/dashboard/queue/","resources/views/dashboard/jobs/"]},b={forms:["forms","form_fields","form_submissions"],cms:["posts","pages","comments","tags","authors","taggable_models","commentables","page_revisions","redirects","menus","menu_items"],commerce:["categories","products","product_variants","product_units","manufacturers","orders","order_items","order_idempotency","carts","cart_items","payments","payment_methods","payment_products","payment_transactions","payment_webhook_events","customers","subscribers","subscriber_emails","subscriptions","gift_cards","coupons","transactions","reviews","couriers","courier_pings","delivery_routes","delivery_stops","digital_deliveries","shipping_methods","shipping_rates","shipping_zones","license_keys","loyalty_points","loyalty_rewards","print_devices","receipts","tax_rates","waitlist_products","waitlist_restaurants","auctions","auction_items","bids","pledges"],dashboard:["boards","board_columns","cards","card_labels","card_assignees","card_comments","labels","ci_run_states","ci_runner_samples","ci_runner_alert_states","requests","logs"],marketing:["campaigns","campaign_sends","email_lists","email_list_subscribers","social_posts","mail_preferences","campaign_variants"],monitoring:["errors"],realtime:["websockets"],queue:["jobs","failed_jobs"]};function _(a){let r=a.match(/-in-([a-z0-9_]+)\.sql$/i);if(r)return r[1]??null;let s=a.match(/-create-([a-z0-9_]+)-table\.sql$/i);if(s)return s[1]??null;let o=a.match(/-alter-([a-z0-9_]+)-/i);if(o)return o[1]??null;return null}function y(a){let r=_(a);if(!r)return null;for(let s of t)if(b[s].includes(r))return s;return null}function E(a,r=m()){let s=n(r,"app/Models");if(!c(s))return!1;let o=new Set(t.flatMap((e)=>u[e]).filter((e)=>e.startsWith("app/Models/")&&!e.endsWith("/"))),i=a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),p=new RegExp(`\\btable\\s*:\\s*['"]${i}['"]`);for(let e of d(s,{withFileTypes:!0})){if(!e.isFile()||!/\.[cm]?[jt]s$/.test(e.name))continue;if(o.has(`app/Models/${e.name}`))continue;if(p.test(l(n(s,e.name),"utf8")))return!0}return!1}export{u as FEATURE_FILES,t as FEATURE_NAMES,b as FEATURE_TABLES,E as appModelClaimsTable,y as migrationFeature,_ as migrationTable};
@@ -0,0 +1,15 @@
1
+ /**
2
+ * The installable feature bundles, and nothing else.
3
+ *
4
+ * Its own module, with no imports at all, so a consumer that only needs the
5
+ * names does not pull `node:fs` and `@stacksjs/path` with them. That consumer
6
+ * is `@stacksjs/config`, which derives its own feature list from this one and
7
+ * is imported on the earliest path in every process - the manifest half of
8
+ * this package costs about a millisecond there, and this costs nothing.
9
+ *
10
+ * A name here is a bundle with a `<feature>:install` command, a file manifest,
11
+ * a table manifest and migration gating. `auth` is deliberately not one: see
12
+ * `@stacksjs/config`'s feature list, which adds it.
13
+ */
14
+ export declare const FEATURE_NAMES: readonly ['dashboard', 'commerce', 'cms', 'forms', 'marketing', 'monitoring', 'realtime', 'queue'];
15
+ export type FeatureName = (typeof FEATURE_NAMES)[number];
package/dist/names.js ADDED
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ var e=["dashboard","commerce","cms","forms","marketing","monitoring","realtime","queue"];export{e as FEATURE_NAMES};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/features",
3
3
  "type": "module",
4
- "version": "0.75.81",
4
+ "version": "0.75.82",
5
5
  "description": "Which files and tables belong to which optional Stacks feature.",
6
6
  "author": "Chris Breuer",
7
7
  "contributors": [
@@ -30,6 +30,11 @@
30
30
  "bun": "./dist/index.js",
31
31
  "import": "./dist/index.js"
32
32
  },
33
+ "./names": {
34
+ "types": "./dist/names.d.ts",
35
+ "bun": "./dist/names.js",
36
+ "import": "./dist/names.js"
37
+ },
33
38
  "./*": {
34
39
  "import": "./dist/*"
35
40
  }
@@ -45,6 +50,6 @@
45
50
  "typecheck": "bun --bun tsc --noEmit"
46
51
  },
47
52
  "dependencies": {
48
- "@stacksjs/path": "0.75.81"
53
+ "@stacksjs/path": "0.75.82"
49
54
  }
50
55
  }