@arcgis/lumina-compiler 4.34.0-next.129 → 4.34.0-next.130

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.js CHANGED
@@ -4728,8 +4728,8 @@ const Bn = /* @__PURE__ */ new Set([
4728
4728
  "support"
4729
4729
  ]), H = "@arcgis/lumina:buildCdn", ke = "cdn", Wn = "index", te = "main";
4730
4730
  function Sc(e) {
4731
- const { skip: t = !1, namespace: i, esbuildOptions: n = {} } = e.options.build?.cdn ?? {}, s = e.options.build?.webApp?.destination, r = i !== void 0;
4732
- if (r) {
4731
+ const { skip: t = !1, namespace: i, esbuildOptions: n = {}, entrypointTransformer: s } = e.options.build?.cdn ?? {}, r = e.options.build?.webApp?.destination, a = i !== void 0;
4732
+ if (a) {
4733
4733
  if (i.toLowerCase() !== i)
4734
4734
  throw new Error(`Expected CDN namespace to be all lowercase. Received: ${i}`);
4735
4735
  if (Bn.has(i))
@@ -4740,12 +4740,12 @@ function Sc(e) {
4740
4740
  'The "namespace" option in the "build.cdn" is deprecated and will be removed in the next major version.'
4741
4741
  );
4742
4742
  }
4743
- const a = i ?? Wn;
4743
+ const c = i ?? Wn;
4744
4744
  if (e.provideAssets([
4745
4745
  {
4746
4746
  type: "dynamic",
4747
4747
  source: () => ao(e),
4748
- destination: `../${r ? a : te}.css`
4748
+ destination: `../${a ? c : te}.css`
4749
4749
  }
4750
4750
  ]), !t)
4751
4751
  return {
@@ -4753,40 +4753,55 @@ function Sc(e) {
4753
4753
  async writeBundle() {
4754
4754
  if (e.isInStorybook)
4755
4755
  return;
4756
- const c = xe && j().name !== "@arcgis/embeddable-components", d = Date.now(), l = Array.isArray(n.entryPoints) ? n.entryPoints.map((f) => typeof f == "string" ? { in: f, out: "" } : f) : typeof n.entryPoints == "object" ? Object.entries(n.entryPoints).map(([f, y]) => ({ in: y, out: f })) : [], p = await wc(e, a, n, l, c);
4757
- await Tc(
4756
+ const d = xe && j().name !== "@arcgis/embeddable-components", l = Date.now(), p = Array.isArray(n.entryPoints) ? n.entryPoints.map((y) => typeof y == "string" ? { in: y, out: "" } : y) : typeof n.entryPoints == "object" ? Object.entries(n.entryPoints).map(([y, g]) => ({ in: g, out: y })) : [], u = await wc(
4757
+ e,
4758
+ c,
4759
+ n,
4758
4760
  p,
4761
+ s,
4762
+ d
4763
+ );
4764
+ await Tc(
4765
+ u,
4759
4766
  e,
4760
- r ? `${a}.esm` : a,
4761
- l,
4762
- c
4767
+ a ? `${c}.esm` : c,
4768
+ p,
4769
+ d
4763
4770
  );
4764
- const u = Date.now();
4765
- w.info(H, `CDN was built in ${u - d}ms`), s && await bc(e, s, `${r ? `${a}.esm` : a}.js`);
4771
+ const f = Date.now();
4772
+ w.info(H, `CDN was built in ${f - l}ms`), r && await bc(e, r, `${a ? `${c}.esm` : c}.js`);
4766
4773
  }
4767
4774
  };
4768
4775
  }
4769
- async function wc(e, t, i, n, s) {
4770
- const r = e.environment;
4771
- if (i.minify && s)
4776
+ async function wc(e, t, i, n, s, r) {
4777
+ const a = e.environment;
4778
+ if (i.minify && r)
4772
4779
  throw Error(
4773
4780
  E(
4774
4781
  H,
4775
4782
  "Unminified CDN build is not yet supported - open a feature request with Lumina maintainers if it is needed"
4776
4783
  )
4777
4784
  );
4778
- if (i.sourcemap && s)
4785
+ if (i.sourcemap && r)
4779
4786
  throw Error(
4780
4787
  E(
4781
4788
  H,
4782
4789
  "Source maps in the CDN build are not yet supported - open a feature request with Lumina maintainers if it is needed"
4783
4790
  )
4784
4791
  );
4792
+ const c = `import { defineCustomElements } from "./loader";
4793
+ /**
4794
+ * We use import.meta.url to get the path to the current file
4795
+ * and pass it to defineCustomElements to set the resources url.
4796
+ * The script's file name will be stripped inside defineCustomElements.
4797
+ **/
4798
+ defineCustomElements({resourcesUrl: import.meta.url});
4799
+ ${dn(e._globalCssString, e)}`, d = s?.(c, e) ?? c;
4785
4800
  return await Ns({
4786
4801
  bundle: !0,
4787
- minify: s ? !0 : r === "production",
4802
+ minify: r ? !0 : a === "production",
4788
4803
  treeShaking: !0,
4789
- sourcemap: s ? !1 : r === "development" ? "inline" : e.options.build?.enableSourceMapsInProduction ? "linked" : !1,
4804
+ sourcemap: r ? !1 : a === "development" ? "inline" : e.options.build?.enableSourceMapsInProduction ? "linked" : !1,
4790
4805
  format: "esm",
4791
4806
  splitting: !0,
4792
4807
  absWorkingDir: e.dir.dist,
@@ -4813,14 +4828,14 @@ async function wc(e, t, i, n, s) {
4813
4828
  plugins: [
4814
4829
  {
4815
4830
  name: "@arcgis/lumina:accessorSupport",
4816
- setup(a) {
4817
- a.onResolve(
4831
+ setup(l) {
4832
+ l.onResolve(
4818
4833
  { filter: /^@arcgis\/core\/applications\/Components\/reactiveUtils.js$/ },
4819
- (c) => c.importer.endsWith("runtime.js") ? {
4820
- path: c.path,
4834
+ (p) => p.importer.endsWith("runtime.js") ? {
4835
+ path: p.path,
4821
4836
  namespace: "@arcgis/lumina:accessorSupport"
4822
4837
  } : void 0
4823
- ), a.onLoad({ filter: /^/, namespace: "@arcgis/lumina:accessorSupport" }, () => ({
4838
+ ), l.onLoad({ filter: /^/, namespace: "@arcgis/lumina:accessorSupport" }, () => ({
4824
4839
  contents: "export const createObservable=undefined, trackAccess=undefined, createTrackingTarget=undefined, runTracked = undefined;",
4825
4840
  loader: "js"
4826
4841
  }));
@@ -4831,18 +4846,18 @@ async function wc(e, t, i, n, s) {
4831
4846
  // manual injection further below. Thus drop the CSS import from the
4832
4847
  // chunks/runtime.js file.
4833
4848
  name: "@arcgis/lumina:customGlobalCssInjection",
4834
- setup(a) {
4835
- const c = e.options.build?.cdn?.namespace === void 0 ? (
4849
+ setup(l) {
4850
+ const p = e.options.build?.cdn?.namespace === void 0 ? (
4836
4851
  // eslint-disable-next-line require-unicode-regexp
4837
4852
  new RegExp(`\\/${ke}\\/${te}\\.css$`)
4838
4853
  ) : (
4839
4854
  // eslint-disable-next-line require-unicode-regexp
4840
4855
  new RegExp(`\\/${e.options.build.cdn.namespace}\\/${e.options.build.cdn.namespace}\\.css$`)
4841
4856
  );
4842
- a.onResolve({ filter: c }, ({ path: d }) => ({
4843
- path: d,
4857
+ l.onResolve({ filter: p }, ({ path: u }) => ({
4858
+ path: u,
4844
4859
  namespace: "build-cdn:global-css"
4845
- })), a.onLoad({ filter: /.*/, namespace: "build-cdn:global-css" }, () => ({
4860
+ })), l.onLoad({ filter: /.*/, namespace: "build-cdn:global-css" }, () => ({
4846
4861
  contents: "",
4847
4862
  loader: "js"
4848
4863
  }));
@@ -4858,14 +4873,7 @@ async function wc(e, t, i, n, s) {
4858
4873
  },
4859
4874
  entryPoints: n,
4860
4875
  stdin: {
4861
- contents: `import { defineCustomElements } from "./loader";
4862
- /**
4863
- * We use import.meta.url to get the path to the current file
4864
- * and pass it to defineCustomElements to set the resources url.
4865
- * The script's file name will be stripped inside defineCustomElements.
4866
- **/
4867
- defineCustomElements({resourcesUrl: import.meta.url});
4868
- ${dn(e._globalCssString, e)}`,
4876
+ contents: d,
4869
4877
  sourcefile: `${t}.esm.js`,
4870
4878
  resolveDir: e.dir.dist,
4871
4879
  loader: "js",
@@ -156,7 +156,15 @@ export type BuildCdnOptions = {
156
156
  */
157
157
  readonly esbuildOptions?: Parameters<typeof esbuildBuild>[0];
158
158
  /**
159
- * A callback for mutating CDN chunks before they are written to disk.
159
+ * Transform the CDN entrypoint before it is processed by ESBuild.
160
+ *
161
+ * This callback is for advanced use cases only. The build output may change
162
+ * between Lumina versions without prior notice.
163
+ */
164
+ readonly entrypointTransformer?: (code: string, context: CompilerContext) => string;
165
+ /**
166
+ * A callback for mutating CDN ESBuild output chunks before they are written
167
+ * to disk.
160
168
  * This callback is for advanced use cases only. The build output may change
161
169
  * between Lumina versions without prior notice. Using this callback may
162
170
  * corrupt the CDN source map if it is enabled.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/lumina-compiler",
3
- "version": "4.34.0-next.129",
3
+ "version": "4.34.0-next.130",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -18,9 +18,9 @@
18
18
  ],
19
19
  "license": "SEE LICENSE IN LICENSE.md",
20
20
  "dependencies": {
21
- "@arcgis/api-extractor": "4.34.0-next.129",
22
- "@arcgis/components-build-utils": "4.34.0-next.129",
23
- "@arcgis/toolkit": "~4.34.0-next.129",
21
+ "@arcgis/api-extractor": "4.34.0-next.130",
22
+ "@arcgis/components-build-utils": "4.34.0-next.130",
23
+ "@arcgis/toolkit": "~4.34.0-next.130",
24
24
  "chalk": "^5.4.1",
25
25
  "esbuild": "^0.25.5",
26
26
  "glob": "^11.0.3",
@@ -30,7 +30,7 @@
30
30
  "vite-plugin-dts": "^4.5.4"
31
31
  },
32
32
  "peerDependencies": {
33
- "@arcgis/lumina": "~4.34.0-next.129",
33
+ "@arcgis/lumina": "~4.34.0-next.130",
34
34
  "lit": "^3.3.0",
35
35
  "typescript": "~5.8.3",
36
36
  "vite": "^7.0.0",