@verdaccio/test-helper 4.1.6 → 4.1.8
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/CHANGELOG.md +27 -0
- package/build/_virtual/_rolldown/runtime.js +1 -1
- package/build/actions.js.map +1 -1
- package/build/addNewVersion.js.map +1 -1
- package/build/generateLocalPackageMetadata.js.map +1 -1
- package/build/generatePackageMetadata.js.map +1 -1
- package/build/generateRemotePackageMetadata.js.map +1 -1
- package/build/getDeprecatedPackageMetadata.js.map +1 -1
- package/build/initializeServer.js.map +1 -1
- package/package.json +11 -11
- package/src/actions.ts +0 -27
- package/src/addNewVersion.ts +0 -60
- package/src/generateLocalPackageMetadata.ts +0 -67
- package/src/generatePackageMetadata.ts +0 -73
- package/src/generatePublishNewVersionManifest.ts +0 -76
- package/src/generateRemotePackageMetadata.ts +0 -86
- package/src/generateUnPublishPackageMetadata.ts +0 -89
- package/src/getDeprecatedPackageMetadata.ts +0 -19
- package/src/index.ts +0 -9
- package/src/initializeServer.ts +0 -62
- package/src/types.ts +0 -3
- package/src/utils.ts +0 -8
- package/types/patch.d.ts +0 -18
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 4.1.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 2bda24a: Update runtime dependencies to their latest minor and patch releases, with no change in behaviour for 6.x.
|
|
8
|
+
|
|
9
|
+
`@verdaccio/config` now uses `js-yaml` 5.5.0, `@verdaccio/tarball` uses `tar-stream` 3.2.2, `@verdaccio/url` uses `validator` 13.15.35 and `@verdaccio/logger-prettify` uses `dayjs` 1.11.23. `@verdaccio/test-helper` moves to `body-parser` 1.20.9, `fs-extra` 11.4.1 and `supertest` 7.3.1. No major versions were bumped. Operators do not need to do anything; the update arrives with the next `verdaccio` 6.x release.
|
|
10
|
+
- Updated dependencies [2bda24a]
|
|
11
|
+
- Updated dependencies [7ab1032]
|
|
12
|
+
- @verdaccio/config@8.4.0
|
|
13
|
+
- @verdaccio/types@13.1.0
|
|
14
|
+
- @verdaccio/middleware@8.2.0
|
|
15
|
+
- @verdaccio/auth@8.1.7
|
|
16
|
+
- @verdaccio/core@8.4.0
|
|
17
|
+
- @verdaccio/logger@8.1.7
|
|
18
|
+
|
|
19
|
+
## 4.1.7
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- Updated dependencies [59595e9]
|
|
24
|
+
- @verdaccio/core@8.3.3
|
|
25
|
+
- @verdaccio/auth@8.1.6
|
|
26
|
+
- @verdaccio/config@8.3.3
|
|
27
|
+
- @verdaccio/middleware@8.1.7
|
|
28
|
+
- @verdaccio/logger@8.1.6
|
|
29
|
+
|
|
3
30
|
## 4.1.6
|
|
4
31
|
|
|
5
32
|
### Patch Changes
|
|
@@ -15,7 +15,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
15
|
}
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
18
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
|
|
19
19
|
value: mod,
|
|
20
20
|
enumerable: true
|
|
21
21
|
}) : target, mod));
|
package/build/actions.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.js","names":[],"sources":["../src/actions.ts"],"sourcesContent":["import buildDebug from 'debug';\nimport supertest from 'supertest';\n\nimport { HEADERS, HEADER_TYPE } from '@verdaccio/core';\nimport type { Manifest } from '@verdaccio/types';\n\nimport { generatePackageMetadata } from './generatePackageMetadata';\n\nconst debug = buildDebug('verdaccio:tools:helpers:actions');\n\nexport function publishVersion(app: any, pkgName, version, metadata: Partial<Manifest> = {}): any {\n debug('publishVersion %s : %s : %s', pkgName, version, JSON.stringify(metadata, null, 2));\n const pkgMetadata = { ...generatePackageMetadata(pkgName, version), ...metadata };\n // sync metadata readme to version of package\n pkgMetadata.versions[version].readme = metadata.readme ? (metadata.readme as string) : '';\n debug('metadata %s', JSON.stringify(pkgMetadata, null, 2));\n return (\n supertest(app)\n .put(`/${encodeURIComponent(pkgName)}`)\n // @ts-ignore ignore content-type mismatch\n .set(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON)\n .send(JSON.stringify(pkgMetadata))\n .set('accept', HEADERS.GZIP)\n .set(HEADER_TYPE.ACCEPT_ENCODING, HEADERS.JSON)\n .set(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON)\n );\n}\n"],"mappings":";;;;;;;;AAQA,
|
|
1
|
+
{"version":3,"file":"actions.js","names":["debug","buildDebug","generatePackageMetadata","HEADER_TYPE","HEADERS"],"sources":["../src/actions.ts"],"sourcesContent":["import buildDebug from 'debug';\nimport supertest from 'supertest';\n\nimport { HEADERS, HEADER_TYPE } from '@verdaccio/core';\nimport type { Manifest } from '@verdaccio/types';\n\nimport { generatePackageMetadata } from './generatePackageMetadata';\n\nconst debug = buildDebug('verdaccio:tools:helpers:actions');\n\nexport function publishVersion(app: any, pkgName, version, metadata: Partial<Manifest> = {}): any {\n debug('publishVersion %s : %s : %s', pkgName, version, JSON.stringify(metadata, null, 2));\n const pkgMetadata = { ...generatePackageMetadata(pkgName, version), ...metadata };\n // sync metadata readme to version of package\n pkgMetadata.versions[version].readme = metadata.readme ? (metadata.readme as string) : '';\n debug('metadata %s', JSON.stringify(pkgMetadata, null, 2));\n return (\n supertest(app)\n .put(`/${encodeURIComponent(pkgName)}`)\n // @ts-ignore ignore content-type mismatch\n .set(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON)\n .send(JSON.stringify(pkgMetadata))\n .set('accept', HEADERS.GZIP)\n .set(HEADER_TYPE.ACCEPT_ENCODING, HEADERS.JSON)\n .set(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON)\n );\n}\n"],"mappings":";;;;;;;;AAQA,IAAMA,WAAAA,GAAQC,MAAAA,QAAAA,CAAW,iCAAiC;AAE1D,SAAgB,eAAe,KAAU,SAAS,SAAS,WAA8B,CAAC,GAAQ;CAChG,QAAM,+BAA+B,SAAS,SAAS,KAAK,UAAU,UAAU,MAAM,CAAC,CAAC;CACxF,MAAM,cAAc;EAAE,GAAGC,gCAAAA,wBAAwB,SAAS,OAAO;EAAG,GAAG;CAAS;CAEhF,YAAY,SAAS,QAAQ,CAAC,SAAS,SAAS,SAAU,SAAS,SAAoB;CACvF,QAAM,eAAe,KAAK,UAAU,aAAa,MAAM,CAAC,CAAC;CACzD,QAAA,GACE,UAAA,QAAA,CAAU,GAAG,CAAC,CACX,IAAI,IAAI,mBAAmB,OAAO,GAAG,CAAC,CAEtC,IAAIC,gBAAAA,YAAY,cAAcC,gBAAAA,QAAQ,IAAI,CAAC,CAC3C,KAAK,KAAK,UAAU,WAAW,CAAC,CAAC,CACjC,IAAI,UAAUA,gBAAAA,QAAQ,IAAI,CAAC,CAC3B,IAAID,gBAAAA,YAAY,iBAAiBC,gBAAAA,QAAQ,IAAI,CAAC,CAC9C,IAAID,gBAAAA,YAAY,cAAcC,gBAAAA,QAAQ,IAAI;AAEjD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addNewVersion.js","names":[],"sources":["../src/addNewVersion.ts"],"sourcesContent":["import type { Manifest } from '@verdaccio/types';\n\nimport { getTarball } from './utils';\n\nexport function addNewVersion(\n manifest: Manifest,\n version: string,\n isRemote: boolean = true,\n domain: string = 'http://localhost:5555'\n): Manifest {\n const currentVersions = Object.keys(manifest.versions);\n if (currentVersions.includes(version)) {\n throw new Error(`Version ${version} already exists`);\n }\n\n const newManifest = { ...manifest };\n newManifest.versions[version] = {\n name: manifest.name,\n version,\n description: manifest.description ?? '',\n readme: '',\n main: 'index.js',\n scripts: { test: 'echo \"Error: no test specified\" && exit 1' },\n keywords: [],\n author: { name: 'User NPM', email: 'user@domain.com' },\n license: 'ISC',\n dependencies: { verdaccio: '^2.7.2' },\n readmeFilename: 'README.md',\n _id: `${manifest.name}@${version}`,\n _npmVersion: '5.5.1',\n _npmUser: { name: 'foo' },\n dist: {\n integrity: 'sha512-6gHiERpiDgtb3hjqpQHoPoH4g==',\n shasum: '2c03764f651a9f016ca0b7620421457b619151b9',\n tarball: `${domain}/${manifest.name}/-/${getTarball(manifest.name)}-${version}.tgz`,\n },\n contributors: [],\n };\n // update the latest with the new version\n newManifest['dist-tags'] = { latest: version };\n // add new version does not need attachments\n if (isRemote) {\n newManifest._distfiles = {\n ...newManifest._distfiles,\n [`${getTarball(manifest.name)}-${version}.tgz`]: {\n sha: '2c03764f651a9f016ca0b7620421457b619151b9',\n url: `${domain}/${manifest.name}/-/${getTarball(manifest.name)}-${version}.tgz`,\n },\n };\n } else {\n newManifest._attachments = {\n ...newManifest._attachments,\n [`${getTarball(manifest.name)}-${version}.tgz`]: {\n shasum: '2c03764f651a9f016ca0b7620421457b619151b9', // pragma: allowlist secret\n version: version,\n },\n };\n }\n return newManifest;\n}\n"],"mappings":";;AAIA,SAAgB,cACd,UACA,SACA,WAAoB,MACpB,SAAiB,yBACP;CAEV,IADwB,OAAO,KAAK,SAAS,QACzC,CAAA,CAAgB,SAAS,OAAO,GAClC,MAAM,IAAI,MAAM,WAAW,QAAQ,gBAAgB;CAGrD,MAAM,cAAc,EAAE,GAAG,SAAS;CAClC,YAAY,SAAS,WAAW;EAC9B,MAAM,SAAS;EACf;EACA,aAAa,SAAS,eAAe;EACrC,QAAQ;EACR,MAAM;EACN,SAAS,EAAE,MAAM,8CAA4C;EAC7D,UAAU,CAAC;EACX,QAAQ;GAAE,MAAM;GAAY,OAAO;EAAkB;EACrD,SAAS;EACT,cAAc,EAAE,WAAW,SAAS;EACpC,gBAAgB;EAChB,KAAK,GAAG,SAAS,KAAK,GAAG;EACzB,aAAa;EACb,UAAU,EAAE,MAAM,MAAM;EACxB,MAAM;GACJ,WAAW;GACX,QAAQ;GACR,SAAS,GAAG,OAAO,GAAG,SAAS,KAAK,
|
|
1
|
+
{"version":3,"file":"addNewVersion.js","names":["getTarball"],"sources":["../src/addNewVersion.ts"],"sourcesContent":["import type { Manifest } from '@verdaccio/types';\n\nimport { getTarball } from './utils';\n\nexport function addNewVersion(\n manifest: Manifest,\n version: string,\n isRemote: boolean = true,\n domain: string = 'http://localhost:5555'\n): Manifest {\n const currentVersions = Object.keys(manifest.versions);\n if (currentVersions.includes(version)) {\n throw new Error(`Version ${version} already exists`);\n }\n\n const newManifest = { ...manifest };\n newManifest.versions[version] = {\n name: manifest.name,\n version,\n description: manifest.description ?? '',\n readme: '',\n main: 'index.js',\n scripts: { test: 'echo \"Error: no test specified\" && exit 1' },\n keywords: [],\n author: { name: 'User NPM', email: 'user@domain.com' },\n license: 'ISC',\n dependencies: { verdaccio: '^2.7.2' },\n readmeFilename: 'README.md',\n _id: `${manifest.name}@${version}`,\n _npmVersion: '5.5.1',\n _npmUser: { name: 'foo' },\n dist: {\n integrity: 'sha512-6gHiERpiDgtb3hjqpQHoPoH4g==',\n shasum: '2c03764f651a9f016ca0b7620421457b619151b9',\n tarball: `${domain}/${manifest.name}/-/${getTarball(manifest.name)}-${version}.tgz`,\n },\n contributors: [],\n };\n // update the latest with the new version\n newManifest['dist-tags'] = { latest: version };\n // add new version does not need attachments\n if (isRemote) {\n newManifest._distfiles = {\n ...newManifest._distfiles,\n [`${getTarball(manifest.name)}-${version}.tgz`]: {\n sha: '2c03764f651a9f016ca0b7620421457b619151b9',\n url: `${domain}/${manifest.name}/-/${getTarball(manifest.name)}-${version}.tgz`,\n },\n };\n } else {\n newManifest._attachments = {\n ...newManifest._attachments,\n [`${getTarball(manifest.name)}-${version}.tgz`]: {\n shasum: '2c03764f651a9f016ca0b7620421457b619151b9', // pragma: allowlist secret\n version: version,\n },\n };\n }\n return newManifest;\n}\n"],"mappings":";;AAIA,SAAgB,cACd,UACA,SACA,WAAoB,MACpB,SAAiB,yBACP;CAEV,IADwB,OAAO,KAAK,SAAS,QACzC,CAAA,CAAgB,SAAS,OAAO,GAClC,MAAM,IAAI,MAAM,WAAW,QAAQ,gBAAgB;CAGrD,MAAM,cAAc,EAAE,GAAG,SAAS;CAClC,YAAY,SAAS,WAAW;EAC9B,MAAM,SAAS;EACf;EACA,aAAa,SAAS,eAAe;EACrC,QAAQ;EACR,MAAM;EACN,SAAS,EAAE,MAAM,8CAA4C;EAC7D,UAAU,CAAC;EACX,QAAQ;GAAE,MAAM;GAAY,OAAO;EAAkB;EACrD,SAAS;EACT,cAAc,EAAE,WAAW,SAAS;EACpC,gBAAgB;EAChB,KAAK,GAAG,SAAS,KAAK,GAAG;EACzB,aAAa;EACb,UAAU,EAAE,MAAM,MAAM;EACxB,MAAM;GACJ,WAAW;GACX,QAAQ;GACR,SAAS,GAAG,OAAO,GAAG,SAAS,KAAK,KAAKA,cAAAA,WAAW,SAAS,IAAI,EAAE,GAAG,QAAQ;EAChF;EACA,cAAc,CAAC;CACjB;CAEA,YAAY,eAAe,EAAE,QAAQ,QAAQ;CAE7C,IAAI,UACF,YAAY,aAAa;EACvB,GAAG,YAAY;GACd,GAAGA,cAAAA,WAAW,SAAS,IAAI,EAAE,GAAG,QAAQ,QAAQ;GAC/C,KAAK;GACL,KAAK,GAAG,OAAO,GAAG,SAAS,KAAK,KAAKA,cAAAA,WAAW,SAAS,IAAI,EAAE,GAAG,QAAQ;EAC5E;CACF;MAEA,YAAY,eAAe;EACzB,GAAG,YAAY;GACd,GAAGA,cAAAA,WAAW,SAAS,IAAI,EAAE,GAAG,QAAQ,QAAQ;GAC/C,QAAQ;GACC;EACX;CACF;CAEF,OAAO;AACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateLocalPackageMetadata.js","names":[],"sources":["../src/generateLocalPackageMetadata.ts"],"sourcesContent":["import type { GenericBody, Manifest } from '@verdaccio/types';\n\nimport { getTarball } from './utils';\n\nexport function generateLocalPackageMetadata(\n pkgName: string,\n version = '1.0.0',\n domain: string = 'http://localhost:5555',\n time?: GenericBody\n): Manifest {\n // @ts-ignore\n return {\n _id: pkgName,\n name: pkgName,\n description: '',\n 'dist-tags': { ['latest']: version },\n versions: {\n [version]: {\n name: pkgName,\n version: version,\n description: 'package generated',\n main: 'index.js',\n scripts: {\n test: 'echo \"Error: no test specified\" && exit 1',\n },\n keywords: [],\n author: {\n name: 'User NPM',\n email: 'user@domain.com',\n },\n license: 'ISC',\n dependencies: {\n verdaccio: '^2.7.2',\n },\n readme: '# test',\n readmeFilename: 'README.md',\n _id: `${pkgName}@${version}`,\n _npmVersion: '5.5.1',\n _npmUser: {\n name: 'foo',\n },\n dist: {\n integrity:\n 'sha512-6gHiERpiDgtb3hjqpQH5/i7zRmvYi9pmCjQf2ZMy3QEa9wVk9RgdZaPWUt7ZOnWUPFjcr9cm' +\n 'E6dUBf+XoPoH4g==',\n shasum: '2c03764f651a9f016ca0b7620421457b619151b9', // pragma: allowlist secret\n tarball: `${domain}/${pkgName}\\/-\\/${getTarball(pkgName)}-${version}.tgz`,\n },\n },\n },\n time: time ?? {\n modified: new Date().toISOString(),\n created: new Date().toISOString(),\n [version]: new Date().toISOString(),\n },\n readme: '# test',\n _attachments: {\n [`${getTarball(pkgName)}-${version}.tgz`]: {\n shasum: '2c03764f651a9f016ca0b7620421457b619151b9', // pragma: allowlist secret\n version: version,\n },\n },\n _uplinks: {},\n _distfiles: {},\n _rev: '',\n };\n}\n"],"mappings":";;AAIA,SAAgB,6BACd,SACA,UAAU,SACV,SAAiB,yBACjB,MACU;CAEV,OAAO;EACL,KAAK;EACL,MAAM;EACN,aAAa;EACb,aAAa,GAAG,WAAW,QAAQ;EACnC,UAAU,GACP,UAAU;GACT,MAAM;GACG;GACT,aAAa;GACb,MAAM;GACN,SAAS,EACP,MAAM,8CACR;GACA,UAAU,CAAC;GACX,QAAQ;IACN,MAAM;IACN,OAAO;GACT;GACA,SAAS;GACT,cAAc,EACZ,WAAW,SACb;GACA,QAAQ;GACR,gBAAgB;GAChB,KAAK,GAAG,QAAQ,GAAG;GACnB,aAAa;GACb,UAAU,EACR,MAAM,MACR;GACA,MAAM;IACJ,WACE;IAEF,QAAQ;IACR,SAAS,GAAG,OAAO,GAAG,QAAQ,
|
|
1
|
+
{"version":3,"file":"generateLocalPackageMetadata.js","names":["getTarball"],"sources":["../src/generateLocalPackageMetadata.ts"],"sourcesContent":["import type { GenericBody, Manifest } from '@verdaccio/types';\n\nimport { getTarball } from './utils';\n\nexport function generateLocalPackageMetadata(\n pkgName: string,\n version = '1.0.0',\n domain: string = 'http://localhost:5555',\n time?: GenericBody\n): Manifest {\n // @ts-ignore\n return {\n _id: pkgName,\n name: pkgName,\n description: '',\n 'dist-tags': { ['latest']: version },\n versions: {\n [version]: {\n name: pkgName,\n version: version,\n description: 'package generated',\n main: 'index.js',\n scripts: {\n test: 'echo \"Error: no test specified\" && exit 1',\n },\n keywords: [],\n author: {\n name: 'User NPM',\n email: 'user@domain.com',\n },\n license: 'ISC',\n dependencies: {\n verdaccio: '^2.7.2',\n },\n readme: '# test',\n readmeFilename: 'README.md',\n _id: `${pkgName}@${version}`,\n _npmVersion: '5.5.1',\n _npmUser: {\n name: 'foo',\n },\n dist: {\n integrity:\n 'sha512-6gHiERpiDgtb3hjqpQH5/i7zRmvYi9pmCjQf2ZMy3QEa9wVk9RgdZaPWUt7ZOnWUPFjcr9cm' +\n 'E6dUBf+XoPoH4g==',\n shasum: '2c03764f651a9f016ca0b7620421457b619151b9', // pragma: allowlist secret\n tarball: `${domain}/${pkgName}\\/-\\/${getTarball(pkgName)}-${version}.tgz`,\n },\n },\n },\n time: time ?? {\n modified: new Date().toISOString(),\n created: new Date().toISOString(),\n [version]: new Date().toISOString(),\n },\n readme: '# test',\n _attachments: {\n [`${getTarball(pkgName)}-${version}.tgz`]: {\n shasum: '2c03764f651a9f016ca0b7620421457b619151b9', // pragma: allowlist secret\n version: version,\n },\n },\n _uplinks: {},\n _distfiles: {},\n _rev: '',\n };\n}\n"],"mappings":";;AAIA,SAAgB,6BACd,SACA,UAAU,SACV,SAAiB,yBACjB,MACU;CAEV,OAAO;EACL,KAAK;EACL,MAAM;EACN,aAAa;EACb,aAAa,GAAG,WAAW,QAAQ;EACnC,UAAU,GACP,UAAU;GACT,MAAM;GACG;GACT,aAAa;GACb,MAAM;GACN,SAAS,EACP,MAAM,8CACR;GACA,UAAU,CAAC;GACX,QAAQ;IACN,MAAM;IACN,OAAO;GACT;GACA,SAAS;GACT,cAAc,EACZ,WAAW,SACb;GACA,QAAQ;GACR,gBAAgB;GAChB,KAAK,GAAG,QAAQ,GAAG;GACnB,aAAa;GACb,UAAU,EACR,MAAM,MACR;GACA,MAAM;IACJ,WACE;IAEF,QAAQ;IACR,SAAS,GAAG,OAAO,GAAG,QAAQ,OAAOA,cAAAA,WAAW,OAAO,EAAE,GAAG,QAAQ;GACtE;EACF,EACF;EACA,MAAM,QAAQ;GACZ,2BAAU,IAAI,KAAK,EAAA,CAAE,YAAY;GACjC,0BAAS,IAAI,KAAK,EAAA,CAAE,YAAY;IAC/B,2BAAU,IAAI,KAAK,EAAA,CAAE,YAAY;EACpC;EACA,QAAQ;EACR,cAAc,GACX,GAAGA,cAAAA,WAAW,OAAO,EAAE,GAAG,QAAQ,QAAQ;GACzC,QAAQ;GACC;EACX,EACF;EACA,UAAU,CAAC;EACX,YAAY,CAAC;EACb,MAAM;CACR;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generatePackageMetadata.js","names":[],"sources":["../src/generatePackageMetadata.ts"],"sourcesContent":["import type { Manifest } from '@verdaccio/types';\n\nimport type { DistTags } from './types';\nimport { getTarball } from './utils';\n\nexport function generatePackageMetadata(\n pkgName: string,\n version = '1.0.0',\n distTags: DistTags = { ['latest']: version }\n): Manifest {\n // @ts-ignore\n return {\n _id: pkgName,\n name: pkgName,\n 'dist-tags': {\n ...distTags,\n },\n versions: {\n [version]: {\n name: pkgName,\n version: version,\n description: 'package generated',\n main: 'index.js',\n scripts: {\n test: 'echo \"Error: no test specified\" && exit 1',\n },\n keywords: [],\n author: {\n name: 'User NPM',\n email: 'user@domain.com',\n },\n license: 'ISC',\n dependencies: {\n verdaccio: '^2.7.2',\n },\n readme: '# test',\n readmeFilename: 'README.md',\n _id: `${pkgName}@${version}`,\n _npmVersion: '5.5.1',\n _npmUser: {\n name: 'foo',\n },\n dist: {\n integrity:\n 'sha512-6gHiERpiDgtb3hjqpQH5/i7zRmvYi9pmCjQf2ZMy3QEa9wVk9RgdZaPWUt7ZOnWUPFjcr9cm' +\n 'E6dUBf+XoPoH4g==',\n shasum: '2c03764f651a9f016ca0b7620421457b619151b9', // pragma: allowlist secret\n tarball: `http:\\/\\/localhost:5555\\/${pkgName}\\/-\\/${getTarball(pkgName)}-${version}.tgz`,\n },\n },\n },\n readme: '# test',\n _attachments: {\n [`${getTarball(pkgName)}-${version}.tgz`]: {\n content_type: 'application/octet-stream',\n data:\n 'H4sIAAAAAAAAE+2W32vbMBDH85y/QnjQp9qxLEeBMsbGlocNBmN7bFdQ5WuqxJaEpGQdo//79KPeQsnI' +\n 'w5KUDX/9IOvurLuz/DHSjK/YAiY6jcXSKjk6sMqypHWNdtmD6hlBI0wqQmo8nVbVqMR4OsNoVB66kF1a' +\n 'W8eML+Vv10m9oF/jP6IfY4QyyTrILlD2eqkcm+gVzpdrJrPz4NuAsULJ4MZFWdBkbcByI7R79CRjx0Sc' +\n 'CdnAvf+SkjUFWu8IubzBgXUhDPidQlfZ3BhlLpBUKDiQ1cDFrYDmKkNnZwjuhUM4808+xNVW8P2bMk1Y' +\n '7vJrtLC1u1MmLPjBF40+Cc4ahV6GDmI/DWygVRpMwVX3KtXUCg7Sxp7ff3nbt6TBFy65gK1iffsN41yo' +\n 'EHtdFbOiisWMH8bPvXUH0SP3k+KG3UBr+DFy7OGfEJr4x5iWVeS/pLQe+D+FIv/agIWI6GX66kFuIhT+' +\n '1gDjrp/4d7WAvAwEJPh0u14IufWkM0zaW2W6nLfM2lybgJ4LTJ0/jWiAK8OcMjt8MW3OlfQppcuhhQ6k' +\n '+2OgkK2Q8DssFPi/IHpU9fz3/+xj5NjDf8QFE39VmE4JDfzPCBn4P4X6/f88f/Pu47zomiPk2Lv/dOv8' +\n 'h+P/34/D/p9CL+Kp67mrGDRo0KBBp9ZPsETQegASAAA=+2W32vbMBDH85y',\n length: 512,\n },\n },\n _uplinks: {},\n _distfiles: {},\n _rev: '',\n };\n}\n"],"mappings":";;AAKA,SAAgB,wBACd,SACA,UAAU,SACV,WAAqB,GAAG,WAAW,QAAQ,GACjC;CAEV,OAAO;EACL,KAAK;EACL,MAAM;EACN,aAAa,EACX,GAAG,SACL;EACA,UAAU,GACP,UAAU;GACT,MAAM;GACG;GACT,aAAa;GACb,MAAM;GACN,SAAS,EACP,MAAM,8CACR;GACA,UAAU,CAAC;GACX,QAAQ;IACN,MAAM;IACN,OAAO;GACT;GACA,SAAS;GACT,cAAc,EACZ,WAAW,SACb;GACA,QAAQ;GACR,gBAAgB;GAChB,KAAK,GAAG,QAAQ,GAAG;GACnB,aAAa;GACb,UAAU,EACR,MAAM,MACR;GACA,MAAM;IACJ,WACE;IAEF,QAAQ;IACR,SAAS,4BAA4B,QAAQ,
|
|
1
|
+
{"version":3,"file":"generatePackageMetadata.js","names":["getTarball"],"sources":["../src/generatePackageMetadata.ts"],"sourcesContent":["import type { Manifest } from '@verdaccio/types';\n\nimport type { DistTags } from './types';\nimport { getTarball } from './utils';\n\nexport function generatePackageMetadata(\n pkgName: string,\n version = '1.0.0',\n distTags: DistTags = { ['latest']: version }\n): Manifest {\n // @ts-ignore\n return {\n _id: pkgName,\n name: pkgName,\n 'dist-tags': {\n ...distTags,\n },\n versions: {\n [version]: {\n name: pkgName,\n version: version,\n description: 'package generated',\n main: 'index.js',\n scripts: {\n test: 'echo \"Error: no test specified\" && exit 1',\n },\n keywords: [],\n author: {\n name: 'User NPM',\n email: 'user@domain.com',\n },\n license: 'ISC',\n dependencies: {\n verdaccio: '^2.7.2',\n },\n readme: '# test',\n readmeFilename: 'README.md',\n _id: `${pkgName}@${version}`,\n _npmVersion: '5.5.1',\n _npmUser: {\n name: 'foo',\n },\n dist: {\n integrity:\n 'sha512-6gHiERpiDgtb3hjqpQH5/i7zRmvYi9pmCjQf2ZMy3QEa9wVk9RgdZaPWUt7ZOnWUPFjcr9cm' +\n 'E6dUBf+XoPoH4g==',\n shasum: '2c03764f651a9f016ca0b7620421457b619151b9', // pragma: allowlist secret\n tarball: `http:\\/\\/localhost:5555\\/${pkgName}\\/-\\/${getTarball(pkgName)}-${version}.tgz`,\n },\n },\n },\n readme: '# test',\n _attachments: {\n [`${getTarball(pkgName)}-${version}.tgz`]: {\n content_type: 'application/octet-stream',\n data:\n 'H4sIAAAAAAAAE+2W32vbMBDH85y/QnjQp9qxLEeBMsbGlocNBmN7bFdQ5WuqxJaEpGQdo//79KPeQsnI' +\n 'w5KUDX/9IOvurLuz/DHSjK/YAiY6jcXSKjk6sMqypHWNdtmD6hlBI0wqQmo8nVbVqMR4OsNoVB66kF1a' +\n 'W8eML+Vv10m9oF/jP6IfY4QyyTrILlD2eqkcm+gVzpdrJrPz4NuAsULJ4MZFWdBkbcByI7R79CRjx0Sc' +\n 'CdnAvf+SkjUFWu8IubzBgXUhDPidQlfZ3BhlLpBUKDiQ1cDFrYDmKkNnZwjuhUM4808+xNVW8P2bMk1Y' +\n '7vJrtLC1u1MmLPjBF40+Cc4ahV6GDmI/DWygVRpMwVX3KtXUCg7Sxp7ff3nbt6TBFy65gK1iffsN41yo' +\n 'EHtdFbOiisWMH8bPvXUH0SP3k+KG3UBr+DFy7OGfEJr4x5iWVeS/pLQe+D+FIv/agIWI6GX66kFuIhT+' +\n '1gDjrp/4d7WAvAwEJPh0u14IufWkM0zaW2W6nLfM2lybgJ4LTJ0/jWiAK8OcMjt8MW3OlfQppcuhhQ6k' +\n '+2OgkK2Q8DssFPi/IHpU9fz3/+xj5NjDf8QFE39VmE4JDfzPCBn4P4X6/f88f/Pu47zomiPk2Lv/dOv8' +\n 'h+P/34/D/p9CL+Kp67mrGDRo0KBBp9ZPsETQegASAAA=+2W32vbMBDH85y',\n length: 512,\n },\n },\n _uplinks: {},\n _distfiles: {},\n _rev: '',\n };\n}\n"],"mappings":";;AAKA,SAAgB,wBACd,SACA,UAAU,SACV,WAAqB,GAAG,WAAW,QAAQ,GACjC;CAEV,OAAO;EACL,KAAK;EACL,MAAM;EACN,aAAa,EACX,GAAG,SACL;EACA,UAAU,GACP,UAAU;GACT,MAAM;GACG;GACT,aAAa;GACb,MAAM;GACN,SAAS,EACP,MAAM,8CACR;GACA,UAAU,CAAC;GACX,QAAQ;IACN,MAAM;IACN,OAAO;GACT;GACA,SAAS;GACT,cAAc,EACZ,WAAW,SACb;GACA,QAAQ;GACR,gBAAgB;GAChB,KAAK,GAAG,QAAQ,GAAG;GACnB,aAAa;GACb,UAAU,EACR,MAAM,MACR;GACA,MAAM;IACJ,WACE;IAEF,QAAQ;IACR,SAAS,4BAA4B,QAAQ,OAAOA,cAAAA,WAAW,OAAO,EAAE,GAAG,QAAQ;GACrF;EACF,EACF;EACA,QAAQ;EACR,cAAc,GACX,GAAGA,cAAAA,WAAW,OAAO,EAAE,GAAG,QAAQ,QAAQ;GACzC,cAAc;GACd,MACE;GASF,QAAQ;EACV,EACF;EACA,UAAU,CAAC;EACX,YAAY,CAAC;EACb,MAAM;CACR;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateRemotePackageMetadata.js","names":[],"sources":["../src/generateRemotePackageMetadata.ts"],"sourcesContent":["import type { FullRemoteManifest, GenericBody, Version, Versions } from '@verdaccio/types';\n\nimport { getTarball } from './utils';\n\nexport function generateRemotePackageMetadata(\n pkgName: string,\n version = '1.0.0',\n domain: string = 'http://localhost:5555',\n versions: string[] = []\n): FullRemoteManifest {\n // @ts-ignore\n const generateVersion = (version: string): Version => {\n const metadata = {\n name: pkgName,\n version: version,\n description: 'package generated',\n main: 'index.js',\n scripts: {\n test: 'echo \"Error: no test specified\" && exit 1',\n },\n keywords: [],\n author: {\n name: 'User NPM',\n email: 'user@domain.com',\n },\n license: 'ISC',\n dependencies: {\n verdaccio: '^2.7.2',\n },\n readme: '# test',\n readmeFilename: 'README.md',\n _id: `${pkgName}@${version}`,\n _npmVersion: '5.5.1',\n _npmUser: {\n name: 'foo',\n },\n dist: {\n integrity:\n 'sha512-6gHiERpiDgtb3hjqpQH5/i7zRmvYi9pmCjQf2ZMy3QEa9wVk9RgdZaPWUt7ZOnWUPFjcr9cm' +\n 'E6dUBf+XoPoH4g==',\n shasum: '2c03764f651a9f016ca0b7620421457b619151b9', // pragma: allowlist secret\n tarball: `${domain}\\/${pkgName}\\/-\\/${getTarball(pkgName)}-${version}.tgz`,\n },\n };\n\n return metadata;\n };\n const mappedVersions: Versions = versions.reduce((acc, v) => {\n acc[v] = generateVersion(v);\n return acc;\n }, {});\n\n const mappedTimes: GenericBody = versions.reduce((acc, v) => {\n const date = new Date(Date.now());\n acc[v] = date.toISOString();\n return acc;\n }, {});\n\n return {\n _id: pkgName,\n name: pkgName,\n description: '',\n 'dist-tags': { ['latest']: version },\n versions: {\n [version]: generateVersion(version),\n ...mappedVersions,\n },\n time: {\n modified: '2019-06-13T06:44:45.747Z',\n created: '2019-06-13T06:44:45.747Z',\n [version]: '2019-06-13T06:44:45.747Z',\n ...mappedTimes,\n },\n maintainers: [\n {\n name: 'foo',\n email: 'foo@foo.com',\n },\n ],\n author: {\n name: 'foo',\n },\n readme: '# test',\n _rev: '12-c8fe8a9c79fa57a87347a0213e6f2548',\n };\n}\n"],"mappings":";;AAIA,SAAgB,8BACd,SACA,UAAU,SACV,SAAiB,yBACjB,WAAqB,CAAC,GACF;CAEpB,MAAM,mBAAmB,YAA6B;EAkCpD,OAAO;GAhCL,MAAM;GACG;GACT,aAAa;GACb,MAAM;GACN,SAAS,EACP,MAAM,8CACR;GACA,UAAU,CAAC;GACX,QAAQ;IACN,MAAM;IACN,OAAO;GACT;GACA,SAAS;GACT,cAAc,EACZ,WAAW,SACb;GACA,QAAQ;GACR,gBAAgB;GAChB,KAAK,GAAG,QAAQ,GAAG;GACnB,aAAa;GACb,UAAU,EACR,MAAM,MACR;GACA,MAAM;IACJ,WACE;IAEF,QAAQ;IACR,SAAS,GAAG,OAAO,IAAI,QAAQ,
|
|
1
|
+
{"version":3,"file":"generateRemotePackageMetadata.js","names":["getTarball"],"sources":["../src/generateRemotePackageMetadata.ts"],"sourcesContent":["import type { FullRemoteManifest, GenericBody, Version, Versions } from '@verdaccio/types';\n\nimport { getTarball } from './utils';\n\nexport function generateRemotePackageMetadata(\n pkgName: string,\n version = '1.0.0',\n domain: string = 'http://localhost:5555',\n versions: string[] = []\n): FullRemoteManifest {\n // @ts-ignore\n const generateVersion = (version: string): Version => {\n const metadata = {\n name: pkgName,\n version: version,\n description: 'package generated',\n main: 'index.js',\n scripts: {\n test: 'echo \"Error: no test specified\" && exit 1',\n },\n keywords: [],\n author: {\n name: 'User NPM',\n email: 'user@domain.com',\n },\n license: 'ISC',\n dependencies: {\n verdaccio: '^2.7.2',\n },\n readme: '# test',\n readmeFilename: 'README.md',\n _id: `${pkgName}@${version}`,\n _npmVersion: '5.5.1',\n _npmUser: {\n name: 'foo',\n },\n dist: {\n integrity:\n 'sha512-6gHiERpiDgtb3hjqpQH5/i7zRmvYi9pmCjQf2ZMy3QEa9wVk9RgdZaPWUt7ZOnWUPFjcr9cm' +\n 'E6dUBf+XoPoH4g==',\n shasum: '2c03764f651a9f016ca0b7620421457b619151b9', // pragma: allowlist secret\n tarball: `${domain}\\/${pkgName}\\/-\\/${getTarball(pkgName)}-${version}.tgz`,\n },\n };\n\n return metadata;\n };\n const mappedVersions: Versions = versions.reduce((acc, v) => {\n acc[v] = generateVersion(v);\n return acc;\n }, {});\n\n const mappedTimes: GenericBody = versions.reduce((acc, v) => {\n const date = new Date(Date.now());\n acc[v] = date.toISOString();\n return acc;\n }, {});\n\n return {\n _id: pkgName,\n name: pkgName,\n description: '',\n 'dist-tags': { ['latest']: version },\n versions: {\n [version]: generateVersion(version),\n ...mappedVersions,\n },\n time: {\n modified: '2019-06-13T06:44:45.747Z',\n created: '2019-06-13T06:44:45.747Z',\n [version]: '2019-06-13T06:44:45.747Z',\n ...mappedTimes,\n },\n maintainers: [\n {\n name: 'foo',\n email: 'foo@foo.com',\n },\n ],\n author: {\n name: 'foo',\n },\n readme: '# test',\n _rev: '12-c8fe8a9c79fa57a87347a0213e6f2548',\n };\n}\n"],"mappings":";;AAIA,SAAgB,8BACd,SACA,UAAU,SACV,SAAiB,yBACjB,WAAqB,CAAC,GACF;CAEpB,MAAM,mBAAmB,YAA6B;EAkCpD,OAAO;GAhCL,MAAM;GACG;GACT,aAAa;GACb,MAAM;GACN,SAAS,EACP,MAAM,8CACR;GACA,UAAU,CAAC;GACX,QAAQ;IACN,MAAM;IACN,OAAO;GACT;GACA,SAAS;GACT,cAAc,EACZ,WAAW,SACb;GACA,QAAQ;GACR,gBAAgB;GAChB,KAAK,GAAG,QAAQ,GAAG;GACnB,aAAa;GACb,UAAU,EACR,MAAM,MACR;GACA,MAAM;IACJ,WACE;IAEF,QAAQ;IACR,SAAS,GAAG,OAAO,IAAI,QAAQ,OAAOA,cAAAA,WAAW,OAAO,EAAE,GAAG,QAAQ;GACvE;EAGK;CACT;CACA,MAAM,iBAA2B,SAAS,QAAQ,KAAK,MAAM;EAC3D,IAAI,KAAK,gBAAgB,CAAC;EAC1B,OAAO;CACT,GAAG,CAAC,CAAC;CAEL,MAAM,cAA2B,SAAS,QAAQ,KAAK,MAAM;EAE3D,IAAI,KAAK,IADQ,KAAK,KAAK,IAAI,CACtB,CAAA,CAAK,YAAY;EAC1B,OAAO;CACT,GAAG,CAAC,CAAC;CAEL,OAAO;EACL,KAAK;EACL,MAAM;EACN,aAAa;EACb,aAAa,GAAG,WAAW,QAAQ;EACnC,UAAU;IACP,UAAU,gBAAgB,OAAO;GAClC,GAAG;EACL;EACA,MAAM;GACJ,UAAU;GACV,SAAS;IACR,UAAU;GACX,GAAG;EACL;EACA,aAAa,CACX;GACE,MAAM;GACN,OAAO;EACT,CACF;EACA,QAAQ,EACN,MAAM,MACR;EACA,QAAQ;EACR,MAAM;CACR;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDeprecatedPackageMetadata.js","names":[],"sources":["../src/getDeprecatedPackageMetadata.ts"],"sourcesContent":["import type { Manifest } from '@verdaccio/types';\n\nimport { generatePackageMetadata } from './generatePackageMetadata';\nimport type { DistTags } from './types';\n\nexport function getDeprecatedPackageMetadata(\n pkgName: string,\n version = '1.0.0',\n distTags: DistTags = { ['latest']: version },\n deprecated = 'default deprecated message',\n rev = 'rev-foo'\n): Manifest {\n const manifest = generatePackageMetadata(pkgName, version, distTags);\n // deprecated message requires empty attachments\n manifest._attachments = {};\n manifest._rev = rev;\n manifest.versions[version].deprecated = deprecated;\n return manifest;\n}\n"],"mappings":";;AAKA,SAAgB,6BACd,SACA,UAAU,SACV,WAAqB,GAAG,WAAW,QAAQ,GAC3C,aAAa,8BACb,MAAM,WACI;CACV,MAAM,
|
|
1
|
+
{"version":3,"file":"getDeprecatedPackageMetadata.js","names":["generatePackageMetadata"],"sources":["../src/getDeprecatedPackageMetadata.ts"],"sourcesContent":["import type { Manifest } from '@verdaccio/types';\n\nimport { generatePackageMetadata } from './generatePackageMetadata';\nimport type { DistTags } from './types';\n\nexport function getDeprecatedPackageMetadata(\n pkgName: string,\n version = '1.0.0',\n distTags: DistTags = { ['latest']: version },\n deprecated = 'default deprecated message',\n rev = 'rev-foo'\n): Manifest {\n const manifest = generatePackageMetadata(pkgName, version, distTags);\n // deprecated message requires empty attachments\n manifest._attachments = {};\n manifest._rev = rev;\n manifest.versions[version].deprecated = deprecated;\n return manifest;\n}\n"],"mappings":";;AAKA,SAAgB,6BACd,SACA,UAAU,SACV,WAAqB,GAAG,WAAW,QAAQ,GAC3C,aAAa,8BACb,MAAM,WACI;CACV,MAAM,WAAWA,gCAAAA,wBAAwB,SAAS,SAAS,QAAQ;CAEnE,SAAS,eAAe,CAAC;CACzB,SAAS,OAAO;CAChB,SAAS,SAAS,QAAQ,CAAC,aAAa;CACxC,OAAO;AACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initializeServer.js","names":[],"sources":["../src/initializeServer.ts"],"sourcesContent":["import buildDebug from 'debug';\nimport type { Application } from 'express';\nimport express from 'express';\nimport os from 'node:os';\nimport path from 'node:path';\n\nimport { Auth } from '@verdaccio/auth';\nimport { Config } from '@verdaccio/config';\nimport { cryptoUtils, errorUtils } from '@verdaccio/core';\nimport { setup } from '@verdaccio/logger';\nimport { errorReportingMiddleware, final, handleError } from '@verdaccio/middleware';\n\nconst debug = buildDebug('verdaccio:tools:helpers:server');\n\nexport async function initializeServer(\n configObject,\n routesMiddleware: any[] = [],\n Storage\n): Promise<Application> {\n const app = express();\n const logger = setup(configObject.log ?? {});\n const config = new Config(configObject);\n config.storage = path.join(os.tmpdir(), '/storage', cryptoUtils.generateRandomHexString());\n // httpass would get path.basename() for configPath thus we need to create a dummy folder\n // to avoid conflics\n config.configPath = config.storage;\n debug('storage: %s', config.storage);\n\n const storage = new Storage(config, logger);\n await storage.init(config, []);\n const auth: Auth = new Auth(config, logger);\n await auth.init();\n // TODO: this might not be need it, used in apiEndpoints\n app.use(express.json({ strict: false, limit: '10mb' }));\n // @ts-ignore\n app.use(errorReportingMiddleware(logger));\n for (const route of routesMiddleware) {\n if (route.async) {\n const middleware = await route.routes(config, auth, storage, logger);\n app.use(middleware);\n } else {\n app.use(route(config, auth, storage, logger));\n }\n }\n\n // catch 404\n app.get('/*', function (req, res, next) {\n next(errorUtils.getNotFound('resource not found'));\n });\n\n // @ts-ignore\n app.use(handleError(logger));\n // @ts-ignore\n app.use(final);\n\n app.use(function (request, response) {\n response.status(590);\n response.json({ error: 'cannot handle this' });\n });\n\n return app;\n}\n"],"mappings":";;;;;;;;;;;;;;;AAYA,
|
|
1
|
+
{"version":3,"file":"initializeServer.js","names":["debug","buildDebug","setup","Config","path","os","cryptoUtils","Auth","errorReportingMiddleware","errorUtils","handleError","final"],"sources":["../src/initializeServer.ts"],"sourcesContent":["import buildDebug from 'debug';\nimport type { Application } from 'express';\nimport express from 'express';\nimport os from 'node:os';\nimport path from 'node:path';\n\nimport { Auth } from '@verdaccio/auth';\nimport { Config } from '@verdaccio/config';\nimport { cryptoUtils, errorUtils } from '@verdaccio/core';\nimport { setup } from '@verdaccio/logger';\nimport { errorReportingMiddleware, final, handleError } from '@verdaccio/middleware';\n\nconst debug = buildDebug('verdaccio:tools:helpers:server');\n\nexport async function initializeServer(\n configObject,\n routesMiddleware: any[] = [],\n Storage\n): Promise<Application> {\n const app = express();\n const logger = setup(configObject.log ?? {});\n const config = new Config(configObject);\n config.storage = path.join(os.tmpdir(), '/storage', cryptoUtils.generateRandomHexString());\n // httpass would get path.basename() for configPath thus we need to create a dummy folder\n // to avoid conflics\n config.configPath = config.storage;\n debug('storage: %s', config.storage);\n\n const storage = new Storage(config, logger);\n await storage.init(config, []);\n const auth: Auth = new Auth(config, logger);\n await auth.init();\n // TODO: this might not be need it, used in apiEndpoints\n app.use(express.json({ strict: false, limit: '10mb' }));\n // @ts-ignore\n app.use(errorReportingMiddleware(logger));\n for (const route of routesMiddleware) {\n if (route.async) {\n const middleware = await route.routes(config, auth, storage, logger);\n app.use(middleware);\n } else {\n app.use(route(config, auth, storage, logger));\n }\n }\n\n // catch 404\n app.get('/*', function (req, res, next) {\n next(errorUtils.getNotFound('resource not found'));\n });\n\n // @ts-ignore\n app.use(handleError(logger));\n // @ts-ignore\n app.use(final);\n\n app.use(function (request, response) {\n response.status(590);\n response.json({ error: 'cannot handle this' });\n });\n\n return app;\n}\n"],"mappings":";;;;;;;;;;;;;;;AAYA,IAAMA,WAAAA,GAAQC,MAAAA,QAAAA,CAAW,gCAAgC;AAEzD,eAAsB,iBACpB,cACA,mBAA0B,CAAC,GAC3B,SACsB;CACtB,MAAM,OAAA,GAAM,QAAA,QAAA,CAAQ;CACpB,MAAM,UAAA,GAASC,kBAAAA,MAAAA,CAAM,aAAa,OAAO,CAAC,CAAC;CAC3C,MAAM,SAAS,IAAIC,kBAAAA,OAAO,YAAY;CACtC,OAAO,UAAUC,UAAAA,QAAK,KAAKC,QAAAA,QAAG,OAAO,GAAG,YAAYC,gBAAAA,YAAY,wBAAwB,CAAC;CAGzF,OAAO,aAAa,OAAO;CAC3B,QAAM,eAAe,OAAO,OAAO;CAEnC,MAAM,UAAU,IAAI,QAAQ,QAAQ,MAAM;CAC1C,MAAM,QAAQ,KAAK,QAAQ,CAAC,CAAC;CAC7B,MAAM,OAAa,IAAIC,gBAAAA,KAAK,QAAQ,MAAM;CAC1C,MAAM,KAAK,KAAK;CAEhB,IAAI,IAAI,QAAA,QAAQ,KAAK;EAAE,QAAQ;EAAO,OAAO;CAAO,CAAC,CAAC;CAEtD,IAAI,KAAA,GAAIC,sBAAAA,yBAAAA,CAAyB,MAAM,CAAC;CACxC,KAAK,MAAM,SAAS,kBAClB,IAAI,MAAM,OAAO;EACf,MAAM,aAAa,MAAM,MAAM,OAAO,QAAQ,MAAM,SAAS,MAAM;EACnE,IAAI,IAAI,UAAU;CACpB,OACE,IAAI,IAAI,MAAM,QAAQ,MAAM,SAAS,MAAM,CAAC;CAKhD,IAAI,IAAI,MAAM,SAAU,KAAK,KAAK,MAAM;EACtC,KAAKC,gBAAAA,WAAW,YAAY,oBAAoB,CAAC;CACnD,CAAC;CAGD,IAAI,KAAA,GAAIC,sBAAAA,YAAAA,CAAY,MAAM,CAAC;CAE3B,IAAI,IAAIC,sBAAAA,KAAK;CAEb,IAAI,IAAI,SAAU,SAAS,UAAU;EACnC,SAAS,OAAO,GAAG;EACnB,SAAS,KAAK,EAAE,OAAO,qBAAqB,CAAC;CAC/C,CAAC;CAED,OAAO;AACT"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@verdaccio/test-helper",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.8",
|
|
4
4
|
"description": "Verdaccio Test Helpers",
|
|
5
5
|
"homepage": "https://verdaccio.org",
|
|
6
6
|
"bugs": {
|
|
@@ -34,20 +34,20 @@
|
|
|
34
34
|
"./build/*": "./build/*"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@verdaccio/auth": "8.1.
|
|
38
|
-
"@verdaccio/config": "8.
|
|
39
|
-
"@verdaccio/core": "8.
|
|
40
|
-
"@verdaccio/logger": "8.1.
|
|
41
|
-
"@verdaccio/middleware": "8.
|
|
42
|
-
"@verdaccio/types": "13.0
|
|
43
|
-
"body-parser": "1.20.
|
|
37
|
+
"@verdaccio/auth": "8.1.7",
|
|
38
|
+
"@verdaccio/config": "8.4.0",
|
|
39
|
+
"@verdaccio/core": "8.4.0",
|
|
40
|
+
"@verdaccio/logger": "8.1.7",
|
|
41
|
+
"@verdaccio/middleware": "8.2.0",
|
|
42
|
+
"@verdaccio/types": "13.1.0",
|
|
43
|
+
"body-parser": "1.20.9",
|
|
44
44
|
"debug": "4.4.3",
|
|
45
45
|
"express": "4.22.3",
|
|
46
|
-
"fs-extra": "11.
|
|
47
|
-
"supertest": "7.1
|
|
46
|
+
"fs-extra": "11.4.1",
|
|
47
|
+
"supertest": "7.3.1"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"vite": "8.
|
|
50
|
+
"vite": "8.3.4"
|
|
51
51
|
},
|
|
52
52
|
"scripts": {
|
|
53
53
|
"test": "vitest run",
|
package/src/actions.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import buildDebug from 'debug';
|
|
2
|
-
import supertest from 'supertest';
|
|
3
|
-
|
|
4
|
-
import { HEADERS, HEADER_TYPE } from '@verdaccio/core';
|
|
5
|
-
import type { Manifest } from '@verdaccio/types';
|
|
6
|
-
|
|
7
|
-
import { generatePackageMetadata } from './generatePackageMetadata';
|
|
8
|
-
|
|
9
|
-
const debug = buildDebug('verdaccio:tools:helpers:actions');
|
|
10
|
-
|
|
11
|
-
export function publishVersion(app: any, pkgName, version, metadata: Partial<Manifest> = {}): any {
|
|
12
|
-
debug('publishVersion %s : %s : %s', pkgName, version, JSON.stringify(metadata, null, 2));
|
|
13
|
-
const pkgMetadata = { ...generatePackageMetadata(pkgName, version), ...metadata };
|
|
14
|
-
// sync metadata readme to version of package
|
|
15
|
-
pkgMetadata.versions[version].readme = metadata.readme ? (metadata.readme as string) : '';
|
|
16
|
-
debug('metadata %s', JSON.stringify(pkgMetadata, null, 2));
|
|
17
|
-
return (
|
|
18
|
-
supertest(app)
|
|
19
|
-
.put(`/${encodeURIComponent(pkgName)}`)
|
|
20
|
-
// @ts-ignore ignore content-type mismatch
|
|
21
|
-
.set(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON)
|
|
22
|
-
.send(JSON.stringify(pkgMetadata))
|
|
23
|
-
.set('accept', HEADERS.GZIP)
|
|
24
|
-
.set(HEADER_TYPE.ACCEPT_ENCODING, HEADERS.JSON)
|
|
25
|
-
.set(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON)
|
|
26
|
-
);
|
|
27
|
-
}
|
package/src/addNewVersion.ts
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import type { Manifest } from '@verdaccio/types';
|
|
2
|
-
|
|
3
|
-
import { getTarball } from './utils';
|
|
4
|
-
|
|
5
|
-
export function addNewVersion(
|
|
6
|
-
manifest: Manifest,
|
|
7
|
-
version: string,
|
|
8
|
-
isRemote: boolean = true,
|
|
9
|
-
domain: string = 'http://localhost:5555'
|
|
10
|
-
): Manifest {
|
|
11
|
-
const currentVersions = Object.keys(manifest.versions);
|
|
12
|
-
if (currentVersions.includes(version)) {
|
|
13
|
-
throw new Error(`Version ${version} already exists`);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const newManifest = { ...manifest };
|
|
17
|
-
newManifest.versions[version] = {
|
|
18
|
-
name: manifest.name,
|
|
19
|
-
version,
|
|
20
|
-
description: manifest.description ?? '',
|
|
21
|
-
readme: '',
|
|
22
|
-
main: 'index.js',
|
|
23
|
-
scripts: { test: 'echo "Error: no test specified" && exit 1' },
|
|
24
|
-
keywords: [],
|
|
25
|
-
author: { name: 'User NPM', email: 'user@domain.com' },
|
|
26
|
-
license: 'ISC',
|
|
27
|
-
dependencies: { verdaccio: '^2.7.2' },
|
|
28
|
-
readmeFilename: 'README.md',
|
|
29
|
-
_id: `${manifest.name}@${version}`,
|
|
30
|
-
_npmVersion: '5.5.1',
|
|
31
|
-
_npmUser: { name: 'foo' },
|
|
32
|
-
dist: {
|
|
33
|
-
integrity: 'sha512-6gHiERpiDgtb3hjqpQHoPoH4g==',
|
|
34
|
-
shasum: '2c03764f651a9f016ca0b7620421457b619151b9',
|
|
35
|
-
tarball: `${domain}/${manifest.name}/-/${getTarball(manifest.name)}-${version}.tgz`,
|
|
36
|
-
},
|
|
37
|
-
contributors: [],
|
|
38
|
-
};
|
|
39
|
-
// update the latest with the new version
|
|
40
|
-
newManifest['dist-tags'] = { latest: version };
|
|
41
|
-
// add new version does not need attachments
|
|
42
|
-
if (isRemote) {
|
|
43
|
-
newManifest._distfiles = {
|
|
44
|
-
...newManifest._distfiles,
|
|
45
|
-
[`${getTarball(manifest.name)}-${version}.tgz`]: {
|
|
46
|
-
sha: '2c03764f651a9f016ca0b7620421457b619151b9',
|
|
47
|
-
url: `${domain}/${manifest.name}/-/${getTarball(manifest.name)}-${version}.tgz`,
|
|
48
|
-
},
|
|
49
|
-
};
|
|
50
|
-
} else {
|
|
51
|
-
newManifest._attachments = {
|
|
52
|
-
...newManifest._attachments,
|
|
53
|
-
[`${getTarball(manifest.name)}-${version}.tgz`]: {
|
|
54
|
-
shasum: '2c03764f651a9f016ca0b7620421457b619151b9', // pragma: allowlist secret
|
|
55
|
-
version: version,
|
|
56
|
-
},
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
return newManifest;
|
|
60
|
-
}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import type { GenericBody, Manifest } from '@verdaccio/types';
|
|
2
|
-
|
|
3
|
-
import { getTarball } from './utils';
|
|
4
|
-
|
|
5
|
-
export function generateLocalPackageMetadata(
|
|
6
|
-
pkgName: string,
|
|
7
|
-
version = '1.0.0',
|
|
8
|
-
domain: string = 'http://localhost:5555',
|
|
9
|
-
time?: GenericBody
|
|
10
|
-
): Manifest {
|
|
11
|
-
// @ts-ignore
|
|
12
|
-
return {
|
|
13
|
-
_id: pkgName,
|
|
14
|
-
name: pkgName,
|
|
15
|
-
description: '',
|
|
16
|
-
'dist-tags': { ['latest']: version },
|
|
17
|
-
versions: {
|
|
18
|
-
[version]: {
|
|
19
|
-
name: pkgName,
|
|
20
|
-
version: version,
|
|
21
|
-
description: 'package generated',
|
|
22
|
-
main: 'index.js',
|
|
23
|
-
scripts: {
|
|
24
|
-
test: 'echo "Error: no test specified" && exit 1',
|
|
25
|
-
},
|
|
26
|
-
keywords: [],
|
|
27
|
-
author: {
|
|
28
|
-
name: 'User NPM',
|
|
29
|
-
email: 'user@domain.com',
|
|
30
|
-
},
|
|
31
|
-
license: 'ISC',
|
|
32
|
-
dependencies: {
|
|
33
|
-
verdaccio: '^2.7.2',
|
|
34
|
-
},
|
|
35
|
-
readme: '# test',
|
|
36
|
-
readmeFilename: 'README.md',
|
|
37
|
-
_id: `${pkgName}@${version}`,
|
|
38
|
-
_npmVersion: '5.5.1',
|
|
39
|
-
_npmUser: {
|
|
40
|
-
name: 'foo',
|
|
41
|
-
},
|
|
42
|
-
dist: {
|
|
43
|
-
integrity:
|
|
44
|
-
'sha512-6gHiERpiDgtb3hjqpQH5/i7zRmvYi9pmCjQf2ZMy3QEa9wVk9RgdZaPWUt7ZOnWUPFjcr9cm' +
|
|
45
|
-
'E6dUBf+XoPoH4g==',
|
|
46
|
-
shasum: '2c03764f651a9f016ca0b7620421457b619151b9', // pragma: allowlist secret
|
|
47
|
-
tarball: `${domain}/${pkgName}\/-\/${getTarball(pkgName)}-${version}.tgz`,
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
time: time ?? {
|
|
52
|
-
modified: new Date().toISOString(),
|
|
53
|
-
created: new Date().toISOString(),
|
|
54
|
-
[version]: new Date().toISOString(),
|
|
55
|
-
},
|
|
56
|
-
readme: '# test',
|
|
57
|
-
_attachments: {
|
|
58
|
-
[`${getTarball(pkgName)}-${version}.tgz`]: {
|
|
59
|
-
shasum: '2c03764f651a9f016ca0b7620421457b619151b9', // pragma: allowlist secret
|
|
60
|
-
version: version,
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
_uplinks: {},
|
|
64
|
-
_distfiles: {},
|
|
65
|
-
_rev: '',
|
|
66
|
-
};
|
|
67
|
-
}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import type { Manifest } from '@verdaccio/types';
|
|
2
|
-
|
|
3
|
-
import type { DistTags } from './types';
|
|
4
|
-
import { getTarball } from './utils';
|
|
5
|
-
|
|
6
|
-
export function generatePackageMetadata(
|
|
7
|
-
pkgName: string,
|
|
8
|
-
version = '1.0.0',
|
|
9
|
-
distTags: DistTags = { ['latest']: version }
|
|
10
|
-
): Manifest {
|
|
11
|
-
// @ts-ignore
|
|
12
|
-
return {
|
|
13
|
-
_id: pkgName,
|
|
14
|
-
name: pkgName,
|
|
15
|
-
'dist-tags': {
|
|
16
|
-
...distTags,
|
|
17
|
-
},
|
|
18
|
-
versions: {
|
|
19
|
-
[version]: {
|
|
20
|
-
name: pkgName,
|
|
21
|
-
version: version,
|
|
22
|
-
description: 'package generated',
|
|
23
|
-
main: 'index.js',
|
|
24
|
-
scripts: {
|
|
25
|
-
test: 'echo "Error: no test specified" && exit 1',
|
|
26
|
-
},
|
|
27
|
-
keywords: [],
|
|
28
|
-
author: {
|
|
29
|
-
name: 'User NPM',
|
|
30
|
-
email: 'user@domain.com',
|
|
31
|
-
},
|
|
32
|
-
license: 'ISC',
|
|
33
|
-
dependencies: {
|
|
34
|
-
verdaccio: '^2.7.2',
|
|
35
|
-
},
|
|
36
|
-
readme: '# test',
|
|
37
|
-
readmeFilename: 'README.md',
|
|
38
|
-
_id: `${pkgName}@${version}`,
|
|
39
|
-
_npmVersion: '5.5.1',
|
|
40
|
-
_npmUser: {
|
|
41
|
-
name: 'foo',
|
|
42
|
-
},
|
|
43
|
-
dist: {
|
|
44
|
-
integrity:
|
|
45
|
-
'sha512-6gHiERpiDgtb3hjqpQH5/i7zRmvYi9pmCjQf2ZMy3QEa9wVk9RgdZaPWUt7ZOnWUPFjcr9cm' +
|
|
46
|
-
'E6dUBf+XoPoH4g==',
|
|
47
|
-
shasum: '2c03764f651a9f016ca0b7620421457b619151b9', // pragma: allowlist secret
|
|
48
|
-
tarball: `http:\/\/localhost:5555\/${pkgName}\/-\/${getTarball(pkgName)}-${version}.tgz`,
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
readme: '# test',
|
|
53
|
-
_attachments: {
|
|
54
|
-
[`${getTarball(pkgName)}-${version}.tgz`]: {
|
|
55
|
-
content_type: 'application/octet-stream',
|
|
56
|
-
data:
|
|
57
|
-
'H4sIAAAAAAAAE+2W32vbMBDH85y/QnjQp9qxLEeBMsbGlocNBmN7bFdQ5WuqxJaEpGQdo//79KPeQsnI' +
|
|
58
|
-
'w5KUDX/9IOvurLuz/DHSjK/YAiY6jcXSKjk6sMqypHWNdtmD6hlBI0wqQmo8nVbVqMR4OsNoVB66kF1a' +
|
|
59
|
-
'W8eML+Vv10m9oF/jP6IfY4QyyTrILlD2eqkcm+gVzpdrJrPz4NuAsULJ4MZFWdBkbcByI7R79CRjx0Sc' +
|
|
60
|
-
'CdnAvf+SkjUFWu8IubzBgXUhDPidQlfZ3BhlLpBUKDiQ1cDFrYDmKkNnZwjuhUM4808+xNVW8P2bMk1Y' +
|
|
61
|
-
'7vJrtLC1u1MmLPjBF40+Cc4ahV6GDmI/DWygVRpMwVX3KtXUCg7Sxp7ff3nbt6TBFy65gK1iffsN41yo' +
|
|
62
|
-
'EHtdFbOiisWMH8bPvXUH0SP3k+KG3UBr+DFy7OGfEJr4x5iWVeS/pLQe+D+FIv/agIWI6GX66kFuIhT+' +
|
|
63
|
-
'1gDjrp/4d7WAvAwEJPh0u14IufWkM0zaW2W6nLfM2lybgJ4LTJ0/jWiAK8OcMjt8MW3OlfQppcuhhQ6k' +
|
|
64
|
-
'+2OgkK2Q8DssFPi/IHpU9fz3/+xj5NjDf8QFE39VmE4JDfzPCBn4P4X6/f88f/Pu47zomiPk2Lv/dOv8' +
|
|
65
|
-
'h+P/34/D/p9CL+Kp67mrGDRo0KBBp9ZPsETQegASAAA=+2W32vbMBDH85y',
|
|
66
|
-
length: 512,
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
_uplinks: {},
|
|
70
|
-
_distfiles: {},
|
|
71
|
-
_rev: '',
|
|
72
|
-
};
|
|
73
|
-
}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import type { Manifest } from '@verdaccio/types';
|
|
2
|
-
|
|
3
|
-
export interface DistTags {
|
|
4
|
-
[key: string]: string;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Generate package metadata for a published package.
|
|
9
|
-
* This is the shape that a package manager would send to the registry. *
|
|
10
|
-
* @export
|
|
11
|
-
* @param {string} pkgName
|
|
12
|
-
* @param {string} [version='1.0.0']
|
|
13
|
-
* @param {DistTags} [distTags={ ['latest']: version }]
|
|
14
|
-
* @param {string} [description='package generated']
|
|
15
|
-
* @param {string} [readme='# test']
|
|
16
|
-
* @return {*} {Manifest}
|
|
17
|
-
*/
|
|
18
|
-
export function generatePublishNewVersionManifest(
|
|
19
|
-
pkgName: string,
|
|
20
|
-
version = '1.0.0',
|
|
21
|
-
distTags: DistTags = { ['latest']: version },
|
|
22
|
-
description = 'package generated',
|
|
23
|
-
readme = '# test'
|
|
24
|
-
): Manifest {
|
|
25
|
-
// @ts-ignore
|
|
26
|
-
return {
|
|
27
|
-
_id: pkgName,
|
|
28
|
-
description,
|
|
29
|
-
'dist-tags': {
|
|
30
|
-
...distTags,
|
|
31
|
-
},
|
|
32
|
-
versions: {
|
|
33
|
-
[version]: {
|
|
34
|
-
name: pkgName,
|
|
35
|
-
version: version,
|
|
36
|
-
description,
|
|
37
|
-
main: 'index.js',
|
|
38
|
-
scripts: {
|
|
39
|
-
test: 'echo "Error: no test specified" && exit 1',
|
|
40
|
-
},
|
|
41
|
-
keywords: [],
|
|
42
|
-
author: {
|
|
43
|
-
name: 'User NPM',
|
|
44
|
-
email: 'user@domain.com',
|
|
45
|
-
},
|
|
46
|
-
license: 'ISC',
|
|
47
|
-
dependencies: {
|
|
48
|
-
verdaccio: '^2.7.2',
|
|
49
|
-
},
|
|
50
|
-
readme: '# test',
|
|
51
|
-
readmeFilename: 'README.md',
|
|
52
|
-
_id: `${pkgName}@${version}`,
|
|
53
|
-
_npmVersion: '5.5.1',
|
|
54
|
-
_npmUser: {
|
|
55
|
-
name: 'foo',
|
|
56
|
-
},
|
|
57
|
-
dist: {
|
|
58
|
-
integrity:
|
|
59
|
-
'sha512-6gHiERpiDgtb3hjqpQH5/i7zRmvYi9pmCjQf2ZMy3QEa9wVk9RgdZaPWUt7ZOnWUPFjcr9cm' +
|
|
60
|
-
'E6dUBf+XoPoH4g==',
|
|
61
|
-
shasum: '2c03764f651a9f016ca0b7620421457b619151b9', // pragma: allowlist secret
|
|
62
|
-
tarball: `http:\/\/localhost:5555\/${pkgName}\/-\/${pkgName}-${version}.tgz`,
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
access: null,
|
|
67
|
-
readme,
|
|
68
|
-
_attachments: {
|
|
69
|
-
[`${pkgName}-${version}.tgz`]: {
|
|
70
|
-
content_type: 'application/octet-stream',
|
|
71
|
-
data: 'H4sIAAAAAAAC/+2SP0/DMBDFM+dTnDx0QsFpEyN1RQzMjBQiyzlat8Q2tgOtUL8754R/A2OFBMpvOee9i++dZCfVTq7x3I212AZrshPDORdVBT/piWpeQ7aoBS9LITj10aGuLqhmv0AfovQU5QRLEvBZ/wivOQAzskO2pOq6JmKIjfPNnAt2lsxn9EFbk/yy4AUf1RaD8trFd2cUO6mHL21a3NNTGtWxMZCRhpGQRqQ2VBsLK3blvfVLMBaSAcGh0g8a2xWD2QxwryOUjP48Drft8PBifZuuu70bFNnHjfVfKR61QhOGha5vLj/iOqRQRmn8FmT71KM/pMb7RSFotTQlP+bZxMTExP/nDZZA1xkACAAA',
|
|
72
|
-
length: 276,
|
|
73
|
-
},
|
|
74
|
-
},
|
|
75
|
-
};
|
|
76
|
-
}
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import type { FullRemoteManifest, GenericBody, Version, Versions } from '@verdaccio/types';
|
|
2
|
-
|
|
3
|
-
import { getTarball } from './utils';
|
|
4
|
-
|
|
5
|
-
export function generateRemotePackageMetadata(
|
|
6
|
-
pkgName: string,
|
|
7
|
-
version = '1.0.0',
|
|
8
|
-
domain: string = 'http://localhost:5555',
|
|
9
|
-
versions: string[] = []
|
|
10
|
-
): FullRemoteManifest {
|
|
11
|
-
// @ts-ignore
|
|
12
|
-
const generateVersion = (version: string): Version => {
|
|
13
|
-
const metadata = {
|
|
14
|
-
name: pkgName,
|
|
15
|
-
version: version,
|
|
16
|
-
description: 'package generated',
|
|
17
|
-
main: 'index.js',
|
|
18
|
-
scripts: {
|
|
19
|
-
test: 'echo "Error: no test specified" && exit 1',
|
|
20
|
-
},
|
|
21
|
-
keywords: [],
|
|
22
|
-
author: {
|
|
23
|
-
name: 'User NPM',
|
|
24
|
-
email: 'user@domain.com',
|
|
25
|
-
},
|
|
26
|
-
license: 'ISC',
|
|
27
|
-
dependencies: {
|
|
28
|
-
verdaccio: '^2.7.2',
|
|
29
|
-
},
|
|
30
|
-
readme: '# test',
|
|
31
|
-
readmeFilename: 'README.md',
|
|
32
|
-
_id: `${pkgName}@${version}`,
|
|
33
|
-
_npmVersion: '5.5.1',
|
|
34
|
-
_npmUser: {
|
|
35
|
-
name: 'foo',
|
|
36
|
-
},
|
|
37
|
-
dist: {
|
|
38
|
-
integrity:
|
|
39
|
-
'sha512-6gHiERpiDgtb3hjqpQH5/i7zRmvYi9pmCjQf2ZMy3QEa9wVk9RgdZaPWUt7ZOnWUPFjcr9cm' +
|
|
40
|
-
'E6dUBf+XoPoH4g==',
|
|
41
|
-
shasum: '2c03764f651a9f016ca0b7620421457b619151b9', // pragma: allowlist secret
|
|
42
|
-
tarball: `${domain}\/${pkgName}\/-\/${getTarball(pkgName)}-${version}.tgz`,
|
|
43
|
-
},
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
return metadata;
|
|
47
|
-
};
|
|
48
|
-
const mappedVersions: Versions = versions.reduce((acc, v) => {
|
|
49
|
-
acc[v] = generateVersion(v);
|
|
50
|
-
return acc;
|
|
51
|
-
}, {});
|
|
52
|
-
|
|
53
|
-
const mappedTimes: GenericBody = versions.reduce((acc, v) => {
|
|
54
|
-
const date = new Date(Date.now());
|
|
55
|
-
acc[v] = date.toISOString();
|
|
56
|
-
return acc;
|
|
57
|
-
}, {});
|
|
58
|
-
|
|
59
|
-
return {
|
|
60
|
-
_id: pkgName,
|
|
61
|
-
name: pkgName,
|
|
62
|
-
description: '',
|
|
63
|
-
'dist-tags': { ['latest']: version },
|
|
64
|
-
versions: {
|
|
65
|
-
[version]: generateVersion(version),
|
|
66
|
-
...mappedVersions,
|
|
67
|
-
},
|
|
68
|
-
time: {
|
|
69
|
-
modified: '2019-06-13T06:44:45.747Z',
|
|
70
|
-
created: '2019-06-13T06:44:45.747Z',
|
|
71
|
-
[version]: '2019-06-13T06:44:45.747Z',
|
|
72
|
-
...mappedTimes,
|
|
73
|
-
},
|
|
74
|
-
maintainers: [
|
|
75
|
-
{
|
|
76
|
-
name: 'foo',
|
|
77
|
-
email: 'foo@foo.com',
|
|
78
|
-
},
|
|
79
|
-
],
|
|
80
|
-
author: {
|
|
81
|
-
name: 'foo',
|
|
82
|
-
},
|
|
83
|
-
readme: '# test',
|
|
84
|
-
_rev: '12-c8fe8a9c79fa57a87347a0213e6f2548',
|
|
85
|
-
};
|
|
86
|
-
}
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import type { UnPublishManifest } from '@verdaccio/types';
|
|
2
|
-
|
|
3
|
-
export function generateUnPublishPackageMetadata(
|
|
4
|
-
pkgName: string,
|
|
5
|
-
versions: string[] = ['1.0.0'],
|
|
6
|
-
distTags,
|
|
7
|
-
rev: string
|
|
8
|
-
): UnPublishManifest {
|
|
9
|
-
const versionsData = versions.reduce((acc, version) => {
|
|
10
|
-
acc[version] = {
|
|
11
|
-
name: pkgName,
|
|
12
|
-
version: version,
|
|
13
|
-
main: 'index.js',
|
|
14
|
-
scripts: {
|
|
15
|
-
test: 'echo "Error: no test specified" && exit 1',
|
|
16
|
-
},
|
|
17
|
-
author: {
|
|
18
|
-
name: 'Verdaccio Maintainers',
|
|
19
|
-
email: 'verdaccio.npm@gmail.com',
|
|
20
|
-
},
|
|
21
|
-
repository: {
|
|
22
|
-
type: 'git',
|
|
23
|
-
url: 'https://github.com/verdaccio/verdaccio.git',
|
|
24
|
-
},
|
|
25
|
-
homepage: 'https://verdaccio.org',
|
|
26
|
-
funding: {
|
|
27
|
-
type: 'opencollective',
|
|
28
|
-
url: 'https://opencollective.com/verdaccio',
|
|
29
|
-
},
|
|
30
|
-
keywords: [],
|
|
31
|
-
license: 'ISC',
|
|
32
|
-
dependencies: {
|
|
33
|
-
'@verdaccio/logger-7': '^6.0.0-6-next.3',
|
|
34
|
-
},
|
|
35
|
-
bugs: {
|
|
36
|
-
url: 'https://github.com/verdaccio/verdaccio/issues',
|
|
37
|
-
},
|
|
38
|
-
devDependencies: {},
|
|
39
|
-
_id: `${pkgName}@${version}`,
|
|
40
|
-
_nodeVersion: '20.10.0',
|
|
41
|
-
_npmVersion: '10.9.0',
|
|
42
|
-
dist: {
|
|
43
|
-
integrity:
|
|
44
|
-
'sha512-qc+palHxTF5tUhtAHGikwmv7EqhybOZ3cHUvGQZ9H2a8C7VXQ0e4ZVYS7qpNvYmG3m3khfMzsmx/R96BcxaPfw==',
|
|
45
|
-
shasum: '4ece00c13d4a99722275afb6270d44ca158aaaa0',
|
|
46
|
-
tarball: `http://localhost:8000/${pkgName}/-/${pkgName}-${version}.tgz`,
|
|
47
|
-
fileCount: 3,
|
|
48
|
-
unpackedSize: 6488666,
|
|
49
|
-
},
|
|
50
|
-
contributors: [],
|
|
51
|
-
maintainers: [
|
|
52
|
-
{
|
|
53
|
-
name: 'test',
|
|
54
|
-
email: '',
|
|
55
|
-
},
|
|
56
|
-
],
|
|
57
|
-
};
|
|
58
|
-
return acc;
|
|
59
|
-
}, {});
|
|
60
|
-
|
|
61
|
-
const timeData = versions.reduce(
|
|
62
|
-
(acc, version) => {
|
|
63
|
-
const now = new Date().toISOString();
|
|
64
|
-
acc[version] = now;
|
|
65
|
-
return acc;
|
|
66
|
-
},
|
|
67
|
-
{} as Record<string, string>
|
|
68
|
-
);
|
|
69
|
-
|
|
70
|
-
return {
|
|
71
|
-
_id: pkgName,
|
|
72
|
-
name: pkgName,
|
|
73
|
-
'dist-tags': { ...distTags },
|
|
74
|
-
versions: versionsData,
|
|
75
|
-
time: {
|
|
76
|
-
created: new Date().toISOString(),
|
|
77
|
-
modified: new Date().toISOString(),
|
|
78
|
-
...timeData,
|
|
79
|
-
},
|
|
80
|
-
maintainers: [
|
|
81
|
-
{
|
|
82
|
-
name: 'test',
|
|
83
|
-
email: '',
|
|
84
|
-
},
|
|
85
|
-
],
|
|
86
|
-
readme: 'ERROR: No README data found!',
|
|
87
|
-
_rev: rev,
|
|
88
|
-
};
|
|
89
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { Manifest } from '@verdaccio/types';
|
|
2
|
-
|
|
3
|
-
import { generatePackageMetadata } from './generatePackageMetadata';
|
|
4
|
-
import type { DistTags } from './types';
|
|
5
|
-
|
|
6
|
-
export function getDeprecatedPackageMetadata(
|
|
7
|
-
pkgName: string,
|
|
8
|
-
version = '1.0.0',
|
|
9
|
-
distTags: DistTags = { ['latest']: version },
|
|
10
|
-
deprecated = 'default deprecated message',
|
|
11
|
-
rev = 'rev-foo'
|
|
12
|
-
): Manifest {
|
|
13
|
-
const manifest = generatePackageMetadata(pkgName, version, distTags);
|
|
14
|
-
// deprecated message requires empty attachments
|
|
15
|
-
manifest._attachments = {};
|
|
16
|
-
manifest._rev = rev;
|
|
17
|
-
manifest.versions[version].deprecated = deprecated;
|
|
18
|
-
return manifest;
|
|
19
|
-
}
|
package/src/index.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export { generatePackageMetadata } from './generatePackageMetadata';
|
|
2
|
-
export { getDeprecatedPackageMetadata } from './getDeprecatedPackageMetadata';
|
|
3
|
-
export { generateLocalPackageMetadata } from './generateLocalPackageMetadata';
|
|
4
|
-
export { generateRemotePackageMetadata } from './generateRemotePackageMetadata';
|
|
5
|
-
export { addNewVersion } from './addNewVersion';
|
|
6
|
-
export { generatePublishNewVersionManifest } from './generatePublishNewVersionManifest';
|
|
7
|
-
export { initializeServer } from './initializeServer';
|
|
8
|
-
export { publishVersion } from './actions';
|
|
9
|
-
export { generateUnPublishPackageMetadata } from './generateUnPublishPackageMetadata';
|
package/src/initializeServer.ts
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import buildDebug from 'debug';
|
|
2
|
-
import type { Application } from 'express';
|
|
3
|
-
import express from 'express';
|
|
4
|
-
import os from 'node:os';
|
|
5
|
-
import path from 'node:path';
|
|
6
|
-
|
|
7
|
-
import { Auth } from '@verdaccio/auth';
|
|
8
|
-
import { Config } from '@verdaccio/config';
|
|
9
|
-
import { cryptoUtils, errorUtils } from '@verdaccio/core';
|
|
10
|
-
import { setup } from '@verdaccio/logger';
|
|
11
|
-
import { errorReportingMiddleware, final, handleError } from '@verdaccio/middleware';
|
|
12
|
-
|
|
13
|
-
const debug = buildDebug('verdaccio:tools:helpers:server');
|
|
14
|
-
|
|
15
|
-
export async function initializeServer(
|
|
16
|
-
configObject,
|
|
17
|
-
routesMiddleware: any[] = [],
|
|
18
|
-
Storage
|
|
19
|
-
): Promise<Application> {
|
|
20
|
-
const app = express();
|
|
21
|
-
const logger = setup(configObject.log ?? {});
|
|
22
|
-
const config = new Config(configObject);
|
|
23
|
-
config.storage = path.join(os.tmpdir(), '/storage', cryptoUtils.generateRandomHexString());
|
|
24
|
-
// httpass would get path.basename() for configPath thus we need to create a dummy folder
|
|
25
|
-
// to avoid conflics
|
|
26
|
-
config.configPath = config.storage;
|
|
27
|
-
debug('storage: %s', config.storage);
|
|
28
|
-
|
|
29
|
-
const storage = new Storage(config, logger);
|
|
30
|
-
await storage.init(config, []);
|
|
31
|
-
const auth: Auth = new Auth(config, logger);
|
|
32
|
-
await auth.init();
|
|
33
|
-
// TODO: this might not be need it, used in apiEndpoints
|
|
34
|
-
app.use(express.json({ strict: false, limit: '10mb' }));
|
|
35
|
-
// @ts-ignore
|
|
36
|
-
app.use(errorReportingMiddleware(logger));
|
|
37
|
-
for (const route of routesMiddleware) {
|
|
38
|
-
if (route.async) {
|
|
39
|
-
const middleware = await route.routes(config, auth, storage, logger);
|
|
40
|
-
app.use(middleware);
|
|
41
|
-
} else {
|
|
42
|
-
app.use(route(config, auth, storage, logger));
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// catch 404
|
|
47
|
-
app.get('/*', function (req, res, next) {
|
|
48
|
-
next(errorUtils.getNotFound('resource not found'));
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
// @ts-ignore
|
|
52
|
-
app.use(handleError(logger));
|
|
53
|
-
// @ts-ignore
|
|
54
|
-
app.use(final);
|
|
55
|
-
|
|
56
|
-
app.use(function (request, response) {
|
|
57
|
-
response.status(590);
|
|
58
|
-
response.json({ error: 'cannot handle this' });
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
return app;
|
|
62
|
-
}
|
package/src/types.ts
DELETED
package/src/utils.ts
DELETED
package/types/patch.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
declare module 'jest-matcher-utils';
|
|
2
|
-
declare module 'pretty-format' {
|
|
3
|
-
export type Plugin = any;
|
|
4
|
-
}
|
|
5
|
-
declare module '@jest/schemas' {
|
|
6
|
-
export type SnapshotFormat = any;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
declare module 'ms';
|
|
10
|
-
|
|
11
|
-
declare module '@jest/expect-utils';
|
|
12
|
-
declare module 'jest';
|
|
13
|
-
declare module 'expect' {
|
|
14
|
-
export type MatcherState = any;
|
|
15
|
-
export type MatcherUtils = any;
|
|
16
|
-
export type Tester = any;
|
|
17
|
-
export type EqualsFunction = any;
|
|
18
|
-
}
|