@agimon-ai/po-style-system-tooling 0.2.14-alpha.162 → 0.2.14-alpha.164

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/cli.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  const require_childProtocol = require("./childProtocol-cZ1kuh0D.cjs");
3
- const require_stdio = require("./stdio-BR6i6iI1.cjs");
3
+ const require_stdio = require("./stdio-3h_G0W8N.cjs");
4
4
  let node_fs = require("node:fs");
5
5
  let node_path = require("node:path");
6
6
  node_path = require_childProtocol.__toESM(node_path, 1);
package/dist/cli.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { A as resolveStyleSystemThemePath, F as TailwindCSSClassesService, L as STYLE_SYSTEM_TYPES, P as DEFAULT_STYLE_SYSTEM_CONFIG, a as STYLE_SYSTEM_CLI_NAME, i as createServer$1, o as STYLE_SYSTEM_VERSION, r as generateRestrictedClassesConfig, s as createContainer, t as StdioTransportHandler, w as getAppDesignSystemConfig, y as getBundlerServiceFromConfig } from "./stdio-DVUP4ViP.mjs";
2
+ import { A as resolveStyleSystemThemePath, F as TailwindCSSClassesService, L as STYLE_SYSTEM_TYPES, P as DEFAULT_STYLE_SYSTEM_CONFIG, a as STYLE_SYSTEM_CLI_NAME, i as createServer$1, o as STYLE_SYSTEM_VERSION, r as generateRestrictedClassesConfig, s as createContainer, t as StdioTransportHandler, w as getAppDesignSystemConfig, y as getBundlerServiceFromConfig } from "./stdio-o8IuWJEg.mjs";
3
3
  import { u as log } from "./childProtocol-DWDVc60s.mjs";
4
4
  import { promises } from "node:fs";
5
5
  import path, { join } from "node:path";
package/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_childProtocol = require("./childProtocol-cZ1kuh0D.cjs");
3
- const require_stdio = require("./stdio-BR6i6iI1.cjs");
3
+ const require_stdio = require("./stdio-3h_G0W8N.cjs");
4
4
  let node_fs = require("node:fs");
5
5
  let node_path = require("node:path");
6
6
  node_path = require_childProtocol.__toESM(node_path, 1);
