@vltpkg/spec 1.0.0-rc.2 → 1.0.0-rc.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -140,7 +140,7 @@ const fooFromAcmeReg = Spec.parse(
140
140
  ## Properties
141
141
 
142
142
  - type - the type of spec that this is. One of `'registry'`, `'git'`,
143
- `'file'`, or `'remote'`.
143
+ `'file'`, `'remote'`, `catalog` or `workspace`.
144
144
  - spec - the full named specifier passed to the constructor
145
145
  - options - options passed to the constructor, plus defaults
146
146
  - name - the name portion, so `foo` in `foo@1.x`
package/package.json CHANGED
@@ -1,81 +1,69 @@
1
1
  {
2
2
  "name": "@vltpkg/spec",
3
3
  "description": "Package specifier library",
4
- "version": "1.0.0-rc.2",
4
+ "version": "1.0.0-rc.22",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/vltpkg/vltpkg.git",
8
8
  "directory": "src/spec"
9
9
  },
10
- "author": "vlt technology inc. <support@vlt.sh> (http://vlt.sh)",
11
- "tshy": {
12
- "selfLink": false,
13
- "liveDev": true,
14
- "dialects": [
15
- "esm"
16
- ],
17
- "exports": {
18
- "./package.json": "./package.json",
19
- ".": "./src/index.ts",
20
- "./browser": "./src/browser.ts"
21
- }
10
+ "author": {
11
+ "name": "vlt technology inc.",
12
+ "email": "support@vlt.sh"
22
13
  },
23
14
  "dependencies": {
24
- "@vltpkg/error-cause": "1.0.0-rc.2",
25
- "@vltpkg/semver": "1.0.0-rc.2"
15
+ "@vltpkg/error-cause": "1.0.0-rc.22",
16
+ "@vltpkg/semver": "1.0.0-rc.22"
26
17
  },
27
18
  "devDependencies": {
28
- "@eslint/js": "^9.34.0",
29
- "@types/node": "^22.17.2",
19
+ "@eslint/js": "^9.39.1",
20
+ "@types/node": "^22.19.2",
30
21
  "@types/npm-package-arg": "^6.1.4",
31
- "eslint": "^9.34.0",
32
- "npm-package-arg": "^13.0.0",
33
- "prettier": "^3.6.2",
34
- "tap": "^21.1.0",
35
- "tshy": "^3.0.2",
22
+ "@vltpkg/benchmark": "0.0.0",
23
+ "eslint": "^9.39.1",
24
+ "npm-package-arg": "^13.0.2",
25
+ "prettier": "^3.7.4",
26
+ "tap": "^21.5.0",
36
27
  "typedoc": "~0.27.9",
37
28
  "typescript": "5.7.3",
38
- "typescript-eslint": "^8.40.0",
39
- "@vltpkg/benchmark": "0.0.0"
29
+ "typescript-eslint": "^8.49.0"
40
30
  },
41
31
  "license": "BSD-2-Clause-Patent",
42
32
  "engines": {
43
- "node": ">=22"
33
+ "node": ">=22.22.0"
34
+ },
35
+ "scripts": {
36
+ "benchmark": "./scripts/benchmark.ts",
37
+ "format": "prettier --write . --log-level warn --ignore-path ../../.prettierignore --cache",
38
+ "format:check": "prettier --check . --ignore-path ../../.prettierignore --cache",
39
+ "lint": "eslint . --fix",
40
+ "lint:check": "eslint .",
41
+ "prepack": "tsc -p tsconfig.publish.json && ../../scripts/update-dist-exports.ts",
42
+ "snap": "tap",
43
+ "test": "tap",
44
+ "posttest": "tsc --noEmit",
45
+ "typecheck": "tsc --noEmit"
44
46
  },
45
47
  "tap": {
46
48
  "extends": "../../tap-config.yaml"
47
49
  },
48
50
  "prettier": "../../.prettierrc.js",
49
- "module": "./dist/esm/index.js",
51
+ "module": "./src/index.ts",
50
52
  "type": "module",
51
53
  "exports": {
52
54
  "./package.json": "./package.json",
53
55
  ".": {
54
56
  "import": {
55
- "types": "./dist/esm/index.d.ts",
56
- "default": "./dist/esm/index.js"
57
+ "default": "./src/index.ts"
57
58
  }
58
59
  },
59
60
  "./browser": {
60
61
  "import": {
61
- "types": "./dist/esm/browser.d.ts",
62
- "default": "./dist/esm/browser.js"
62
+ "default": "./src/browser.ts"
63
63
  }
64
64
  }
65
65
  },
66
66
  "files": [
67
67
  "dist"
68
- ],
69
- "scripts": {
70
- "benchmark": "./scripts/benchmark.ts",
71
- "format": "prettier --write . --log-level warn --ignore-path ../../.prettierignore --cache",
72
- "format:check": "prettier --check . --ignore-path ../../.prettierignore --cache",
73
- "lint": "eslint . --fix",
74
- "lint:check": "eslint .",
75
- "snap": "tap",
76
- "test": "tap",
77
- "posttest": "tsc --noEmit",
78
- "tshy": "tshy",
79
- "typecheck": "tsc --noEmit"
80
- }
81
- }
68
+ ]
69
+ }
@@ -1,130 +0,0 @@
1
- import type { Range } from '@vltpkg/semver';
2
- import type { GitSelectorParsed, Scope, SpecLike, SpecOptions, SpecOptionsFilled, SpecType } from './types.ts';
3
- export * from './types.ts';
4
- export declare const kCustomInspect: unique symbol;
5
- export declare const defaultRegistry = "https://registry.npmjs.org/";
6
- export declare const defaultRegistries: {
7
- npm: string;
8
- gh: string;
9
- };
10
- export declare const defaultJsrRegistries: {
11
- jsr: string;
12
- };
13
- export declare const defaultGitHosts: {
14
- github: string;
15
- bitbucket: string;
16
- gitlab: string;
17
- gist: string;
18
- };
19
- export declare const defaultGitHostArchives: {
20
- github: string;
21
- bitbucket: string;
22
- gist: string;
23
- gitlab: string;
24
- };
25
- /**
26
- * These are just for legacy support of urls that are supported by npm
27
- * and observed in the wild.
28
- *
29
- * Not configurable, because no more will be added. If you wish to define
30
- * custom git hosts, use it with the `'git-hosts'` and `'git-host-archives'`
31
- * options.
32
- */
33
- export declare const gitHostWebsites: {
34
- github: string;
35
- bitbucket: string;
36
- gist: string;
37
- gitlab: string;
38
- };
39
- export declare const defaultScopeRegistries: {
40
- '@jsr': string;
41
- };
42
- export declare const getOptions: (options?: SpecOptions) => SpecOptionsFilled;
43
- /**
44
- * Injects the Node.js dependencies into the Spec class.
45
- */
46
- export type NodeJSDependenciesOptions = {
47
- homedir: typeof import('os').homedir;
48
- isAbsolute: typeof import('node:path').isAbsolute;
49
- join: typeof import('node:path').join;
50
- resolve: typeof import('node:path').resolve;
51
- winPath: typeof import('node:path').win32;
52
- };
53
- export declare const isSpec: (spec: unknown) => spec is Spec;
54
- /**
55
- * The base, isomorphic Spec implementation.
56
- */
57
- export declare class Spec implements SpecLike<Spec> {
58
- #private;
59
- /**
60
- * Create a Spec object from a full spec, name+bareSpec, or Spec object
61
- *
62
- * Note: If a Spec object is provided, it is returned as-is, without
63
- * investigating whether the options match.
64
- */
65
- static parse(name: string, bareSpec: string, options?: SpecOptions): Spec;
66
- static parse(spec: string, options?: SpecOptions): Spec;
67
- static parse(spec: Spec, options?: SpecOptions): Spec;
68
- static parseArgs(specOrBareSpec: string, opts?: SpecOptions): Spec;
69
- static nodejsDependencies?: NodeJSDependenciesOptions;
70
- type: SpecType;
71
- spec: string;
72
- options: SpecOptionsFilled;
73
- name: string;
74
- scope?: Scope;
75
- scopeRegistry?: string;
76
- bareSpec: string;
77
- gitRemote?: string;
78
- gitSelector?: string;
79
- gitSelectorParsed?: GitSelectorParsed;
80
- gitCommittish?: string;
81
- namedGitHost?: string;
82
- namedGitHostPath?: string;
83
- workspaceSpec?: string;
84
- workspace?: string;
85
- namedRegistry?: string;
86
- namedJsrRegistry?: string;
87
- registry?: string;
88
- registrySpec?: string;
89
- conventionalRegistryTarball?: string;
90
- semver?: string;
91
- range?: Range;
92
- distTag?: string;
93
- remoteURL?: string;
94
- file?: string;
95
- catalog?: string;
96
- subspec?: Spec;
97
- overridden: boolean;
98
- /**
99
- * Return the final entry in the chain of subspecs
100
- * When deciding which thing to actually fetch, spec.final is the thing
101
- * to look at.
102
- */
103
- get final(): Spec & {
104
- type: Exclude<SpecType, 'catalog'>;
105
- };
106
- /**
107
- * Normally, the string value of a Spec is just the string passed in to
108
- * be parsed. However, in the case of a chain of subspecs, like
109
- * `foo@npm:bar@npm:baz@npm:quux@latest`, this simplifies out the middle
110
- * parts of the chain, returning just `foo@npm:quux@latest`
111
- */
112
- toString(): string;
113
- ['constructor']: typeof Spec;
114
- constructor(name: string, bareSpec: string, options?: SpecOptions);
115
- constructor(spec: string, options?: SpecOptions);
116
- constructor(spec: Spec | string, bareOrOptions?: SpecOptions | string, options?: SpecOptions);
117
- [kCustomInspect](): string;
118
- /**
119
- * Sets a registry value that should be used for this spec in case
120
- * it is currently just following the default registry.
121
- */
122
- set inheritedRegistry(reg: string | undefined);
123
- /**
124
- * Should only ever be called with the bit that comes AFTER the #
125
- * in the git remote url.
126
- */
127
- static parseGitSelector(selector: string, spec?: Spec): [parsed: GitSelectorParsed, committish?: string, range?: Range];
128
- }
129
- export declare const getNormalizeFile: (opts?: NodeJSDependenciesOptions) => (bareSpec: string, spec: Spec) => [path: string, uri: string];
130
- //# sourceMappingURL=browser.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../src/browser.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAE3C,OAAO,KAAK,EACV,iBAAiB,EACjB,KAAK,EACL,QAAQ,EACR,WAAW,EACX,iBAAiB,EACjB,QAAQ,EACT,MAAM,YAAY,CAAA;AACnB,cAAc,YAAY,CAAA;AAE1B,eAAO,MAAM,cAAc,eAA2C,CAAA;AAEtE,eAAO,MAAM,eAAe,gCAAgC,CAAA;AAE5D,eAAO,MAAM,iBAAiB;;;CAG7B,CAAA;AAED,eAAO,MAAM,oBAAoB;;CAAiC,CAAA;AAElE,eAAO,MAAM,eAAe;;;;;CAK3B,CAAA;AAED,eAAO,MAAM,sBAAsB;;;;;CAMlC,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe;;;;;CAK3B,CAAA;AAED,eAAO,MAAM,sBAAsB;;CAElC,CAAA;AAED,eAAO,MAAM,UAAU,aACX,WAAW,KACpB,iBAyBD,CAAA;AA0DF;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG;IACtC,OAAO,EAAE,cAAc,IAAI,EAAE,OAAO,CAAA;IACpC,UAAU,EAAE,cAAc,WAAW,EAAE,UAAU,CAAA;IACjD,IAAI,EAAE,cAAc,WAAW,EAAE,IAAI,CAAA;IACrC,OAAO,EAAE,cAAc,WAAW,EAAE,OAAO,CAAA;IAC3C,OAAO,EAA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