-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(boot): support loading ESM artifacts
BREAKING CHANGE: `loadClassesFromFiles` now returns a `Promise` see: #10744 Signed-off-by: Rifa Achrinza <[email protected]>
- Loading branch information
Showing
7 changed files
with
92 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export class DummyCJSClass {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export class DummyESMClass {} |
24 changes: 24 additions & 0 deletions
24
packages/boot/src/__tests__/fixtures/multiple.artifact.cts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Copyright IBM Corp. and LoopBack contributors 2019. All Rights Reserved. | ||
// Node module: @loopback/boot | ||
// This file is licensed under the MIT License. | ||
// License text available at https://opensource.org/licenses/MIT | ||
|
||
import {get} from '@loopback/rest'; | ||
|
||
export class ArtifactOne { | ||
@get('/one') | ||
one() { | ||
return 'ControllerOne.one()'; | ||
} | ||
} | ||
|
||
export class ArtifactTwo { | ||
@get('/two') | ||
two() { | ||
return 'ControllerTwo.two()'; | ||
} | ||
} | ||
|
||
export function hello() { | ||
return 'hello world'; | ||
} |
24 changes: 24 additions & 0 deletions
24
packages/boot/src/__tests__/fixtures/multiple.artifact.mts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Copyright IBM Corp. and LoopBack contributors 2019. All Rights Reserved. | ||
// Node module: @loopback/boot | ||
// This file is licensed under the MIT License. | ||
// License text available at https://opensource.org/licenses/MIT | ||
|
||
import {get} from '@loopback/rest'; | ||
|
||
export class ArtifactOne { | ||
@get('/one') | ||
one() { | ||
return 'ControllerOne.one()'; | ||
} | ||
} | ||
|
||
export class ArtifactTwo { | ||
@get('/two') | ||
two() { | ||
return 'ControllerTwo.two()'; | ||
} | ||
} | ||
|
||
export function hello() { | ||
return 'hello world'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters