diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2024-03-21 14:42:23 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-21 21:42:23 +0000 |
commit | f96f167dc8cc733b43d67801f568b2d546bc2fb9 (patch) | |
tree | 5647b96beaa94da10bf73a29a55bdf7ed2018a62 /tests | |
parent | ffbcad3800ef086bad791c1c640b62fd72d60172 (diff) |
feat(unstable/publish): error when a package's module is excluded from publishing (#22948)
Closes #22657
Diffstat (limited to 'tests')
7 files changed, 39 insertions, 0 deletions
diff --git a/tests/specs/jsr/excluded_export_module/__test__.jsonc b/tests/specs/jsr/excluded_export_module/__test__.jsonc new file mode 100644 index 000000000..2ff51f507 --- /dev/null +++ b/tests/specs/jsr/excluded_export_module/__test__.jsonc @@ -0,0 +1,7 @@ +// test for a module that's excluded from being +// published, but is found in the module graph +{ + "args": "publish --dry-run", + "output": "publish.out", + "exitCode": 1 +} diff --git a/tests/specs/jsr/excluded_export_module/deno.json b/tests/specs/jsr/excluded_export_module/deno.json new file mode 100644 index 000000000..1254582ac --- /dev/null +++ b/tests/specs/jsr/excluded_export_module/deno.json @@ -0,0 +1,12 @@ +{ + "name": "@denotest/excluded-export-module", + "version": "0.1.0", + "exports": "./main.ts", + "publish": { + "exclude": [ + "./excluded_file1.ts", + "./excluded_file2.ts", + "./not_imported_excluded_file.ts" + ] + } +} diff --git a/tests/specs/jsr/excluded_export_module/excluded_file1.ts b/tests/specs/jsr/excluded_export_module/excluded_file1.ts new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/tests/specs/jsr/excluded_export_module/excluded_file1.ts diff --git a/tests/specs/jsr/excluded_export_module/excluded_file2.ts b/tests/specs/jsr/excluded_export_module/excluded_file2.ts new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/tests/specs/jsr/excluded_export_module/excluded_file2.ts diff --git a/tests/specs/jsr/excluded_export_module/main.ts b/tests/specs/jsr/excluded_export_module/main.ts new file mode 100644 index 000000000..69bff30bf --- /dev/null +++ b/tests/specs/jsr/excluded_export_module/main.ts @@ -0,0 +1,2 @@ +import "./excluded_file1.ts"; +import "./excluded_file2.ts"; diff --git a/tests/specs/jsr/excluded_export_module/not_imported_excluded_file.ts b/tests/specs/jsr/excluded_export_module/not_imported_excluded_file.ts new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/tests/specs/jsr/excluded_export_module/not_imported_excluded_file.ts diff --git a/tests/specs/jsr/excluded_export_module/publish.out b/tests/specs/jsr/excluded_export_module/publish.out new file mode 100644 index 000000000..bcf94e521 --- /dev/null +++ b/tests/specs/jsr/excluded_export_module/publish.out @@ -0,0 +1,18 @@ +Check file:///[WILDLINE]/main.ts +Checking for slow types in the public API... +Check file:///[WILDLINE]/main.ts +error[excluded-module]: module in package's module graph was excluded from publishing + --> [WILDLINE]excluded_file1.ts + = hint: remove the module from 'exclude' and/or 'publish.exclude' in the config file + + info: excluded modules referenced via a package export will error at runtime due to not existing in the package + docs: https://jsr.io/go/excluded-module + +error[excluded-module]: module in package's module graph was excluded from publishing + --> [WILDLINE]excluded_file2.ts + = hint: remove the module from 'exclude' and/or 'publish.exclude' in the config file + + info: excluded modules referenced via a package export will error at runtime due to not existing in the package + docs: https://jsr.io/go/excluded-module + +error: Found 2 problems |