Compare commits

..

18 Commits

Author SHA1 Message Date
Juan Picado
3c2f5741f4 chore: update versions (6-next) (#3350)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-09-04 11:56:23 +02:00
Juan Picado
85413ae8b6 Update changesets.yml 2022-09-04 11:50:28 +02:00
Juan Picado
cbff8e4e31 chore: update jest major (#3351)
* chore: update jest major

* remove unused deps
2022-09-04 11:48:51 +02:00
Juan Picado
e24eb59237 Update changesets.yml 2022-09-04 11:42:46 +02:00
Juan Picado
8297e2b36e chore: remove unused dep 2022-09-04 10:49:41 +02:00
Juan Picado
020ede43f6 fix: version output with breakline (#3349) 2022-09-04 10:46:57 +02:00
renovate[bot]
dd177d7166 fix(deps): update dependency msw to v0.47.0 (#3348)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-09-04 10:14:14 +02:00
Juan Picado
5e53e168d4 chore: fix packages release config 2022-09-04 07:58:26 +02:00
renovate[bot]
e9ff724b68 fix(deps): update all core dependencies (master) (#3342)
* fix(deps): update all core dependencies

* Update Search.test.tsx.snap

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Juan Picado <juanpicado19@gmail.com>
2022-09-03 18:47:59 +02:00
Juan Picado
5a61cdd0cf chore: update versions (6-next) (#3341)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-09-02 20:52:37 +02:00
Juan Picado
b849128ded fix: handle upload scoped tarball and add new deprecations (#3340)
* chore: add local publish support

* chore: fix upload scoped tarball

* add e2e
2022-09-02 20:40:12 +02:00
verdacciobot
efa2efe531 chore: updated contributors list 2022-09-01 00:14:39 +00:00
renovate[bot]
62ef397df1 chore(deps): update actions/github-script digest to c713e51 (#3336)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-08-31 08:09:06 +02:00
dependabot[bot]
e8fd4daf78 chore(deps): bump actions/github-script from 6.1.1 to 6.2.0 (#3337)
Bumps [actions/github-script](https://github.com/actions/github-script) from 6.1.1 to 6.2.0.
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](d50f485531...c713e510db)

---
updated-dependencies:
- dependency-name: actions/github-script
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-31 08:08:19 +02:00
dependabot[bot]
acc5862323 chore(deps): bump github/codeql-action from 2.1.20 to 2.1.21 (#3338)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.1.20 to 2.1.21.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](7fee4ca032...c7f292ea4f)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-31 08:08:00 +02:00
Aron Hafner
43c164efe0 docs: update config to use log property (#3339)
Update config.yaml to use log property instead of the depreciated logs

When using logs the following error occurs

```
Error: Error: the property config "logs" property is longer supported, rename to "log" and use object instead
```
2022-08-31 08:07:25 +02:00
verdacciobot
cd02e8d56a chore: updated contributors list 2022-08-29 00:14:20 +00:00
Juan Picado
5b270bdd06 Update package.json 2022-08-28 17:18:29 +02:00
152 changed files with 3322 additions and 2207 deletions

View File

@@ -2,7 +2,9 @@
"$schema": "https://unpkg.com/@changesets/config@1.3.0/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"linked": [],
"fixed": [
["verdaccio", "@verdaccio/cli", "@verdaccio/core", "@verdaccio/config", "@verdaccio/node-api"]
],
"access": "public",
"baseBranch": "master",
"updateInternalDependencies": "patch",

View File

@@ -0,0 +1,5 @@
---
'@verdaccio/cli': patch
---
fix: version with breakline

View File

@@ -50,7 +50,8 @@
"@verdaccio/e2e-cli-yarn1": "1.0.1-6-next.1",
"@verdaccio/e2e-cli-yarn2": "1.0.1-6-next.1",
"@verdaccio/e2e-cli-yarn3": "1.0.1-6-next.1",
"@verdaccio/e2e-cli-yarn4": "1.0.1-6-next.1"
"@verdaccio/e2e-cli-yarn4": "1.0.1-6-next.1",
"@verdaccio/local-publish": "0.0.1"
},
"changesets": [
"afraid-mice-obey",
@@ -91,6 +92,7 @@
"lovely-drinks-argue",
"many-vans-care",
"modern-spies-tell",
"moody-clocks-roll",
"neat-toes-report",
"neat-toys-float",
"olive-candles-speak",
@@ -128,6 +130,7 @@
"tiny-seals-join",
"tricky-taxis-watch",
"two-dolls-check",
"wild-jokes-beam"
"wild-jokes-beam",
"witty-ties-speak"
]
}

View File

@@ -0,0 +1,11 @@
---
'@verdaccio/api': patch
'@verdaccio/cli': patch
'@verdaccio/core': patch
'@verdaccio/types': patch
'@verdaccio/store': patch
'@verdaccio/test-helper': patch
'@verdaccio/local-publish': patch
---
fix: handle upload scoped tarball

View File

@@ -56,12 +56,14 @@ jobs:
run: pnpm build
- name: create versions
uses: verdaccio/changeset-action@master
uses: changesets/action@master
with:
version: pnpm ci:version
commit: 'chore: update versions'
title: 'chore: update versions'
publish: pnpm ci:publish
createGithubReleases: false
setupGitUser: false
env:
GITHUB_TOKEN: ${{ secrets.CHANGESET_RELEASE_TOKEN }}
NPM_TOKEN: ${{ secrets.REGISTRY_AUTH_TOKEN }}

View File

@@ -34,7 +34,7 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@7fee4ca032ac341c12486c4c06822c5221c76533 # tag=v2
uses: github/codeql-action/init@c7f292ea4f542c473194b33813ccd4c207a6c725 # tag=v2
# Override language selection by uncommenting this and choosing your languages
# with:
@@ -42,7 +42,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@7fee4ca032ac341c12486c4c06822c5221c76533 # tag=v2
uses: github/codeql-action/autobuild@c7f292ea4f542c473194b33813ccd4c207a6c725 # tag=v2
# Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
@@ -56,4 +56,4 @@ jobs:
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@7fee4ca032ac341c12486c4c06822c5221c76533 # tag=v2
uses: github/codeql-action/analyze@c7f292ea4f542c473194b33813ccd4c207a6c725 # tag=v2

View File

@@ -100,7 +100,7 @@ jobs:
- name: Format lighthouse score
id: format_lighthouse_score
uses: actions/github-script@d50f485531ba88479582bc2da03ff424389af5c1 # tag=v6
uses: actions/github-script@c713e510dbd7d213d92d41b7a7805a986f4c5c66 # tag=v6
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |

View File

@@ -183,7 +183,7 @@ a report in our [issue tracker](https://github.com/verdaccio/verdaccio/issues).
- _Features clearly flagged as not supported_
- _Node.js issues installation in any platform_: If you cannot install the
global package (this is considered external issue)
- Any ticket which has beed flagged as an [external issue
- Any ticket which has been flagged as an [external issue
](https://github.com/verdaccio/verdaccio/labels/external-issue)
If you intend to report a **security** issue, please follow our [Security policy
@@ -234,7 +234,7 @@ the project. Adding in context and the use-case will really help!
- A detailed description the advantages of your request
- Whether or not it's compatible with `npm`, `pnpm` and [_yarn classic_
](https://github.com/yarnpkg/yarn) or [_yarn berry_
](https://github.com/yarnpkg/yarn) or [_yarn modern_
](https://github.com/yarnpkg/berry).
- A potential implementation or design
- Whatever else is on your mind! 🤓
@@ -420,3 +420,25 @@ If you want to develop your own plugin:
3. You are free to host your plugin in your repository
4. Provide a detailed description of your plugin to help users understand how to
use it
## Testing your changes in a local registry
Once you have perform your changes in the code base, the build and tests passes you can publish a local version:
- Ensure you have build all modules (or the one you have modified)
- Run `pnpm local:publish:release` to launch a local registry and publish all packages into it. This command will be alive until server is killed (Control Key + C)
```
pnpm build
pnpm local:publish:release
```
The last step consist on install globally the package from the local registry.
```
npm i -g verdaccio --registry=http://localhost:4873
verdaccio
```
If you perform more changes in the source code, repeat this process, there is not _hot reloading_ support.

View File

@@ -66,6 +66,6 @@ middlewares:
enabled: true
# log settings
logs:
log:
- { type: stdout, format: pretty, level: trace }
#- {type: file, path: verdaccio.log, level: info}

View File

@@ -40,7 +40,7 @@
"@babel/runtime": "7.18.9",
"@dianmora/contributors": "5.0.0",
"@changesets/changelog-github": "0.4.6",
"@changesets/cli": "2.15.0",
"@changesets/cli": "2.24.4",
"@changesets/get-dependents-graph": "1.3.3",
"@crowdin/cli": "3.7.10",
"@trivago/prettier-plugin-sort-imports": "3.3.0",
@@ -59,7 +59,7 @@
"@types/node-fetch": "2.6.2",
"@types/supertest": "2.0.12",
"@types/testing-library__jest-dom": "5.14.5",
"@types/validator": "13.7.5",
"@types/validator": "13.7.6",
"@types/webpack": "5.28.0",
"@types/webpack-env": "1.18.0",
"@typescript-eslint/eslint-plugin": "5.33.1",
@@ -71,29 +71,27 @@
"autocannon": "7.9.0",
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "10.1.0",
"babel-jest": "27.5.1",
"babel-jest": "29.0.2",
"babel-plugin-dynamic-import-node": "2.3.3",
"babel-plugin-emotion": "10.2.2",
"codecov": "3.8.3",
"concurrently": "6.5.1",
"core-js": "3.25.0",
"cross-env": "7.0.3",
"debug": "4.3.4",
"detect-secrets": "1.0.6",
"pretty-format": "27.5.1",
"jest-diff": "27.5.1",
"jest-diff": "29.0.2",
"eslint": "8.22.0",
"fs-extra": "10.1.0",
"husky": "7.0.4",
"in-publish": "2.0.1",
"jest": "27.5.1",
"jest-environment-jsdom": "27.5.1",
"jest": "29.0.2",
"jest-environment-jsdom": "29.0.2",
"jest-environment-jsdom-global": "3.1.2",
"jest-environment-node": "27.5.1",
"jest-environment-node": "29.0.2",
"jest-junit": "12.3.0",
"kleur": "3.0.3",
"lint-staged": "11.2.6",
"nock": "12.0.3",
"nock": "13.2.9",
"node-fetch": "cjs",
"nodemon": "2.0.19",
"npm-run-all": "4.1.5",
@@ -146,7 +144,10 @@
"crowdin:upload": "crowdin upload sources --auto-update --config ./crowdin.yaml",
"crowdin:download": "crowdin download --verbose --config ./crowdin.yaml",
"crowdin:sync": "pnpm crowdin:upload && pnpm crowdin:download --verbose",
"postinstall": "husky install"
"postinstall": "husky install",
"local:registry": "pnpm start --filter ...@verdaccio/local-publish",
"local:publish": "cross-env npm_config_registry=http://localhost:4873 pnpm ci:publish",
"local:publish:release": "concurrently \"pnpm local:registry\" \"pnpm local:publish\""
},
"engines": {
"node": ">=16.5",

View File

@@ -1,5 +1,31 @@
# @verdaccio/api
## 6.0.0-6-next.30
### Patch Changes
- @verdaccio/core@6.0.0-6-next.47
- @verdaccio/config@6.0.0-6-next.47
- @verdaccio/auth@6.0.0-6-next.26
- @verdaccio/logger@6.0.0-6-next.15
- @verdaccio/middleware@6.0.0-6-next.26
- @verdaccio/store@6.0.0-6-next.27
- @verdaccio/utils@6.0.0-6-next.15
## 6.0.0-6-next.29
### Patch Changes
- b849128d: fix: handle upload scoped tarball
- Updated dependencies [b849128d]
- @verdaccio/core@6.0.0-6-next.8
- @verdaccio/store@6.0.0-6-next.26
- @verdaccio/auth@6.0.0-6-next.25
- @verdaccio/config@6.0.0-6-next.17
- @verdaccio/logger@6.0.0-6-next.14
- @verdaccio/middleware@6.0.0-6-next.25
- @verdaccio/utils@6.0.0-6-next.14
## 6.0.0-6-next.28
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@verdaccio/api",
"version": "6.0.0-6-next.28",
"version": "6.0.0-6-next.30",
"description": "loaders logic",
"main": "./build/index.js",
"types": "build/index.d.ts",
@@ -39,13 +39,13 @@
},
"license": "MIT",
"dependencies": {
"@verdaccio/auth": "workspace:6.0.0-6-next.24",
"@verdaccio/config": "workspace:6.0.0-6-next.16",
"@verdaccio/core": "workspace:6.0.0-6-next.7",
"@verdaccio/logger": "workspace:6.0.0-6-next.13",
"@verdaccio/middleware": "workspace:6.0.0-6-next.24",
"@verdaccio/store": "workspace:6.0.0-6-next.25",
"@verdaccio/utils": "workspace:6.0.0-6-next.13",
"@verdaccio/auth": "workspace:6.0.0-6-next.26",
"@verdaccio/config": "workspace:6.0.0-6-next.47",
"@verdaccio/core": "workspace:6.0.0-6-next.47",
"@verdaccio/logger": "workspace:6.0.0-6-next.15",
"@verdaccio/middleware": "workspace:6.0.0-6-next.26",
"@verdaccio/store": "workspace:6.0.0-6-next.27",
"@verdaccio/utils": "workspace:6.0.0-6-next.15",
"abortcontroller-polyfill": "1.7.3",
"cookies": "0.8.0",
"debug": "4.3.4",
@@ -57,9 +57,9 @@
},
"devDependencies": {
"@types/node": "16.11.56",
"@verdaccio/server": "workspace:6.0.0-6-next.34",
"@verdaccio/types": "workspace:11.0.0-6-next.15",
"@verdaccio/test-helper": "workspace:1.1.0-6-next.3",
"@verdaccio/server": "workspace:6.0.0-6-next.36",
"@verdaccio/types": "workspace:11.0.0-6-next.16",
"@verdaccio/test-helper": "workspace:1.1.0-6-next.4",
"supertest": "6.2.4",
"nock": "13.2.9",
"mockdate": "3.0.5"

View File

@@ -59,6 +59,7 @@ export default function (route: Router, auth: IAuth, storage: Storage): void {
try {
const stream = (await storage.getTarballNext(pkg, filename, {
signal: abort.signal,
// TODO: review why this param
// enableRemote: true,
})) as any;

View File

@@ -81,7 +81,7 @@ const debug = buildDebug('verdaccio:api:publish');
* specific flag for star or un start.
* The URL for star is similar to the unpublish (change package format)
*
* npm has no enpoint for star a package, rather mutate the metadata and acts as, the difference
* npm has no endpoint for star a package, rather mutate the metadata and acts as, the difference
* is the users property which is part of the payload and the body only includes
*
* {
@@ -206,13 +206,12 @@ export function publishPackageNext(storage: Storage): any {
return next({
// TODO: this could be also Package Updated based on the
// action, deprecate, star, publish new version, or create a package
// the mssage some return from the method
// the message some return from the method
ok: API_MESSAGE.PKG_CREATED,
success: true,
});
} catch (err: any) {
// TODO: review if we need the abort controller here
ac.abort();
next(err);
}
};

View File

@@ -0,0 +1,26 @@
auth:
htpasswd:
file: ./htpasswd-publish-proxy
web:
enable: true
title: verdaccio
uplinks:
npmjs:
url: https://registry.npmjs.org/
log: { type: stdout, format: pretty, level: trace }
packages:
'@*/*':
access: $all
publish: $anonymous
unpublish: $anonymous
proxy: npmjs
'**':
access: $all
publish: $anonymous
unpublish: $anonymous
proxy: npmjs
_debug: true

View File

@@ -6,64 +6,100 @@ import { Storage } from '@verdaccio/store';
import { initializeServer, publishVersion } from './_helper';
describe('package', () => {
let app;
beforeEach(async () => {
app = await initializeServer('package.yaml');
describe('get tarball', () => {
let app;
beforeEach(async () => {
app = await initializeServer('package.yaml');
});
test.each([
['foo', 'foo-1.0.0.tgz'],
['@scope/foo', 'foo-1.0.0.tgz'],
])('should return a file tarball', async (pkg, fileName) => {
await publishVersion(app, pkg, '1.0.0');
const response = await supertest(app)
.get(`/${pkg}/-/${fileName}`)
.set(HEADERS.ACCEPT, HEADERS.JSON)
.expect(HEADER_TYPE.CONTENT_TYPE, HEADERS.OCTET_STREAM)
.expect(HTTP_STATUS.OK);
expect(Buffer.from(response.body).toString('utf8')).toBeDefined();
});
test.each([
['foo', 'foo-1.0.0.tgz'],
['@scope/foo', 'foo-1.0.0.tgz'],
])('should fails if tarball does not exist', async (pkg, fileName) => {
await publishVersion(app, pkg, '1.0.1');
return await supertest(app)
.get(`/${pkg}/-/${fileName}`)
.set(HEADERS.ACCEPT, HEADERS.JSON)
.expect(HEADER_TYPE.CONTENT_TYPE, HEADERS.OCTET_STREAM)
.expect(HTTP_STATUS.NOT_FOUND);
});
test.todo('check content length file header');
test.todo('fails on file was aborted');
});
test.each([['foo'], ['@scope/foo']])('should return a foo private package', async (pkg) => {
await publishVersion(app, pkg, '1.0.0');
const response = await supertest(app)
.get(`/${pkg}`)
.set(HEADERS.ACCEPT, HEADERS.JSON)
.expect(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON_CHARSET)
.expect(HTTP_STATUS.OK);
expect(response.body.name).toEqual(pkg);
describe('get package', () => {
let app;
beforeEach(async () => {
app = await initializeServer('package.yaml');
});
test.each([['foo'], ['@scope/foo']])('should return a foo private package', async (pkg) => {
await publishVersion(app, pkg, '1.0.0');
const response = await supertest(app)
.get(`/${pkg}`)
.set(HEADERS.ACCEPT, HEADERS.JSON)
.expect(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON_CHARSET)
.expect(HTTP_STATUS.OK);
expect(response.body.name).toEqual(pkg);
});
test.each([['foo'], ['@scope/foo']])(
'should return a foo private package by version',
async (pkg) => {
await publishVersion(app, pkg, '1.0.0');
const response = await supertest(app)
.get(`/${pkg}`)
.set(HEADERS.ACCEPT, HEADERS.JSON)
.expect(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON_CHARSET)
.expect(HTTP_STATUS.OK);
expect(response.body.name).toEqual(pkg);
}
);
test.each([['foo'], ['@scope/foo']])(
'should return a foo private package by version',
async (pkg) => {
await publishVersion(app, pkg, '1.0.0');
const response = await supertest(app)
.get(`/${pkg}`)
.set(HEADERS.ACCEPT, HEADERS.JSON)
.expect(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON_CHARSET)
.expect(HTTP_STATUS.OK);
expect(response.body.name).toEqual(pkg);
}
);
test.each([['foo-abbreviated'], ['@scope/foo-abbreviated']])(
'should return abbreviated local manifest',
async (pkg) => {
await publishVersion(app, pkg, '1.0.0');
const response = await supertest(app)
.get(`/${pkg}`)
.set(HEADERS.ACCEPT, HEADERS.JSON)
.set(HEADERS.ACCEPT, Storage.ABBREVIATED_HEADER)
.expect(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON_CHARSET)
.expect(HTTP_STATUS.OK);
expect(response.body.name).toEqual(pkg);
expect(response.body.time).toBeDefined();
expect(response.body.modified).toBeDefined();
expect(response.body[DIST_TAGS]).toEqual({ latest: '1.0.0' });
expect(response.body.readme).not.toBeDefined();
expect(response.body._rev).not.toBeDefined();
expect(response.body.users).not.toBeDefined();
}
);
});
test.each([['foo'], ['@scope/foo']])(
'should return a foo private package by version',
async (pkg) => {
await publishVersion(app, pkg, '1.0.0');
const response = await supertest(app)
.get(`/${pkg}`)
.set(HEADERS.ACCEPT, HEADERS.JSON)
.expect(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON_CHARSET)
.expect(HTTP_STATUS.OK);
expect(response.body.name).toEqual(pkg);
}
);
test.each([['foo'], ['@scope/foo']])(
'should return a foo private package by version',
async (pkg) => {
await publishVersion(app, pkg, '1.0.0');
const response = await supertest(app)
.get(`/${pkg}`)
.set(HEADERS.ACCEPT, HEADERS.JSON)
.expect(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON_CHARSET)
.expect(HTTP_STATUS.OK);
expect(response.body.name).toEqual(pkg);
}
);
test.each([['foo-abbreviated'], ['@scope/foo-abbreviated']])(
'should return abbreviated local manifest',
async (pkg) => {
await publishVersion(app, pkg, '1.0.0');
const response = await supertest(app)
.get(`/${pkg}`)
.set(HEADERS.ACCEPT, HEADERS.JSON)
.set(HEADERS.ACCEPT, Storage.ABBREVIATED_HEADER)
.expect(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON_CHARSET)
.expect(HTTP_STATUS.OK);
expect(response.body.name).toEqual(pkg);
expect(response.body.time).toBeDefined();
expect(response.body.modified).toBeDefined();
expect(response.body[DIST_TAGS]).toEqual({ latest: '1.0.0' });
expect(response.body.readme).not.toBeDefined();
expect(response.body._rev).not.toBeDefined();
expect(response.body.users).not.toBeDefined();
}
);
});

View File

@@ -1,11 +1,13 @@
import nock from 'nock';
import { basename } from 'path';
import supertest from 'supertest';
import { HTTP_STATUS } from '@verdaccio/core';
import { API_ERROR, API_MESSAGE, HEADERS, HEADER_TYPE } from '@verdaccio/core';
import { generatePackageMetadata } from '@verdaccio/test-helper';
import { generatePackageMetadata, generateRemotePackageMetadata } from '@verdaccio/test-helper';
import { $RequestExtend, $ResponseExtend } from '../../types/custom';
import { initializeServer, publishVersion } from './_helper';
import { getPackage, initializeServer, publishVersion } from './_helper';
const mockApiJWTmiddleware = jest.fn(
() =>
@@ -33,31 +35,8 @@ jest.mock('@verdaccio/auth', () => ({
},
}));
// const mockStorage = jest.fn(() => {
// const { Storage } = jest.requireActual('@verdaccio/store');
// return {
// Storage: class extends Storage {
// addPackage(name, metadata, cb) {
// super.addPackage(name, metadata, cb);
// }
// }
// };
// });
// jest.mock('@verdaccio/store', () => {
// const { Storage } = jest.requireActual('@verdaccio/store');
// return ({
// Storage: class extends Storage {
// addPackage(name, metadata, cb) {
// // super.addPackage(name, metadata, cb);
// return mockStorage(name, metadata, cb);
// }
// }
// })
// });
describe('publish', () => {
describe('handle invalid publish formats', () => {
describe('handle errors', () => {
const pkgName = 'test';
const pkgMetadata = generatePackageMetadata(pkgName, '1.0.0');
test('should fail on publish a bad _attachments package', async () => {
@@ -101,134 +80,179 @@ describe('publish', () => {
});
describe('publish a package', () => {
test('should publish a package', async () => {
const app = await initializeServer('publish.yaml');
return new Promise((resolve) => {
publishVersion(app, 'foo', '1.0.0')
.expect(HTTP_STATUS.CREATED)
.then((response) => {
expect(response.body.ok).toEqual(API_MESSAGE.PKG_CREATED);
resolve(response);
});
});
});
test('should publish a new package', async () => {
const pkgName = 'test';
const pkgMetadata = generatePackageMetadata(pkgName, '1.0.0');
const app = await initializeServer('publish.yaml');
return new Promise((resolve) => {
supertest(app)
.put(`/${encodeURIComponent(pkgName)}`)
.set(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON)
.send(JSON.stringify(Object.assign({}, pkgMetadata)))
.set('accept', HEADERS.GZIP)
.expect(HTTP_STATUS.CREATED)
.then((response) => {
expect(response.body.ok).toEqual(API_MESSAGE.PKG_CREATED);
resolve(response);
});
});
});
test('should publish a new package with no readme', async () => {
const pkgName = 'test';
const pkgMetadata = generatePackageMetadata(pkgName, '1.0.0');
const app = await initializeServer('publish.yaml');
return new Promise((resolve) => {
supertest(app)
.put(`/${encodeURIComponent(pkgName)}`)
.set(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON)
.send(
JSON.stringify(
Object.assign({}, pkgMetadata, {
versions: {
['1.0.0']: {
readme: null,
},
},
})
)
)
.set('accept', HEADERS.GZIP)
.expect(HTTP_STATUS.CREATED)
.then((response) => {
expect(response.body.ok).toEqual(API_MESSAGE.PKG_CREATED);
resolve(response);
});
});
});
});
test('should fails on publish a duplicated package', async () => {
const app = await initializeServer('publish.yaml');
await publishVersion(app, 'foo', '1.0.0');
return new Promise((resolve) => {
publishVersion(app, 'foo', '1.0.0')
.expect(HTTP_STATUS.CONFLICT)
.then((response) => {
expect(response.body.error).toEqual(API_ERROR.PACKAGE_EXIST);
resolve(response);
describe('no proxies setup', () => {
test.each([['foo', '@scope/foo']])('should publish a package', async (pkgName) => {
const app = await initializeServer('publish.yaml');
return new Promise((resolve) => {
publishVersion(app, pkgName, '1.0.0')
.expect(HTTP_STATUS.CREATED)
.then((response) => {
expect(response.body.ok).toEqual(API_MESSAGE.PKG_CREATED);
resolve(response);
});
});
});
test.each([['foo', '@scope/foo']])('should publish a new package', async (pkgName) => {
const pkgMetadata = generatePackageMetadata(pkgName, '1.0.0');
const app = await initializeServer('publish.yaml');
return new Promise((resolve) => {
supertest(app)
.put(`/${encodeURIComponent(pkgName)}`)
.set(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON)
.send(JSON.stringify(Object.assign({}, pkgMetadata)))
.set('accept', HEADERS.GZIP)
.expect(HTTP_STATUS.CREATED)
.then((response) => {
expect(response.body.ok).toEqual(API_MESSAGE.PKG_CREATED);
resolve(response);
});
});
});
test('should publish a new package with no readme', async () => {
const pkgName = 'test';
const pkgMetadata = generatePackageMetadata(pkgName, '1.0.0');
const app = await initializeServer('publish.yaml');
return new Promise((resolve) => {
supertest(app)
.put(`/${encodeURIComponent(pkgName)}`)
.set(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON)
.send(
JSON.stringify(
Object.assign({}, pkgMetadata, {
versions: {
['1.0.0']: {
readme: null,
},
},
})
)
)
.set('accept', HEADERS.GZIP)
.expect(HTTP_STATUS.CREATED)
.then((response) => {
expect(response.body.ok).toEqual(API_MESSAGE.PKG_CREATED);
resolve(response);
});
});
});
});
describe('proxies setup', () => {
test.each([['foo', '@scope%2Ffoo']])(
'should publish a a patch package that already exist on a remote',
async (pkgName) => {
const upstreamManifest = generateRemotePackageMetadata(
pkgName,
'1.0.0',
'https://registry.npmjs.org',
['1.0.1', '1.0.2', '1.0.3']
);
nock('https://registry.npmjs.org').get(`/${pkgName}`).reply(200, upstreamManifest);
const app = await initializeServer('publish-proxy.yaml');
const manifest = await getPackage(app, '', decodeURIComponent(pkgName));
expect(manifest.body.name).toEqual(decodeURIComponent(pkgName));
const response = await publishVersion(
app,
decodeURIComponent(pkgName),
'1.0.1-patch'
).expect(HTTP_STATUS.CREATED);
expect(response.body.ok).toEqual(API_MESSAGE.PKG_CREATED);
const response2 = await publishVersion(
app,
decodeURIComponent(pkgName),
'1.0.2-patch'
).expect(HTTP_STATUS.CREATED);
expect(response2.body.ok).toEqual(API_MESSAGE.PKG_CREATED);
}
);
});
});
test.each([['foo', '@scope/foo']])(
'should fails on publish a duplicated package',
async (pkgName) => {
const app = await initializeServer('publish.yaml');
await publishVersion(app, pkgName, '1.0.0');
return new Promise((resolve) => {
publishVersion(app, pkgName, '1.0.0')
.expect(HTTP_STATUS.CONFLICT)
.then((response) => {
expect(response.body.error).toEqual(API_ERROR.PACKAGE_EXIST);
resolve(response);
});
});
}
);
describe('unpublish a package', () => {
test('should unpublish entirely a package', async () => {
test.each([['foo', '@scope/foo']])('should unpublish entirely a package', async (pkgName) => {
const app = await initializeServer('publish.yaml');
await publishVersion(app, 'foo', '1.0.0');
await publishVersion(app, pkgName, '1.0.0');
const response = await supertest(app)
// FIXME: should be filtered by revision to avoid
// conflicts
.delete(`/${encodeURIComponent('foo')}/-rev/xxx`)
.delete(`/${encodeURIComponent(pkgName)}/-rev/xxx`)
.set(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON)
.expect(HTTP_STATUS.CREATED);
expect(response.body.ok).toEqual(API_MESSAGE.PKG_REMOVED);
// package should be completely un published
await supertest(app)
.get('/foo')
.get(`/${pkgName}`)
.set('Accept', HEADERS.JSON)
.expect(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON_CHARSET)
.expect(HTTP_STATUS.NOT_FOUND);
});
test('should fails unpublish entirely a package', async () => {
const app = await initializeServer('publish.yaml');
const response = await supertest(app)
.delete(`/${encodeURIComponent('foo')}/-rev/1cf3-fe3`)
.set(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON)
.expect(HTTP_STATUS.NOT_FOUND);
expect(response.body.error).toEqual(API_ERROR.NO_PACKAGE);
});
test.each([['foo', '@scope/foo']])(
'should fails unpublish entirely a package',
async (pkgName) => {
const app = await initializeServer('publish.yaml');
const response = await supertest(app)
.delete(`/${encodeURIComponent(pkgName)}/-rev/1cf3-fe3`)
.set(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON)
.expect(HTTP_STATUS.NOT_FOUND);
expect(response.body.error).toEqual(API_ERROR.NO_PACKAGE);
}
);
test('should fails remove a tarball of a package does not exist', async () => {
const app = await initializeServer('publish.yaml');
const response = await supertest(app)
.delete(`/foo/-/foo-1.0.3.tgz/-rev/revision`)
.set(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON)
.expect(HTTP_STATUS.NOT_FOUND);
expect(response.body.error).toEqual(API_ERROR.NO_PACKAGE);
});
test.each([['foo', '@scope/foo']])(
'should fails remove a tarball of a package does not exist',
async (pkgName) => {
const app = await initializeServer('publish.yaml');
const response = await supertest(app)
.delete(`/${pkgName}/-/${basename(pkgName)}-1.0.3.tgz/-rev/revision`)
.set(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON)
.expect(HTTP_STATUS.NOT_FOUND);
expect(response.body.error).toEqual(API_ERROR.NO_PACKAGE);
}
);
test('should fails on try remove a tarball does not exist', async () => {
const app = await initializeServer('publish.yaml');
await publishVersion(app, 'foo', '1.0.0');
const response = await supertest(app)
.delete(`/foo/-/foo-1.0.3.tgz/-rev/revision`)
.set(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON)
.expect(HTTP_STATUS.NOT_FOUND);
expect(response.body.error).toEqual(API_ERROR.NO_SUCH_FILE);
});
test.each([['foo', '@scope/foo']])(
'should fails on try remove a tarball does not exist',
async (pkgName) => {
const app = await initializeServer('publish.yaml');
await publishVersion(app, pkgName, '1.0.0');
const response = await supertest(app)
.delete(`/${pkgName}/-/${basename(pkgName)}-1.0.3.tgz/-rev/revision`)
.set(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON)
.expect(HTTP_STATUS.NOT_FOUND);
expect(response.body.error).toEqual(API_ERROR.NO_SUCH_FILE);
}
);
test('should remove a tarball that does exist', async () => {
const app = await initializeServer('publish.yaml');
await publishVersion(app, 'foo', '1.0.0');
const response = await supertest(app)
.delete(`/foo/-/foo-1.0.0.tgz/-rev/revision`)
.set(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON)
.expect(HTTP_STATUS.CREATED);
expect(response.body.ok).toEqual(API_MESSAGE.TARBALL_REMOVED);
});
test.each([['foo', '@scope/foo']])(
'should remove a tarball that does exist',
async (pkgName) => {
const app = await initializeServer('publish.yaml');
await publishVersion(app, pkgName, '1.0.0');
const response = await supertest(app)
.delete(`/${pkgName}/-/${basename(pkgName)}-1.0.0.tgz/-rev/revision`)
.set(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON)
.expect(HTTP_STATUS.CREATED);
expect(response.body.ok).toEqual(API_MESSAGE.TARBALL_REMOVED);
}
);
});
describe('star a package', () => {});

View File

@@ -1,8 +1,6 @@
import nock from 'nock';
import supertest from 'supertest';
import { API_ERROR, HEADERS, HEADER_TYPE, HTTP_STATUS, TOKEN_BEARER } from '@verdaccio/core';
import { generateRemotePackageMetadata } from '@verdaccio/test-helper';
import { buildToken } from '@verdaccio/utils';
import { createUser, getPackage, initializeServer } from './_helper';
@@ -13,13 +11,6 @@ describe('token', () => {
describe('basics', () => {
const FAKE_TOKEN: string = buildToken(TOKEN_BEARER, 'fake');
test.each([['user.yaml'], ['user.jwt.yaml']])('should test add a new user', async (conf) => {
const upstreamManifest = generateRemotePackageMetadata(
'vue',
'1.0.0',
'https://registry.verdaccio.org'
);
nock('https://registry.verdaccio.org').get(`/vue`).reply(201, upstreamManifest);
const app = await initializeServer(conf);
const credentials = { name: 'JotaJWT', password: 'secretPass' };
const response = await createUser(app, credentials.name, credentials.password);

View File

@@ -1,5 +1,28 @@
# @verdaccio/auth
## 6.0.0-6-next.26
### Patch Changes
- @verdaccio/core@6.0.0-6-next.47
- @verdaccio/config@6.0.0-6-next.47
- @verdaccio/loaders@6.0.0-6-next.16
- @verdaccio/logger@6.0.0-6-next.15
- verdaccio-htpasswd@11.0.0-6-next.17
- @verdaccio/utils@6.0.0-6-next.15
## 6.0.0-6-next.25
### Patch Changes
- Updated dependencies [b849128d]
- @verdaccio/core@6.0.0-6-next.8
- @verdaccio/config@6.0.0-6-next.17
- @verdaccio/loaders@6.0.0-6-next.15
- @verdaccio/logger@6.0.0-6-next.14
- verdaccio-htpasswd@11.0.0-6-next.16
- @verdaccio/utils@6.0.0-6-next.14
## 6.0.0-6-next.24
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@verdaccio/auth",
"version": "6.0.0-6-next.24",
"version": "6.0.0-6-next.26",
"description": "logger",
"main": "./build/index.js",
"types": "build/index.d.ts",
@@ -39,19 +39,19 @@
},
"license": "MIT",
"dependencies": {
"@verdaccio/core": "workspace:6.0.0-6-next.7",
"@verdaccio/config": "workspace:6.0.0-6-next.16",
"@verdaccio/loaders": "workspace:6.0.0-6-next.14",
"@verdaccio/logger": "workspace:6.0.0-6-next.13",
"@verdaccio/utils": "workspace:6.0.0-6-next.13",
"@verdaccio/core": "workspace:6.0.0-6-next.47",
"@verdaccio/config": "workspace:6.0.0-6-next.47",
"@verdaccio/loaders": "workspace:6.0.0-6-next.16",
"@verdaccio/logger": "workspace:6.0.0-6-next.15",
"@verdaccio/utils": "workspace:6.0.0-6-next.15",
"debug": "4.3.4",
"express": "4.18.1",
"jsonwebtoken": "8.5.1",
"lodash": "4.17.21",
"verdaccio-htpasswd": "workspace:11.0.0-6-next.15"
"verdaccio-htpasswd": "workspace:11.0.0-6-next.17"
},
"devDependencies": {
"@verdaccio/types": "workspace:11.0.0-6-next.15"
"@verdaccio/types": "workspace:11.0.0-6-next.16"
},
"funding": {
"type": "opencollective",

View File

@@ -1,5 +1,26 @@
# @verdaccio/cli
## 6.0.0-6-next.47
### Patch Changes
- 020ede43: fix: version with breakline
- @verdaccio/core@6.0.0-6-next.47
- @verdaccio/config@6.0.0-6-next.47
- @verdaccio/node-api@6.0.0-6-next.47
- @verdaccio/logger@6.0.0-6-next.15
## 6.0.0-6-next.38
### Patch Changes
- b849128d: fix: handle upload scoped tarball
- Updated dependencies [b849128d]
- @verdaccio/core@6.0.0-6-next.8
- @verdaccio/config@6.0.0-6-next.17
- @verdaccio/logger@6.0.0-6-next.14
- @verdaccio/node-api@6.0.0-6-next.36
## 6.0.0-6-next.37
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@verdaccio/cli",
"version": "6.0.0-6-next.37",
"version": "6.0.0-6-next.47",
"author": {
"name": "Juan Picado",
"email": "juanpicado19@gmail.com"
@@ -44,10 +44,10 @@
"start": "ts-node src/index.ts"
},
"dependencies": {
"@verdaccio/core": "workspace:6.0.0-6-next.7",
"@verdaccio/config": "workspace:6.0.0-6-next.16",
"@verdaccio/logger": "workspace:6.0.0-6-next.13",
"@verdaccio/node-api": "workspace:6.0.0-6-next.35",
"@verdaccio/core": "workspace:6.0.0-6-next.47",
"@verdaccio/config": "workspace:6.0.0-6-next.47",
"@verdaccio/logger": "workspace:6.0.0-6-next.15",
"@verdaccio/node-api": "workspace:6.0.0-6-next.47",
"clipanion": "3.1.0",
"envinfo": "7.8.1",
"kleur": "3.0.3",

View File

@@ -1,6 +1,7 @@
import { Command, Option } from 'clipanion';
import { findConfigFile, parseConfigFile } from '@verdaccio/config';
import { warningUtils } from '@verdaccio/core';
import { logger, setup } from '@verdaccio/logger';
import { initServer } from '@verdaccio/node-api';
import { ConfigYaml, LoggerConfigItem } from '@verdaccio/types';
@@ -45,17 +46,13 @@ export class InitCommand extends Command {
});
private initLogger(logConfig: ConfigYaml) {
try {
// @ts-expect-error
if (logConfig.logs) {
// @ts-expect-error
if (logConfig.logs) {
throw Error(
'the property config "logs" property is longer supported, rename to "log" and use object instead'
);
}
setup(logConfig.log as LoggerConfigItem);
} catch (err: any) {
throw new Error(err);
logConfig.log = logConfig.logs;
warningUtils.emit(warningUtils.Codes.VERWAR002);
}
setup(logConfig.log as LoggerConfigItem);
}
public async execute() {

View File

@@ -6,7 +6,7 @@ export class VersionCommand extends Command {
async execute() {
const version = require('../../package.json').version;
this.context.stdout.write(`v${version}`);
this.context.stdout.write(`v${version}\n`);
process.exit(0);
}
}

View File

@@ -1,5 +1,20 @@
# @verdaccio/config
## 6.0.0-6-next.47
### Patch Changes
- @verdaccio/core@6.0.0-6-next.47
- @verdaccio/utils@6.0.0-6-next.15
## 6.0.0-6-next.17
### Patch Changes
- Updated dependencies [b849128d]
- @verdaccio/core@6.0.0-6-next.8
- @verdaccio/utils@6.0.0-6-next.14
## 6.0.0-6-next.16
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@verdaccio/config",
"version": "6.0.0-6-next.16",
"version": "6.0.0-6-next.47",
"description": "logger",
"main": "./build/index.js",
"types": "build/index.d.ts",
@@ -39,8 +39,8 @@
"build": "pnpm run build:js && pnpm run build:types"
},
"dependencies": {
"@verdaccio/core": "workspace:6.0.0-6-next.7",
"@verdaccio/utils": "workspace:6.0.0-6-next.13",
"@verdaccio/core": "workspace:6.0.0-6-next.47",
"@verdaccio/utils": "workspace:6.0.0-6-next.15",
"debug": "4.3.4",
"yaml": "2.1.1",
"lodash": "4.17.21",

View File

@@ -6,7 +6,7 @@ uplinks:
npmjs:
url: http://localhost:4873/
packages:
\\"@*/*\\":
"@*/*":
access: $all
publish: $all
proxy: npmjs
@@ -32,7 +32,7 @@ packages:
access: $authenticated
publish: $authenticated
proxy: npmjs
\\"*\\":
"*":
access: $all
publish: $all
proxy: npmjs

View File

@@ -1,5 +1,13 @@
# @verdaccio/core
## 6.0.0-6-next.47
## 6.0.0-6-next.8
### Patch Changes
- b849128d: fix: handle upload scoped tarball
## 6.0.0-6-next.7
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@verdaccio/core",
"version": "6.0.0-6-next.7",
"version": "6.0.0-6-next.47",
"description": "core utilities",
"keywords": [
"private",
@@ -43,7 +43,7 @@
},
"devDependencies": {
"lodash": "4.17.21",
"@verdaccio/types": "workspace:11.0.0-6-next.15"
"@verdaccio/types": "workspace:11.0.0-6-next.16"
},
"scripts": {
"clean": "rimraf ./build",

View File

@@ -6,12 +6,19 @@ const verdaccioDeprecation = 'VerdaccioDeprecation';
export enum Codes {
VERWAR001 = 'VERWAR001',
VERWAR002 = 'VERWAR002',
VERWAR003 = 'VERWAR003',
VERWAR004 = 'VERWAR004',
// deprecation warnings
VERDEP003 = 'VERDEP003',
}
warningInstance.create(
verdaccioWarning,
Codes.VERWAR002,
`The property config "logs" property is longer supported, rename to "log" and use object instead`
);
warningInstance.create(
verdaccioWarning,
Codes.VERWAR001,

View File

@@ -40,7 +40,7 @@
"lockfile": "1.0.4"
},
"devDependencies": {
"@verdaccio/types": "workspace:11.0.0-6-next.15"
"@verdaccio/types": "workspace:11.0.0-6-next.16"
},
"scripts": {
"clean": "rimraf ./build",

View File

@@ -54,12 +54,12 @@ describe('testing locking', () => {
readFile(getFilePath('package.json'), {}, (error: Error, data: string) => {
expect(error).toBeNull();
expect(data).toMatchInlineSnapshot(`
"{
\\"name\\": \\"assets\\",
\\"version\\": \\"0.0.1\\"
}
"
`);
"{
"name": "assets",
"version": "0.0.1"
}
"
`);
done();
});
});
@@ -71,11 +71,11 @@ describe('testing locking', () => {
readFile(getFilePath('package.json'), options, (error: Error, data: string) => {
expect(error).toBeNull();
expect(data).toMatchInlineSnapshot(`
Object {
"name": "assets",
"version": "0.0.1",
}
`);
{
"name": "assets",
"version": "0.0.1",
}
`);
done();
});
});
@@ -110,11 +110,11 @@ describe('testing locking', () => {
readFile(getFilePath('package2.json'), options, (error: Error, data: string) => {
expect(error).toBeNull();
expect(data).toMatchInlineSnapshot(`
Object {
"name": "assets",
"version": "0.0.1",
}
`);
{
"name": "assets",
"version": "0.0.1",
}
`);
removeTempFile('package2.json.lock');
done();
});

View File

@@ -55,12 +55,12 @@ describe('testing locking', () => {
test('read file with no options should to be found to be read it as string', async () => {
const data = await readFileNext(getFilePath('package.json'), {});
expect(data).toMatchInlineSnapshot(`
"{
\\"name\\": \\"assets\\",
\\"version\\": \\"0.0.1\\"
}
"
`);
"{
"name": "assets",
"version": "0.0.1"
}
"
`);
});
test('read file with no options should to be found to be read it as object', async () => {
@@ -69,11 +69,11 @@ describe('testing locking', () => {
};
const data = await readFileNext(getFilePath('package.json'), options);
expect(data).toMatchInlineSnapshot(`
Object {
"name": "assets",
"version": "0.0.1",
}
`);
{
"name": "assets",
"version": "0.0.1",
}
`);
});
test('read file with options (parse) should to be not found to be read it', async () => {
@@ -99,16 +99,13 @@ describe('testing locking', () => {
parse: true,
lock: true,
};
await expect(
readFileNext(getFilePath('package2.json'), options)
).resolves.toMatchInlineSnapshot(
`
Object {
"name": "assets",
"version": "0.0.1",
}
`
);
await expect(readFileNext(getFilePath('package2.json'), options)).resolves
.toMatchInlineSnapshot(`
{
"name": "assets",
"version": "0.0.1",
}
`);
removeTempFile('package2.json.lock');
});

View File

@@ -45,7 +45,7 @@
"marked": "3.0.8"
},
"devDependencies": {
"@verdaccio/types": "workspace:11.0.0-6-next.15"
"@verdaccio/types": "workspace:11.0.0-6-next.16"
},
"scripts": {
"clean": "rimraf ./build",

View File

@@ -0,0 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`readme mix readmes / markdown should parse marked 1`] = `"<h1 id="mix-html-and-xss-markdown">mix html and XSS markdown</h1><p><a>Basic</a></p><p><a href="https://github.com/webpack/webpack"><img src="https://webpack.js.org/assets/icon-square-big.svg" height="200" width="200"></a></p>"`;

View File

@@ -241,11 +241,7 @@ describe('readme', () => {
test('should parse marked', async () => {
const readme: string = await readReadme('mixed-html-mk');
expect(clean(parseReadme(readme) as string)).toMatchInlineSnapshot(
'"<h1 id=\\"mix-html-and-xss-markdown\\">mix html and XSS markdown</h1><p><a>Basic<' +
'/a></p><p><a href=\\"https://github.com/webpack/webpack\\"><img src=\\"https://webp' +
'ack.js.org/assets/icon-square-big.svg\\" height=\\"200\\" width=\\"200\\"></a></p>"'
);
expect(clean(parseReadme(readme) as string)).toMatchSnapshot();
});
});
});

View File

@@ -1,5 +1,22 @@
# Change Log
## 11.0.0-6-next.16
### Patch Changes
- @verdaccio/core@6.0.0-6-next.47
- @verdaccio/url@11.0.0-6-next.13
- @verdaccio/utils@6.0.0-6-next.15
## 11.0.0-6-next.15
### Patch Changes
- Updated dependencies [b849128d]
- @verdaccio/core@6.0.0-6-next.8
- @verdaccio/url@11.0.0-6-next.12
- @verdaccio/utils@6.0.0-6-next.14
## 11.0.0-6-next.14
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@verdaccio/tarball",
"version": "11.0.0-6-next.14",
"version": "11.0.0-6-next.16",
"description": "tarball utilities resolver",
"keywords": [
"private",
@@ -35,13 +35,13 @@
},
"dependencies": {
"debug": "4.3.4",
"@verdaccio/core": "workspace:6.0.0-6-next.7",
"@verdaccio/url": "workspace:11.0.0-6-next.11",
"@verdaccio/utils": "workspace:6.0.0-6-next.13",
"@verdaccio/core": "workspace:6.0.0-6-next.47",
"@verdaccio/url": "workspace:11.0.0-6-next.13",
"@verdaccio/utils": "workspace:6.0.0-6-next.15",
"lodash": "4.17.21"
},
"devDependencies": {
"@verdaccio/types": "workspace:11.0.0-6-next.15",
"@verdaccio/types": "workspace:11.0.0-6-next.16",
"node-mocks-http": "1.11.0"
},
"scripts": {

View File

@@ -1,5 +1,11 @@
# Change Log
## 11.0.0-6-next.16
### Patch Changes
- b849128d: fix: handle upload scoped tarball
## 11.0.0-6-next.15
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@verdaccio/types",
"version": "11.0.0-6-next.15",
"version": "11.0.0-6-next.16",
"description": "verdaccio types definitions",
"keywords": [
"private",

View File

@@ -181,6 +181,7 @@ export interface FullRemoteManifest {
homepage?: string;
repository?: string | { type?: string; url: string; directory?: string };
keywords?: string[];
author?: string | Author;
}
export interface Manifest extends FullRemoteManifest, PublishManifest {

View File

@@ -1,5 +1,18 @@
# Change Log
## 11.0.0-6-next.13
### Patch Changes
- @verdaccio/core@6.0.0-6-next.47
## 11.0.0-6-next.12
### Patch Changes
- Updated dependencies [b849128d]
- @verdaccio/core@6.0.0-6-next.8
## 11.0.0-6-next.11
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@verdaccio/url",
"version": "11.0.0-6-next.11",
"version": "11.0.0-6-next.13",
"description": "url utilities resolver",
"keywords": [
"private",
@@ -34,13 +34,13 @@
"access": "public"
},
"dependencies": {
"@verdaccio/core": "workspace:6.0.0-6-next.7",
"@verdaccio/core": "workspace:6.0.0-6-next.47",
"debug": "4.3.4",
"lodash": "4.17.21",
"validator": "13.7.0"
},
"devDependencies": {
"@verdaccio/types": "workspace:11.0.0-6-next.15",
"@verdaccio/types": "workspace:11.0.0-6-next.16",
"node-mocks-http": "1.11.0"
},
"scripts": {

View File

@@ -1,5 +1,20 @@
# @verdaccio/hooks
## 6.0.0-6-next.17
### Patch Changes
- @verdaccio/core@6.0.0-6-next.47
- @verdaccio/logger@6.0.0-6-next.15
## 6.0.0-6-next.16
### Patch Changes
- Updated dependencies [b849128d]
- @verdaccio/core@6.0.0-6-next.8
- @verdaccio/logger@6.0.0-6-next.14
## 6.0.0-6-next.15
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@verdaccio/hooks",
"version": "6.0.0-6-next.15",
"version": "6.0.0-6-next.17",
"description": "loaders logic",
"main": "./build/index.js",
"types": "build/index.d.ts",
@@ -30,8 +30,8 @@
"npm": ">=6"
},
"dependencies": {
"@verdaccio/core": "workspace:6.0.0-6-next.7",
"@verdaccio/logger": "workspace:6.0.0-6-next.13",
"@verdaccio/core": "workspace:6.0.0-6-next.47",
"@verdaccio/logger": "workspace:6.0.0-6-next.15",
"core-js": "3.25.0",
"debug": "4.3.4",
"handlebars": "4.7.7",
@@ -39,9 +39,9 @@
},
"devDependencies": {
"@types/node": "16.11.56",
"@verdaccio/auth": "workspace:6.0.0-6-next.24",
"@verdaccio/config": "workspace:6.0.0-6-next.16",
"@verdaccio/types": "workspace:11.0.0-6-next.15"
"@verdaccio/auth": "workspace:6.0.0-6-next.26",
"@verdaccio/config": "workspace:6.0.0-6-next.47",
"@verdaccio/types": "workspace:11.0.0-6-next.16"
},
"scripts": {
"clean": "rimraf ./build",

View File

@@ -1,5 +1,17 @@
# @verdaccio/loaders
## 6.0.0-6-next.16
### Patch Changes
- @verdaccio/logger@6.0.0-6-next.15
## 6.0.0-6-next.15
### Patch Changes
- @verdaccio/logger@6.0.0-6-next.14
## 6.0.0-6-next.14
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@verdaccio/loaders",
"version": "6.0.0-6-next.14",
"version": "6.0.0-6-next.16",
"description": "loaders logic",
"main": "./build/index.js",
"types": "build/index.d.ts",
@@ -13,14 +13,14 @@
"url": "https://github.com/verdaccio/verdaccio"
},
"dependencies": {
"@verdaccio/logger": "workspace:6.0.0-6-next.13",
"@verdaccio/logger": "workspace:6.0.0-6-next.15",
"debug": "4.3.4",
"lodash": "4.17.21"
},
"devDependencies": {
"@verdaccio/core": "workspace:6.0.0-6-next.7",
"@verdaccio/config": "workspace:6.0.0-6-next.16",
"@verdaccio/types": "workspace:11.0.0-6-next.15"
"@verdaccio/core": "workspace:6.0.0-6-next.47",
"@verdaccio/config": "workspace:6.0.0-6-next.47",
"@verdaccio/types": "workspace:11.0.0-6-next.16"
},
"homepage": "https://verdaccio.org",
"keywords": [

View File

@@ -1,5 +1,18 @@
# @verdaccio/logger
## 6.0.0-6-next.15
### Patch Changes
- @verdaccio/core@6.0.0-6-next.47
## 6.0.0-6-next.14
### Patch Changes
- Updated dependencies [b849128d]
- @verdaccio/core@6.0.0-6-next.8
## 6.0.0-6-next.13
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@verdaccio/logger",
"version": "6.0.0-6-next.13",
"version": "6.0.0-6-next.15",
"description": "logger",
"main": "./build/index.js",
"types": "build/index.d.ts",
@@ -39,14 +39,14 @@
"build": "babel src/ --out-dir build/ --copy-files --extensions \".ts,.tsx\" --source-maps"
},
"dependencies": {
"@verdaccio/core": "workspace:6.0.0-6-next.7",
"@verdaccio/core": "workspace:6.0.0-6-next.47",
"@verdaccio/logger-prettify": "workspace:6.0.0-6-next.7",
"debug": "4.3.4",
"colorette": "2.0.19",
"pino": "8.4.2"
},
"devDependencies": {
"@verdaccio/types": "workspace:11.0.0-6-next.15"
"@verdaccio/types": "workspace:11.0.0-6-next.16"
},
"funding": {
"type": "opencollective",

View File

@@ -1,5 +1,24 @@
# @verdaccio/middleware
## 6.0.0-6-next.26
### Patch Changes
- @verdaccio/core@6.0.0-6-next.47
- @verdaccio/auth@6.0.0-6-next.26
- @verdaccio/logger@6.0.0-6-next.15
- @verdaccio/utils@6.0.0-6-next.15
## 6.0.0-6-next.25
### Patch Changes
- Updated dependencies [b849128d]
- @verdaccio/core@6.0.0-6-next.8
- @verdaccio/auth@6.0.0-6-next.25
- @verdaccio/logger@6.0.0-6-next.14
- @verdaccio/utils@6.0.0-6-next.14
## 6.0.0-6-next.24
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@verdaccio/middleware",
"version": "6.0.0-6-next.24",
"version": "6.0.0-6-next.26",
"description": "loaders logic",
"main": "./build/index.js",
"types": "build/index.d.ts",
@@ -40,10 +40,10 @@
"dependencies": {
"debug": "4.3.4",
"body-parser": "1.20.0",
"@verdaccio/auth": "workspace:6.0.0-6-next.24",
"@verdaccio/core": "workspace:6.0.0-6-next.7",
"@verdaccio/logger": "workspace:6.0.0-6-next.13",
"@verdaccio/utils": "workspace:6.0.0-6-next.13",
"@verdaccio/auth": "workspace:6.0.0-6-next.26",
"@verdaccio/core": "workspace:6.0.0-6-next.47",
"@verdaccio/logger": "workspace:6.0.0-6-next.15",
"@verdaccio/utils": "workspace:6.0.0-6-next.15",
"lodash": "4.17.21"
},
"funding": {

View File

@@ -1,5 +1,26 @@
# @verdaccio/node-api
## 6.0.0-6-next.47
### Patch Changes
- @verdaccio/core@6.0.0-6-next.47
- @verdaccio/config@6.0.0-6-next.47
- @verdaccio/logger@6.0.0-6-next.15
- @verdaccio/server@6.0.0-6-next.36
- @verdaccio/server-fastify@6.0.0-6-next.28
## 6.0.0-6-next.36
### Patch Changes
- Updated dependencies [b849128d]
- @verdaccio/core@6.0.0-6-next.8
- @verdaccio/server@6.0.0-6-next.35
- @verdaccio/config@6.0.0-6-next.17
- @verdaccio/logger@6.0.0-6-next.14
- @verdaccio/server-fastify@6.0.0-6-next.27
## 6.0.0-6-next.35
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@verdaccio/node-api",
"version": "6.0.0-6-next.35",
"version": "6.0.0-6-next.47",
"description": "node API",
"main": "build/index.js",
"types": "build/index.d.ts",
@@ -39,18 +39,18 @@
},
"license": "MIT",
"dependencies": {
"@verdaccio/core": "workspace:6.0.0-6-next.7",
"@verdaccio/config": "workspace:6.0.0-6-next.16",
"@verdaccio/logger": "workspace:6.0.0-6-next.13",
"@verdaccio/server": "workspace:6.0.0-6-next.34",
"@verdaccio/server-fastify": "workspace:6.0.0-6-next.26",
"@verdaccio/core": "workspace:6.0.0-6-next.47",
"@verdaccio/config": "workspace:6.0.0-6-next.47",
"@verdaccio/logger": "workspace:6.0.0-6-next.15",
"@verdaccio/server": "workspace:6.0.0-6-next.36",
"@verdaccio/server-fastify": "workspace:6.0.0-6-next.28",
"core-js": "3.25.0",
"debug": "4.3.4",
"lodash": "4.17.21"
},
"devDependencies": {
"@types/node": "16.11.56",
"@verdaccio/types": "workspace:11.0.0-6-next.15",
"@verdaccio/types": "workspace:11.0.0-6-next.16",
"jest-mock-process": "1.5.1",
"selfsigned": "1.10.14",
"supertest": "6.2.4"

View File

@@ -37,9 +37,9 @@
"node-fetch": "cjs"
},
"devDependencies": {
"@verdaccio/types": "workspace:11.0.0-6-next.15",
"@verdaccio/config": "workspace:6.0.0-6-next.16",
"@verdaccio/logger": "workspace:6.0.0-6-next.13",
"@verdaccio/types": "workspace:11.0.0-6-next.16",
"@verdaccio/config": "workspace:6.0.0-6-next.47",
"@verdaccio/logger": "workspace:6.0.0-6-next.15",
"nock": "13.2.9",
"supertest": "6.2.4"
},

View File

@@ -1,5 +1,18 @@
# Change Log
## 11.0.0-6-next.12
### Patch Changes
- @verdaccio/core@6.0.0-6-next.47
## 11.0.0-6-next.11
### Patch Changes
- Updated dependencies [b849128d]
- @verdaccio/core@6.0.0-6-next.8
## 11.0.0-6-next.10
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "verdaccio-auth-memory",
"version": "11.0.0-6-next.10",
"version": "11.0.0-6-next.12",
"description": "Auth plugin for Verdaccio that keeps users in memory",
"keywords": [
"private",
@@ -32,10 +32,10 @@
},
"dependencies": {
"debug": "4.3.4",
"@verdaccio/core": "workspace:6.0.0-6-next.7"
"@verdaccio/core": "workspace:6.0.0-6-next.47"
},
"devDependencies": {
"@verdaccio/types": "workspace:11.0.0-6-next.15"
"@verdaccio/types": "workspace:11.0.0-6-next.16"
},
"scripts": {
"clean": "rimraf ./build",

View File

@@ -1,5 +1,19 @@
# Change Log
## 11.0.0-6-next.17
### Patch Changes
- @verdaccio/core@6.0.0-6-next.47
## 11.0.0-6-next.16
### Patch Changes
- Updated dependencies [b849128d]
- @verdaccio/core@6.0.0-6-next.8
- @verdaccio/file-locking@11.0.0-6-next.6
## 11.0.0-6-next.15
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "verdaccio-htpasswd",
"version": "11.0.0-6-next.15",
"version": "11.0.0-6-next.17",
"description": "htpasswd auth plugin for Verdaccio",
"keywords": [
"private",
@@ -34,7 +34,7 @@
"npm": ">=6"
},
"dependencies": {
"@verdaccio/core": "workspace:6.0.0-6-next.7",
"@verdaccio/core": "workspace:6.0.0-6-next.47",
"@verdaccio/file-locking": "workspace:11.0.0-6-next.6",
"apache-md5": "1.1.7",
"bcryptjs": "2.4.3",
@@ -45,9 +45,9 @@
},
"devDependencies": {
"@types/bcryptjs": "2.4.2",
"@verdaccio/types": "workspace:11.0.0-6-next.15",
"@verdaccio/config": "workspace:6.0.0-6-next.16",
"@verdaccio/logger": "workspace:6.0.0-6-next.13",
"@verdaccio/types": "workspace:11.0.0-6-next.16",
"@verdaccio/config": "workspace:6.0.0-6-next.47",
"@verdaccio/logger": "workspace:6.0.0-6-next.15",
"mockdate": "3.0.5"
},
"scripts": {

View File

@@ -1,5 +1,21 @@
# Change Log
## 11.0.0-6-next.17
### Patch Changes
- @verdaccio/core@6.0.0-6-next.47
- @verdaccio/utils@6.0.0-6-next.15
## 11.0.0-6-next.16
### Patch Changes
- Updated dependencies [b849128d]
- @verdaccio/core@6.0.0-6-next.8
- @verdaccio/utils@6.0.0-6-next.14
- @verdaccio/file-locking@11.0.0-6-next.6
## 11.0.0-6-next.15
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@verdaccio/local-storage",
"version": "11.0.0-6-next.15",
"version": "11.0.0-6-next.17",
"description": "Local storage implementation",
"keywords": [
"private",
@@ -37,9 +37,9 @@
"npm": ">=7"
},
"dependencies": {
"@verdaccio/core": "workspace:6.0.0-6-next.7",
"@verdaccio/core": "workspace:6.0.0-6-next.47",
"@verdaccio/file-locking": "workspace:11.0.0-6-next.6",
"@verdaccio/utils": "workspace:6.0.0-6-next.13",
"@verdaccio/utils": "workspace:6.0.0-6-next.15",
"core-js": "3.25.0",
"debug": "4.3.4",
"globby": "11.1.0",
@@ -51,10 +51,10 @@
},
"devDependencies": {
"@types/minimatch": "3.0.5",
"@verdaccio/types": "workspace:11.0.0-6-next.15",
"@verdaccio/config": "workspace:6.0.0-6-next.16",
"@verdaccio/logger": "workspace:6.0.0-6-next.13",
"@verdaccio/test-helper": "workspace:1.1.0-6-next.3",
"@verdaccio/types": "workspace:11.0.0-6-next.16",
"@verdaccio/config": "workspace:6.0.0-6-next.47",
"@verdaccio/logger": "workspace:6.0.0-6-next.15",
"@verdaccio/test-helper": "workspace:1.1.0-6-next.4",
"minimatch": "3.1.2"
},
"scripts": {

View File

@@ -1,5 +1,18 @@
# Change Log
## 11.0.0-6-next.14
### Patch Changes
- @verdaccio/core@6.0.0-6-next.47
## 11.0.0-6-next.13
### Patch Changes
- Updated dependencies [b849128d]
- @verdaccio/core@6.0.0-6-next.8
## 11.0.0-6-next.12
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "verdaccio-memory",
"version": "11.0.0-6-next.12",
"version": "11.0.0-6-next.14",
"description": "Storage implementation in memory",
"keywords": [
"private",
@@ -31,15 +31,15 @@
"npm": ">=6"
},
"dependencies": {
"@verdaccio/core": "workspace:6.0.0-6-next.7",
"@verdaccio/core": "workspace:6.0.0-6-next.47",
"memory-fs": "0.5.0",
"debug": "4.3.4",
"memfs": "3.4.7"
},
"devDependencies": {
"@verdaccio/types": "workspace:11.0.0-6-next.15",
"@verdaccio/config": "workspace:6.0.0-6-next.16",
"@verdaccio/logger": "workspace:6.0.0-6-next.13"
"@verdaccio/types": "workspace:11.0.0-6-next.16",
"@verdaccio/config": "workspace:6.0.0-6-next.47",
"@verdaccio/logger": "workspace:6.0.0-6-next.15"
},
"scripts": {
"clean": "rimraf ./build",

View File

@@ -13,27 +13,27 @@
"homepage": "https://verdaccio.org",
"main": "index.js",
"devDependencies": {
"@types/react": "17.0.48",
"@types/react": "17.0.49",
"@types/react-autosuggest": "10.1.5",
"@types/react-dom": "17.0.17",
"@types/react-helmet": "6.1.5",
"@types/redux": "3.6.0",
"@types/react-router-dom": "5.3.3",
"@types/react-virtualized": "9.21.21",
"@emotion/react": "11.10.0",
"@emotion/react": "11.10.4",
"@emotion/jest": "11.10.0",
"@emotion/styled": "11.10.0",
"@emotion/styled": "11.10.4",
"@emotion/css": "11.10.0",
"@emotion/babel-plugin": "11.10.2",
"@mui/icons-material": "5.10.2",
"@mui/material": "5.10.2",
"@mui/styles": "5.10.2",
"@mui/icons-material": "5.10.3",
"@mui/material": "5.10.3",
"@mui/styles": "5.10.3",
"@rematch/core": "2.2.0",
"@rematch/loading": "2.1.2",
"@testing-library/dom": "8.17.1",
"@testing-library/jest-dom": "5.16.5",
"@testing-library/react": "12.1.5",
"@verdaccio/node-api": "workspace:6.0.0-6-next.35",
"@verdaccio/node-api": "workspace:6.0.0-6-next.47",
"@verdaccio/types": "workspace:*",
"babel-loader": "8.2.5",
"babel-plugin-dynamic-import-node": "2.3.3",
@@ -72,7 +72,7 @@
"redux": "4.2.0",
"rimraf": "3.0.2",
"raw-loader": "4.0.2",
"msw": "0.45.0",
"msw": "0.47.0",
"style-loader": "3.3.1",
"stylelint": "14.10.0",
"stylelint-config-recommended": "7.0.0",
@@ -80,7 +80,7 @@
"stylelint-processor-styled-components": "1.10.0",
"stylelint-webpack-plugin": "3.3.0",
"supertest": "6.2.4",
"terser-webpack-plugin": "5.3.5",
"terser-webpack-plugin": "5.3.6",
"url-loader": "4.1.1",
"validator": "13.7.0",
"webpack": "5.74.0",

View File

@@ -81,7 +81,9 @@ exports[`<Search /> component should load the component in default state 1`] = `
}
.emotion-2 .MuiOutlinedInput-root.MuiInputBase-sizeSmall {
padding: 6px;
padding-top: 6px;
padding-bottom: 6px;
padding-left: 6px;
}
.emotion-2 .MuiOutlinedInput-root.MuiInputBase-sizeSmall .MuiAutocomplete-input {

View File

@@ -199,6 +199,10 @@
"username": "dschaller",
"id": 1004789
},
{
"username": "zkochan",
"id": 1927579
},
{
"username": "semoal",
"id": 22656541
@@ -287,10 +291,6 @@
"username": "ddhp",
"id": 1715380
},
{
"username": "zkochan",
"id": 1927579
},
{
"username": "alexjurkiewicz",
"id": 379509
@@ -611,6 +611,10 @@
"username": "tiandrey",
"id": 152357
},
{
"username": "hafffe",
"id": 3322693
},
{
"username": "BarthV",
"id": 1901955
@@ -1047,6 +1051,10 @@
"username": "oeph",
"id": 2753218
},
{
"username": "okyanusoz",
"id": 46757266
},
{
"username": "robi-wan",
"id": 30210

View File

@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`<Author /> component should render the component in default state 1`] = `
Object {
{
"asFragment": [Function],
"baseElement": .emotion-0 {
list-style: none;
@@ -560,7 +560,7 @@ Object {
`;
exports[`<Author /> component should render the component when there is no author email 1`] = `
Object {
{
"asFragment": [Function],
"baseElement": .emotion-0 {
list-style: none;

View File

@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`<Spinner /> component should render the component in default state 1`] = `
Object {
{
"asFragment": [Function],
"baseElement": @keyframes animation-0 {
0% {

View File

@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`<Readme /> component should load the component in default state 1`] = `
Object {
{
"asFragment": [Function],
"baseElement": .emotion-0 {
background: #fff;

View File

@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`<UpLinks /> component should render the component when there is no uplink 1`] = `
Object {
{
"asFragment": [Function],
"baseElement": .emotion-0 {
margin: 0;
@@ -92,7 +92,7 @@ Object {
`;
exports[`<UpLinks /> component should render the component with uplinks 1`] = `
Object {
{
"asFragment": [Function],
"baseElement": .emotion-1 {
margin: 0;

View File

@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`test Developers should render the component for contributors with items 1`] = `
Object {
{
"asFragment": [Function],
"baseElement": .emotion-1 {
margin: 0;
@@ -304,7 +304,7 @@ Object {
`;
exports[`test Developers should render the component for maintainers with items 1`] = `
Object {
{
"asFragment": [Function],
"baseElement": .emotion-1 {
margin: 0;
@@ -607,7 +607,7 @@ Object {
`;
exports[`test Developers should render the component with no items 1`] = `
Object {
{
"asFragment": [Function],
"baseElement": <body>
<div />

View File

@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`<Dist /> component should render the component in default state 1`] = `
Object {
{
"asFragment": [Function],
"baseElement": .emotion-0 {
list-style: none;
@@ -640,7 +640,7 @@ Object {
`;
exports[`<Dist /> component should render the component with license as object 1`] = `
Object {
{
"asFragment": [Function],
"baseElement": .emotion-0 {
list-style: none;
@@ -1305,7 +1305,7 @@ Object {
`;
exports[`<Dist /> component should render the component with license as string 1`] = `
Object {
{
"asFragment": [Function],
"baseElement": .emotion-0 {
list-style: none;

View File

@@ -1,5 +1,26 @@
# @verdaccio/proxy
## 6.0.0-6-next.25
### Patch Changes
- @verdaccio/core@6.0.0-6-next.47
- @verdaccio/config@6.0.0-6-next.47
- @verdaccio/logger@6.0.0-6-next.15
- @verdaccio/local-storage@11.0.0-6-next.17
- @verdaccio/utils@6.0.0-6-next.15
## 6.0.0-6-next.24
### Patch Changes
- Updated dependencies [b849128d]
- @verdaccio/core@6.0.0-6-next.8
- @verdaccio/config@6.0.0-6-next.17
- @verdaccio/logger@6.0.0-6-next.14
- @verdaccio/local-storage@11.0.0-6-next.16
- @verdaccio/utils@6.0.0-6-next.14
## 6.0.0-6-next.23
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@verdaccio/proxy",
"version": "6.0.0-6-next.23",
"version": "6.0.0-6-next.25",
"description": "verdaccio proxy fetcher",
"main": "./build/index.js",
"types": "build/index.d.ts",
@@ -39,11 +39,11 @@
"build": "pnpm run build:js && pnpm run build:types"
},
"dependencies": {
"@verdaccio/config": "workspace:6.0.0-6-next.16",
"@verdaccio/core": "workspace:6.0.0-6-next.7",
"@verdaccio/local-storage": "workspace:11.0.0-6-next.15",
"@verdaccio/logger": "workspace:6.0.0-6-next.13",
"@verdaccio/utils": "workspace:6.0.0-6-next.13",
"@verdaccio/config": "workspace:6.0.0-6-next.47",
"@verdaccio/core": "workspace:6.0.0-6-next.47",
"@verdaccio/local-storage": "workspace:11.0.0-6-next.17",
"@verdaccio/logger": "workspace:6.0.0-6-next.15",
"@verdaccio/utils": "workspace:6.0.0-6-next.15",
"JSONStream": "1.3.5",
"debug": "4.3.4",
"lodash": "4.17.21",
@@ -53,7 +53,7 @@
},
"devDependencies": {
"@types/node": "16.11.56",
"@verdaccio/types": "workspace:11.0.0-6-next.15",
"@verdaccio/types": "workspace:11.0.0-6-next.16",
"get-stream": "^6.0.1",
"nock": "13.2.9",
"node-mocks-http": "1.11.0",

View File

@@ -1,5 +1,38 @@
# @verdaccio/server
## 6.0.0-6-next.36
### Patch Changes
- @verdaccio/core@6.0.0-6-next.47
- @verdaccio/config@6.0.0-6-next.47
- @verdaccio/api@6.0.0-6-next.30
- @verdaccio/auth@6.0.0-6-next.26
- @verdaccio/loaders@6.0.0-6-next.16
- @verdaccio/logger@6.0.0-6-next.15
- @verdaccio/middleware@6.0.0-6-next.26
- @verdaccio/store@6.0.0-6-next.27
- @verdaccio/utils@6.0.0-6-next.15
- @verdaccio/web@6.0.0-6-next.34
- verdaccio-audit@11.0.0-6-next.10
## 6.0.0-6-next.35
### Patch Changes
- Updated dependencies [b849128d]
- @verdaccio/api@6.0.0-6-next.29
- @verdaccio/core@6.0.0-6-next.8
- @verdaccio/store@6.0.0-6-next.26
- @verdaccio/web@6.0.0-6-next.33
- @verdaccio/auth@6.0.0-6-next.25
- @verdaccio/config@6.0.0-6-next.17
- @verdaccio/loaders@6.0.0-6-next.15
- @verdaccio/logger@6.0.0-6-next.14
- @verdaccio/middleware@6.0.0-6-next.25
- @verdaccio/utils@6.0.0-6-next.14
- verdaccio-audit@11.0.0-6-next.10
## 6.0.0-6-next.34
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@verdaccio/server",
"version": "6.0.0-6-next.34",
"version": "6.0.0-6-next.36",
"description": "server logic",
"main": "./build/index.js",
"types": "build/index.d.ts",
@@ -30,16 +30,16 @@
"npm": ">=6"
},
"dependencies": {
"@verdaccio/api": "workspace:6.0.0-6-next.28",
"@verdaccio/auth": "workspace:6.0.0-6-next.24",
"@verdaccio/core": "workspace:6.0.0-6-next.7",
"@verdaccio/config": "workspace:6.0.0-6-next.16",
"@verdaccio/loaders": "workspace:6.0.0-6-next.14",
"@verdaccio/logger": "workspace:6.0.0-6-next.13",
"@verdaccio/middleware": "workspace:6.0.0-6-next.24",
"@verdaccio/store": "workspace:6.0.0-6-next.25",
"@verdaccio/utils": "workspace:6.0.0-6-next.13",
"@verdaccio/web": "workspace:6.0.0-6-next.32",
"@verdaccio/api": "workspace:6.0.0-6-next.30",
"@verdaccio/auth": "workspace:6.0.0-6-next.26",
"@verdaccio/core": "workspace:6.0.0-6-next.47",
"@verdaccio/config": "workspace:6.0.0-6-next.47",
"@verdaccio/loaders": "workspace:6.0.0-6-next.16",
"@verdaccio/logger": "workspace:6.0.0-6-next.15",
"@verdaccio/middleware": "workspace:6.0.0-6-next.26",
"@verdaccio/store": "workspace:6.0.0-6-next.27",
"@verdaccio/utils": "workspace:6.0.0-6-next.15",
"@verdaccio/web": "workspace:6.0.0-6-next.34",
"verdaccio-audit": "workspace:11.0.0-6-next.10",
"compression": "1.7.4",
"cors": "2.8.5",
@@ -50,8 +50,8 @@
},
"devDependencies": {
"@types/node": "16.11.56",
"@verdaccio/proxy": "workspace:6.0.0-6-next.23",
"@verdaccio/test-helper": "workspace:1.1.0-6-next.3",
"@verdaccio/proxy": "workspace:6.0.0-6-next.25",
"@verdaccio/test-helper": "workspace:1.1.0-6-next.4",
"http-errors": "1.8.1"
},
"scripts": {

View File

@@ -1,5 +1,31 @@
# @verdaccio/server-fastify
## 6.0.0-6-next.28
### Patch Changes
- @verdaccio/core@6.0.0-6-next.47
- @verdaccio/config@6.0.0-6-next.47
- @verdaccio/auth@6.0.0-6-next.26
- @verdaccio/tarball@11.0.0-6-next.16
- @verdaccio/logger@6.0.0-6-next.15
- @verdaccio/store@6.0.0-6-next.27
- @verdaccio/utils@6.0.0-6-next.15
## 6.0.0-6-next.27
### Patch Changes
- Updated dependencies [b849128d]
- @verdaccio/core@6.0.0-6-next.8
- @verdaccio/store@6.0.0-6-next.26
- @verdaccio/auth@6.0.0-6-next.25
- @verdaccio/config@6.0.0-6-next.17
- @verdaccio/tarball@11.0.0-6-next.15
- @verdaccio/logger@6.0.0-6-next.14
- @verdaccio/utils@6.0.0-6-next.14
- @verdaccio/readme@11.0.0-6-next.6
## 6.0.0-6-next.26
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@verdaccio/server-fastify",
"version": "6.0.0-6-next.26",
"version": "6.0.0-6-next.28",
"description": "fastify server api implementation",
"keywords": [
"private",
@@ -34,13 +34,13 @@
"access": "public"
},
"dependencies": {
"@verdaccio/core": "workspace:6.0.0-6-next.7",
"@verdaccio/config": "workspace:6.0.0-6-next.16",
"@verdaccio/auth": "workspace:6.0.0-6-next.24",
"@verdaccio/logger": "workspace:6.0.0-6-next.13",
"@verdaccio/store": "workspace:6.0.0-6-next.25",
"@verdaccio/tarball": "workspace:11.0.0-6-next.14",
"@verdaccio/utils": "workspace:6.0.0-6-next.13",
"@verdaccio/core": "workspace:6.0.0-6-next.47",
"@verdaccio/config": "workspace:6.0.0-6-next.47",
"@verdaccio/auth": "workspace:6.0.0-6-next.26",
"@verdaccio/logger": "workspace:6.0.0-6-next.15",
"@verdaccio/store": "workspace:6.0.0-6-next.27",
"@verdaccio/tarball": "workspace:11.0.0-6-next.16",
"@verdaccio/utils": "workspace:6.0.0-6-next.15",
"@verdaccio/readme": "workspace:11.0.0-6-next.6",
"core-js": "3.25.0",
"debug": "4.3.4",
@@ -50,7 +50,7 @@
},
"devDependencies": {
"@types/node": "16.11.56",
"@verdaccio/types": "workspace:11.0.0-6-next.15",
"@verdaccio/types": "workspace:11.0.0-6-next.16",
"ts-node": "10.9.1"
},
"scripts": {

View File

@@ -32,7 +32,7 @@
"homepage": "https://verdaccio.org",
"license": "MIT",
"devDependencies": {
"@verdaccio/cli": "workspace:6.0.0-6-next.37",
"@verdaccio/cli": "workspace:6.0.0-6-next.47",
"@verdaccio/ui-theme": "workspace:6.0.0-6-next.28",
"fs-extra": "10.1.0",
"webpack": "5.74.0",

View File

@@ -1,5 +1,37 @@
# @verdaccio/store
## 6.0.0-6-next.27
### Patch Changes
- @verdaccio/core@6.0.0-6-next.47
- @verdaccio/config@6.0.0-6-next.47
- @verdaccio/tarball@11.0.0-6-next.16
- @verdaccio/url@11.0.0-6-next.13
- @verdaccio/hooks@6.0.0-6-next.17
- @verdaccio/loaders@6.0.0-6-next.16
- @verdaccio/logger@6.0.0-6-next.15
- @verdaccio/local-storage@11.0.0-6-next.17
- @verdaccio/proxy@6.0.0-6-next.25
- @verdaccio/utils@6.0.0-6-next.15
## 6.0.0-6-next.26
### Patch Changes
- b849128d: fix: handle upload scoped tarball
- Updated dependencies [b849128d]
- @verdaccio/core@6.0.0-6-next.8
- @verdaccio/config@6.0.0-6-next.17
- @verdaccio/tarball@11.0.0-6-next.15
- @verdaccio/url@11.0.0-6-next.12
- @verdaccio/hooks@6.0.0-6-next.16
- @verdaccio/loaders@6.0.0-6-next.15
- @verdaccio/logger@6.0.0-6-next.14
- @verdaccio/local-storage@11.0.0-6-next.16
- @verdaccio/proxy@6.0.0-6-next.24
- @verdaccio/utils@6.0.0-6-next.14
## 6.0.0-6-next.25
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@verdaccio/store",
"version": "6.0.0-6-next.25",
"version": "6.0.0-6-next.27",
"description": "loaders logic",
"main": "./build/index.js",
"types": "build/index.d.ts",
@@ -39,16 +39,16 @@
"build": "pnpm run build:js && pnpm run build:types"
},
"dependencies": {
"@verdaccio/config": "workspace:6.0.0-6-next.16",
"@verdaccio/core": "workspace:6.0.0-6-next.7",
"@verdaccio/hooks": "workspace:6.0.0-6-next.15",
"@verdaccio/loaders": "workspace:6.0.0-6-next.14",
"@verdaccio/local-storage": "workspace:11.0.0-6-next.15",
"@verdaccio/logger": "workspace:6.0.0-6-next.13",
"@verdaccio/proxy": "workspace:6.0.0-6-next.23",
"@verdaccio/url": "workspace:11.0.0-6-next.11",
"@verdaccio/utils": "workspace:6.0.0-6-next.13",
"@verdaccio/tarball": "workspace:11.0.0-6-next.14",
"@verdaccio/config": "workspace:6.0.0-6-next.47",
"@verdaccio/core": "workspace:6.0.0-6-next.47",
"@verdaccio/hooks": "workspace:6.0.0-6-next.17",
"@verdaccio/loaders": "workspace:6.0.0-6-next.16",
"@verdaccio/local-storage": "workspace:11.0.0-6-next.17",
"@verdaccio/logger": "workspace:6.0.0-6-next.15",
"@verdaccio/proxy": "workspace:6.0.0-6-next.25",
"@verdaccio/url": "workspace:11.0.0-6-next.13",
"@verdaccio/utils": "workspace:6.0.0-6-next.15",
"@verdaccio/tarball": "workspace:11.0.0-6-next.16",
"JSONStream": "1.3.5",
"debug": "4.3.4",
"lodash": "4.17.21",
@@ -57,8 +57,8 @@
},
"devDependencies": {
"@types/node": "16.11.56",
"@verdaccio/types": "workspace:11.0.0-6-next.15",
"@verdaccio/test-helper": "workspace:1.1.0-6-next.3",
"@verdaccio/types": "workspace:11.0.0-6-next.16",
"@verdaccio/test-helper": "workspace:1.1.0-6-next.4",
"undici": "4.16.0",
"nock": "13.2.9",
"node-mocks-http": "1.11.0",

View File

@@ -1,7 +1,8 @@
import assert from 'assert';
import buildDebug from 'debug';
import _, { isEmpty, isNil } from 'lodash';
import { PassThrough, Readable, Transform, Writable, pipeline as streamPipeline } from 'stream';
import { basename } from 'path';
import { PassThrough, Readable, Transform, pipeline as streamPipeline } from 'stream';
import { pipeline } from 'stream/promises';
import { default as URL } from 'url';
@@ -961,7 +962,7 @@ class Storage {
// if (typeof storage === 'undefined') {
// throw errorUtils.getNotFound();
// }
throw errorUtils.getInternalError('no implemenation ready for npm deprecate');
throw errorUtils.getInternalError('no implementation ready for npm deprecate');
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -972,7 +973,7 @@ class Storage {
// throw errorUtils.getNotFound();
// }
throw errorUtils.getInternalError('no implemenation ready for npm star');
throw errorUtils.getInternalError('no implementation ready for npm star');
}
/**
@@ -1060,9 +1061,9 @@ class Storage {
debug('%s version %s already exists', name, versionToPublish);
throw errorUtils.getConflict();
}
const uplinksLook = this.config?.publish?.allow_offline === false;
// if execution get here, package does not exist locally, we search upstream
const remoteManifest = await this.checkPackageRemote(name, this.isAllowPublishOffline());
const remoteManifest = await this.checkPackageRemote(name, uplinksLook);
if (remoteManifest?.versions[versionToPublish] != null) {
debug('%s version %s already exists', name, versionToPublish);
throw errorUtils.getConflict();
@@ -1112,7 +1113,7 @@ class Storage {
// 3. upload the tarball to the storage
try {
const readable = Readable.from(buffer);
await this.uploadTarball(name, firstAttachmentKey, readable, {
await this.uploadTarball(name, basename(firstAttachmentKey), readable, {
signal: options.signal,
});
} catch (err: any) {
@@ -1148,43 +1149,46 @@ class Storage {
* @param options
* @returns
*/
public async uploadTarball(
public uploadTarball(
name: string,
fileName: string,
contentReadable: Readable,
{ signal }
): Promise<void> {
return new Promise((resolve, reject) => {
(async () => {
const stream: Writable = await this.uploadTarballAsStream(name, fileName, {
signal,
this.uploadTarballAsStream(name, fileName, {
signal,
})
.then((stream) => {
stream.on('error', (err) => {
debug(
'error on stream a tarball %o for %o with error %o',
'foo.tar.gz',
name,
err.message
);
reject(err);
});
stream.on('success', () => {
this.logger.debug(
{ fileName, name },
'file @{fileName} for package @{name} has been successfully uploaded'
);
resolve();
});
return stream;
})
.then((stream) => {
pipeline(contentReadable, stream, { signal })
.then(() => {
debug('success pipe upload tarball');
})
.catch(reject);
});
stream.on('error', (err) => {
debug(
'error on stream a tarball %o for %o with error %o',
'foo.tar.gz',
name,
err.message
);
reject(err);
});
stream.on('success', () => {
this.logger.debug(
{ fileName, name },
'file @{fileName} for package @{name} has been succesfully uploaded'
);
resolve();
});
await pipeline(contentReadable, stream, { signal });
})().catch((err) => {
reject(err);
});
});
}
public async uploadTarballAsStream(
private async uploadTarballAsStream(
pkgName: string,
filename: string,
{ signal }
@@ -1395,14 +1399,6 @@ class Storage {
}
}
private isAllowPublishOffline(): boolean {
return (
typeof this.config.publish !== 'undefined' &&
_.isBoolean(this.config.publish.allow_offline) &&
this.config.publish.allow_offline
);
}
/**
*
* @param name package name
@@ -1567,8 +1563,8 @@ class Storage {
A package requires uplinks syncronization if enables the proxy section, uplinks
can be more than one, the more are the most slow request will take, the request
are made in serie and if 1st call fails, the second will be triggered, otherwise
the 1st will reply and others will be discareded. The order is important.
are made in serial and if 1st call fails, the second will be triggered, otherwise
the 1st will reply and others will be discarded. The order is important.
Errors on upkinks are considered are, time outs, connection fails and http status 304,
in that case the request returns empty body and we want ask next on the list if has fresh

View File

@@ -668,8 +668,9 @@ describe('storage', () => {
});
test.todo('should handle double proxy with last one success');
});
describe('options', () => {
test('should handle disable uplinks via options.uplinksLook=false', async () => {
test('should handle disable uplinks via options.uplinksLook=false with cache', async () => {
const fooManifest = generatePackageMetadata('foo', '8.0.0');
nock('https://registry.verdaccio.org').get('/foo').reply(201, manifestFooRemoteNpmjs);
const config = new Config(
@@ -691,6 +692,35 @@ describe('storage', () => {
expect((response as Manifest).name).toEqual(fooManifest.name);
expect((response as Manifest)[DIST_TAGS].latest).toEqual('8.0.0');
});
test('should handle disable uplinks via options.uplinksLook=false without cache', async () => {
const fooRemoteManifest = generateRemotePackageMetadata(
'foo',
'9.0.0',
'https://registry.verdaccio.org',
['9.0.0', '9.0.1', '9.0.2', '9.0.3']
);
nock('https://registry.verdaccio.org').get('/foo').reply(201, fooRemoteManifest);
const config = new Config(
configExample(
{
...getDefaultConfig(),
storage: generateRandomStorage(),
},
'./fixtures/config/syncSingleUplinksMetadata.yaml',
__dirname
)
);
const storage = new Storage(config);
await storage.init(config);
const [response] = await storage.syncUplinksMetadataNext('foo', null, {
uplinksLook: true,
});
expect((response as Manifest).name).toEqual('foo');
expect((response as Manifest)[DIST_TAGS].latest).toEqual('9.0.0');
});
});
});

View File

@@ -5,8 +5,8 @@
"main": "./build/index.js",
"types": "build/index.d.ts",
"dependencies": {
"@docusaurus/types": "2.0.1 ",
"@docusaurus/utils": "2.0.1 "
"@docusaurus/types": "2.1.0",
"@docusaurus/utils": "2.1.0"
},
"scripts": {
"clean": "rimraf ./build",

View File

@@ -3,11 +3,11 @@
{
"id": 558752,
"login": "juanpicado",
"contributions": 4809,
"contributions": 4815,
"repositories": [
{
"name": "verdaccio",
"contributions": 2580
"contributions": 2586
},
{
"name": "verdaccio-cookbook",
@@ -910,6 +910,21 @@
}
]
},
{
"id": 1927579,
"login": "zkochan",
"contributions": 4,
"repositories": [
{
"name": "verdaccio",
"contributions": 3
},
{
"name": "website",
"contributions": 1
}
]
},
{
"id": 22656541,
"login": "semoal",
@@ -1200,21 +1215,6 @@
}
]
},
{
"id": 1927579,
"login": "zkochan",
"contributions": 3,
"repositories": [
{
"name": "verdaccio",
"contributions": 2
},
{
"name": "website",
"contributions": 1
}
]
},
{
"id": 379509,
"login": "alexjurkiewicz",
@@ -2183,6 +2183,17 @@
}
]
},
{
"id": 3322693,
"login": "hafffe",
"contributions": 1,
"repositories": [
{
"name": "verdaccio",
"contributions": 1
}
]
},
{
"id": 1901955,
"login": "BarthV",
@@ -3382,6 +3393,17 @@
}
]
},
{
"id": 46757266,
"login": "okyanusoz",
"contributions": 1,
"repositories": [
{
"name": "verdaccio",
"contributions": 1
}
]
},
{
"id": 30210,
"login": "robi-wan",
@@ -4666,7 +4688,7 @@
"full_name": "verdaccio/verdaccio",
"html_url": "https://github.com/verdaccio/verdaccio",
"description": "📦🔐 A lightweight Node.js private proxy registry",
"stargazers_count": 13814,
"stargazers_count": 13826,
"archived": false
},
{

View File

@@ -1,5 +1,11 @@
# Change Log
## 1.1.0-6-next.4
### Patch Changes
- b849128d: fix: handle upload scoped tarball
## 1.1.0-6-next.3
### Patch Changes

View File

@@ -0,0 +1,10 @@
const config = require('../../../jest/config');
module.exports = Object.assign({}, config, {
coverageThreshold: {
global: {
// FIXME: increase to 90
lines: 50,
},
},
});

View File

@@ -1,6 +1,6 @@
{
"name": "@verdaccio/test-helper",
"version": "1.1.0-6-next.3",
"version": "1.1.0-6-next.4",
"private": true,
"description": "test helpers",
"author": "Juan Picado <juanpicado19@gmail.com>",
@@ -9,12 +9,12 @@
"main": "build/index.js",
"types": "build/index.d.ts",
"devDependencies": {
"@verdaccio/types": "workspace:11.0.0-6-next.15",
"@verdaccio/auth": "workspace:6.0.0-6-next.24",
"@verdaccio/core": "workspace:6.0.0-6-next.7",
"@verdaccio/config": "workspace:6.0.0-6-next.16",
"@verdaccio/middleware": "workspace:6.0.0-6-next.24",
"@verdaccio/utils": "workspace:6.0.0-6-next.13",
"@verdaccio/types": "workspace:11.0.0-6-next.16",
"@verdaccio/auth": "workspace:6.0.0-6-next.26",
"@verdaccio/core": "workspace:6.0.0-6-next.47",
"@verdaccio/config": "workspace:6.0.0-6-next.47",
"@verdaccio/middleware": "workspace:6.0.0-6-next.26",
"@verdaccio/utils": "workspace:6.0.0-6-next.15",
"body-parser": "1.20.0",
"express": "4.18.1",
"supertest": "6.2.4",

View File

@@ -1,4 +1,4 @@
import { GenericBody, Manifest } from '@verdaccio/types';
import { FullRemoteManifest, GenericBody, Manifest, Version, Versions } from '@verdaccio/types';
export interface DistTags {
[key: string]: string;
@@ -49,7 +49,7 @@ export function addNewVersion(
};
// update the latest with the new version
newManifest['dist-tags'] = { latest: version };
// add new version does not need attachmetns
// add new version does not need attachments
if (isRemote) {
newManifest._distfiles = {
...newManifest._distfiles,
@@ -137,58 +137,83 @@ export function generateLocalPackageMetadata(
export function generateRemotePackageMetadata(
pkgName: string,
version = '1.0.0',
domain: string = 'http://localhost:5555'
): Manifest {
domain: string = 'http://localhost:5555',
versions: string[] = []
): FullRemoteManifest {
// @ts-ignore
const generateVersion = (version: string): Version => {
const metadata = {
name: pkgName,
version: version,
description: 'package generated',
main: 'index.js',
scripts: {
test: 'echo "Error: no test specified" && exit 1',
},
keywords: [],
author: {
name: 'User NPM',
email: 'user@domain.com',
},
license: 'ISC',
dependencies: {
verdaccio: '^2.7.2',
},
readme: '# test',
readmeFilename: 'README.md',
_id: `${pkgName}@${version}`,
_npmVersion: '5.5.1',
_npmUser: {
name: 'foo',
},
dist: {
integrity:
'sha512-6gHiERpiDgtb3hjqpQH5/i7zRmvYi9pmCjQf2ZMy3QEa9wVk9RgdZaPWUt7ZOnWUPFjcr9cm' +
'E6dUBf+XoPoH4g==',
shasum: '2c03764f651a9f016ca0b7620421457b619151b9', // pragma: allowlist secret
tarball: `${domain}\/${pkgName}\/-\/${getTarball(pkgName)}-${version}.tgz`,
},
};
return metadata;
};
const mappedVersions: Versions = versions.reduce((acc, v) => {
acc[v] = generateVersion(v);
return acc;
}, {});
const mappedTimes: GenericBody = versions.reduce((acc, v) => {
const date = new Date(Date.now());
acc[v] = date.toISOString();
return acc;
}, {});
return {
_id: pkgName,
name: pkgName,
description: '',
'dist-tags': { ['latest']: version },
versions: {
[version]: {
name: pkgName,
version: version,
description: 'package generated',
main: 'index.js',
scripts: {
test: 'echo "Error: no test specified" && exit 1',
},
keywords: [],
author: {
name: 'User NPM',
email: 'user@domain.com',
},
license: 'ISC',
dependencies: {
verdaccio: '^2.7.2',
},
readme: '# test',
readmeFilename: 'README.md',
_id: `${pkgName}@${version}`,
_npmVersion: '5.5.1',
_npmUser: {
name: 'foo',
},
dist: {
integrity:
'sha512-6gHiERpiDgtb3hjqpQH5/i7zRmvYi9pmCjQf2ZMy3QEa9wVk9RgdZaPWUt7ZOnWUPFjcr9cm' +
'E6dUBf+XoPoH4g==',
shasum: '2c03764f651a9f016ca0b7620421457b619151b9', // pragma: allowlist secret
tarball: `${domain}\/${pkgName}\/-\/${getTarball(pkgName)}-${version}.tgz`,
},
[version]: generateVersion(version),
...mappedVersions,
},
time: {
modified: '2019-06-13T06:44:45.747Z',
created: '2019-06-13T06:44:45.747Z',
[version]: '2019-06-13T06:44:45.747Z',
...mappedTimes,
},
maintainers: [
{
name: 'foo',
email: 'foo@foo.com',
},
],
author: {
name: 'foo',
},
readme: '# test',
_attachments: {},
_uplinks: {},
_distfiles: {
[`${pkgName}-${version}.tgz`]: {
url: `${domain}/${pkgName}\/-\/${getTarball(pkgName)}-${version}.tgz`,
sha: '2c03764f651a9f016ca0b7620421457b619151b9', // pragma: allowlist secret
},
},
_rev: '',
_rev: '12-c8fe8a9c79fa57a87347a0213e6f2548',
};
}

View File

@@ -1,3 +0,0 @@
const config = require('../../jest/config');
module.exports = Object.assign({}, config, {});

View File

@@ -35,27 +35,27 @@ describe('generate metadata', () => {
});
describe('generateRemotePackageMetadata', () => {
test('should generate package metadata', () => {
const m = generateRemotePackageMetadata('foo', '1.0.0', 'https://registry.verdaccio.org');
expect(m).toBeDefined();
expect(m._attachments).toEqual({});
expect(m._distfiles['foo-1.0.0.tgz']).toEqual({
sha: '2c03764f651a9f016ca0b7620421457b619151b9',
url: 'https://registry.verdaccio.org/foo/-/foo-1.0.0.tgz',
});
expect(
generateRemotePackageMetadata('foo', '1.0.0', 'https://registry.verdaccio.org')
).toBeDefined();
});
test('should add new versions remote', () => {
const manifest = generateRemotePackageMetadata('foo', '1.0.0');
const m1 = addNewVersion(manifest, '1.0.1', true);
expect(Object.keys(m1._attachments)).toEqual([]);
expect(Object.keys(m1._distfiles)).toEqual(['foo-1.0.0.tgz', 'foo-1.0.1.tgz']);
const m2 = addNewVersion(m1, '1.0.2');
expect(Object.keys(m2.versions)).toEqual(['1.0.0', '1.0.1', '1.0.2']);
expect(m2['dist-tags'].latest).toEqual('1.0.2');
expect(m2._distfiles['foo-1.0.2.tgz']).toEqual({
sha: '2c03764f651a9f016ca0b7620421457b619151b9',
url: 'http://localhost:5555/foo/-/foo-1.0.2.tgz',
});
expect(Object.keys(m2._attachments)).toEqual([]);
test('should generate package metadata with multiple versions', () => {
const m = generateRemotePackageMetadata('foo', '1.0.0', 'https://registry.verdaccio.org', [
'1.0.1',
'1.0.2',
'3.0.0',
]);
expect(m).toBeDefined();
expect(Object.keys(m.versions)).toEqual(['1.0.0', '1.0.1', '1.0.2', '3.0.0']);
expect(Object.keys(m.time)).toEqual([
'modified',
'created',
'1.0.0',
'1.0.1',
'1.0.2',
'3.0.0',
]);
});
});
describe('generateLocalPackageMetadata', () => {

View File

@@ -1 +1,7 @@
declare module 'jest-matcher-utils';
declare module 'pretty-format' {
export type Plugin = any;
}
declare module '@jest/schemas' {
export type SnapshotFormat = any;
}

View File

@@ -0,0 +1,3 @@
{
"extends": "../../../.babelrc"
}

View File

@@ -0,0 +1,3 @@
node_modules
coverage/
lib/

View File

@@ -0,0 +1 @@
lib/

View File

@@ -0,0 +1,7 @@
# @verdaccio/local-publish
## 0.0.2-6-next.0
### Patch Changes
- b849128d: fix: handle upload scoped tarball

View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2019 Verdaccio
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -0,0 +1,22 @@
{
"name": "@verdaccio/local-publish",
"version": "0.0.2-6-next.0",
"private": true,
"description": "trigger server for local development",
"author": "Juan Picado <juanpicado19@gmail.com>",
"license": "MIT",
"homepage": "https://verdaccio.org",
"main": "build/index.js",
"types": "build/index.d.ts",
"devDependencies": {
"@verdaccio/types": "workspace:11.0.0-6-next.16",
"@verdaccio/core": "workspace:6.0.0-6-next.47",
"@verdaccio/config": "workspace:6.0.0-6-next.47",
"verdaccio": "6.0.0-6-next.47",
"ts-node": "10.9.1"
},
"scripts": {
"start": "ts-node src/index.ts",
"build": "echo 0"
}
}

View File

@@ -0,0 +1,5 @@
{
"rules": {
"no-console": 0
}
}

View File

@@ -0,0 +1,52 @@
import { runServer } from 'verdaccio';
import { ConfigBuilder } from '@verdaccio/config';
import { constants, fileUtils } from '@verdaccio/core';
fileUtils
.createTempFolder('test')
.then((folderPath) => {
const configuration = ConfigBuilder.build({
storage: folderPath,
// @ts-ignore
logs: { level: 'info', type: 'stdout', format: 'pretty' },
uplinks: {},
packages: {},
self_path: folderPath,
})
.addUplink('npmjs', { url: 'https://registry.npmjs.org' })
.addPackageAccess('@verdaccio/*', {
access: constants.ROLES.$ANONYMOUS,
publish: constants.ROLES.$ANONYMOUS,
})
.addPackageAccess(constants.PACKAGE_ACCESS.SCOPE, {
access: constants.ROLES.$ANONYMOUS,
publish: constants.ROLES.$ANONYMOUS,
proxy: 'npmjs',
})
.addPackageAccess('verdaccio', {
access: constants.ROLES.$ANONYMOUS,
publish: constants.ROLES.$ANONYMOUS,
})
.addPackageAccess('verdaccio-*', {
access: constants.ROLES.$ANONYMOUS,
publish: constants.ROLES.$ANONYMOUS,
})
.addPackageAccess(constants.PACKAGE_ACCESS.ALL, {
access: constants.ROLES.$ALL,
publish: constants.ROLES.$ALL,
proxy: 'npmjs',
})
.addAuth({
htpasswd: {
file: './htpasswd',
},
});
return runServer(configuration.getConfig());
})
.then((app: any) => {
app.listen(4873, () => {
console.log('running verdaccio@5 server');
});
})
.catch(console.error);

View File

@@ -0,0 +1,10 @@
{
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"rootDir": "./src",
"outDir": "./build",
"preserveSymlinks": true
},
"include": ["src/**/*.ts"],
"exclude": ["src/**/*.test.ts"]
}

Some files were not shown because too many files have changed in this diff Show More