fix: fix ESM and web polyfills issue (#201)

This commit is contained in:
Todd Baert 2022-12-29 12:11:53 -05:00 committed by GitHub
parent 0eb3f1802d
commit acee6e1817
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 17 additions and 13 deletions

View File

@ -1,7 +1,6 @@
{
"name": "@openfeature/open-telemetry-hook",
"version": "5.1.1",
"type": "commonjs",
"repository": {
"type": "git",
"url": "https://github.com/open-feature/js-sdk-contrib.git",

View File

@ -4,7 +4,7 @@
"projectType": "library",
"targets": {
"package": {
"executor": "@nrwl/web:rollup",
"executor": "@nrwl/rollup:rollup",
"outputs": [
"{options.outputPath}"
],
@ -13,7 +13,9 @@
"outputPath": "dist/libs/hooks/open-telemetry",
"entryFile": "libs/hooks/open-telemetry/src/index.ts",
"tsConfig": "libs/hooks/open-telemetry/tsconfig.lib.json",
"compiler": "babel",
"compiler": "tsc",
"skipTypeField": true,
"generateExportsField": true,
"umdName": "OpenTelemetry",
"external": [
"typescript"

View File

@ -1,7 +1,6 @@
{
"name": "@openfeature/flagd-web-provider",
"version": "0.1.2",
"type": "commonjs",
"scripts": {
"publish-if-not-exists": "cp $NPM_CONFIG_USERCONFIG .npmrc && if [ \"$(npm show $npm_package_name@$npm_package_version version)\" = \"$(npm run current-version -s)\" ]; then echo 'already published, skipping'; else npm publish --access public; fi",
"current-version": "echo $npm_package_version"

View File

@ -1,7 +1,6 @@
{
"name": "@openfeature/flagd-provider",
"version": "0.7.2",
"type": "commonjs",
"scripts": {
"publish-if-not-exists": "cp $NPM_CONFIG_USERCONFIG .npmrc && if [ \"$(npm show $npm_package_name@$npm_package_version version)\" = \"$(npm run current-version -s)\" ]; then echo 'already published, skipping'; else npm publish --access public; fi",
"current-version": "echo $npm_package_version"

View File

@ -57,14 +57,16 @@
]
},
"package": {
"executor": "@nrwl/web:rollup",
"executor": "@nrwl/rollup:rollup",
"outputs": ["{options.outputPath}"],
"options": {
"project": "libs/providers/flagd/package.json",
"outputPath": "dist/libs/providers/flagd",
"entryFile": "libs/providers/flagd/src/index.ts",
"tsConfig": "libs/providers/flagd/tsconfig.lib.json",
"compiler": "babel",
"compiler": "tsc",
"skipTypeField": true,
"generateExportsField": true,
"buildableProjectDepsInPackageJsonType": "dependencies",
"umdName": "flagd",
"external": ["typescript"],

View File

@ -1,7 +1,6 @@
{
"name": "@openfeature/go-feature-flag-provider",
"version": "0.5.2",
"type": "commonjs",
"scripts": {
"publish-if-not-exists": "cp $NPM_CONFIG_USERCONFIG .npmrc && if [ \"$(npm show $npm_package_name@$npm_package_version version)\" = \"$(npm run current-version -s)\" ]; then echo 'already published, skipping'; else npm publish --access public; fi",
"current-version": "echo $npm_package_version"

View File

@ -38,7 +38,7 @@
}
},
"package": {
"executor": "@nrwl/web:rollup",
"executor": "@nrwl/rollup:rollup",
"outputs": [
"{options.outputPath}"
],
@ -47,7 +47,9 @@
"outputPath": "dist/libs/providers/go-feature-flag",
"entryFile": "libs/providers/go-feature-flag/src/index.ts",
"tsConfig": "libs/providers/go-feature-flag/tsconfig.lib.json",
"compiler": "babel",
"compiler": "tsc",
"skipTypeField": true,
"generateExportsField": true,
"buildableProjectDepsInPackageJsonType": "dependencies",
"umdName": "go-feature-flag",
"external": [

View File

@ -120,15 +120,17 @@ function normalizeOptions(tree: Tree, schema: SchemaOptions) {
function updateProject(tree: Tree, projectRoot: string, umdName: string) {
updateJson(tree, joinPathFragments(projectRoot, 'project.json'), (json) => {
json.targets['package'] = {
executor: '@nrwl/web:rollup',
executor: '@nrwl/rollup:rollup',
outputs: ['{options.outputPath}'],
options: {
project: `${projectRoot}/package.json`,
outputPath: `dist/${projectRoot}`,
entryFile: `${projectRoot}/src/index.ts`,
tsConfig: `${projectRoot}/tsconfig.lib.json`,
buildableProjectDepsInPackageJsonType: "dependencies",
compiler: 'babel',
buildableProjectDepsInPackageJsonType: 'dependencies',
compiler: 'tsc',
skipTypeField: true,
generateExportsField: true,
umdName,
external: ['typescript'],
format: ['cjs', 'esm'],