Skip to content

Commit

Permalink
chore: add esm2015 entry for web app aiming at modern browsers
Browse files Browse the repository at this point in the history
  • Loading branch information
echoontheway committed Oct 21, 2021
1 parent c160ad8 commit 05d08e4
Show file tree
Hide file tree
Showing 79 changed files with 789 additions and 378 deletions.
5 changes: 4 additions & 1 deletion experimental/packages/opentelemetry-api-metrics/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,8 @@ module.exports = {
"commonjs": true,
"shared-node-browser": true
},
...require('../../../eslint.config.js')
...require('../../../eslint.config.js'),
parserOptions: {
"project": "./tsconfig.cjs.json"
},
}
13 changes: 9 additions & 4 deletions experimental/packages/opentelemetry-api-metrics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,27 @@
"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",
"test": "nyc ts-mocha -p tsconfig.json test/**/*.test.ts",
"compile": "tsc --build",
"clean": "tsc --build --clean",
"test": "nyc ts-mocha -p tsconfig.cjs.json test/**/*.test.ts",
"test:browser": "nyc karma start --single-run",
"codecov": "nyc report --reporter=json && codecov -f coverage/*.json -p ../../",
"codecov:browser": "nyc report --reporter=json && codecov -f coverage/*.json -p ../../",
"build": "npm run compile",
"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",
"precompile": "lerna run version --scope $(npm pkg get name) --include-filtered-dependencies",
"prewatch": "node ../../../scripts/version-update.js"
},
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
11 changes: 11 additions & 0 deletions experimental/packages/opentelemetry-api-metrics/tsconfig.cjs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"rootDir": ".",
"outDir": "build"
},
"include": [
"src/**/*.ts",
"test/**/*.ts"
]
}
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"
]
}
14 changes: 6 additions & 8 deletions experimental/packages/opentelemetry-api-metrics/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
{
"extends": "../../../tsconfig.es5.json",
"compilerOptions": {
"rootDir": ".",
"outDir": "build"
},
"include": [
"src/**/*.ts",
"test/**/*.ts"
"extends": "../../../tsconfig.base.json",
"files": [],
"references": [
{ "path": "./tsconfig.cjs.json" },
{ "path": "./tsconfig.esm.json" },
{ "path": "./tsconfig.esm2015.json" }
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@ module.exports = {
"node": true,
"browser": true
},
...require('../../../eslint.config.js')
...require('../../../eslint.config.js'),
parserOptions: {
"project": "./tsconfig.cjs.json"
},
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,27 @@
"description": "OpenTelemetry Collector 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",
"clean": "tsc --build --clean",
"codecov:browser": "nyc report --reporter=json && codecov -f coverage/*.json -p ../../",
"lint": "eslint . --ext .ts",
"lint:fix": "eslint . --ext .ts --fix",
"tdd": "npm run test -- --watch-extensions ts --watch",
"tdd:browser": "karma start",
"test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts' --exclude 'test/browser/**/*.ts'",
"test": "nyc ts-mocha -p tsconfig.cjs.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",
"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,19 @@
{
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"rootDir": ".",
"outDir": "build"
},
"include": [
"src/**/*.ts",
"test/**/*.ts"
],
"references": [
{
"path": "../opentelemetry-api-metrics/tsconfig.cjs.json"
},
{
"path": "../opentelemetry-sdk-metrics-base/tsconfig.cjs.json"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"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"
},
{
"path": "../opentelemetry-sdk-metrics-base/tsconfig.esm2015.json"
}
]
}
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
{
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"rootDir": ".",
"outDir": "build"
},
"include": [
"src/**/*.ts",
"test/**/*.ts"
],
"files": [],
"references": [
{
"path": "../opentelemetry-api-metrics"
},
{
"path": "../opentelemetry-sdk-metrics-base"
}
{ "path": "./tsconfig.cjs.json" },
{ "path": "./tsconfig.esm.json" },
{ "path": "./tsconfig.esm2015.json" }
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@ module.exports = {
"node": true,
"browser": true
},
...require('../../../eslint.config.js')
...require('../../../eslint.config.js'),
parserOptions: {
"project": "./tsconfig.cjs.json"
},
}
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",
"clean": "tsc --build --clean",
"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",
"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,17 @@
{
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"rootDir": ".",
"outDir": "build",
"skipLibCheck": true
},
"include": [
"src/**/*.ts",
"test/**/*.ts"
],
"references": [
{
"path": "../opentelemetry-instrumentation/tsconfig.cjs.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
@@ -1,17 +1,9 @@
{
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"rootDir": ".",
"outDir": "build",
"skipLibCheck": true
},
"include": [
"src/**/*.ts",
"test/**/*.ts"
],
"files": [],
"references": [
{
"path": "../opentelemetry-instrumentation"
}
{ "path": "./tsconfig.cjs.json" },
{ "path": "./tsconfig.esm.json" },
{ "path": "./tsconfig.esm2015.json" }
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@ module.exports = {
"browser": true,
"jquery": true
},
...require('../../../eslint.config.js')
...require('../../../eslint.config.js'),
parserOptions: {
"project": "./tsconfig.cjs.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",
"clean": "tsc --build --clean",
"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",
"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,17 @@
{
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"rootDir": ".",
"outDir": "build",
"skipLibCheck": true
},
"include": [
"src/**/*.ts",
"test/**/*.ts"
],
"references": [
{
"path": "../opentelemetry-instrumentation/tsconfig.cjs.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"
}
]
}
Loading

0 comments on commit 05d08e4

Please sign in to comment.