Skip to content

Commit 729be0a

Browse files
committed
chore: reorg project layout for better typescript refs
1 parent d16e94b commit 729be0a

File tree

289 files changed

+203
-573
lines changed

Some content is hidden

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

289 files changed

+203
-573
lines changed

benchmark/index.ts

Lines changed: 0 additions & 6 deletions
This file was deleted.

benchmark/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"performance",
99
"benchmark"
1010
],
11-
"main": "index.js",
11+
"types": "./dist10/index.d.ts",
1212
"engines": {
1313
"node": ">=8.9"
1414
},
@@ -19,7 +19,7 @@
1919
"build:dist10": "lb-tsc es2018",
2020
"clean": "lb-clean dist*",
2121
"pretest": "npm run clean && npm run build",
22-
"test": "lb-mocha \"DIST/test\"",
22+
"test": "lb-mocha \"DIST/__tests__\"",
2323
"prestart": "npm run build",
2424
"start": "node ."
2525
},

benchmark/test/benchmark.integration.ts renamed to benchmark/src/__tests__/benchmark.integration.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import {expect} from '@loopback/testlab';
77
import * as request from 'request-promise-native';
88
import {Benchmark} from '..';
9-
import {Autocannon, EndpointStats} from '../src/autocannon';
9+
import {Autocannon, EndpointStats} from '../autocannon';
1010

1111
const debug = require('debug')('test');
1212

File renamed without changes.

