Skip to content

Commit 3c811ae

Browse files
committed
chore: switch to single distribution for es2017
1 parent 729be0a commit 3c811ae

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+91
-164
lines changed

benchmark/package.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,12 @@
88
"performance",
99
"benchmark"
1010
],
11-
"types": "./dist10/index.d.ts",
11+
"types": "./dist/index.d.ts",
1212
"engines": {
1313
"node": ">=8.9"
1414
},
1515
"scripts": {
16-
"build:all-dist": "npm run build:dist8 && npm run build:dist10",
1716
"build": "lb-tsc",
18-
"build:dist8": "lb-tsc es2017",
19-
"build:dist10": "lb-tsc es2018",
2017
"clean": "lb-clean dist*",
2118
"pretest": "npm run clean && npm run build",
2219
"test": "lb-mocha \"DIST/__tests__\"",

benchmark/tsconfig.build.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"compilerOptions": {
55
"rootDir": "src",
66
"composite": true,
7-
"target": "es2018",
8-
"outDir": "dist10"
7+
"target": "es2017",
8+
"outDir": "dist"
99
},
1010
"references": [
1111
{

examples/hello-world/package.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,11 @@
66
"engines": {
77
"node": ">=8.9"
88
},
9-
"types": "./dist10/index.d.ts",
9+
"types": "./dist/index.d.ts",
1010
"scripts": {
1111
"acceptance": "lb-mocha \"DIST/__tests__/acceptance/**/*.js\"",
12-
"build:all-dist": "npm run build:dist8 && npm run build:dist10",
1312
"build:apidocs": "lb-apidocs",
1413
"build": "lb-tsc",
15-
"build:dist8": "lb-tsc es2017",
16-
"build:dist10": "lb-tsc es2018",
1714
"build:watch": "lb-tsc --watch",
1815
"clean": "lb-clean *example-hello-world*.tgz dist* package api-docs",
1916
"verify": "npm pack && tar xf *example-hello-world*.tgz && tree package && npm run clean",

examples/hello-world/tsconfig.build.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"compilerOptions": {
55
"rootDir": "src",
66
"composite": true,
7-
"target": "es2018",
8-
"outDir": "dist10"
7+
"target": "es2017",
8+
"outDir": "dist"
99
},
1010
"references": [
1111
{

examples/log-extension/package.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,10 @@
66
"engines": {
77
"node": ">=8.9"
88
},
9-
"types": "./dist10/index.d.ts",
9+
"types": "./dist/index.d.ts",
1010
"scripts": {
11-
"build:all-dist": "npm run build:dist8 && npm run build:dist10",
1211
"build:apidocs": "lb-apidocs",
1312
"build": "lb-tsc",
14-
"build:dist8": "lb-tsc es2017",
15-
"build:dist10": "lb-tsc es2018",
1613
"build:watch": "lb-tsc --watch",
1714
"clean": "lb-clean *example-log-extension-*.tgz dist* package api-docs",
1815
"lint": "npm run prettier:check && npm run tslint",

examples/log-extension/tsconfig.build.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"compilerOptions": {
55
"rootDir": "src",
66
"composite": true,
7-
"target": "es2018",
8-
"outDir": "dist10"
7+
"target": "es2017",
8+
"outDir": "dist"
99
},
1010
"references": [
1111
{

examples/rpc-server/package.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,10 @@
99
"engines": {
1010
"node": ">=8.9"
1111
},
12-
"types": "./dist10/index.d.ts",
12+
"types": "./dist/index.d.ts",
1313
"scripts": {
14-
"build:all-dist": "npm run build:dist8 && npm run build:dist10",
1514
"build:apidocs": "lb-apidocs",
1615
"build": "lb-tsc",
17-
"build:dist8": "lb-tsc es2017",
18-
"build:dist10": "lb-tsc es2018",
1916
"build:watch": "lb-tsc --watch",
2017
"clean": "lb-clean dist*",
2118
"lint": "npm run prettier:check && npm run tslint",

examples/soap-calculator/package.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,10 @@
1313
"engines": {
1414
"node": ">=8.9"
1515
},
16-
"types": "./dist10/index.d.ts",
16+
"types": "./dist/index.d.ts",
1717
"scripts": {
18-
"build:all-dist": "npm run build:dist8 && npm run build:dist10",
1918
"build:apidocs": "lb-apidocs",
2019
"build": "lb-tsc",
21-
"build:dist8": "lb-tsc es2017",
22-
"build:dist10": "lb-tsc es2018",
2320
"build:watch": "lb-tsc --watch",
2421
"clean": "lb-clean *example-soap*.tgz dist* package api-docs dist*",
2522
"lint": "npm run prettier:check && npm run tslint",

examples/soap-calculator/tsconfig.build.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"compilerOptions": {
55
"rootDir": "src",
66
"composite": true,
7-
"target": "es2018",
8-
"outDir": "dist10"
7+
"target": "es2017",
8+
"outDir": "dist"
99
},
1010
"references": [
1111
{

examples/todo-list/package.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,10 @@
66
"engines": {
77
"node": ">=8.9"
88
},
9-
"types": "./dist10/index.d.ts",
9+
"types": "./dist/index.d.ts",
1010
"scripts": {
11-
"build:all-dist": "npm run build:dist8 && npm run build:dist10",
1211
"build:apidocs": "lb-apidocs",
1312
"build": "lb-tsc",
14-
"build:dist8": "lb-tsc es2017",
15-
"build:dist10": "lb-tsc es2018",
1613
"build:watch": "lb-tsc --watch",
1714
"clean": "lb-clean *example-todo-list*.tgz dist* package api-docs",
1815
"lint": "npm run prettier:check && npm run tslint",

examples/todo-list/tsconfig.build.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"compilerOptions": {
55
"rootDir": "src",
66
"composite": true,
7-
"target": "es2018",
8-
"outDir": "dist10"
7+
"target": "es2017",
8+
"outDir": "dist"
99
},
1010
"references": [
1111
{

examples/todo/package.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,10 @@
66
"engines": {
77
"node": ">=8.9"
88
},
9-
"types": "./dist10/index.d.ts",
9+
"types": "./dist/index.d.ts",
1010
"scripts": {
11-
"build:all-dist": "npm run build:dist8 && npm run build:dist10",
1211
"build:apidocs": "lb-apidocs",
1312
"build": "lb-tsc",
14-
"build:dist8": "lb-tsc es2017",
15-
"build:dist10": "lb-tsc es2018",
1613
"build:watch": "lb-tsc --watch",
1714
"clean": "lb-clean *example-todo*.tgz dist* package api-docs",
1815
"lint": "npm run prettier:check && npm run tslint",

examples/todo/tsconfig.build.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"compilerOptions": {
55
"rootDir": "src",
66
"composite": true,
7-
"target": "es2018",
8-
"outDir": "dist10"
7+
"target": "es2017",
8+
"outDir": "dist"
99
},
1010
"references": [
1111
{

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@
4040
"clean": "lerna run clean && node packages/build/bin/run-clean \"packages/*/dist*\" \"examples/*/dist*\"",
4141
"clean:lerna": "lerna clean",
4242
"build": "node bin/run-lerna run build",
43-
"build:all-dist": "node bin/run-lerna run build:all-dist",
44-
"build:full": "npm run clean:lerna && npm install && npm run build:all-dist",
43+
"build:full": "npm run clean:lerna && npm install && npm run build",
4544
"pretest": "npm run clean && npm run build",
4645
"test": "node packages/build/bin/run-nyc npm run mocha --scripts-prepend-node-path",
4746
"pretest:ci": "npm run build",

packages/authentication/package.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,11 @@
55
"engines": {
66
"node": ">=8.9"
77
},
8-
"types": "./dist10/index.d.ts",
8+
"types": "./dist/index.d.ts",
99
"scripts": {
1010
"acceptance": "lb-mocha \"DIST/__tests__/acceptance/**/*.js\"",
11-
"build:all-dist": "npm run build:dist8 && npm run build:dist10",
1211
"build:apidocs": "lb-apidocs",
1312
"build": "lb-tsc",
14-
"build:dist8": "lb-tsc es2017",
15-
"build:dist10": "lb-tsc es2018",
1613
"clean": "lb-clean loopback-authentication*.tgz dist* package api-docs",
1714
"integration": "lb-mocha \"DIST/__tests__/integration/**/*.js\"",
1815
"pretest": "npm run build",

packages/authentication/tsconfig.build.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"compilerOptions": {
55
"rootDir": "src",
66
"composite": true,
7-
"target": "es2018",
8-
"outDir": "dist10"
7+
"target": "es2017",
8+
"outDir": "dist"
99
},
1010
"references": [
1111
{

packages/boot/package.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,14 @@
55
"engines": {
66
"node": ">=8.9"
77
},
8-
"types": "./dist10/index.d.ts",
8+
"types": "./dist/index.d.ts",
99
"publishConfig": {
1010
"access": "public"
1111
},
1212
"scripts": {
1313
"acceptance": "lb-mocha \"DIST/__tests__/acceptance/**/*.js\"",
14-
"build:all-dist": "npm run build:dist8 && npm run build:dist10",
1514
"build:apidocs": "lb-apidocs",
1615
"build": "lb-tsc",
17-
"build:dist8": "lb-tsc es2017",
18-
"build:dist10": "lb-tsc es2018",
1916
"clean": "lb-clean loopback-boot*.tgz dist* package api-docs",
2017
"pretest": "npm run build",
2118
"integration": "lb-mocha \"DIST/__tests__/integration/**/*.js\"",

packages/boot/tsconfig.build.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"compilerOptions": {
55
"rootDir": "src",
66
"composite": true,
7-
"target": "es2018",
8-
"outDir": "dist10"
7+
"target": "es2017",
8+
"outDir": "dist"
99
},
1010
"references": [
1111
{

packages/build/bin/compile-package.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
Usage:
1111
node ./bin/compile-package <target>
1212
13-
Where <target> is one of es2015, es2017 or es2018.
13+
Where <target> is one of es2015, es2017 or es2017.
1414
1515
========
1616
*/
@@ -108,12 +108,11 @@ function run(argv, options) {
108108
JSON.stringify(
109109
{
110110
extends: baseConfigFile,
111-
exclude: [
112-
'node_modules/**',
113-
'packages/*/node_modules/**',
114-
'examples/*/node_modules/**',
115-
'**/*.d.ts',
116-
],
111+
compilerOptions: {
112+
target: 'es2017',
113+
outDir: 'dist',
114+
},
115+
exclude: ['**/*.d.ts'],
117116
},
118117
null,
119118
' ',

packages/build/bin/utils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const debug = require('debug')('loopback:build');
1717
function getCompilationTarget() {
1818
const nodeMajorVersion = +process.versions.node.split('.')[0];
1919
return nodeMajorVersion >= 10
20-
? 'es2018'
20+
? 'es2017'
2121
: nodeMajorVersion >= 7
2222
? 'es2017'
2323
: 'es2015';
@@ -37,7 +37,7 @@ function getDistribution(target) {
3737
dist = 'dist10';
3838
break;
3939
case 'es2017':
40-
dist = 'dist8';
40+
dist = 'dist';
4141
break;
4242
case 'es2015':
4343
dist = 'dist6';

packages/build/config/tsconfig.common.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"noImplicitAny": true,
77
"strictNullChecks": true,
88

9-
"lib": ["es2018", "dom", "esnext.asynciterable"],
9+
"lib": ["es2017", "dom", "esnext.asynciterable"],
1010
"module": "commonjs",
1111
"moduleResolution": "node",
1212
"target": "es2017",
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export * from './dist8';
1+
export * from './dist';

packages/cli/generators/project/templates/package.json.ejs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,8 @@
1111
"node": ">=8.9"
1212
},
1313
"scripts": {
14-
"build:all-dist": "npm run build:dist8 && npm run build:dist10",
1514
"build:apidocs": "lb-apidocs",
1615
"build": "lb-tsc",
17-
"build:dist8": "lb-tsc es2017",
18-
"build:dist10": "lb-tsc es2018",
1916
"build:watch": "lb-tsc --watch",
2017
"clean": "lb-clean dist*",
2118
<% if (project.prettier && project.tslint) { -%>

packages/cli/generators/project/templates/package.plain.json.ejs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@
1111
"node": ">=8.9"
1212
},
1313
"scripts": {
14-
"build": "tsc --outDir dist --target es2017",
15-
"build:all-dist": "npm run build",
16-
"build:watch": "tsc --outDir dist --target es2017 --watch",
14+
"build": "tsc",
15+
"build:watch": "tsc --watch",
1716
"clean": "rimraf dist",
1817
<% if (project.prettier && project.tslint) { -%>
1918
"lint": "npm run prettier:check && npm run tslint",

packages/cli/generators/project/templates/tsconfig.json.ejs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"extends": "./node_modules/@loopback/build/config/tsconfig.common.json",
55
"compilerOptions": {
66
"rootDir": "src",
7-
"outDir": "dist10"
7+
"outDir": "dist"
88
},
99
<% } else { -%>
1010
"compilerOptions": {
@@ -13,14 +13,14 @@
1313
"noImplicitAny": true,
1414
"strictNullChecks": true,
1515
16-
"lib": ["es2018", "dom", "esnext.asynciterable"],
16+
"lib": ["es2017", "dom", "esnext.asynciterable"],
1717
"module": "commonjs",
1818
"moduleResolution": "node",
1919
"target": "es2017",
2020
"sourceMap": true,
2121
"declaration": true,
2222
"rootDir": "src",
23-
"outDir": "dist10"
23+
"outDir": "dist"
2424
},
2525
<% } -%>
2626
"exclude": [

packages/cli/test/integration/generators/app.integration.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ describe('app-generator specific files', () => {
6060
/\'\@loopback\/rest\'/,
6161
);
6262
assert.fileContent(
63-
'test/acceptance/ping.controller.acceptance.ts',
63+
'src/__tests__/acceptance/ping.controller.acceptance.ts',
6464
/describe\('PingController'/,
6565
);
6666
});

packages/cli/test/integration/lib/project-generator.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,6 @@ module.exports = function(projGenerator, props, projectType) {
255255
assert.noFileContent([
256256
['package.json', '"typescript"'],
257257
['tslint.json', '"rules"'],
258-
['tsconfig.json', '"compilerOptions"'],
259258
]);
260259

261260
if (projectType === 'application') {

packages/context/package.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,11 @@
55
"engines": {
66
"node": ">=8.9"
77
},
8-
"types": "./dist10/index.d.ts",
8+
"types": "./dist/index.d.ts",
99
"scripts": {
1010
"acceptance": "lb-mocha \"DIST/__tests__/acceptance/**/*.js\"",
11-
"build:all-dist": "npm run build:dist8 && npm run build:dist10",
1211
"build:apidocs": "lb-apidocs",
1312
"build": "lb-tsc",
14-
"build:dist8": "lb-tsc es2017",
15-
"build:dist10": "lb-tsc es2018",
1613
"clean": "lb-clean loopback-context*.tgz dist* package api-docs",
1714
"pretest": "npm run build",
1815
"test": "lb-mocha \"DIST/__tests__/unit/**/*.js\" \"DIST/__tests__/acceptance/**/*.js\"",

packages/context/src/inject.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ export function describeInjectedArguments(
304304
if (method === '') {
305305
// A hacky way to check if an explicit constructor exists
306306
// See https://github.com/strongloop/loopback-next/issues/1565
307-
if (target.toString().match(/\s+constructor\s*\([^\)]*\)\s+\{/m)) {
307+
if (target.toString().match(/\{\s*constructor\s*\([^\)]*\)\s*\{/m)) {
308308
options.ownMetadataOnly = true;
309309
}
310310
} else if (target.hasOwnProperty(method)) {

0 commit comments

Comments
 (0)