Skip to content

fix: module issues with types #212

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

Merged
merged 3 commits into from
Jan 19, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions assets/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"module": "commonjs"
}
6 changes: 5 additions & 1 deletion libs/hooks/open-telemetry/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"entryFile": "libs/hooks/open-telemetry/src/index.ts",
"tsConfig": "libs/hooks/open-telemetry/tsconfig.lib.json",
"compiler": "tsc",
"skipTypeField": true,
"generateExportsField": true,
"umdName": "OpenTelemetry",
"external": [
Expand All @@ -25,6 +24,11 @@
"esm"
],
"assets": [
{
"glob": "package.json",
"input": "./assets",
"output": "./src/"
},
{
"glob": "LICENSE",
"input": "./",
Expand Down
5 changes: 5 additions & 0 deletions libs/providers/flagd-web/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@
"external": ["typescript"],
"format": ["cjs", "esm"],
"assets": [
{
"glob": "package.json",
"input": "./assets",
"output": "./src/"
},
{
"glob": "LICENSE",
"input": "./",
Expand Down
6 changes: 5 additions & 1 deletion libs/providers/flagd/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,17 @@
"entryFile": "libs/providers/flagd/src/index.ts",
"tsConfig": "libs/providers/flagd/tsconfig.lib.json",
"compiler": "tsc",
"skipTypeField": true,
"generateExportsField": true,
"buildableProjectDepsInPackageJsonType": "dependencies",
"umdName": "flagd",
"external": ["typescript"],
"format": ["cjs", "esm"],
"assets": [
{
"glob": "package.json",
"input": "./assets",
"output": "./src/"
},
{
"glob": "LICENSE",
"input": "./",
Expand Down
6 changes: 5 additions & 1 deletion libs/providers/go-feature-flag/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
"entryFile": "libs/providers/go-feature-flag/src/index.ts",
"tsConfig": "libs/providers/go-feature-flag/tsconfig.lib.json",
"compiler": "tsc",
"skipTypeField": true,
"generateExportsField": true,
"buildableProjectDepsInPackageJsonType": "dependencies",
"umdName": "go-feature-flag",
Expand All @@ -60,6 +59,11 @@
"esm"
],
"assets": [
{
"glob": "package.json",
"input": "./assets",
"output": "./src/"
},
{
"glob": "LICENSE",
"input": "./",
Expand Down
8 changes: 7 additions & 1 deletion tools/generators/open-feature/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,18 @@ function updateProject(tree: Tree, projectRoot: string, umdName: string) {
tsConfig: `${projectRoot}/tsconfig.lib.json`,
buildableProjectDepsInPackageJsonType: 'dependencies',
compiler: 'tsc',
skipTypeField: true,
generateExportsField: true,
umdName,
external: ['typescript'],
format: ['cjs', 'esm'],
assets: [
// Move a "commonjs" package.json to the types root (js is bundled).
// This prevents us from having to add file extensions to all our imports in ESM contexts, which ESM requires.
{
glob: "package.json",
input: "./assets",
output: "./src/"
},
{
glob: 'LICENSE',
input: './',
Expand Down