package/dist/index.d.cts CHANGED
@@ -627,6 +627,7 @@ export declare class ChildBundlerService extends BaseBundlerService {
627
627
  private state;
628
628
  private sequence;
629
629
  private generation;
630
+ private readonly staticWorkers;
630
631
  private readonly pending;
631
632
  constructor(bundler?: ChildBundlerKey, workspaceRoot?: string | undefined, launch?: BundlerChildLauncher);
632
633
  getBundlerId(): string;
package/dist/index.d.mts CHANGED
@@ -627,6 +627,7 @@ export declare class ChildBundlerService extends BaseBundlerService {
627
627
  private state;
628
628
  private sequence;
629
629
  private generation;
630
+ private readonly staticWorkers;
630
631
  private readonly pending;
631
632
  constructor(bundler?: ChildBundlerKey, workspaceRoot?: string | undefined, launch?: BundlerChildLauncher);
632
633
  getBundlerId(): string;
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { A as resolveStyleSystemThemePath, C as withRenderSlot, D as resetStyleSystemConfigCache, E as hasStyleSystemProjectConfig, F as TailwindCSSClassesService, I as BaseCSSClassesService, L as STYLE_SYSTEM_TYPES, M as StoriesIndexService, N as CSSClassesServiceFactory, O as resolveAppDesignSystemConfig, P as DEFAULT_STYLE_SYSTEM_CONFIG, S as launchBrowserWithFallback, T as getSharedComponentTags, _ as createDefaultBundlerService, b as ChildBundlerService, c as createStyleSystemModule, d as GetComponentVisualTool, f as GetCSSClassesTool, g as ThemeService, h as ComponentRendererService, i as createServer, j as MAX_STYLE_SYSTEM_VIEWPORT_DIMENSION, k as StyleSystemConfigLoader, l as ListAppComponentsTool, m as GetUiComponentService, n as extractCustomTokenNames, p as ListThemesTool, r as generateRestrictedClassesConfig, s as createContainer, t as StdioTransportHandler, u as ListSharedComponentsTool, v as getBundlerService, w as getAppDesignSystemConfig, x as createBundlerChildLauncher, y as getBundlerServiceFromConfig } from "./stdio-DVUP4ViP.mjs";
1
+ import { A as resolveStyleSystemThemePath, C as withRenderSlot, D as resetStyleSystemConfigCache, E as hasStyleSystemProjectConfig, F as TailwindCSSClassesService, I as BaseCSSClassesService, L as STYLE_SYSTEM_TYPES, M as StoriesIndexService, N as CSSClassesServiceFactory, O as resolveAppDesignSystemConfig, P as DEFAULT_STYLE_SYSTEM_CONFIG, S as launchBrowserWithFallback, T as getSharedComponentTags, _ as createDefaultBundlerService, b as ChildBundlerService, c as createStyleSystemModule, d as GetComponentVisualTool, f as GetCSSClassesTool, g as ThemeService, h as ComponentRendererService, i as createServer, j as MAX_STYLE_SYSTEM_VIEWPORT_DIMENSION, k as StyleSystemConfigLoader, l as ListAppComponentsTool, m as GetUiComponentService, n as extractCustomTokenNames, p as ListThemesTool, r as generateRestrictedClassesConfig, s as createContainer, t as StdioTransportHandler, u as ListSharedComponentsTool, v as getBundlerService, w as getAppDesignSystemConfig, x as createBundlerChildLauncher, y as getBundlerServiceFromConfig } from "./stdio-o8IuWJEg.mjs";
2
2
  import { a as ViteReactBundlerService, c as isContained, i as ViteReactNativeBundlerService, o as BaseBundlerService, s as TemplatesManagerService, u as log } from "./childProtocol-DWDVc60s.mjs";
3
3
  import { promises } from "node:fs";
4
4
  import path from "node:path";
@@ -1675,7 +1675,7 @@ const EMPTY_STATE = {
1675
1675
  };
1676
1676
  const REQUEST_TIMEOUT_MS = 12e4;
1677
1677
  /** BaseBundlerService proxy. Vite, its watchers and SQLite never run in this owner. */
1678
- var ChildBundlerService = class extends require_childProtocol.BaseBundlerService {
1678
+ var ChildBundlerService = class ChildBundlerService extends require_childProtocol.BaseBundlerService {
1679
1679
  bundler;
1680
1680
  workspaceRoot;
1681
1681
  launch;
@@ -1686,6 +1686,7 @@ var ChildBundlerService = class extends require_childProtocol.BaseBundlerService
1686
1686
  state = EMPTY_STATE;
1687
1687
  sequence = 0;
1688
1688
  generation = 0;
1689
+ staticWorkers = /* @__PURE__ */ new Set();
1689
1690
  pending = /* @__PURE__ */ new Map();
1690
1691
  constructor(bundler = "vite-react", workspaceRoot, launch = launchBundlerChild) {
1691
1692
  super();
@@ -1720,19 +1721,33 @@ var ChildBundlerService = class extends require_childProtocol.BaseBundlerService
1720
1721
  return this.request("serveComponent", options);
1721
1722
  }
1722
1723
  async prerenderComponent(options) {
1723
- await this.initialize();
1724
- return this.request("prerenderComponent", options);
1724
+ if (this.initializing || this.closing) {
1725
+ await this.initialize();
1726
+ return this.request("prerenderComponent", options);
1727
+ }
1728
+ const worker = new ChildBundlerService(this.bundler, this.workspaceRoot, this.launch);
1729
+ this.staticWorkers.add(worker);
1730
+ try {
1731
+ await worker.initialize();
1732
+ return await worker.request("prerenderComponent", options);
1733
+ } finally {
1734
+ try {
1735
+ await worker.cleanup();
1736
+ } finally {
1737
+ this.staticWorkers.delete(worker);
1738
+ }
1739
+ }
1725
1740
  }
1726
1741
  cleanup() {
1727
1742
  if (this.closing) return this.closing;
1728
1743
  const child = this.child;
1729
- if (!child) {
1744
+ if (!child && this.staticWorkers.size === 0) {
1730
1745
  this.generation++;
1731
1746
  this.failure = void 0;
1732
1747
  this.initializing = void 0;
1733
1748
  return Promise.resolve();
1734
1749
  }
1735
- this.closing = this.close(child).finally(() => {
1750
+ this.closing = Promise.all([child && this.close(child), ...Array.from(this.staticWorkers, (worker) => worker.cleanup())]).then(() => void 0).finally(() => {
1736
1751
  this.generation++;
1737
1752
  this.child = void 0;
1738
1753
  this.initializing = void 0;
@@ -3523,7 +3538,7 @@ function createContainer(options) {
3523
3538
  }
3524
3539
  //#endregion
3525
3540
  //#region package.json
3526
- var version = "0.2.14-alpha.162";
3541
+ var version = "0.2.14-alpha.164";
3527
3542
  //#endregion
3528
3543
  //#region src/metadata.ts
3529
3544
  const STYLE_SYSTEM_CLI_NAME = "style-system";
@@ -1671,7 +1671,7 @@ const EMPTY_STATE = {
1671
1671
  };
1672
1672
  const REQUEST_TIMEOUT_MS = 12e4;
1673
1673
  /** BaseBundlerService proxy. Vite, its watchers and SQLite never run in this owner. */
1674
- var ChildBundlerService = class extends BaseBundlerService {
1674
+ var ChildBundlerService = class ChildBundlerService extends BaseBundlerService {
1675
1675
  bundler;
1676
1676
  workspaceRoot;
1677
1677
  launch;
@@ -1682,6 +1682,7 @@ var ChildBundlerService = class extends BaseBundlerService {
1682
1682
  state = EMPTY_STATE;
1683
1683
  sequence = 0;
1684
1684
  generation = 0;
1685
+ staticWorkers = /* @__PURE__ */ new Set();
1685
1686
  pending = /* @__PURE__ */ new Map();
1686
1687
  constructor(bundler = "vite-react", workspaceRoot, launch = launchBundlerChild) {
1687
1688
  super();
@@ -1716,19 +1717,33 @@ var ChildBundlerService = class extends BaseBundlerService {
1716
1717
  return this.request("serveComponent", options);
1717
1718
  }
1718
1719
  async prerenderComponent(options) {
1719
- await this.initialize();
1720
- return this.request("prerenderComponent", options);
1720
+ if (this.initializing || this.closing) {
1721
+ await this.initialize();
1722
+ return this.request("prerenderComponent", options);
1723
+ }
1724
+ const worker = new ChildBundlerService(this.bundler, this.workspaceRoot, this.launch);
1725
+ this.staticWorkers.add(worker);
1726
+ try {
1727
+ await worker.initialize();
1728
+ return await worker.request("prerenderComponent", options);
1729
+ } finally {
1730
+ try {
1731
+ await worker.cleanup();
1732
+ } finally {
1733
+ this.staticWorkers.delete(worker);
1734
+ }
1735
+ }
1721
1736
  }
1722
1737
  cleanup() {
1723
1738
  if (this.closing) return this.closing;
1724
1739
  const child = this.child;
1725
- if (!child) {
1740
+ if (!child && this.staticWorkers.size === 0) {
1726
1741
  this.generation++;
1727
1742
  this.failure = void 0;
1728
1743
  this.initializing = void 0;
1729
1744
  return Promise.resolve();
1730
1745
  }
1731
- this.closing = this.close(child).finally(() => {
1746
+ this.closing = Promise.all([child && this.close(child), ...Array.from(this.staticWorkers, (worker) => worker.cleanup())]).then(() => void 0).finally(() => {
1732
1747
  this.generation++;
1733
1748
  this.child = void 0;
1734
1749
  this.initializing = void 0;
@@ -3519,7 +3534,7 @@ function createContainer(options) {
3519
3534
  }
3520
3535
  //#endregion
3521
3536
  //#region package.json
3522
- var version = "0.2.14-alpha.162";
3537
+ var version = "0.2.14-alpha.164";
3523
3538
  //#endregion
3524
3539
  //#region src/metadata.ts
3525
3540
  const STYLE_SYSTEM_CLI_NAME = "style-system";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agimon-ai/po-style-system-tooling",
3
- "version": "0.2.14-alpha.162",
3
+ "version": "0.2.14-alpha.164",
4
4
  "description": "MCP server for exploring themes, Tailwind CSS classes, and UI components from Storybook with standalone component rendering capabilities",
5
5
  "keywords": [
6
6
  "design-system",