Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(drivers/framework): Fix type generation for ESM and add exports field #18824

Merged
merged 6 commits into from Dec 14, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 14 additions & 0 deletions packages/drivers/debugger/package.json
Expand Up @@ -11,6 +11,18 @@
"license": "MIT",
"author": "Microsoft and contributors",
"sideEffects": false,
"exports": {
".": {
"import": {
"types": "./lib/index.d.mts",
"default": "./lib/index.mjs"
},
"require": {
"types": "./dist/index.d.ts",
"default": "./dist/index.cjs"
}
}
},
"main": "dist/index.cjs",
"module": "lib/index.mjs",
"types": "dist/index.d.ts",
Expand All @@ -22,6 +34,7 @@
"build:compile": "fluid-build . --task compile",
"build:docs": "fluid-build . --task api",
"build:esnext": "tsc-multi --config ../../../common/build/build-common/tsc-multi.esm.json",
"build:rename-types": "renamer \"lib/**\" -f .d.ts -r .d.mts --force",
"check:are-the-types-wrong": "attw --pack",
"check:release-tags": "api-extractor run --local --config ./api-extractor-lint.json",
"ci:build:docs": "api-extractor run",
Expand Down Expand Up @@ -57,6 +70,7 @@
"copyfiles": "^2.4.1",
"eslint": "~8.50.0",
"prettier": "~3.0.3",
"renamer": "^4.0.0",
"rimraf": "^4.4.0",
"tsc-multi": "^1.1.0",
"typescript": "~5.1.6"
Expand Down
14 changes: 14 additions & 0 deletions packages/drivers/driver-base/package.json
Expand Up @@ -11,6 +11,18 @@
"license": "MIT",
"author": "Microsoft and contributors",
"sideEffects": false,
"exports": {
".": {
"import": {
"types": "./lib/index.d.mts",
"default": "./lib/index.mjs"
},
"require": {
"types": "./dist/index.d.ts",
"default": "./dist/index.cjs"
}
}
},
"main": "dist/index.cjs",
"module": "lib/index.mjs",
"types": "dist/index.d.ts",
Expand All @@ -24,6 +36,7 @@
"build:docs": "fluid-build . --task api",
"build:esnext": "tsc-multi --config ../../../common/build/build-common/tsc-multi.esm.json",
"build:genver": "gen-version",
"build:rename-types": "renamer \"lib/**\" -f .d.ts -r .d.mts --force",
"build:test": "tsc-multi --config ./tsc-multi.test.json",
"check:are-the-types-wrong": "attw --pack",
"check:release-tags": "api-extractor run --local --config ./api-extractor-lint.json",
Expand Down Expand Up @@ -93,6 +106,7 @@
"mocha-multi-reporters": "^1.5.1",
"moment": "^2.21.0",
"prettier": "~3.0.3",
"renamer": "^4.0.0",
"rimraf": "^4.4.0",
"socket.io-client": "^4.6.1",
"tsc-multi": "^1.1.0",
Expand Down
14 changes: 14 additions & 0 deletions packages/drivers/driver-web-cache/package.json
Expand Up @@ -11,6 +11,18 @@
"license": "MIT",
"author": "Microsoft and contributors",
"sideEffects": false,
"exports": {
".": {
"import": {
"types": "./lib/index.d.mts",
"default": "./lib/index.mjs"
},
"require": {
"types": "./dist/index.d.ts",
"default": "./dist/index.cjs"
}
}
},
"main": "dist/index.cjs",
"module": "lib/index.mjs",
"types": "dist/index.d.ts",
Expand All @@ -24,6 +36,7 @@
"build:docs": "fluid-build . --task api",
"build:esnext": "tsc-multi --config ../../../common/build/build-common/tsc-multi.esm.json",
"build:genver": "gen-version",
"build:rename-types": "renamer \"lib/**\" -f .d.ts -r .d.mts --force",
"build:test": "tsc-multi --config ./tsc-multi.test.json",
"check:are-the-types-wrong": "attw --pack",
"check:release-tags": "api-extractor run --local --config ./api-extractor-lint.json",
Expand Down Expand Up @@ -64,6 +77,7 @@
"fake-indexeddb": "3.1.4",
"jest": "^29.6.2",
"prettier": "~3.0.3",
"renamer": "^4.0.0",
"rimraf": "^4.4.0",
"tsc-multi": "^1.1.0",
"typescript": "~5.1.6"
Expand Down
14 changes: 14 additions & 0 deletions packages/drivers/fluidapp-odsp-urlResolver/package.json
Expand Up @@ -11,6 +11,18 @@
"license": "MIT",
"author": "Microsoft and contributors",
"sideEffects": false,
"exports": {
".": {
"import": {
"types": "./lib/index.d.mts",
"default": "./lib/index.mjs"
},
"require": {
"types": "./dist/index.d.ts",
"default": "./dist/index.cjs"
}
}
},
"main": "dist/index.cjs",
"module": "lib/index.mjs",
"types": "dist/index.d.ts",
Expand All @@ -23,6 +35,7 @@
"build:compile": "fluid-build . --task compile",
"build:docs": "fluid-build . --task api",
"build:esnext": "tsc-multi --config ../../../common/build/build-common/tsc-multi.esm.json",
"build:rename-types": "renamer \"lib/**\" -f .d.ts -r .d.mts --force",
"build:test": "tsc-multi --config ./tsc-multi.test.json",
"check:are-the-types-wrong": "attw --pack",
"check:release-tags": "api-extractor run --local --config ./api-extractor-lint.json",
Expand Down Expand Up @@ -69,6 +82,7 @@
"mocha-multi-reporters": "^1.5.1",
"moment": "^2.21.0",
"prettier": "~3.0.3",
"renamer": "^4.0.0",
"rimraf": "^4.4.0",
"tsc-multi": "^1.1.0",
"typescript": "~5.1.6"
Expand Down
14 changes: 14 additions & 0 deletions packages/drivers/local-driver/package.json
Expand Up @@ -10,6 +10,18 @@
},
"license": "MIT",
"author": "Microsoft and contributors",
"exports": {
".": {
"import": {
"types": "./lib/index.d.mts",
"default": "./lib/index.mjs"
},
"require": {
"types": "./dist/index.d.ts",
"default": "./dist/index.cjs"
}
}
},
"main": "dist/index.cjs",
"module": "lib/index.mjs",
"browser": {
Expand All @@ -25,6 +37,7 @@
"build:compile": "fluid-build . --task compile",
"build:docs": "fluid-build . --task api",
"build:esnext": "tsc-multi --config ../../../common/build/build-common/tsc-multi.esm.json",
"build:rename-types": "renamer \"lib/**\" -f .d.ts -r .d.mts --force",
"build:test": "tsc-multi --config ./tsc-multi.test.json",
"check:are-the-types-wrong": "attw --pack",
"check:release-tags": "api-extractor run --local --config ./api-extractor-lint.json",
Expand Down Expand Up @@ -107,6 +120,7 @@
"mocha-multi-reporters": "^1.5.1",
"moment": "^2.21.0",
"prettier": "~3.0.3",
"renamer": "^4.0.0",
"rimraf": "^4.4.0",
"socket.io-client": "^4.6.1",
"tsc-multi": "^1.1.0",
Expand Down
14 changes: 14 additions & 0 deletions packages/drivers/odsp-driver-definitions/package.json
Expand Up @@ -11,6 +11,18 @@
"license": "MIT",
"author": "Microsoft and contributors",
"sideEffects": false,
"exports": {
".": {
"import": {
"types": "./lib/index.d.mts",
"default": "./lib/index.mjs"
},
"require": {
"types": "./dist/index.d.ts",
"default": "./dist/index.cjs"
}
}
},
"main": "dist/index.cjs",
"module": "lib/index.mjs",
"types": "dist/index.d.ts",
Expand All @@ -23,6 +35,7 @@
"build:compile": "fluid-build . --task compile",
"build:docs": "fluid-build . --task api",
"build:esnext": "tsc-multi --config ../../../common/build/build-common/tsc-multi.esm.json",
"build:rename-types": "renamer \"lib/**\" -f .d.ts -r .d.mts --force",
"build:test": "tsc-multi --config ./tsc-multi.test.json",
"check:are-the-types-wrong": "attw --pack",
"check:release-tags": "api-extractor run --local --config ./api-extractor-lint.json",
Expand Down Expand Up @@ -55,6 +68,7 @@
"cross-env": "^7.0.3",
"eslint": "~8.50.0",
"prettier": "~3.0.3",
"renamer": "^4.0.0",
"rimraf": "^4.4.0",
"tsc-multi": "^1.1.0",
"typescript": "~5.1.6"
Expand Down
2 changes: 2 additions & 0 deletions packages/drivers/odsp-driver/package.json
Expand Up @@ -24,6 +24,7 @@
"build:docs": "fluid-build . --task api",
"build:esnext": "tsc-multi --config ../../../common/build/build-common/tsc-multi.esm.json",
"build:genver": "gen-version",
"build:rename-types": "renamer \"lib/**\" -f .d.ts -r .d.mts --force",
"build:test": "tsc-multi --config ./tsc-multi.test.json",
"check:are-the-types-wrong": "attw --pack",
"check:release-tags": "api-extractor run --local --config ./api-extractor-lint.json",
Expand Down Expand Up @@ -102,6 +103,7 @@
"mocha-multi-reporters": "^1.5.1",
"moment": "^2.21.0",
"prettier": "~3.0.3",
"renamer": "^4.0.0",
"rimraf": "^4.4.0",
"sinon": "^7.4.2",
"tsc-multi": "^1.1.0",
Expand Down
14 changes: 14 additions & 0 deletions packages/drivers/odsp-urlResolver/package.json
Expand Up @@ -11,6 +11,18 @@
"license": "MIT",
"author": "Microsoft and contributors",
"sideEffects": false,
"exports": {
".": {
"import": {
"types": "./lib/index.d.mts",
"default": "./lib/index.mjs"
},
"require": {
"types": "./dist/index.d.ts",
"default": "./dist/index.cjs"
}
}
},
"main": "dist/index.cjs",
"module": "lib/index.mjs",
"types": "dist/index.d.ts",
Expand All @@ -23,6 +35,7 @@
"build:compile": "fluid-build . --task compile",
"build:docs": "fluid-build . --task api",
"build:esnext": "tsc-multi --config ../../../common/build/build-common/tsc-multi.esm.json",
"build:rename-types": "renamer \"lib/**\" -f .d.ts -r .d.mts --force",
"build:test": "tsc-multi --config ./tsc-multi.test.json",
"check:are-the-types-wrong": "attw --pack",
"check:release-tags": "api-extractor run --local --config ./api-extractor-lint.json",
Expand Down Expand Up @@ -67,6 +80,7 @@
"mocha-multi-reporters": "^1.5.1",
"moment": "^2.21.0",
"prettier": "~3.0.3",
"renamer": "^4.0.0",
"rimraf": "^4.4.0",
"tsc-multi": "^1.1.0",
"typescript": "~5.1.6"
Expand Down
14 changes: 14 additions & 0 deletions packages/drivers/replay-driver/package.json
Expand Up @@ -11,6 +11,18 @@
"license": "MIT",
"author": "Microsoft and contributors",
"sideEffects": false,
"exports": {
".": {
"import": {
"types": "./lib/index.d.mts",
"default": "./lib/index.mjs"
},
"require": {
"types": "./dist/index.d.ts",
"default": "./dist/index.cjs"
}
}
},
"main": "dist/index.cjs",
"module": "lib/index.mjs",
"types": "dist/index.d.ts",
Expand All @@ -22,6 +34,7 @@
"build:compile": "fluid-build . --task compile",
"build:docs": "fluid-build . --task api",
"build:esnext": "tsc-multi --config ../../../common/build/build-common/tsc-multi.esm.json",
"build:rename-types": "renamer \"lib/**\" -f .d.ts -r .d.mts --force",
"check:are-the-types-wrong": "attw --pack",
"check:release-tags": "api-extractor run --local --config ./api-extractor-lint.json",
"ci:build:docs": "api-extractor run",
Expand Down Expand Up @@ -60,6 +73,7 @@
"eslint": "~8.50.0",
"nock": "^13.3.3",
"prettier": "~3.0.3",
"renamer": "^4.0.0",
"rimraf": "^4.4.0",
"tsc-multi": "^1.1.0",
"typescript": "~5.1.6"
Expand Down
14 changes: 14 additions & 0 deletions packages/drivers/routerlicious-driver/package.json
Expand Up @@ -11,6 +11,18 @@
"license": "MIT",
"author": "Microsoft and contributors",
"sideEffects": false,
"exports": {
".": {
"import": {
"types": "./lib/index.d.mts",
"default": "./lib/index.mjs"
},
"require": {
"types": "./dist/index.d.ts",
"default": "./dist/index.cjs"
}
}
},
"main": "dist/index.cjs",
"module": "lib/index.mjs",
"types": "dist/index.d.ts",
Expand All @@ -24,6 +36,7 @@
"build:docs": "fluid-build . --task api",
"build:esnext": "tsc-multi --config ../../../common/build/build-common/tsc-multi.esm.json",
"build:genver": "gen-version",
"build:rename-types": "renamer \"lib/**\" -f .d.ts -r .d.mts --force",
"build:test": "tsc-multi --config ./tsc-multi.test.json",
"check:are-the-types-wrong": "attw --pack",
"check:release-tags": "api-extractor run --local --config ./api-extractor-lint.json",
Expand Down Expand Up @@ -108,6 +121,7 @@
"moment": "^2.21.0",
"nock": "^13.3.3",
"prettier": "~3.0.3",
"renamer": "^4.0.0",
"rimraf": "^4.4.0",
"sinon": "^7.4.2",
"tsc-multi": "^1.1.0",
Expand Down
14 changes: 14 additions & 0 deletions packages/drivers/routerlicious-urlResolver/package.json
Expand Up @@ -11,6 +11,18 @@
"license": "MIT",
"author": "Microsoft and contributors",
"sideEffects": false,
"exports": {
".": {
"import": {
"types": "./lib/index.d.mts",
"default": "./lib/index.mjs"
},
"require": {
"types": "./dist/index.d.ts",
"default": "./dist/index.cjs"
}
}
},
"main": "dist/index.cjs",
"module": "lib/index.mjs",
"types": "dist/index.d.ts",
Expand All @@ -23,6 +35,7 @@
"build:compile": "fluid-build . --task compile",
"build:docs": "fluid-build . --task api",
"build:esnext": "tsc-multi --config ../../../common/build/build-common/tsc-multi.esm.json",
"build:rename-types": "renamer \"lib/**\" -f .d.ts -r .d.mts --force",
"build:test": "tsc-multi --config ./tsc-multi.test.json",
"check:are-the-types-wrong": "attw --pack",
"check:release-tags": "api-extractor run --local --config ./api-extractor-lint.json",
Expand Down Expand Up @@ -71,6 +84,7 @@
"mocha-multi-reporters": "^1.5.1",
"moment": "^2.21.0",
"prettier": "~3.0.3",
"renamer": "^4.0.0",
"rimraf": "^4.4.0",
"tsc-multi": "^1.1.0",
"typescript": "~5.1.6"
Expand Down