Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "Add nested export conditions",
"packageName": "@nova/examples",
"email": "stwilczy@microsoft.com",
"dependentChangeType": "none"
}
7 changes: 7 additions & 0 deletions change/@nova-react-a2b641e3-77cc-4e9c-99f8-8f4db5031ac0.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Add .d.mts declarations and nested export conditions for modern moduleResolution",
"packageName": "@nova/react",
"email": "stwilczy@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Fix exports map: move types condition before import/require for modern moduleResolution compatibility",
"packageName": "@nova/react-test-utils",
"email": "stwilczy@microsoft.com",
"dependentChangeType": "patch"
}
7 changes: 7 additions & 0 deletions change/@nova-types-7b01095b-4805-46aa-a17c-a16bcea5de7d.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Add .d.mts declarations and nested export conditions for modern moduleResolution",
"packageName": "@nova/types",
"email": "stwilczy@microsoft.com",
"dependentChangeType": "patch"
}
5 changes: 2 additions & 3 deletions packages/examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,8 @@
"publishConfig": {
"exports": {
".": {
"types": "./lib/index.d.ts",
"import": "./lib/index.mjs",
"require": "./lib/index.js"
"import": { "types": "./lib/index.d.mts", "default": "./lib/index.mjs" },
"require": { "types": "./lib/index.d.ts", "default": "./lib/index.js" }
}
},
"main": "./lib/index",
Expand Down
15 changes: 6 additions & 9 deletions packages/nova-react-test-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,19 +113,16 @@
"publishConfig": {
"exports": {
".": {
"import": "./lib/relay/index.mjs",
"require": "./lib/relay/index.js",
"types": "./lib/relay/index.d.ts"
"import": { "types": "./lib/relay/index.d.mts", "default": "./lib/relay/index.mjs" },
"require": { "types": "./lib/relay/index.d.ts", "default": "./lib/relay/index.js" }
},
"./relay": {
"import": "./lib/relay/index.mjs",
"require": "./lib/relay/index.js",
"types": "./lib/relay/index.d.ts"
"import": { "types": "./lib/relay/index.d.mts", "default": "./lib/relay/index.mjs" },
"require": { "types": "./lib/relay/index.d.ts", "default": "./lib/relay/index.js" }
},
"./apollo": {
"import": "./lib/apollo/index.mjs",
"require": "./lib/apollo/index.js",
"types": "./lib/apollo/index.d.ts"
"import": { "types": "./lib/apollo/index.d.mts", "default": "./lib/apollo/index.mjs" },
"require": { "types": "./lib/apollo/index.d.ts", "default": "./lib/apollo/index.js" }
}
},
"main": "./lib/relay/index",
Expand Down
5 changes: 2 additions & 3 deletions packages/nova-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,8 @@
"publishConfig": {
"exports": {
".": {
"types": "./lib/index.d.ts",
"import": "./lib/index.mjs",
"require": "./lib/index.js"
"import": { "types": "./lib/index.d.mts", "default": "./lib/index.mjs" },
"require": { "types": "./lib/index.d.ts", "default": "./lib/index.js" }
}
},
"main": "./lib/index",
Expand Down
5 changes: 2 additions & 3 deletions packages/nova-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@
"publishConfig": {
"exports": {
".": {
"types": "./lib/index.d.ts",
"import": "./lib/index.mjs",
"require": "./lib/index.js"
"import": { "types": "./lib/index.d.mts", "default": "./lib/index.mjs" },
"require": { "types": "./lib/index.d.ts", "default": "./lib/index.js" }
}
},
"main": "./lib/index",
Expand Down
13 changes: 12 additions & 1 deletion scripts/just.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,18 @@ import * as path from "path";
import * as fs from "fs";
import * as glob from "fast-glob";

export const types = tscTask({ emitDeclarationOnly: true });
export const types = async () => {
await tscTask({ emitDeclarationOnly: true })();
// Copy .d.ts -> .d.mts so ESM imports resolve to correct declaration files
const dtsFiles = glob.sync(["lib/**/*.d.ts"], { ignore: ["lib/**/*.d.mts"] });
for (const file of dtsFiles) {
fs.copyFileSync(file, file.replace(/\.d\.ts$/, ".d.mts"));
}
const mapFiles = glob.sync(["lib/**/*.d.ts.map"]);
for (const file of mapFiles) {
fs.copyFileSync(file, file.replace(/\.d\.ts\.map$/, ".d.mts.map"));
}
};

export const build = () => {
const baseEsbuildOptions: EsbuildBuildOptions = {
Expand Down