-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
subpath imports for explicit 1:1 and concat prefix + suffix scenarios
- Loading branch information
Adam McKee
committed
Nov 6, 2024
1 parent
ca35659
commit b3bd003
Showing
48 changed files
with
1,073 additions
and
218 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
15 changes: 9 additions & 6 deletions
15
fn_build/fixtures/swc/nodejs/js/http_route/.fixture/parse.json
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 |
---|---|---|
@@ -1,6 +1,9 @@ | ||
[ | ||
{ | ||
"imports": [], | ||
"path": "routes/data/lambda.js" | ||
} | ||
] | ||
{ | ||
"dependencies": "unused", | ||
"sources": [ | ||
{ | ||
"imports": [], | ||
"path": "routes/data/lambda.js" | ||
} | ||
] | ||
} |
31 changes: 17 additions & 14 deletions
31
fn_build/fixtures/swc/nodejs/js/relative_import/.fixture/parse.json
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 |
---|---|---|
@@ -1,14 +1,17 @@ | ||
[ | ||
{ | ||
"imports": [], | ||
"path": "lib/data.js" | ||
}, | ||
{ | ||
"imports": [ | ||
{ | ||
"relativeSource": "lib/data.js" | ||
} | ||
], | ||
"path": "routes/data/lambda.js" | ||
} | ||
] | ||
{ | ||
"dependencies": "unused", | ||
"sources": [ | ||
{ | ||
"imports": [], | ||
"path": "lib/data.js" | ||
}, | ||
{ | ||
"imports": [ | ||
{ | ||
"relativeSource": "lib/data.js" | ||
} | ||
], | ||
"path": "routes/data/lambda.js" | ||
} | ||
] | ||
} |
6 changes: 6 additions & 0 deletions
6
fn_build/fixtures/swc/nodejs/js/subpath_import/explicit_dependency/.fixture/build_debug.json
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,6 @@ | ||
[ | ||
{ | ||
"path": "routes/data/lambda.js", | ||
"result": "identical" | ||
} | ||
] |
8 changes: 8 additions & 0 deletions
8
...ild/fixtures/swc/nodejs/js/subpath_import/explicit_dependency/.fixture/build_release.json
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,8 @@ | ||
[ | ||
{ | ||
"path": "routes/data/lambda.js", | ||
"result": { | ||
"content": "import{getData as o}from\"#lib/data.js\";export const GET=()=>{console.log(\"got\",o())};" | ||
} | ||
} | ||
] |
16 changes: 16 additions & 0 deletions
16
fn_build/fixtures/swc/nodejs/js/subpath_import/explicit_dependency/.fixture/parse.json
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,16 @@ | ||
{ | ||
"dependencies": "required", | ||
"sources": [ | ||
{ | ||
"imports": [ | ||
{ | ||
"packageDependency": { | ||
"package": "data-dep", | ||
"subpath": null | ||
} | ||
} | ||
], | ||
"path": "routes/data/lambda.js" | ||
} | ||
] | ||
} |
3 changes: 3 additions & 0 deletions
3
fn_build/fixtures/swc/nodejs/js/subpath_import/explicit_dependency/.fixture/spec.json
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,3 @@ | ||
{ | ||
"entrypoint": "routes/data/lambda.js" | ||
} |
3 changes: 3 additions & 0 deletions
3
.../fixtures/swc/nodejs/js/subpath_import/explicit_dependency/node_modules/data-dep/index.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
4 changes: 4 additions & 0 deletions
4
...tures/swc/nodejs/js/subpath_import/explicit_dependency/node_modules/data-dep/package.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
6 changes: 6 additions & 0 deletions
6
fn_build/fixtures/swc/nodejs/js/subpath_import/explicit_dependency/package.json
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,6 @@ | ||
{ | ||
"type": "module", | ||
"imports": { | ||
"#lib/data.js": "data-dep" | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
fn_build/fixtures/swc/nodejs/js/subpath_import/explicit_dependency/routes/data/lambda.js
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,5 @@ | ||
import {getData} from '#lib/data.js' | ||
|
||
export const GET = () => { | ||
console.log('got', getData()) | ||
} |
10 changes: 10 additions & 0 deletions
10
fn_build/fixtures/swc/nodejs/js/subpath_import/explicit_source/.fixture/build_debug.json
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,10 @@ | ||
[ | ||
{ | ||
"path": "lib/redis.js", | ||
"result": "identical" | ||
}, | ||
{ | ||
"path": "routes/data/lambda.js", | ||
"result": "identical" | ||
} | ||
] |
14 changes: 14 additions & 0 deletions
14
fn_build/fixtures/swc/nodejs/js/subpath_import/explicit_source/.fixture/build_release.json
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,14 @@ | ||
[ | ||
{ | ||
"path": "lib/redis.js", | ||
"result": { | ||
"content": "let t=[];export function getData(){return t}" | ||
} | ||
}, | ||
{ | ||
"path": "routes/data/lambda.js", | ||
"result": { | ||
"content": "import{getData as o}from\"#lib/data.js\";export const GET=()=>{console.log(\"got\",o())};" | ||
} | ||
} | ||
] |
17 changes: 17 additions & 0 deletions
17
fn_build/fixtures/swc/nodejs/js/subpath_import/explicit_source/.fixture/parse.json
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,17 @@ | ||
{ | ||
"dependencies": "unused", | ||
"sources": [ | ||
{ | ||
"imports": [], | ||
"path": "lib/redis.js" | ||
}, | ||
{ | ||
"imports": [ | ||
{ | ||
"relativeSource": "lib/redis.js" | ||
} | ||
], | ||
"path": "routes/data/lambda.js" | ||
} | ||
] | ||
} |
3 changes: 3 additions & 0 deletions
3
fn_build/fixtures/swc/nodejs/js/subpath_import/explicit_source/.fixture/spec.json
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,3 @@ | ||
{ | ||
"entrypoint": "routes/data/lambda.js" | ||
} |
5 changes: 5 additions & 0 deletions
5
fn_build/fixtures/swc/nodejs/js/subpath_import/explicit_source/lib/redis.js
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,5 @@ | ||
const empty = [] | ||
|
||
export function getData() { | ||
return empty | ||
} |
6 changes: 6 additions & 0 deletions
6
fn_build/fixtures/swc/nodejs/js/subpath_import/explicit_source/package.json
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,6 @@ | ||
{ | ||
"type": "module", | ||
"imports": { | ||
"#lib/data.js": "./lib/redis.js" | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
fn_build/fixtures/swc/nodejs/js/subpath_import/explicit_source/routes/data/lambda.js
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,5 @@ | ||
import {getData} from '#lib/data.js' | ||
|
||
export const GET = () => { | ||
console.log('got', getData()) | ||
} |
14 changes: 14 additions & 0 deletions
14
fn_build/fixtures/swc/nodejs/js/subpath_import/wildcard_concat/.fixture/build_debug.json
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,14 @@ | ||
[ | ||
{ | ||
"path": "data/raw.js", | ||
"result": "identical" | ||
}, | ||
{ | ||
"path": "data/abstraction/orm.js", | ||
"result": "identical" | ||
}, | ||
{ | ||
"path": "routes/data/lambda.js", | ||
"result": "identical" | ||
} | ||
] |
20 changes: 20 additions & 0 deletions
20
fn_build/fixtures/swc/nodejs/js/subpath_import/wildcard_concat/.fixture/build_release.json
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,20 @@ | ||
[ | ||
{ | ||
"path": "data/raw.js", | ||
"result": { | ||
"content": "let t=[];export function getData(){return t}" | ||
} | ||
}, | ||
{ | ||
"path": "data/abstraction/orm.js", | ||
"result": { | ||
"content": "let t=[[[]],[]];export function getComplexData(){return t}" | ||
} | ||
}, | ||
{ | ||
"path": "routes/data/lambda.js", | ||
"result": { | ||
"content": "import{getData as o}from\"#lib/data/raw.js\";import{getComplexData as t}from\"#lib/data/abstraction/orm.js\";export const GET=()=>{console.log(\"got\",o()),console.log(\"getting\",t())};" | ||
} | ||
} | ||
] |
24 changes: 24 additions & 0 deletions
24
fn_build/fixtures/swc/nodejs/js/subpath_import/wildcard_concat/.fixture/parse.json
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 @@ | ||
{ | ||
"dependencies": "unused", | ||
"sources": [ | ||
{ | ||
"imports": [], | ||
"path": "data/raw.js" | ||
}, | ||
{ | ||
"imports": [], | ||
"path": "data/abstraction/orm.js" | ||
}, | ||
{ | ||
"imports": [ | ||
{ | ||
"relativeSource": "data/raw.js" | ||
}, | ||
{ | ||
"relativeSource": "data/abstraction/orm.js" | ||
} | ||
], | ||
"path": "routes/data/lambda.js" | ||
} | ||
] | ||
} |
3 changes: 3 additions & 0 deletions
3
fn_build/fixtures/swc/nodejs/js/subpath_import/wildcard_concat/.fixture/spec.json
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,3 @@ | ||
{ | ||
"entrypoint": "routes/data/lambda.js" | ||
} |
5 changes: 5 additions & 0 deletions
5
fn_build/fixtures/swc/nodejs/js/subpath_import/wildcard_concat/data/abstraction/orm.js
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,5 @@ | ||
const architecturalDiagrams = [[[]], []] | ||
|
||
export function getComplexData() { | ||
return architecturalDiagrams | ||
} |
5 changes: 5 additions & 0 deletions
5
fn_build/fixtures/swc/nodejs/js/subpath_import/wildcard_concat/data/raw.js
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,5 @@ | ||
const empty = [] | ||
|
||
export function getData() { | ||
return empty | ||
} |
7 changes: 7 additions & 0 deletions
7
fn_build/fixtures/swc/nodejs/js/subpath_import/wildcard_concat/package.json
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,7 @@ | ||
{ | ||
"description": "mapping a concatenation wildcard subpath import", | ||
"type": "module", | ||
"imports": { | ||
"#lib/data/*": "./data/*" | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
fn_build/fixtures/swc/nodejs/js/subpath_import/wildcard_concat/routes/data/lambda.js
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,7 @@ | ||
import {getData} from '#lib/data/raw.js' | ||
import {getComplexData} from '#lib/data/abstraction/orm.js' | ||
|
||
export const GET = () => { | ||
console.log('got', getData()) | ||
console.log('getting', getComplexData()) | ||
} |
Oops, something went wrong.