mirror of
https://github.com/denoland/deno.git
synced 2025-10-02 07:01:16 +00:00
fix(publish): error for missing version constraints on dry-publish instead of just publish (#23798)
Closes https://github.com/denoland/deno/issues/22835
This commit is contained in:
parent
c0a600786e
commit
c6189e2070
16 changed files with 254 additions and 38 deletions
|
@ -1,4 +1,4 @@
|
|||
import * as inner from "jsr:@denotest/add";
|
||||
import * as inner from "jsr:@denotest/add@1";
|
||||
|
||||
export function add(a: number, b: number): number {
|
||||
return inner.add(a, b);
|
||||
|
|
5
tests/specs/publish/missing_constraint/__test__.jsonc
Normal file
5
tests/specs/publish/missing_constraint/__test__.jsonc
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"args": "publish --dry-run",
|
||||
"output": "publish.out",
|
||||
"exitCode": 1
|
||||
}
|
9
tests/specs/publish/missing_constraint/deno.json
Normal file
9
tests/specs/publish/missing_constraint/deno.json
Normal file
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"name": "@scope/pkg",
|
||||
"version": "1.0.0",
|
||||
"exports": "./mod.ts",
|
||||
"imports": {
|
||||
"basic": "npm:@denotest/esm-basic",
|
||||
"add": "jsr:@denotest/add"
|
||||
}
|
||||
}
|
7
tests/specs/publish/missing_constraint/mod.ts
Normal file
7
tests/specs/publish/missing_constraint/mod.ts
Normal file
|
@ -0,0 +1,7 @@
|
|||
import { add } from "add";
|
||||
import * as basic from "basic";
|
||||
import * as deps from "jsr:@denotest/deps";
|
||||
|
||||
console.log(add(1, 2));
|
||||
console.log(deps);
|
||||
console.log(basic);
|
37
tests/specs/publish/missing_constraint/publish.out
Normal file
37
tests/specs/publish/missing_constraint/publish.out
Normal file
|
@ -0,0 +1,37 @@
|
|||
[WILDCARD]
|
||||
Checking for slow types in the public API...
|
||||
Check file:///[WILDLINE]/mod.ts
|
||||
error[missing-constraint]: specifier 'jsr:@denotest/add' is missing a version constraint
|
||||
--> [WILDLINE]mod.ts:[WILDLINE]
|
||||
|
|
||||
1 | import { add } from "add";
|
||||
| ^^^^^ the specifier
|
||||
= hint: specify a version constraint for the specifier in the import map
|
||||
|
||||
info: the specifier resolved to version 1.0.0 today, but will resolve to a different
|
||||
info: major version if one is published in the future and potentially break
|
||||
docs: https://jsr.io/go/missing-constraint
|
||||
|
||||
error[missing-constraint]: specifier 'npm:@denotest/esm-basic' is missing a version constraint
|
||||
--> [WILDLINE]mod.ts:[WILDLINE]
|
||||
|
|
||||
2 | import * as basic from "basic";
|
||||
| ^^^^^^^ the specifier
|
||||
= hint: specify a version constraint for the specifier in the import map
|
||||
|
||||
info: the specifier resolved to version 1.0.0 today, but will resolve to a different
|
||||
info: major version if one is published in the future and potentially break
|
||||
docs: https://jsr.io/go/missing-constraint
|
||||
|
||||
error[missing-constraint]: specifier 'jsr:@denotest/deps' is missing a version constraint
|
||||
--> [WILDLINE]mod.ts:[WILDLINE]
|
||||
|
|
||||
3 | import * as deps from "jsr:@denotest/deps";
|
||||
| ^^^^^^^^^^^^^^^^^^^^ the specifier
|
||||
= hint: specify a version constraint for the specifier
|
||||
|
||||
info: the specifier resolved to version 1.0.0 today, but will resolve to a different
|
||||
info: major version if one is published in the future and potentially break
|
||||
docs: https://jsr.io/go/missing-constraint
|
||||
|
||||
error: Found 3 problems
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"args": "publish --token 'sadfasdf'",
|
||||
"output": "mod.out",
|
||||
"exitCode": 1
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
import { renderToString } from "npm:preact-render-to-string@6";
|
||||
|
||||
export default function render() {
|
||||
return renderToString(<div>foo.tsx</div>);
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"name": "@foo/bar",
|
||||
"version": "1.0.0",
|
||||
"exports": {
|
||||
".": "./mod.ts"
|
||||
},
|
||||
"compilerOptions": {
|
||||
"jsx": "react-jsx",
|
||||
"jsxImportSource": "npm:preact"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
[WILDCARD]
|
||||
Checking for slow types in the public API...
|
||||
Check file:///[WILDCARD]/mod.ts
|
||||
error[missing-constraint]: specifier 'npm:preact/jsx-runtime' is missing a version constraint
|
||||
--> [WILDLINE]
|
||||
= hint: specify a version constraint for the specifier
|
||||
|
||||
info: the specifier resolved to version 10.19.6 today, but will resolve to a different
|
||||
info: major version if one is published in the future and potentially break
|
||||
docs: https://jsr.io/go/missing-constraint
|
||||
|
||||
warning[unsupported-jsx-tsx]: JSX and TSX files are currently not supported
|
||||
--> [WILDLINE]foo.tsx
|
||||
|
||||
info: follow https://github.com/jsr-io/jsr/issues/24 for updates
|
||||
|
||||
error: Found 1 problem
|
|
@ -0,0 +1,5 @@
|
|||
import fooTsx from "./foo.tsx";
|
||||
|
||||
export function renderTsx() {
|
||||
console.log(fooTsx());
|
||||
}
|
|
@ -2,6 +2,6 @@
|
|||
"name": "@deno/foo",
|
||||
"version": "0.0.1",
|
||||
"dependencies": {
|
||||
"picocolors": "*"
|
||||
"picocolors": "1"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { renderToString } from "npm:preact-render-to-string";
|
||||
import { renderToString } from "npm:preact-render-to-string@6";
|
||||
|
||||
export default function render() {
|
||||
return renderToString(<div>foo.tsx</div>);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { renderToString } from "npm:preact-render-to-string";
|
||||
import { renderToString } from "npm:preact-render-to-string@6";
|
||||
|
||||
export default function render() {
|
||||
return renderToString(<div>foo.tsx</div>);
|
||||
|
|
|
@ -6,6 +6,6 @@
|
|||
},
|
||||
"compilerOptions": {
|
||||
"jsx": "react-jsx",
|
||||
"jsxImportSource": "npm:preact"
|
||||
"jsxImportSource": "npm:preact@10"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue