-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Set --unstable-byonm during publishing by default (#54)
- Loading branch information
1 parent
d4e5408
commit b85eea6
Showing
2 changed files
with
39 additions
and
0 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
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 |
---|---|---|
|
@@ -499,6 +499,44 @@ describe("publish", () => { | |
}); | ||
}).timeout(600000); | ||
|
||
it("should leave node_modules as is", async () => { | ||
await runInTempDir(async (dir) => { | ||
const pkgJsonPath = path.join(dir, "package.json"); | ||
const pkgJson = await readJson<PkgJson>(pkgJsonPath); | ||
pkgJson.exports = { | ||
".": "./mod.js", | ||
}; | ||
await writeJson(pkgJsonPath, pkgJson); | ||
|
||
// Add dependency | ||
await runJsr(["i", "--npm", "@std/[email protected]"], dir); | ||
|
||
await writeTextFile( | ||
path.join(dir, "mod.ts"), | ||
[ | ||
'import * as encoding from "@std/encoding/hex";', | ||
"console.log(encoding);", | ||
"export const value = 42;", | ||
].join("\n"), | ||
); | ||
|
||
await writeJson<DenoJson>(path.join(dir, "jsr.json"), { | ||
name: "@deno/jsr-cli-test", | ||
version: pkgJson.version!, | ||
exports: { | ||
".": "./mod.ts", | ||
}, | ||
}); | ||
|
||
await runJsr(["publish", "--dry-run", "--token", "dummy-token"], dir); | ||
|
||
assert.ok( | ||
!(await isDirectory(path.join(dir, "node_modules", ".deno"))), | ||
".deno found inside node_modules", | ||
); | ||
}); | ||
}); | ||
|
||
// Windows doesn't support #!/usr/bin/env | ||
if (process.platform !== "win32") { | ||
it("use deno binary from DENO_BIN_PATH when set", async () => { | ||
|