@animus-ui/next-plugin 0.1.0-next.58 → 0.1.0-next.60

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.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_singleton = require("./singleton-VPOM1BCR.cjs");
2
+ const require_singleton = require("./singleton-Cyu9XArN.cjs");
3
3
  let fs = require("fs");
4
4
  let path = require("path");
5
5
  let url = require("url");
@@ -23,6 +23,7 @@ var AnimusWebpackPlugin = class {
23
23
  pathAliasesJson = null;
24
24
  fileCache = /* @__PURE__ */ new Map();
25
25
  lastCssHash = null;
26
+ lastSystemPropsHash = null;
26
27
  externalPackageDirs = [];
27
28
  externalSourceEntries = /* @__PURE__ */ new Map();
28
29
  constructor(options) {
@@ -118,6 +119,25 @@ var AnimusWebpackPlugin = class {
118
119
  if (entries.length > 0) this.pathAliasesJson = JSON.stringify({ aliases: entries });
119
120
  }
120
121
  apply(compiler) {
122
+ if (compiler.options?.name === "edge-server") return;
123
+ compiler.hooks.compilation.tap(PLUGIN_NAME, (compilation) => {
124
+ const stage = compiler.webpack?.Compilation.PROCESS_ASSETS_STAGE_ADDITIONAL ?? -2e3;
125
+ const RawSource = compiler.webpack?.sources.RawSource;
126
+ compilation.hooks.processAssets.tap({
127
+ name: PLUGIN_NAME,
128
+ stage
129
+ }, () => {
130
+ const css = require_singleton.getSharedCss();
131
+ if (!css || !RawSource) return;
132
+ const cssPath = (0, path.join)(this.rootDir || compiler.context, ".animus", "styles.css");
133
+ if (compilation.getAsset(cssPath)) {
134
+ compilation.updateAsset(cssPath, new RawSource(css));
135
+ return;
136
+ }
137
+ const relPath = ".animus/styles.css";
138
+ if (compilation.getAsset(relPath)) compilation.updateAsset(relPath, new RawSource(css));
139
+ });
140
+ });
121
141
  compiler.hooks.run.tapPromise(PLUGIN_NAME, async (_compiler) => {
122
142
  this.rootDir = _compiler.context;
123
143
  this.extractAliases(_compiler);
@@ -150,6 +170,7 @@ var AnimusWebpackPlugin = class {
150
170
  });
151
171
  }
152
172
  async handleWatchUpdate() {
173
+ if (this.configJson === "") return;
153
174
  const rootDir = this.rootDir;
154
175
  const resolvedSystemPath = (0, path.resolve)(rootDir, this.options.system);
155
176
  try {
@@ -281,6 +302,8 @@ var AnimusWebpackPlugin = class {
281
302
  } else collectedPkgDirs.push((0, path.dirname)(absEntry));
282
303
  }
283
304
  this.externalPackageDirs = collectedPkgDirs;
305
+ require_singleton.setSharedExternalDirs(collectedPkgDirs);
306
+ require_singleton.setSharedExternalEntries(this.externalSourceEntries);
284
307
  bt.packageResolve = this.elapsed(t);
285
308
  const { analyzeProject } = require("@animus-ui/extract");
286
309
  const animusDirPath = (0, path.join)(rootDir, ".animus");
@@ -310,6 +333,7 @@ var AnimusWebpackPlugin = class {
310
333
  globalCss: this.globalCss,
311
334
  componentCss
312
335
  });
336
+ require_singleton.setSharedCss(fullCss);
313
337
  const cssHash = (0, crypto.createHash)("md5").update(fullCss).digest("hex");
314
338
  if (cssHash !== this.lastCssHash) {
315
339
  const animusDir = (0, path.join)(rootDir, ".animus");
@@ -329,7 +353,9 @@ var AnimusWebpackPlugin = class {
329
353
  const transformsSource = "{}";
330
354
  const animusDir = (0, path.join)(rootDir, ".animus");
331
355
  if (!(0, fs.existsSync)(animusDir)) (0, fs.mkdirSync)(animusDir, { recursive: true });
332
- (0, fs.writeFileSync)((0, path.join)(animusDir, "system-props.js"), `export const systemPropMap = ${systemPropMap};\nexport const systemPropGroups = ${this.groupRegistryJson};\nexport const dynamicPropConfig = ${JSON.stringify(dynamicPropConfig)};\nexport const transforms = ${transformsSource};\n`);
356
+ const systemPropsContent = `export const systemPropMap = ${systemPropMap};\nexport const systemPropGroups = ${this.groupRegistryJson};\nexport const dynamicPropConfig = ${JSON.stringify(dynamicPropConfig)};\nexport const transforms = ${transformsSource};\n`;
357
+ require_singleton.setSharedSystemProps(systemPropsContent);
358
+ (0, fs.writeFileSync)((0, path.join)(animusDir, "system-props.js"), systemPropsContent);
333
359
  require_singleton.setManifestJson(manifestJson);
334
360
  bt.total = this.elapsed(pipelineStart);
335
361
  this.logBuildTimings(bt, manifest?.timing);
@@ -423,6 +449,7 @@ var AnimusWebpackPlugin = class {
423
449
  resetForHmr() {
424
450
  require_singleton.resetAnalysisPromise();
425
451
  this.lastCssHash = null;
452
+ this.lastSystemPropsHash = null;
426
453
  try {
427
454
  const { clearAnalysisCache } = require("@animus-ui/extract");
428
455
  clearAnalysisCache();
@@ -454,14 +481,15 @@ var AnimusWebpackPlugin = class {
454
481
  const animusDirPath = (0, path.join)(rootDir, ".animus");
455
482
  const emitterConfig = JSON.stringify({
456
483
  runtime_import: "@animus-ui/system/runtime",
457
- css_module_id: (0, path.join)(animusDirPath, "system-props.js")
484
+ css_module_id: ".animus/styles.css",
485
+ system_props_module_id: (0, path.join)(animusDirPath, "system-props.js")
458
486
  });
459
487
  const packageMapJson = JSON.stringify(Object.fromEntries(Array.from(this.externalSourceEntries).map(([spec, entry]) => [spec, (0, path.relative)(rootDir, entry)])));
460
488
  let t = this.now();
461
489
  const fileEntriesJson = JSON.stringify(fileEntries);
462
490
  bt.jsonSerialize = this.elapsed(t);
463
491
  t = this.now();
464
- const manifestJson = analyzeProject(fileEntriesJson, this.themeJson, this.variableMapJson, this.contextualVarsJson || null, this.configJson, this.groupRegistryJson, packageMapJson, false, emitterConfig, this.selectorAliasesJson, this.selectorOrderJson, this.globalStyleBlocksJson, this.pathAliasesJson);
492
+ const manifestJson = analyzeProject(fileEntriesJson, this.themeJson, this.variableMapJson, this.contextualVarsJson || null, this.configJson, this.groupRegistryJson, packageMapJson, true, emitterConfig, this.selectorAliasesJson, this.selectorOrderJson, this.globalStyleBlocksJson, this.pathAliasesJson);
465
493
  bt.rustExtract = this.elapsed(t);
466
494
  t = this.now();
467
495
  const manifest = JSON.parse(manifestJson);
@@ -475,6 +503,7 @@ var AnimusWebpackPlugin = class {
475
503
  globalCss: this.globalCss,
476
504
  componentCss
477
505
  });
506
+ require_singleton.setSharedCss(fullCss);
478
507
  const cssHash = (0, crypto.createHash)("md5").update(fullCss).digest("hex");
479
508
  if (cssHash !== this.lastCssHash) {
480
509
  const animusDir = (0, path.join)(rootDir, ".animus");
@@ -482,6 +511,24 @@ var AnimusWebpackPlugin = class {
482
511
  (0, fs.writeFileSync)((0, path.join)(animusDir, "styles.css"), fullCss);
483
512
  this.lastCssHash = cssHash;
484
513
  }
514
+ const systemPropMap = JSON.stringify(manifest?.system_prop_map ?? {});
515
+ const dynamicProps = manifest?.dynamic_props ?? {};
516
+ const dynamicPropConfig = {};
517
+ for (const [propName, meta] of Object.entries(dynamicProps)) dynamicPropConfig[propName] = {
518
+ varName: meta.var_name,
519
+ slotClass: meta.slot_class,
520
+ ...meta.transform_name ? { transformName: meta.transform_name } : {},
521
+ ...meta.scale_values && Object.keys(meta.scale_values).length > 0 ? { scaleValues: meta.scale_values } : {}
522
+ };
523
+ const systemPropsContent = `export const systemPropMap = ${systemPropMap};\nexport const systemPropGroups = ${this.groupRegistryJson};\nexport const dynamicPropConfig = ${JSON.stringify(dynamicPropConfig)};\nexport const transforms = {};\n`;
524
+ require_singleton.setSharedSystemProps(systemPropsContent);
525
+ const systemPropsHash = (0, crypto.createHash)("md5").update(systemPropsContent).digest("hex");
526
+ if (systemPropsHash !== this.lastSystemPropsHash) {
527
+ const spDir = (0, path.join)(rootDir, ".animus");
528
+ if (!(0, fs.existsSync)(spDir)) (0, fs.mkdirSync)(spDir, { recursive: true });
529
+ (0, fs.writeFileSync)((0, path.join)(spDir, "system-props.js"), systemPropsContent);
530
+ this.lastSystemPropsHash = systemPropsHash;
531
+ }
485
532
  require_singleton.setManifestJson(manifestJson);
486
533
  bt.total = this.elapsed(pipelineStart);
487
534
  this.logBuildTimings(bt, manifest?.timing);
@@ -494,13 +541,15 @@ var AnimusWebpackPlugin = class {
494
541
  getOptions() {
495
542
  return this.options;
496
543
  }
497
- /** Expose external package directories for webpack loader allowlisting */
544
+ /** Expose external package directories for webpack loader allowlisting.
545
+ * Falls back to shared globalThis state for non-owning compiler instances. */
498
546
  getExternalPackageDirs() {
499
- return this.externalPackageDirs;
547
+ return this.externalPackageDirs.length > 0 ? this.externalPackageDirs : require_singleton.getSharedExternalDirs();
500
548
  }
501
- /** Expose external package source entries for webpack resolve alias */
549
+ /** Expose external package source entries for webpack resolve alias.
550
+ * Falls back to shared globalThis state for non-owning compiler instances. */
502
551
  getExternalSourceEntries() {
503
- return this.externalSourceEntries;
552
+ return this.externalSourceEntries.size > 0 ? this.externalSourceEntries : require_singleton.getSharedExternalEntries();
504
553
  }
505
554
  };
506
555
  //#endregion
@@ -526,6 +575,8 @@ function withAnimus(options) {
526
575
  const rootDir = process.cwd();
527
576
  const animusDir = (0, path.join)(rootDir, ".animus");
528
577
  if (!(0, fs.existsSync)(animusDir)) (0, fs.mkdirSync)(animusDir, { recursive: true });
578
+ const stubCssPath = (0, path.join)(animusDir, "styles.css");
579
+ if (!(0, fs.existsSync)(stubCssPath)) (0, fs.writeFileSync)(stubCssPath, "@layer anm-global, anm-base, anm-variants, anm-compounds, anm-states, anm-system, anm-custom;\n");
529
580
  if (!warnedGitignore) {
530
581
  warnedGitignore = true;
531
582
  try {
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { a as setManifestJson, i as setAnalysisPromise, o as __require, r as resetAnalysisPromise, t as getAnalysisPromise } from "./singleton-BZ7W87Ir.mjs";
1
+ import { a as getSharedExternalEntries, c as setManifestJson, d as setSharedExternalEntries, f as setSharedSystemProps, i as getSharedExternalDirs, l as setSharedCss, o as resetAnalysisPromise, p as __require, r as getSharedCss, s as setAnalysisPromise, t as getAnalysisPromise, u as setSharedExternalDirs } from "./singleton-BZ9F3FQ_.mjs";
2
2
  import { existsSync, mkdirSync, readFileSync, readdirSync, statSync, writeFileSync } from "fs";
3
3
  import { dirname, extname, join, relative, resolve, sep } from "path";
4
4
  import { fileURLToPath } from "url";
@@ -22,6 +22,7 @@ var AnimusWebpackPlugin = class {
22
22
  pathAliasesJson = null;
23
23
  fileCache = /* @__PURE__ */ new Map();
24
24
  lastCssHash = null;
25
+ lastSystemPropsHash = null;
25
26
  externalPackageDirs = [];
26
27
  externalSourceEntries = /* @__PURE__ */ new Map();
27
28
  constructor(options) {
@@ -117,6 +118,25 @@ var AnimusWebpackPlugin = class {
117
118
  if (entries.length > 0) this.pathAliasesJson = JSON.stringify({ aliases: entries });
118
119
  }
119
120
  apply(compiler) {
121
+ if (compiler.options?.name === "edge-server") return;
122
+ compiler.hooks.compilation.tap(PLUGIN_NAME, (compilation) => {
123
+ const stage = compiler.webpack?.Compilation.PROCESS_ASSETS_STAGE_ADDITIONAL ?? -2e3;
124
+ const RawSource = compiler.webpack?.sources.RawSource;
125
+ compilation.hooks.processAssets.tap({
126
+ name: PLUGIN_NAME,
127
+ stage
128
+ }, () => {
129
+ const css = getSharedCss();
130
+ if (!css || !RawSource) return;
131
+ const cssPath = join(this.rootDir || compiler.context, ".animus", "styles.css");
132
+ if (compilation.getAsset(cssPath)) {
133
+ compilation.updateAsset(cssPath, new RawSource(css));
134
+ return;
135
+ }
136
+ const relPath = ".animus/styles.css";
137
+ if (compilation.getAsset(relPath)) compilation.updateAsset(relPath, new RawSource(css));
138
+ });
139
+ });
120
140
  compiler.hooks.run.tapPromise(PLUGIN_NAME, async (_compiler) => {
121
141
  this.rootDir = _compiler.context;
122
142
  this.extractAliases(_compiler);
@@ -149,6 +169,7 @@ var AnimusWebpackPlugin = class {
149
169
  });
150
170
  }
151
171
  async handleWatchUpdate() {
172
+ if (this.configJson === "") return;
152
173
  const rootDir = this.rootDir;
153
174
  const resolvedSystemPath = resolve(rootDir, this.options.system);
154
175
  try {
@@ -280,6 +301,8 @@ var AnimusWebpackPlugin = class {
280
301
  } else collectedPkgDirs.push(dirname(absEntry));
281
302
  }
282
303
  this.externalPackageDirs = collectedPkgDirs;
304
+ setSharedExternalDirs(collectedPkgDirs);
305
+ setSharedExternalEntries(this.externalSourceEntries);
283
306
  bt.packageResolve = this.elapsed(t);
284
307
  const { analyzeProject } = __require("@animus-ui/extract");
285
308
  const animusDirPath = join(rootDir, ".animus");
@@ -309,6 +332,7 @@ var AnimusWebpackPlugin = class {
309
332
  globalCss: this.globalCss,
310
333
  componentCss
311
334
  });
335
+ setSharedCss(fullCss);
312
336
  const cssHash = createHash("md5").update(fullCss).digest("hex");
313
337
  if (cssHash !== this.lastCssHash) {
314
338
  const animusDir = join(rootDir, ".animus");
@@ -328,7 +352,9 @@ var AnimusWebpackPlugin = class {
328
352
  const transformsSource = "{}";
329
353
  const animusDir = join(rootDir, ".animus");
330
354
  if (!existsSync(animusDir)) mkdirSync(animusDir, { recursive: true });
331
- writeFileSync(join(animusDir, "system-props.js"), `export const systemPropMap = ${systemPropMap};\nexport const systemPropGroups = ${this.groupRegistryJson};\nexport const dynamicPropConfig = ${JSON.stringify(dynamicPropConfig)};\nexport const transforms = ${transformsSource};\n`);
355
+ const systemPropsContent = `export const systemPropMap = ${systemPropMap};\nexport const systemPropGroups = ${this.groupRegistryJson};\nexport const dynamicPropConfig = ${JSON.stringify(dynamicPropConfig)};\nexport const transforms = ${transformsSource};\n`;
356
+ setSharedSystemProps(systemPropsContent);
357
+ writeFileSync(join(animusDir, "system-props.js"), systemPropsContent);
332
358
  setManifestJson(manifestJson);
333
359
  bt.total = this.elapsed(pipelineStart);
334
360
  this.logBuildTimings(bt, manifest?.timing);
@@ -422,6 +448,7 @@ var AnimusWebpackPlugin = class {
422
448
  resetForHmr() {
423
449
  resetAnalysisPromise();
424
450
  this.lastCssHash = null;
451
+ this.lastSystemPropsHash = null;
425
452
  try {
426
453
  const { clearAnalysisCache } = __require("@animus-ui/extract");
427
454
  clearAnalysisCache();
@@ -453,14 +480,15 @@ var AnimusWebpackPlugin = class {
453
480
  const animusDirPath = join(rootDir, ".animus");
454
481
  const emitterConfig = JSON.stringify({
455
482
  runtime_import: "@animus-ui/system/runtime",
456
- css_module_id: join(animusDirPath, "system-props.js")
483
+ css_module_id: ".animus/styles.css",
484
+ system_props_module_id: join(animusDirPath, "system-props.js")
457
485
  });
458
486
  const packageMapJson = JSON.stringify(Object.fromEntries(Array.from(this.externalSourceEntries).map(([spec, entry]) => [spec, relative(rootDir, entry)])));
459
487
  let t = this.now();
460
488
  const fileEntriesJson = JSON.stringify(fileEntries);
461
489
  bt.jsonSerialize = this.elapsed(t);
462
490
  t = this.now();
463
- const manifestJson = analyzeProject(fileEntriesJson, this.themeJson, this.variableMapJson, this.contextualVarsJson || null, this.configJson, this.groupRegistryJson, packageMapJson, false, emitterConfig, this.selectorAliasesJson, this.selectorOrderJson, this.globalStyleBlocksJson, this.pathAliasesJson);
491
+ const manifestJson = analyzeProject(fileEntriesJson, this.themeJson, this.variableMapJson, this.contextualVarsJson || null, this.configJson, this.groupRegistryJson, packageMapJson, true, emitterConfig, this.selectorAliasesJson, this.selectorOrderJson, this.globalStyleBlocksJson, this.pathAliasesJson);
464
492
  bt.rustExtract = this.elapsed(t);
465
493
  t = this.now();
466
494
  const manifest = JSON.parse(manifestJson);
@@ -474,6 +502,7 @@ var AnimusWebpackPlugin = class {
474
502
  globalCss: this.globalCss,
475
503
  componentCss
476
504
  });
505
+ setSharedCss(fullCss);
477
506
  const cssHash = createHash("md5").update(fullCss).digest("hex");
478
507
  if (cssHash !== this.lastCssHash) {
479
508
  const animusDir = join(rootDir, ".animus");
@@ -481,6 +510,24 @@ var AnimusWebpackPlugin = class {
481
510
  writeFileSync(join(animusDir, "styles.css"), fullCss);
482
511
  this.lastCssHash = cssHash;
483
512
  }
513
+ const systemPropMap = JSON.stringify(manifest?.system_prop_map ?? {});
514
+ const dynamicProps = manifest?.dynamic_props ?? {};
515
+ const dynamicPropConfig = {};
516
+ for (const [propName, meta] of Object.entries(dynamicProps)) dynamicPropConfig[propName] = {
517
+ varName: meta.var_name,
518
+ slotClass: meta.slot_class,
519
+ ...meta.transform_name ? { transformName: meta.transform_name } : {},
520
+ ...meta.scale_values && Object.keys(meta.scale_values).length > 0 ? { scaleValues: meta.scale_values } : {}
521
+ };
522
+ const systemPropsContent = `export const systemPropMap = ${systemPropMap};\nexport const systemPropGroups = ${this.groupRegistryJson};\nexport const dynamicPropConfig = ${JSON.stringify(dynamicPropConfig)};\nexport const transforms = {};\n`;
523
+ setSharedSystemProps(systemPropsContent);
524
+ const systemPropsHash = createHash("md5").update(systemPropsContent).digest("hex");
525
+ if (systemPropsHash !== this.lastSystemPropsHash) {
526
+ const spDir = join(rootDir, ".animus");
527
+ if (!existsSync(spDir)) mkdirSync(spDir, { recursive: true });
528
+ writeFileSync(join(spDir, "system-props.js"), systemPropsContent);
529
+ this.lastSystemPropsHash = systemPropsHash;
530
+ }
484
531
  setManifestJson(manifestJson);
485
532
  bt.total = this.elapsed(pipelineStart);
486
533
  this.logBuildTimings(bt, manifest?.timing);
@@ -493,13 +540,15 @@ var AnimusWebpackPlugin = class {
493
540
  getOptions() {
494
541
  return this.options;
495
542
  }
496
- /** Expose external package directories for webpack loader allowlisting */
543
+ /** Expose external package directories for webpack loader allowlisting.
544
+ * Falls back to shared globalThis state for non-owning compiler instances. */
497
545
  getExternalPackageDirs() {
498
- return this.externalPackageDirs;
546
+ return this.externalPackageDirs.length > 0 ? this.externalPackageDirs : getSharedExternalDirs();
499
547
  }
500
- /** Expose external package source entries for webpack resolve alias */
548
+ /** Expose external package source entries for webpack resolve alias.
549
+ * Falls back to shared globalThis state for non-owning compiler instances. */
501
550
  getExternalSourceEntries() {
502
- return this.externalSourceEntries;
551
+ return this.externalSourceEntries.size > 0 ? this.externalSourceEntries : getSharedExternalEntries();
503
552
  }
504
553
  };
505
554
  //#endregion
@@ -525,6 +574,8 @@ function withAnimus(options) {
525
574
  const rootDir = process.cwd();
526
575
  const animusDir = join(rootDir, ".animus");
527
576
  if (!existsSync(animusDir)) mkdirSync(animusDir, { recursive: true });
577
+ const stubCssPath = join(animusDir, "styles.css");
578
+ if (!existsSync(stubCssPath)) writeFileSync(stubCssPath, "@layer anm-global, anm-base, anm-variants, anm-compounds, anm-states, anm-system, anm-custom;\n");
528
579
  if (!warnedGitignore) {
529
580
  warnedGitignore = true;
530
581
  try {
package/dist/loader.cjs CHANGED
@@ -1,4 +1,4 @@
1
- const require_singleton = require("./singleton-VPOM1BCR.cjs");
1
+ const require_singleton = require("./singleton-Cyu9XArN.cjs");
2
2
  let path = require("path");
3
3
  //#region src/loader.ts
4
4
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAIA,KAAK,aAAa,GAAG;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM;QAAE,MAAM,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;CACxC,CAAC;AAuBF;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,IAAI,EAAE,aAAa,EACnB,MAAM,EAAE,MAAM,GACb,MAAM,CAwCR"}
1
+ {"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAIA,KAAK,aAAa,GAAG;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM;QAAE,MAAM,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;CACxC,CAAC;AAuBF;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,IAAI,EAAE,aAAa,EACnB,MAAM,EAAE,MAAM,GACb,MAAM,CAyCR"}
package/dist/loader.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { n as getManifestJson, o as __require } from "./singleton-BZ7W87Ir.mjs";
1
+ import { n as getManifestJson, p as __require } from "./singleton-BZ9F3FQ_.mjs";
2
2
  import { relative } from "path";
3
3
  //#region src/loader.ts
4
4
  /**
package/dist/plugin.d.ts CHANGED
@@ -1,4 +1,22 @@
1
1
  import type { AnimusNextOptions } from './types';
2
+ type WebpackSource = {
3
+ source(): string | Buffer;
4
+ size(): number;
5
+ };
6
+ type Compilation = {
7
+ hooks: {
8
+ processAssets: {
9
+ tap: (options: {
10
+ name: string;
11
+ stage: number;
12
+ }, fn: (assets: Record<string, WebpackSource>) => void) => void;
13
+ };
14
+ };
15
+ getAsset(name: string): {
16
+ source: WebpackSource;
17
+ } | undefined;
18
+ updateAsset(name: string, newSource: WebpackSource): void;
19
+ };
2
20
  type Compiler = {
3
21
  hooks: {
4
22
  run: {
@@ -7,13 +25,25 @@ type Compiler = {
7
25
  watchRun: {
8
26
  tapPromise: (name: string, fn: (c: Compiler) => Promise<void>) => void;
9
27
  };
28
+ compilation: {
29
+ tap: (name: string, fn: (compilation: Compilation) => void) => void;
30
+ };
10
31
  };
11
32
  context: string;
12
33
  options?: {
34
+ name?: string;
13
35
  resolve?: {
14
36
  alias?: Record<string, string | string[] | false>;
15
37
  };
16
38
  };
39
+ webpack?: {
40
+ Compilation: {
41
+ PROCESS_ASSETS_STAGE_ADDITIONAL: number;
42
+ };
43
+ sources: {
44
+ RawSource: new (source: string) => WebpackSource;
45
+ };
46
+ };
17
47
  };
18
48
  export declare class AnimusWebpackPlugin {
19
49
  private options;
@@ -31,6 +61,7 @@ export declare class AnimusWebpackPlugin {
31
61
  private pathAliasesJson;
32
62
  private fileCache;
33
63
  private lastCssHash;
64
+ private lastSystemPropsHash;
34
65
  private externalPackageDirs;
35
66
  private externalSourceEntries;
36
67
  constructor(options: AnimusNextOptions);
@@ -69,9 +100,11 @@ export declare class AnimusWebpackPlugin {
69
100
  }>;
70
101
  /** Expose options for the loader */
71
102
  getOptions(): AnimusNextOptions;
72
- /** Expose external package directories for webpack loader allowlisting */
103
+ /** Expose external package directories for webpack loader allowlisting.
104
+ * Falls back to shared globalThis state for non-owning compiler instances. */
73
105
  getExternalPackageDirs(): string[];
74
- /** Expose external package source entries for webpack resolve alias */
106
+ /** Expose external package source entries for webpack resolve alias.
107
+ * Falls back to shared globalThis state for non-owning compiler instances. */
75
108
  getExternalSourceEntries(): Map<string, string>;
76
109
  }
77
110
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEjD,KAAK,QAAQ,GAAG;IACd,KAAK,EAAE;QACL,GAAG,EAAE;YACH,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,QAAQ,KAAK,OAAO,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;SACxE,CAAC;QACF,QAAQ,EAAE;YACR,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,QAAQ,KAAK,OAAO,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;SACxE,CAAC;KACH,CAAC;IACF,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE;QACR,OAAO,CAAC,EAAE;YACR,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,KAAK,CAAC,CAAC;SACnD,CAAC;KACH,CAAC;CACH,CAAC;AAIF,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,OAAO,CAAoB;IACnC,OAAO,CAAC,OAAO,CAAuB;IAGtC,OAAO,CAAC,UAAU,CAAM;IACxB,OAAO,CAAC,iBAAiB,CAAM;IAC/B,OAAO,CAAC,SAAS,CAAM;IACvB,OAAO,CAAC,eAAe,CAAM;IAC7B,OAAO,CAAC,WAAW,CAAM;IACzB,OAAO,CAAC,kBAAkB,CAAuB;IACjD,OAAO,CAAC,mBAAmB,CAAuB;IAClD,OAAO,CAAC,iBAAiB,CAAuB;IAChD,OAAO,CAAC,SAAS,CAAM;IACvB,OAAO,CAAC,qBAAqB,CAAuB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AejC;;;OAGG;YACW,sBAAsB;IA2HpC,iDAAiD;IACjD,YAAY,IAAI,GAAG,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAI7D,oCAAoC;IACpC,UAAU,IAAI,iBAAiB;IAI/B;mFAC+E;IAC/E,sBAAsB,IAAI,MAAM,EAAE;IAMlC;mFAC+E;IAC/E,wBAAwB,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC;CAKhD"}
@@ -0,0 +1,56 @@
1
+ import { createRequire } from "node:module";
2
+ //#region \0rolldown/runtime.js
3
+ var __require = /* @__PURE__ */ createRequire(import.meta.url);
4
+ //#endregion
5
+ //#region src/singleton.ts
6
+ /**
7
+ * Module-scope singleton for sharing analysis state between the webpack plugin and loader.
8
+ *
9
+ * Uses globalThis to survive the ESM/CJS module boundary: the plugin is loaded via ESM
10
+ * (next.config.ts import) while the loader is loaded by webpack via require(). Without
11
+ * globalThis, each module system gets its own singleton instance.
12
+ */
13
+ const MANIFEST_KEY = "__animus_manifest_json__";
14
+ const PROMISE_KEY = "__animus_analysis_promise__";
15
+ const SHARED_CSS_KEY = "__animus_shared_css__";
16
+ const SHARED_SYSTEM_PROPS_KEY = "__animus_shared_system_props__";
17
+ const SHARED_EXTERNAL_DIRS_KEY = "__animus_external_pkg_dirs__";
18
+ const SHARED_EXTERNAL_ENTRIES_KEY = "__animus_external_source_entries__";
19
+ function getManifestJson() {
20
+ return globalThis[MANIFEST_KEY];
21
+ }
22
+ function setManifestJson(json) {
23
+ globalThis[MANIFEST_KEY] = json;
24
+ }
25
+ function getAnalysisPromise() {
26
+ return globalThis[PROMISE_KEY];
27
+ }
28
+ function setAnalysisPromise(promise) {
29
+ globalThis[PROMISE_KEY] = promise;
30
+ }
31
+ function resetAnalysisPromise() {
32
+ globalThis[PROMISE_KEY] = null;
33
+ }
34
+ function getSharedCss() {
35
+ return globalThis[SHARED_CSS_KEY] || "";
36
+ }
37
+ function setSharedCss(css) {
38
+ globalThis[SHARED_CSS_KEY] = css;
39
+ }
40
+ function setSharedSystemProps(content) {
41
+ globalThis[SHARED_SYSTEM_PROPS_KEY] = content;
42
+ }
43
+ function getSharedExternalDirs() {
44
+ return globalThis[SHARED_EXTERNAL_DIRS_KEY] || [];
45
+ }
46
+ function setSharedExternalDirs(dirs) {
47
+ globalThis[SHARED_EXTERNAL_DIRS_KEY] = dirs;
48
+ }
49
+ function getSharedExternalEntries() {
50
+ return globalThis[SHARED_EXTERNAL_ENTRIES_KEY] || /* @__PURE__ */ new Map();
51
+ }
52
+ function setSharedExternalEntries(entries) {
53
+ globalThis[SHARED_EXTERNAL_ENTRIES_KEY] = entries;
54
+ }
55
+ //#endregion
56
+ export { getSharedExternalEntries as a, setManifestJson as c, setSharedExternalEntries as d, setSharedSystemProps as f, getSharedExternalDirs as i, setSharedCss as l, getManifestJson as n, resetAnalysisPromise as o, __require as p, getSharedCss as r, setAnalysisPromise as s, getAnalysisPromise as t, setSharedExternalDirs as u };
@@ -0,0 +1,123 @@
1
+ //#region src/singleton.ts
2
+ /**
3
+ * Module-scope singleton for sharing analysis state between the webpack plugin and loader.
4
+ *
5
+ * Uses globalThis to survive the ESM/CJS module boundary: the plugin is loaded via ESM
6
+ * (next.config.ts import) while the loader is loaded by webpack via require(). Without
7
+ * globalThis, each module system gets its own singleton instance.
8
+ */
9
+ const MANIFEST_KEY = "__animus_manifest_json__";
10
+ const PROMISE_KEY = "__animus_analysis_promise__";
11
+ const SHARED_CSS_KEY = "__animus_shared_css__";
12
+ const SHARED_SYSTEM_PROPS_KEY = "__animus_shared_system_props__";
13
+ const SHARED_EXTERNAL_DIRS_KEY = "__animus_external_pkg_dirs__";
14
+ const SHARED_EXTERNAL_ENTRIES_KEY = "__animus_external_source_entries__";
15
+ function getManifestJson() {
16
+ return globalThis[MANIFEST_KEY];
17
+ }
18
+ function setManifestJson(json) {
19
+ globalThis[MANIFEST_KEY] = json;
20
+ }
21
+ function getAnalysisPromise() {
22
+ return globalThis[PROMISE_KEY];
23
+ }
24
+ function setAnalysisPromise(promise) {
25
+ globalThis[PROMISE_KEY] = promise;
26
+ }
27
+ function resetAnalysisPromise() {
28
+ globalThis[PROMISE_KEY] = null;
29
+ }
30
+ function getSharedCss() {
31
+ return globalThis[SHARED_CSS_KEY] || "";
32
+ }
33
+ function setSharedCss(css) {
34
+ globalThis[SHARED_CSS_KEY] = css;
35
+ }
36
+ function setSharedSystemProps(content) {
37
+ globalThis[SHARED_SYSTEM_PROPS_KEY] = content;
38
+ }
39
+ function getSharedExternalDirs() {
40
+ return globalThis[SHARED_EXTERNAL_DIRS_KEY] || [];
41
+ }
42
+ function setSharedExternalDirs(dirs) {
43
+ globalThis[SHARED_EXTERNAL_DIRS_KEY] = dirs;
44
+ }
45
+ function getSharedExternalEntries() {
46
+ return globalThis[SHARED_EXTERNAL_ENTRIES_KEY] || /* @__PURE__ */ new Map();
47
+ }
48
+ function setSharedExternalEntries(entries) {
49
+ globalThis[SHARED_EXTERNAL_ENTRIES_KEY] = entries;
50
+ }
51
+ //#endregion
52
+ Object.defineProperty(exports, "getAnalysisPromise", {
53
+ enumerable: true,
54
+ get: function() {
55
+ return getAnalysisPromise;
56
+ }
57
+ });
58
+ Object.defineProperty(exports, "getManifestJson", {
59
+ enumerable: true,
60
+ get: function() {
61
+ return getManifestJson;
62
+ }
63
+ });
64
+ Object.defineProperty(exports, "getSharedCss", {
65
+ enumerable: true,
66
+ get: function() {
67
+ return getSharedCss;
68
+ }
69
+ });
70
+ Object.defineProperty(exports, "getSharedExternalDirs", {
71
+ enumerable: true,
72
+ get: function() {
73
+ return getSharedExternalDirs;
74
+ }
75
+ });
76
+ Object.defineProperty(exports, "getSharedExternalEntries", {
77
+ enumerable: true,
78
+ get: function() {
79
+ return getSharedExternalEntries;
80
+ }
81
+ });
82
+ Object.defineProperty(exports, "resetAnalysisPromise", {
83
+ enumerable: true,
84
+ get: function() {
85
+ return resetAnalysisPromise;
86
+ }
87
+ });
88
+ Object.defineProperty(exports, "setAnalysisPromise", {
89
+ enumerable: true,
90
+ get: function() {
91
+ return setAnalysisPromise;
92
+ }
93
+ });
94
+ Object.defineProperty(exports, "setManifestJson", {
95
+ enumerable: true,
96
+ get: function() {
97
+ return setManifestJson;
98
+ }
99
+ });
100
+ Object.defineProperty(exports, "setSharedCss", {
101
+ enumerable: true,
102
+ get: function() {
103
+ return setSharedCss;
104
+ }
105
+ });
106
+ Object.defineProperty(exports, "setSharedExternalDirs", {
107
+ enumerable: true,
108
+ get: function() {
109
+ return setSharedExternalDirs;
110
+ }
111
+ });
112
+ Object.defineProperty(exports, "setSharedExternalEntries", {
113
+ enumerable: true,
114
+ get: function() {
115
+ return setSharedExternalEntries;
116
+ }
117
+ });
118
+ Object.defineProperty(exports, "setSharedSystemProps", {
119
+ enumerable: true,
120
+ get: function() {
121
+ return setSharedSystemProps;
122
+ }
123
+ });
@@ -10,4 +10,12 @@ export declare function setManifestJson(json: string): void;
10
10
  export declare function getAnalysisPromise(): Promise<void> | null;
11
11
  export declare function setAnalysisPromise(promise: Promise<void>): void;
12
12
  export declare function resetAnalysisPromise(): void;
13
+ export declare function getSharedCss(): string;
14
+ export declare function setSharedCss(css: string): void;
15
+ export declare function getSharedSystemProps(): string;
16
+ export declare function setSharedSystemProps(content: string): void;
17
+ export declare function getSharedExternalDirs(): string[];
18
+ export declare function setSharedExternalDirs(dirs: string[]): void;
19
+ export declare function getSharedExternalEntries(): Map<string, string>;
20
+ export declare function setSharedExternalEntries(entries: Map<string, string>): void;
13
21
  //# sourceMappingURL=singleton.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"singleton.d.ts","sourceRoot":"","sources":["../src/singleton.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,wBAAgB,eAAe,IAAI,MAAM,GAAG,IAAI,CAE/C;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAElD;AAED,wBAAgB,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAIzD;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAE/D;AAED,wBAAgB,oBAAoB,IAAI,IAAI,CAE3C"}
1
+ {"version":3,"file":"singleton.d.ts","sourceRoot":"","sources":["../src/singleton.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AASH,wBAAgB,eAAe,IAAI,MAAM,GAAG,IAAI,CAE/C;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAElD;AAED,wBAAgB,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAIzD;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAE/D;AAED,wBAAgB,oBAAoB,IAAI,IAAI,CAE3C;AAED,wBAAgB,YAAY,IAAI,MAAM,CAErC;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAE9C;AAED,wBAAgB,oBAAoB,IAAI,MAAM,CAE7C;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAE1D;AAED,wBAAgB,qBAAqB,IAAI,MAAM,EAAE,CAEhD;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,CAE1D;AAED,wBAAgB,wBAAwB,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAE9D;AAED,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAE3E"}
@@ -1 +1 @@
1
- {"version":3,"file":"with-animus.d.ts","sourceRoot":"","sources":["../src/with-animus.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAKjD,KAAK,aAAa,GAAG;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F,MAAM,CAAC,EAAE;QACP,KAAK,CAAC,EAAE,KAAK,CAAC;YACZ,IAAI,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC;YAC5C,OAAO,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC;YAC/C,OAAO,CAAC,EAAE,MAAM,CAAC;YACjB,GAAG,CAAC,EAAE,KAAK,CAAC;gBAAE,MAAM,EAAE,MAAM,CAAC;gBAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;aAAE,CAAC,CAAC;SACpE,CAAC,CAAC;KACJ,CAAC;CACH,CAAC;AAEF,KAAK,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IAC1C,OAAO,CAAC,EAAE,CACR,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC7B,aAAa,CAAC;CACpB,CAAC;AAIF;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CACxB,OAAO,EAAE,iBAAiB,GACzB,CAAC,UAAU,EAAE,UAAU,KAAK,UAAU,CA+KxC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@animus-ui/next-plugin",
3
- "version": "0.1.0-next.58",
3
+ "version": "0.1.0-next.60",
4
4
  "description": "Animus static CSS extraction for Next.js (webpack)",
5
5
  "author": "codecaaron <airrobb@gmail.com>",
6
6
  "license": "MIT",
@@ -53,6 +53,6 @@
53
53
  "webpack": ">=5.0.0"
54
54
  },
55
55
  "dependencies": {
56
- "@animus-ui/extract": "0.1.0-next.58"
56
+ "@animus-ui/extract": "0.1.0-next.60"
57
57
  }
58
58
  }
@@ -1,31 +0,0 @@
1
- import { createRequire } from "node:module";
2
- //#region \0rolldown/runtime.js
3
- var __require = /* @__PURE__ */ createRequire(import.meta.url);
4
- //#endregion
5
- //#region src/singleton.ts
6
- /**
7
- * Module-scope singleton for sharing analysis state between the webpack plugin and loader.
8
- *
9
- * Uses globalThis to survive the ESM/CJS module boundary: the plugin is loaded via ESM
10
- * (next.config.ts import) while the loader is loaded by webpack via require(). Without
11
- * globalThis, each module system gets its own singleton instance.
12
- */
13
- const MANIFEST_KEY = "__animus_manifest_json__";
14
- const PROMISE_KEY = "__animus_analysis_promise__";
15
- function getManifestJson() {
16
- return globalThis[MANIFEST_KEY];
17
- }
18
- function setManifestJson(json) {
19
- globalThis[MANIFEST_KEY] = json;
20
- }
21
- function getAnalysisPromise() {
22
- return globalThis[PROMISE_KEY];
23
- }
24
- function setAnalysisPromise(promise) {
25
- globalThis[PROMISE_KEY] = promise;
26
- }
27
- function resetAnalysisPromise() {
28
- globalThis[PROMISE_KEY] = null;
29
- }
30
- //#endregion
31
- export { setManifestJson as a, setAnalysisPromise as i, getManifestJson as n, __require as o, resetAnalysisPromise as r, getAnalysisPromise as t };
@@ -1,56 +0,0 @@
1
- //#region src/singleton.ts
2
- /**
3
- * Module-scope singleton for sharing analysis state between the webpack plugin and loader.
4
- *
5
- * Uses globalThis to survive the ESM/CJS module boundary: the plugin is loaded via ESM
6
- * (next.config.ts import) while the loader is loaded by webpack via require(). Without
7
- * globalThis, each module system gets its own singleton instance.
8
- */
9
- const MANIFEST_KEY = "__animus_manifest_json__";
10
- const PROMISE_KEY = "__animus_analysis_promise__";
11
- function getManifestJson() {
12
- return globalThis[MANIFEST_KEY];
13
- }
14
- function setManifestJson(json) {
15
- globalThis[MANIFEST_KEY] = json;
16
- }
17
- function getAnalysisPromise() {
18
- return globalThis[PROMISE_KEY];
19
- }
20
- function setAnalysisPromise(promise) {
21
- globalThis[PROMISE_KEY] = promise;
22
- }
23
- function resetAnalysisPromise() {
24
- globalThis[PROMISE_KEY] = null;
25
- }
26
- //#endregion
27
- Object.defineProperty(exports, "getAnalysisPromise", {
28
- enumerable: true,
29
- get: function() {
30
- return getAnalysisPromise;
31
- }
32
- });
33
- Object.defineProperty(exports, "getManifestJson", {
34
- enumerable: true,
35
- get: function() {
36
- return getManifestJson;
37
- }
38
- });
39
- Object.defineProperty(exports, "resetAnalysisPromise", {
40
- enumerable: true,
41
- get: function() {
42
- return resetAnalysisPromise;
43
- }
44
- });
45
- Object.defineProperty(exports, "setAnalysisPromise", {
46
- enumerable: true,
47
- get: function() {
48
- return setAnalysisPromise;
49
- }
50
- });
51
- Object.defineProperty(exports, "setManifestJson", {
52
- enumerable: true,
53
- get: function() {
54
- return setManifestJson;
55
- }
56
- });