benchmark/tsconfig.build.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,11 @@
22
"$schema": "http://json.schemastore.org/tsconfig",
33
"extends": "../packages/build/config/tsconfig.common.json",
44
"compilerOptions": {
5-
"rootDir": ".",
5+
"rootDir": "src",
66
"composite": true,
77
"target": "es2018",
88
"outDir": "dist10"
99
},
10-
"include": [
11-
"index.ts",
12-
"src",
13-
"test"
14-
],
1510
"references": [
1611
{
1712
"path": "../packages/testlab/tsconfig.build.json"

docs/site/Controllers.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,8 @@ with a test to verify that the error is thrown properly.
241241

242242
```ts
243243
// test/integration/controllers/hello.controller.integration.ts
244-
import {HelloController} from '../../../src/controllers';
245-
import {HelloRepository} from '../../../src/repositories';
244+
import {HelloController} from '../../..//controllers';
245+
import {HelloRepository} from '../../..//repositories';
246246
import {testdb} from '../../fixtures/datasources/testdb.datasource';
247247
import {expect} from '@loopback/testlab';
248248
import {HttpErrors} from '@loopback/rest';

docs/site/Testing-your-application.md

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ helper method; for example:
129129
{% include code-caption.html content="test/helpers/database.helpers.ts" %}
130130

131131
```ts
132-
import {ProductRepository, CategoryRepository} from '../../src/repositories';
132+
import {ProductRepository, CategoryRepository} from '../../repositories';
133133
import {testdb} from '../fixtures/datasources/testdb.datasource';
134134

135135
export async function givenEmptyDatabase() {
@@ -413,8 +413,8 @@ detailed explanation.
413413

414414
```ts
415415
import {expect, sinon} from '@loopback/testlab';
416-
import {ProductRepository} from '../../../src/repositories';
417-
import {ProductController} from '../../../src/controllers';
416+
import {ProductRepository} from '../../..//repositories';
417+
import {ProductController} from '../../..//controllers';
418418

419419
describe('ProductController (unit)', () => {
420420
let repository: ProductRepository;
@@ -456,7 +456,7 @@ valid data to create a new model instance.
456456
{% include code-caption.html content="test/unit/models/person.model.unit.ts" %}
457457

458458
```ts
459-
import {Person} from '../../../src/models';
459+
import {Person} from '../../..//models';
460460
import {givenPersonData} from '../../helpers/database.helpers';
461461
import {expect} from '@loopback/testlab';
462462

@@ -547,7 +547,7 @@ import {
547547
givenEmptyDatabase,
548548
givenCategory,
549549
} from '../../helpers/database.helpers';
550-
import {CategoryRepository} from '../../../src/repositories';
550+
import {CategoryRepository} from '../../..//repositories';
551551
import {expect} from '@loopback/testlab';
552552
import {testdb} from '../../fixtures/datasources/testdb.datasource';
553553

@@ -580,8 +580,8 @@ ingredient.
580580
```ts
581581
import {expect} from '@loopback/testlab';
582582
import {givenEmptyDatabase, givenProduct} from '../../helpers/database.helpers';
583-
import {ProductController} from '../../../src/controllers';
584-
import {ProductRepository} from '../../../src/repositories';
583+
import {ProductController} from '../../..//controllers';
584+
import {ProductRepository} from '../../..//repositories';
585585
import {testdb} from '../../fixtures/datasources/testdb.datasource';
586586

587587
describe('ProductController (integration)', () => {
@@ -628,11 +628,8 @@ of the service proxy by invoking the provider. This helper should be typically
628628
invoked once before the integration test suite begins.
629629

630630
```ts
631-
import {
632-
GeoService,
633-
GeoServiceProvider,
634-
} from '../../src/services/geo.service.ts';
635-
import {GeoDataSource} from '../../src/datasources/geo.datasource.ts';
631+
import {GeoService, GeoServiceProvider} from '../../services/geo.service.ts';
632+
import {GeoDataSource} from '../../datasources/geo.datasource.ts';
636633

637634
describe('GeoService', () => {
638635
let service: GeoService;
@@ -653,7 +650,7 @@ instance:
653650
```ts
654651
import {merge} from 'lodash';
655652

656-
const GEO_CODER_CONFIG = require('../src/datasources/geo.datasource.json');
653+
const GEO_CODER_CONFIG = require('../datasources/geo.datasource.json');
657654

658655
function givenGeoService() {
659656
const config = merge({}, GEO_CODER_CONFIG, {

examples/hello-world/index.d.ts

Lines changed: 0 additions & 6 deletions
This file was deleted.

examples/hello-world/index.ts

Lines changed: 0 additions & 8 deletions
This file was deleted.

examples/hello-world/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
"engines": {
77
"node": ">=8.9"
88
},
9+
"types": "./dist10/index.d.ts",
910
"scripts": {
10-
"acceptance": "lb-mocha \"DIST/test/acceptance/**/*.js\"",
11+
"acceptance": "lb-mocha \"DIST/__tests__/acceptance/**/*.js\"",
1112
"build:all-dist": "npm run build:dist8 && npm run build:dist10",
1213
"build:apidocs": "lb-apidocs",
1314
"build": "lb-tsc",
@@ -24,9 +25,9 @@
2425
"tslint": "lb-tslint",
2526
"tslint:fix": "npm run tslint -- --fix",
2627
"pretest": "npm run clean && npm run build",
27-
"test": "lb-mocha --allow-console-logs \"DIST/test\"",
28+
"test": "lb-mocha --allow-console-logs \"DIST/__tests__\"",
2829
"posttest": "npm run lint",
29-
"test:dev": "lb-mocha --allow-console-logs DIST/test/**/*.js && npm run posttest",
30+
"test:dev": "lb-mocha --allow-console-logs DIST/__tests__/**/*.js && npm run posttest",
3031
"prestart": "npm run build",
3132
"start": "node ."
3233
},

examples/hello-world/test/acceptance/application.acceptance.ts renamed to examples/hello-world/src/__tests__/acceptance/application.acceptance.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
expect,
1010
givenHttpServerConfig,
1111
} from '@loopback/testlab';
12-
import {HelloWorldApplication} from '../../src/application';
12+
import {HelloWorldApplication} from '../../application';
1313

1414
describe('Application', () => {
1515
let app: HelloWorldApplication;

examples/hello-world/tsconfig.build.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,11 @@
22
"$schema": "http://json.schemastore.org/tsconfig",
33
"extends": "./node_modules/@loopback/build/config/tsconfig.common.json",
44
"compilerOptions": {
5-
"rootDir": ".",
5+
"rootDir": "src",
66
"composite": true,
77
"target": "es2018",
88
"outDir": "dist10"
99
},
10-
"include": [
11-
"index.ts",
12-
"src",
13-
"test"
14-
],
1510
"references": [
1611
{
1712
"path": "../../packages/testlab/tsconfig.build.json"

examples/log-extension/index.d.ts

Lines changed: 0 additions & 6 deletions
This file was deleted.

examples/log-extension/index.ts

Lines changed: 0 additions & 6 deletions
This file was deleted.

examples/log-extension/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"engines": {
77
"node": ">=8.9"
88
},
9+
"types": "./dist10/index.d.ts",
910
"scripts": {
1011
"build:all-dist": "npm run build:dist8 && npm run build:dist10",
1112
"build:apidocs": "lb-apidocs",
@@ -22,9 +23,9 @@
2223
"tslint": "lb-tslint",
2324
"tslint:fix": "npm run tslint -- --fix",
2425
"pretest": "npm run clean && npm run build",
25-
"test": "lb-mocha \"DIST/test/unit/**/*.js\" \"DIST/test/acceptance/**/*.js\"",
26+
"test": "lb-mocha \"DIST/__tests__/unit/**/*.js\" \"DIST/__tests__/acceptance/**/*.js\"",
2627
"posttest": "npm run lint",
27-
"test:dev": "lb-mocha --allow-console-logs DIST/test/**/*.js && npm run posttest",
28+
"test:dev": "lb-mocha --allow-console-logs DIST/__tests__/**/*.js && npm run posttest",
2829
"verify": "npm pack && tar xf *example-log-extension*.tgz && tree package && npm run clean"
2930
},
3031
"repository": {

examples/log-extension/tsconfig.build.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,11 @@
22
"$schema": "http://json.schemastore.org/tsconfig",
33
"extends": "./node_modules/@loopback/build/config/tsconfig.common.json",
44
"compilerOptions": {
5-
"rootDir": ".",
5+
"rootDir": "src",
66
"composite": true,
77
"target": "es2018",
88
"outDir": "dist10"
99
},
10-
"include": [
11-
"index.ts",
12-
"src",
13-
"test"
14-
],
1510
"references": [
1611
{
1712
"path": "../../packages/testlab/tsconfig.build.json"

examples/rpc-server/index.d.ts

Lines changed: 0 additions & 6 deletions
This file was deleted.

examples/rpc-server/index.ts

Lines changed: 0 additions & 11 deletions
This file was deleted.

examples/rpc-server/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"engines": {
1010
"node": ">=8.9"
1111
},
12+
"types": "./dist10/index.d.ts",
1213
"scripts": {
1314
"build:all-dist": "npm run build:dist8 && npm run build:dist10",
1415
"build:apidocs": "lb-apidocs",
@@ -25,9 +26,9 @@
2526
"tslint": "lb-tslint",
2627
"tslint:fix": "npm run tslint -- --fix",
2728
"pretest": "npm run clean && npm run build",
28-
"test": "lb-mocha DIST/test",
29+
"test": "lb-mocha DIST/__tests__",
2930
"posttest": "npm run lint",
30-
"test:dev": "lb-mocha --allow-console-logs DIST/test/**/*.js && npm run posttest",
31+
"test:dev": "lb-mocha --allow-console-logs DIST/__tests__/**/*.js && npm run posttest",
3132
"prestart": "npm run build",
3233
"start": "node ."
3334
},

examples/rpc-server/test/unit/controllers/greet.controller.unit.ts renamed to examples/rpc-server/src/__tests__/unit/controllers/greet.controller.unit.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// This file is licensed under the MIT License.
44
// License text available at https://opensource.org/licenses/MIT
55

6-
import {GreetController} from '../../../src/controllers';
6+
import {GreetController} from '../../..//controllers';
77
import {expect} from '@loopback/testlab';
88

99
describe('greet.controller', () => {

examples/rpc-server/test/unit/rpc.router.unit.ts renamed to examples/rpc-server/src/__tests__/unit/rpc.router.unit.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
// License text available at https://opensource.org/licenses/MIT
55

66
import * as express from 'express';
7-
import {RPCServer} from '../../src/rpc.server';
8-
import {routeHandler} from '../../src/rpc.router';
7+
import {RPCServer} from '../../rpc.server';
8+
import {routeHandler} from '../../rpc.router';
99
import {expect, sinon} from '@loopback/testlab';
1010

1111
describe('rpcRouter', () => {

examples/soap-calculator/index.d.ts

Lines changed: 0 additions & 5 deletions
This file was deleted.

examples/soap-calculator/index.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

examples/soap-calculator/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@
1111
],
1212
"main": "index.js",
1313
"engines": {
14-
"node": ">=8"
14+
"node": ">=8.9"
1515
},
16+
"types": "./dist10/index.d.ts",
1617
"scripts": {
1718
"build:all-dist": "npm run build:dist8 && npm run build:dist10",
1819
"build:apidocs": "lb-apidocs",
@@ -29,9 +30,9 @@
2930
"tslint": "lb-tslint",
3031
"tslint:fix": "npm run tslint -- --fix",
3132
"pretest": "npm run clean && npm run build",
32-
"test": "lb-mocha \"DIST/test\"",
33+
"test": "lb-mocha \"DIST/__tests__\"",
3334
"posttest": "npm run lint",
34-
"test:dev": "lb-mocha --allow-console-logs DIST/test/**/*.js && npm run posttest",
35+
"test:dev": "lb-mocha --allow-console-logs DIST/__tests__/**/*.js && npm run posttest",
3536
"prestart": "npm run build",
3637
"start": "node ."
3738
},

examples/soap-calculator/test/acceptance/application.acceptance.ts renamed to examples/soap-calculator/src/__tests__/acceptance/application.acceptance.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {Client, createRestAppClient, expect} from '@loopback/testlab';
2-
import {SoapCalculatorApplication} from '../../src/application';
2+
import {SoapCalculatorApplication} from '../../application';
33

44
describe('Application', function() {
55
let app: SoapCalculatorApplication;

examples/soap-calculator/test/helpers.ts renamed to examples/soap-calculator/src/__tests__/helpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {CalculatorDataSource} from '../src/datasources/calculator.datasource';
1+
import {CalculatorDataSource} from '../datasources/calculator.datasource';
22

33
export async function givenAConnectedDataSource(): Promise<
44
CalculatorDataSource

examples/soap-calculator/test/integration/services/calculator.service.integration.ts renamed to examples/soap-calculator/src/__tests__/integration/services/calculator.service.integration.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import {
22
CalculatorService,
33
CalculatorParameters,
4-
} from '../../../src/services/calculator.service';
5-
import {CalculatorServiceProvider} from '../../../src/services/calculator.service';
4+
} from '../../..//services/calculator.service';
5+
import {CalculatorServiceProvider} from '../../..//services/calculator.service';
66
import {givenAConnectedDataSource} from '../../helpers';
77

88
import {expect} from '@loopback/testlab';

examples/soap-calculator/tsconfig.build.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,11 @@
22
"$schema": "http://json.schemastore.org/tsconfig",
33
"extends": "./node_modules/@loopback/build/config/tsconfig.common.json",
44
"compilerOptions": {
5-
"rootDir": ".",
5+
"rootDir": "src",
66
"composite": true,
77
"target": "es2018",
88
"outDir": "dist10"
99
},
10-
"include": [
11-
"index.ts",
12-
"src",
13-
"test"
14-
],
1510
"references": [
1611
{
1712
"path": "../../packages/testlab/tsconfig.build.json"

examples/todo-list/index.d.ts

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)