zephyr-rolldown-plugin 0.0.0-canary-20250728214036 → 0.0.0-canary-20250806121212

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.
@@ -1,3 +1,3 @@
1
+ import type { OutputBundle } from 'rolldown';
1
2
  import type { ZeBuildAssetsMap } from 'zephyr-agent';
2
- import type { XOutputAsset, XOutputBundle, XOutputChunk } from 'zephyr-rollx-internal';
3
- export declare function getAssetsMap(assets: XOutputBundle<XOutputChunk | XOutputAsset>): ZeBuildAssetsMap;
3
+ export declare function getAssetsMap(assets: OutputBundle): ZeBuildAssetsMap;
@@ -1,8 +1,21 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getAssetsMap = getAssetsMap;
4
- const zephyr_rollx_internal_1 = require("zephyr-rollx-internal");
4
+ const zephyr_agent_1 = require("zephyr-agent");
5
5
  function getAssetsMap(assets) {
6
- return (0, zephyr_rollx_internal_1.getRollxAssetsMap)(assets);
6
+ return (0, zephyr_agent_1.buildAssetsMap)(assets, extractBuffer, getAssetType);
7
7
  }
8
+ const extractBuffer = (asset) => {
9
+ switch (asset.type) {
10
+ case 'chunk':
11
+ return asset.code;
12
+ case 'asset':
13
+ return typeof asset.source === 'string'
14
+ ? asset.source
15
+ : new TextDecoder().decode(asset.source);
16
+ default:
17
+ return void 0;
18
+ }
19
+ };
20
+ const getAssetType = (asset) => asset.type;
8
21
  //# sourceMappingURL=get-assets-map.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-assets-map.js","sourceRoot":"","sources":["../../../src/lib/internal/get-assets-map.ts"],"names":[],"mappings":";;AAIA,oCAIC;AARD,iEAA0D;AAI1D,SAAgB,YAAY,CAC1B,MAAkD;IAElD,OAAO,IAAA,yCAAiB,EAAC,MAAM,CAAC,CAAC;AACnC,CAAC"}
1
+ {"version":3,"file":"get-assets-map.js","sourceRoot":"","sources":["../../../src/lib/internal/get-assets-map.ts"],"names":[],"mappings":";;AAIA,oCAEC;AAJD,+CAA8C;AAE9C,SAAgB,YAAY,CAAC,MAAoB;IAC/C,OAAO,IAAA,6BAAc,EAAC,MAAM,EAAE,aAAa,EAAE,YAAY,CAAC,CAAC;AAC7D,CAAC;AAED,MAAM,aAAa,GAAG,CAAC,KAAgC,EAAsB,EAAE;IAC7E,QAAQ,KAAK,CAAC,IAAI,EAAE,CAAC;QACnB,KAAK,OAAO;YACV,OAAO,KAAK,CAAC,IAAI,CAAC;QACpB,KAAK,OAAO;YACV,OAAO,OAAO,KAAK,CAAC,MAAM,KAAK,QAAQ;gBACrC,CAAC,CAAC,KAAK,CAAC,MAAM;gBACd,CAAC,CAAC,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC7C;YACE,OAAO,KAAK,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,KAAgC,EAAU,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC"}
@@ -1,7 +1,6 @@
1
- import type { InputOptions, NormalizedOutputOptions } from 'rolldown';
2
- import { type XOutputAsset, type XOutputBundle, type XOutputChunk } from 'zephyr-rollx-internal';
1
+ import type { InputOptions, NormalizedOutputOptions, OutputBundle } from 'rolldown';
3
2
  export declare function withZephyr(): {
4
3
  name: string;
5
- buildStart: (inputOptions: InputOptions) => Promise<void>;
6
- writeBundle: (_options: NormalizedOutputOptions, bundle: XOutputBundle<XOutputChunk | XOutputAsset>) => Promise<void>;
4
+ buildStart: (options: InputOptions) => Promise<void>;
5
+ writeBundle: (_options: NormalizedOutputOptions, bundle: OutputBundle) => Promise<void>;
7
6
  };
@@ -1,9 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.withZephyr = withZephyr;
4
- const node_process_1 = require("node:process");
5
4
  const zephyr_agent_1 = require("zephyr-agent");
6
- const zephyr_rollx_internal_1 = require("zephyr-rollx-internal");
5
+ const node_process_1 = require("node:process");
7
6
  const get_assets_map_1 = require("./internal/get-assets-map");
