-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(compile/windows): handle cjs re-export of relative path with pare…
- Loading branch information
Showing
7 changed files
with
94 additions
and
1 deletion.
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
7 changes: 7 additions & 0 deletions
7
tests/registry/npm/@denotest/cjs-reexport-relative-parent/1.0.0/dir/index.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 @@ | ||
"use strict"; | ||
class Hello { | ||
sayHello() { | ||
console.log("Hi."); | ||
} | ||
} | ||
exports.hello = new Hello(); |
5 changes: 5 additions & 0 deletions
5
tests/registry/npm/@denotest/cjs-reexport-relative-parent/1.0.0/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,5 @@ | ||
{ | ||
"name": "@denotest/cjs-reexport-relative-parent", | ||
"version": "1.0.0", | ||
"main": "./sub_dir/index.js" | ||
} |
19 changes: 19 additions & 0 deletions
19
tests/registry/npm/@denotest/cjs-reexport-relative-parent/1.0.0/sub_dir/index.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,19 @@ | ||
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
// collision will occur with __esModule in other_file.js | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const other_file_1 = __importDefault(require("../dir")); | ||
__exportStar(require("../dir"), exports); | ||
exports.default = other_file_1.default; |
22 changes: 22 additions & 0 deletions
22
tests/specs/compile/npm_cjs_reexport_relative_parent_component/__test__.jsonc
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,22 @@ | ||
{ | ||
"tempDir": true, | ||
"steps": [{ | ||
"if": "unix", | ||
"args": "compile --output main main.ts", | ||
"output": "[WILDCARD]" | ||
}, { | ||
"if": "unix", | ||
"commandName": "./main", | ||
"args": [], | ||
"output": "main.out" | ||
}, { | ||
"if": "windows", | ||
"args": "compile --output main.exe main.ts", | ||
"output": "[WILDCARD]" | ||
}, { | ||
"if": "windows", | ||
"commandName": "./main.exe", | ||
"args": [], | ||
"output": "main.out" | ||
}] | ||
} |
1 change: 1 addition & 0 deletions
1
tests/specs/compile/npm_cjs_reexport_relative_parent_component/main.out
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 @@ | ||
Hi. |
2 changes: 2 additions & 0 deletions
2
tests/specs/compile/npm_cjs_reexport_relative_parent_component/main.ts
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,2 @@ | ||
import { hello } from "npm:@denotest/cjs-reexport-relative-parent"; | ||
hello.sayHello(); |