Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Set --unstable-byonm during publishing by default #54

Merged
merged 1 commit into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ export async function publish(cwd: string, options: PublishOptions) {
"publish",
"--unstable-bare-node-builtins",
"--unstable-sloppy-imports",
"--unstable-byonm",
"--no-check",
...options.publishArgs,
];
Expand Down
38 changes: 38 additions & 0 deletions test/commands.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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/encoding@0.216.0"], 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 () => {
Expand Down
Loading