8
7
  const getInputFolder = (options) => {
9
8
  if (typeof options.input === 'string')
@@ -16,13 +15,12 @@ const getInputFolder = (options) => {
16
15
  };
17
16
  function withZephyr() {
18
17
  const { zephyr_engine_defer, zephyr_defer_create } = zephyr_agent_1.ZephyrEngine.defer_create();
19
- let path_to_execution_dir;
20
18
  return {
21
19
  name: 'with-zephyr',
22
- buildStart: async (inputOptions) => {
23
- path_to_execution_dir = getInputFolder(inputOptions);
20
+ buildStart: async (options) => {
21
+ const path_to_execution_dir = getInputFolder(options);
24
22
  zephyr_defer_create({
25
- builder: 'rolldown', // Now explicitly using 'rolldown' as the builder
23
+ builder: 'rollup', //TODO(Nestor): API is the same, but we should make it explicit.
26
24
  context: path_to_execution_dir,
27
25
  });
28
26
  },
@@ -33,18 +31,10 @@ function withZephyr() {
33
31
  zephyr_engine.buildProperties.baseHref = _options.dir;
34
32
  // Start a new build
35
33
  await zephyr_engine.start_new_build();
36
- // Get assets map
37
- const assetsMap = (0, get_assets_map_1.getAssetsMap)(bundle);
38
- // Generate enhanced build stats for Rolldown
39
- const buildStats = await (0, zephyr_rollx_internal_1.extractRollxBuildStats)({
40
- zephyr_engine,
41
- bundle,
42
- root: path_to_execution_dir,
43
- });
44
- // Upload assets and build stats
34
+ // Upload assets and finish the build
45
35
  await zephyr_engine.upload_assets({
46
- assetsMap,
47
- buildStats,
36
+ assetsMap: (0, get_assets_map_1.getAssetsMap)(bundle),
37
+ buildStats: await (0, zephyr_agent_1.zeBuildDashData)(zephyr_engine),
48
38
  });
49
39
  await zephyr_engine.build_finished();
50
40
  }
@@ -1 +1 @@
1
- {"version":3,"file":"zephyr-rolldown-plugin.js","sourceRoot":"","sources":["../../src/lib/zephyr-rolldown-plugin.ts"],"names":[],"mappings":";;AAmBA,gCAiDC;AApED,+CAAmC;AAEnC,+CAAgE;AAEhE,iEAK+B;AAC/B,8DAAyD;AAEzD,MAA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AAC;YACtD,mBAAmB,CAAC;gBAClB,OAAO,EAAE,QAAQ,EAAE,gEAAgE;gBACnF,OAAO,EAAE,qBAAqB;aAC/B,CAAC,CAAC;QACL,CAAC;QACD,WAAW,EAAE,KAAK,EAAE,QAAiC,EAAE,MAAoB,EAAE,EAAE;YAC7E,IAAI,CAAC;gBACH,MAAM,aAAa,GAAG,MAAM,mBAAmB,CAAC;gBAEhD,mBAAmB;gBACnB,aAAa,CAAC,eAAe,CAAC,QAAQ,GAAG,QAAQ,CAAC,GAAG,CAAC;gBAEtD,oBAAoB;gBACpB,MAAM,aAAa,CAAC,eAAe,EAAE,CAAC;gBAEtC,qCAAqC;gBACrC,MAAM,aAAa,CAAC,aAAa,CAAC;oBAChC,SAAS,EAAE,IAAA,6BAAY,EAAC,MAAM,CAAC;oBAC/B,UAAU,EAAE,MAAM,IAAA,8BAAe,EAAC,aAAa,CAAC;iBACjD,CAAC,CAAC;gBAEH,MAAM,aAAa,CAAC,cAAc,EAAE,CAAC;YACvC,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,IAAA,oBAAK,EAAC,OAAO,EAAE,0BAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;YAC5C,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
package/dist/package.json CHANGED
@@ -22,8 +22,7 @@
22
22
  "dependencies": {
23
23
  "is-ci": "catalog:plugin-shared",
24
24
  "rolldown": "catalog:rolldown",
25
- "zephyr-agent": "workspace:*",
26
- "zephyr-rollx-internal": "workspace:*"
25
+ "zephyr-agent": "workspace:*"
27
26
  },
28
27
  "devDependencies": {
29
28
  "@types/is-ci": "catalog:typescript",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zephyr-rolldown-plugin",
3
- "version": "0.0.0-canary-20250728214036",
3
+ "version": "0.0.0-canary-20250806121212",
4
4
  "description": "Rolldown plugin for Zephyr",
5
5
  "repository": {
6
6
  "type": "git",
@@ -18,8 +18,7 @@
18
18
  "dependencies": {
19
19
  "is-ci": "^4.1.0",
20
20
  "rolldown": "1.0.0-beta.3",
21
- "zephyr-agent": "0.0.0-canary-20250728214036",
22
- "zephyr-rollx-internal": "0.0.0-canary-20250728214036"
21
+ "zephyr-agent": "0.0.0-canary-20250806121212"
23
22
  },
24
23
  "devDependencies": {
25
24
  "@types/is-ci": "3.0.4",