@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 +6 -0
- package/README.md +11 -8
- package/package.json +23 -5
- package/packages/analytics-node-client/src/chunk-G1eueebf.mjs +1 -0
- package/packages/analytics-node-client/src/index.cjs +41 -0
- package/packages/analytics-node-client/src/index.d.cts +1104 -0
- package/packages/analytics-node-client/src/index.d.mts +1104 -0
- package/packages/analytics-node-client/src/index.mjs +41 -0
- package/packages/ari/index.cjs +1 -0
- package/packages/ari/index.d.cts +218 -0
- package/packages/ari/index.d.mts +218 -0
- package/packages/ari/index.mjs +1 -0
- package/packages/899.js +0 -1
- package/packages/analytics-node-client/src/index.js +0 -2
- package/packages/analytics-node-client/src/index.js.LICENSE.txt +0 -8
- package/packages/ari/index.js +0 -1
- package/scripts/build.sh +0 -18
- package/webpack.config.js +0 -20
package/CHANGELOG.md
CHANGED
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 [
|
|
10
|
-
|
|
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
|
|
16
|
+
Find the package's entry file through `tsdown.config.ts`.
|
|
15
17
|
Add the required named exports to that file under `src/`.
|
|
16
|
-
|
|
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
|
|
24
|
-
3.
|
|
25
|
-
4.
|
|
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
|
|
3
|
+
"version": "4.1.0-next.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"scripts": {
|
|
6
|
-
"build": "
|
|
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":
|
|
13
|
-
|
|
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
|
-
"
|
|
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};
|