@forge/util 4.0.1-next.0 → 4.1.0-next.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @forge/util
2
2
 
3
+ ## 4.1.0-next.1
4
+
5
+ ### Minor Changes
6
+
7
+ - f93add1: Bundle selected internal exports with tsdown in ESM and CommonJS formats, and publish their TypeScript declarations.
8
+
3
9
  ## 4.0.1-next.0
4
10
 
5
11
  ### Patch Changes
package/README.md CHANGED
@@ -6,21 +6,24 @@ Expose only the names that consumers in this monorepo need.
6
6
  ## Build
7
7
 
8
8
  For development, `bolt install` from the repository root builds util automatically.
9
- The [build script](scripts/build.sh) uses [webpack](webpack.config.js) to bundle the exports in [src](src/) into CommonJS modules under `packages/`.
10
- ARI declarations remain available to workspace consumers and are excluded from the published package.
9
+ The [tsdown configuration](tsdown.config.ts) bundles the exports in [src](src/) into ESM (`.mjs`) and CommonJS (`.cjs`) modules under `packages/`.
10
+ Each format includes bundled TypeScript declarations (`.d.mts` and `.d.cts`).
11
+ Private dependencies are bundled into both JavaScript and declarations, so consumers do not need access to the private registry.
12
+ The package's conditional exports select the matching JavaScript and declarations for `import` and `require`.
11
13
 
12
14
  ## Add exports to an existing package
13
15
 
14
- Find the package's entry file through [webpack.config.js](webpack.config.js).
16
+ Find the package's entry file through `tsdown.config.ts`.
15
17
  Add the required named exports to that file under `src/`.
16
- The ARI declaration entry uses the same export list, so it updates with the bundle.
18
+ Use `export type` for types consumers need to import by name.
19
+ Both output formats and their declarations use the same export list.
17
20
  Update the expected exports in the [package integration tests](__test__/bundle.integration.test.ts).
18
21
 
19
22
  ## Add another package
20
23
 
21
24
  1. Add the package to util's `devDependencies` with `yarn bolt w @forge/util add --dev <package>`.
22
25
  Run the command from the repository root.
23
- 2. Add an entry file under `src/` that exports only the required names.
24
- 3. Connect the entry through `webpack.config.js` and expose its generated path through [package.json](package.json) `exports`.
25
- 4. If workspace consumers need types, extend `scripts/build.sh` to prepare declarations beside the bundle.
26
- 5. Extend the package integration tests to load the new module and assert its public exports.
26
+ 2. Add a TypeScript entry file under `src/` that exports only the required names.
27
+ 3. Add the entry with its output directory, and the private dependency, to `tsdown.config.ts`.
28
+ 4. Expose its generated paths through [package.json](package.json) `exports`, with separate `import` and `require` conditions and matching `types` conditions.
29
+ 5. Extend the package integration tests to load the new module and assert its public exports and types.
package/package.json CHANGED
@@ -1,22 +1,40 @@
1
1
  {
2
2
  "name": "@forge/util",
3
- "version": "4.0.1-next.0",
3
+ "version": "4.1.0-next.1",
4
4
  "description": "",
5
5
  "scripts": {
6
- "build": "./scripts/build.sh",
6
+ "build": "tsdown",
7
7
  "pack": "yarn run build"
8
8
  },
9
9
  "author": "Atlassian",
10
10
  "license": "SEE LICENSE IN LICENSE.txt",
11
11
  "exports": {
12
- "./packages/analytics-node-client": "./packages/analytics-node-client/src/index.js",
13
- "./packages/ari": "./packages/ari/index.js"
12
+ "./packages/analytics-node-client": {
13
+ "import": {
14
+ "types": "./packages/analytics-node-client/src/index.d.mts",
15
+ "default": "./packages/analytics-node-client/src/index.mjs"
16
+ },
17
+ "require": {
18
+ "types": "./packages/analytics-node-client/src/index.d.cts",
19
+ "default": "./packages/analytics-node-client/src/index.cjs"
20
+ }
21
+ },
22
+ "./packages/ari": {
23
+ "import": {
24
+ "types": "./packages/ari/index.d.mts",
25
+ "default": "./packages/ari/index.mjs"
26
+ },
27
+ "require": {
28
+ "types": "./packages/ari/index.d.cts",
29
+ "default": "./packages/ari/index.cjs"
30
+ }
31
+ }
14
32
  },
15
33
  "devDependencies": {
16
34
  "@atlassian/ari": "2.754.0",
17
35
  "@atlassiansox/analytics-node-client": "4.8.1",
18
36
  "typescript": "5.9.2",
19
- "webpack-cli": "^5.1.4"
37
+ "tsdown": "0.23.7"
20
38
  },
21
39
  "publishConfig": {
22
40
  "registry": "https://packages.atlassian.com/api/npm/npm-public/"
@@ -0,0 +1 @@
1
+ import{createRequire as e}from"node:module";var t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.prototype.hasOwnProperty,a=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),s=(e,n)=>{let r=Object.setPrototypeOf({},null);for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n&1||t(r,Symbol.toStringTag,{value:`Module`}),n&2?r:Object.preventExtensions(r)},c=(e,a,o,s)=>{if(a&&typeof a==`object`||typeof a==`function`)for(var c=r(a),l=0,u=c.length,d;l<u;l++)d=c[l],!i.call(e,d)&&d!==o&&t(e,d,{get:(e=>a[e]).bind(null,d),enumerable:!(s=n(a,d))||s.enumerable});return e},l=e=>i.call(e,`module.exports`)?e[`module.exports`]:c(t({},`__esModule`,{value:!0}),e),u=/* @__PURE__ */ e(import.meta.url);export{l as a,u as i,a as n,s as r,o as t};