Skip to content

Commit

Permalink
chore: add esm2015 entry for web apps aiming at modern browsers
Browse files Browse the repository at this point in the history
  • Loading branch information
echoontheway committed Dec 11, 2021
1 parent dded3f8 commit 36705eb
Show file tree
Hide file tree
Showing 55 changed files with 561 additions and 182 deletions.
11 changes: 8 additions & 3 deletions experimental/packages/opentelemetry-api-metrics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,18 @@
"description": "Public metrics API for OpenTelemetry",
"main": "build/src/index.js",
"module": "build/esm/index.js",
"esm2015": "build/esm2015/index.js",
"types": "build/src/index.d.ts",
"browser": {
"./src/platform/index.ts": "./src/platform/browser/index.ts",
"./build/esm/platform/index.js": "./build/esm/platform/browser/index.js",
"./build/esm2015/platform/index.js": "./build/esm2015/platform/browser/index.js",
"./build/src/platform/index.js": "./build/src/platform/browser/index.js"
},
"repository": "open-telemetry/opentelemetry-js",
"scripts": {
"compile": "tsc --build tsconfig.json tsconfig.esm.json",
"clean": "tsc --build --clean tsconfig.json tsconfig.esm.json",
"compile": "tsc --build tsconfig.all.json",
"clean": "tsc --build --clean tsconfig.all.json",
"test": "nyc ts-mocha -p tsconfig.json test/**/*.test.ts",
"test:browser": "nyc karma start --single-run",
"codecov": "nyc report --reporter=json && codecov -f coverage/*.json -p ../../",
Expand All @@ -23,7 +25,7 @@
"lint": "eslint . --ext .ts",
"lint:fix": "eslint . --ext .ts --fix",
"version": "node ../../../scripts/version-update.js",
"watch": "tsc --build --watch tsconfig.json tsconfig.esm.json",
"watch": "tsc --build --watch tsconfig.all.json",
"precompile": "lerna run version --scope $(npm pkg get name) --include-filtered-dependencies",
"prewatch": "node ../../../scripts/version-update.js"
},
Expand All @@ -45,6 +47,9 @@
"build/esm/**/*.js",
"build/esm/**/*.js.map",
"build/esm/**/*.d.ts",
"build/esm2015/**/*.js",
"build/esm2015/**/*.js.map",
"build/esm2015/**/*.d.ts",
"build/src/**/*.js",
"build/src/**/*.js.map",
"build/src/**/*.d.ts",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "../../../tsconfig.base.json",
"files": [],
"references": [
{ "path": "./tsconfig.json" },
{ "path": "./tsconfig.esm.json" },
{ "path": "./tsconfig.esm2015.json" }
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": "../../../tsconfig.base.esm2015.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "build/esm2015",
"tsBuildInfoFile": "build/esm2015/tsconfig.esm2015.tsbuildinfo"
},
"include": [
"src/**/*.ts"
]
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../../tsconfig.es5.json",
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"rootDir": ".",
"outDir": "build"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@
"description": "OpenTelemetry Collector Metrics Exporter allows user to send collected metrics to the OpenTelemetry Collector",
"main": "build/src/index.js",
"module": "build/esm/index.js",
"esm2015": "build/esm2015/index.js",
"types": "build/src/index.d.ts",
"repository": "open-telemetry/opentelemetry-js",
"browser": {
"./src/platform/index.ts": "./src/platform/browser/index.ts",
"./build/esm/platform/index.js": "./build/esm/platform/browser/index.js",
"./build/esm2015/platform/index.js": "./build/esm2015/platform/browser/index.js",
"./build/src/platform/index.js": "./build/src/platform/browser/index.js"
},
"scripts": {
"compile": "tsc --build tsconfig.json tsconfig.esm.json",
"clean": "tsc --build --clean tsconfig.json tsconfig.esm.json",
"compile": "tsc --build tsconfig.all.json",
"clean": "tsc --build --clean tsconfig.all.json",
"codecov:browser": "nyc report --reporter=json && codecov -f coverage/*.json -p ../../",
"lint": "eslint . --ext .ts",
"lint:fix": "eslint . --ext .ts --fix",
Expand All @@ -22,7 +24,7 @@
"test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts' --exclude 'test/browser/**/*.ts'",
"test:browser": "nyc karma start --single-run",
"version": "node ../../../scripts/version-update.js",
"watch": "tsc --build --watch tsconfig.json tsconfig.esm.json",
"watch": "tsc --build --watch tsconfig.all.json",
"precompile": "lerna run version --scope $(npm pkg get name) --include-filtered-dependencies",
"prewatch": "npm run precompile"
},
Expand All @@ -44,6 +46,9 @@
"build/esm/**/*.js",
"build/esm/**/*.js.map",
"build/esm/**/*.d.ts",
"build/esm2015/**/*.js",
"build/esm2015/**/*.js.map",
"build/esm2015/**/*.d.ts",
"build/src/**/*.js",
"build/src/**/*.js.map",
"build/src/**/*.d.ts",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "../../../tsconfig.base.json",
"files": [],
"references": [
{ "path": "./tsconfig.json" },
{ "path": "./tsconfig.esm.json" },
{ "path": "./tsconfig.esm2015.json" }
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"extends": "../../../tsconfig.base.esm2015.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "build/esm2015",
"tsBuildInfoFile": "build/esm2015/tsconfig.esm2015.tsbuildinfo"
},
"include": [
"src/**/*.ts"
],
"references": [
{
"path": "../opentelemetry-exporter-trace-otlp-http/tsconfig.esm2015.json"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@
"description": "OpenTelemetry Collector Trace Exporter allows user to send collected traces to the OpenTelemetry Collector",
"main": "build/src/index.js",
"module": "build/esm/index.js",
"esm2015": "build/esm2015/index.js",
"types": "build/src/index.d.ts",
"repository": "open-telemetry/opentelemetry-js",
"browser": {
"./src/platform/index.ts": "./src/platform/browser/index.ts",
"./build/esm/platform/index.js": "./build/esm/platform/browser/index.js",
"./build/esm2015/platform/index.js": "./build/esm2015/platform/browser/index.js",
"./build/src/platform/index.js": "./build/src/platform/browser/index.js"
},
"scripts": {
"compile": "tsc --build tsconfig.json tsconfig.esm.json",
"clean": "tsc --build --clean tsconfig.json tsconfig.esm.json",
"compile": "tsc --build tsconfig.all.json",
"clean": "tsc --build --clean tsconfig.all.json",
"codecov:browser": "nyc report --reporter=json && codecov -f coverage/*.json -p ../../",
"lint": "eslint . --ext .ts",
"lint:fix": "eslint . --ext .ts --fix",
Expand All @@ -22,7 +24,7 @@
"test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts' --exclude 'test/browser/**/*.ts'",
"test:browser": "nyc karma start --single-run",
"version": "node ../../../scripts/version-update.js",
"watch": "tsc --build --watch tsconfig.json tsconfig.esm.json",
"watch": "tsc --build --watch tsconfig.all.json",
"precompile": "lerna run version --scope $(npm pkg get name) --include-filtered-dependencies",
"prewatch": "npm run precompile"
},
Expand All @@ -44,6 +46,9 @@
"build/esm/**/*.js",
"build/esm/**/*.js.map",
"build/esm/**/*.d.ts",
"build/esm2015/**/*.js",
"build/esm2015/**/*.js.map",
"build/esm2015/**/*.d.ts",
"build/src/**/*.js",
"build/src/**/*.js.map",
"build/src/**/*.d.ts",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "../../../tsconfig.base.json",
"files": [],
"references": [
{ "path": "./tsconfig.json" },
{ "path": "./tsconfig.esm.json" },
{ "path": "./tsconfig.esm2015.json" }
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": "../../../tsconfig.base.esm2015.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "build/esm2015",
"tsBuildInfoFile": "build/esm2015/tsconfig.esm2015.tsbuildinfo"
},
"include": [
"src/**/*.ts"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,19 @@
"description": "OpenTelemetry fetch automatic instrumentation package.",
"main": "build/src/index.js",
"module": "build/esm/index.js",
"esm2015": "build/esm2015/index.js",
"types": "build/src/index.d.ts",
"repository": "open-telemetry/opentelemetry-js",
"scripts": {
"compile": "tsc --build tsconfig.json tsconfig.esm.json",
"clean": "tsc --build --clean tsconfig.json tsconfig.esm.json",
"compile": "tsc --build tsconfig.all.json",
"clean": "tsc --build --clean tsconfig.all.json",
"lint": "eslint . --ext .ts",
"lint:fix": "eslint . --ext .ts --fix",
"codecov:browser": "nyc report --reporter=json && codecov -f coverage/*.json -p ../../",
"version": "node ../../../scripts/version-update.js",
"tdd": "karma start",
"test:browser": "nyc karma start --single-run",
"watch": "tsc --build --watch tsconfig.json tsconfig.esm.json",
"watch": "tsc --build --watch tsconfig.all.json",
"precompile": "lerna run version --scope $(npm pkg get name) --include-filtered-dependencies",
"prewatch": "node ../../../scripts/version-update.js"
},
Expand All @@ -37,6 +38,9 @@
"build/esm/**/*.js",
"build/esm/**/*.js.map",
"build/esm/**/*.d.ts",
"build/esm2015/**/*.js",
"build/esm2015/**/*.js.map",
"build/esm2015/**/*.d.ts",
"build/src/**/*.js",
"build/src/**/*.js.map",
"build/src/**/*.d.ts",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "../../../tsconfig.base.json",
"files": [],
"references": [
{ "path": "./tsconfig.json" },
{ "path": "./tsconfig.esm.json" },
{ "path": "./tsconfig.esm2015.json" }
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"extends": "../../../tsconfig.base.esm2015.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "build/esm2015",
"tsBuildInfoFile": "build/esm2015/tsconfig.esm2015.tsbuildinfo"
},
"include": [
"src/**/*.ts"
],
"references": [
{
"path": "../opentelemetry-instrumentation/tsconfig.esm2015.json"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,19 @@
"description": "OpenTelemetry XMLHttpRequest automatic instrumentation package.",
"main": "build/src/index.js",
"module": "build/esm/index.js",
"esm2015": "build/esm2015/index.js",
"types": "build/src/index.d.ts",
"repository": "open-telemetry/opentelemetry-js",
"scripts": {
"compile": "tsc --build tsconfig.json tsconfig.esm.json",
"clean": "tsc --build --clean tsconfig.json tsconfig.esm.json",
"compile": "tsc --build tsconfig.all.json",
"clean": "tsc --build --clean tsconfig.all.json",
"lint": "eslint . --ext .ts",
"lint:fix": "eslint . --ext .ts --fix",
"codecov:browser": "nyc report --reporter=json && codecov -f coverage/*.json -p ../../",
"version": "node ../../../scripts/version-update.js",
"tdd": "karma start",
"test:browser": "nyc karma start --single-run",
"watch": "tsc --build --watch tsconfig.json tsconfig.esm.json",
"watch": "tsc --build --watch tsconfig.all.json",
"precompile": "lerna run version --scope $(npm pkg get name) --include-filtered-dependencies",
"prewatch": "node ../../../scripts/version-update.js"
},
Expand All @@ -37,6 +38,9 @@
"build/esm/**/*.js",
"build/esm/**/*.js.map",
"build/esm/**/*.d.ts",
"build/esm2015/**/*.js",
"build/esm2015/**/*.js.map",
"build/esm2015/**/*.d.ts",
"build/src/**/*.js",
"build/src/**/*.js.map",
"build/src/**/*.d.ts",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "../../../tsconfig.base.json",
"files": [],
"references": [
{ "path": "./tsconfig.json" },
{ "path": "./tsconfig.esm.json" },
{ "path": "./tsconfig.esm2015.json" }
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"extends": "../../../tsconfig.base.esm2015.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "build/esm2015",
"tsBuildInfoFile": "build/esm2015/tsconfig.esm2015.tsbuildinfo"
},
"include": [
"src/**/*.ts"
],
"references": [
{
"path": "../opentelemetry-instrumentation/tsconfig.esm2015.json"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"license": "Apache-2.0",
"main": "build/src/index.js",
"module": "build/esm/index.js",
"esm2015": "build/esm2015/index.js",
"types": "build/src/index.d.ts",
"publishConfig": {
"access": "public"
Expand All @@ -18,6 +19,7 @@
"browser": {
"./src/platform/index.ts": "./src/platform/browser/index.ts",
"./build/esm/platform/index.js": "./build/esm/platform/browser/index.js",
"./build/esm2015/platform/index.js": "./build/esm2015/platform/browser/index.js",
"./build/src/platform/index.js": "./build/src/platform/browser/index.js"
},
"files": [
Expand All @@ -32,8 +34,8 @@
"README.md"
],
"scripts": {
"compile": "tsc --build tsconfig.json tsconfig.esm.json",
"clean": "tsc --build --clean tsconfig.json tsconfig.esm.json",
"compile": "tsc --build tsconfig.all.json",
"clean": "tsc --build --clean tsconfig.all.json",
"codecov": "nyc report --reporter=json && codecov -f coverage/*.json -p ../../",
"codecov:browser": "nyc report --reporter=json && codecov -f coverage/*.json -p ../../",
"lint": "eslint . --ext .ts",
Expand All @@ -44,7 +46,7 @@
"test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts' --exclude 'test/browser/**/*.ts'",
"test:browser": "nyc karma start --single-run",
"version": "node ../../../scripts/version-update.js",
"watch": "tsc --build --watch tsconfig.json tsconfig.esm.json",
"watch": "tsc --build --watch tsconfig.all.json",
"precompile": "lerna run version --scope $(npm pkg get name) --include-filtered-dependencies",
"prewatch": "node ../../../scripts/version-update.js"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "../../../tsconfig.base.json",
"files": [],
"references": [
{ "path": "./tsconfig.json" },
{ "path": "./tsconfig.esm.json" },
{ "path": "./tsconfig.esm2015.json" }
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"extends": "../../../tsconfig.base.esm2015.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "build/esm2015",
"tsBuildInfoFile": "build/esm2015/tsconfig.esm2015.tsbuildinfo"
},
"include": [
"src/**/*.ts"
],
"references": [
{
"path": "../opentelemetry-api-metrics/tsconfig.esm2015.json"
}
]
}
Loading

0 comments on commit 36705eb

Please sign in to comment.