markus markus
  • Joined on 2018-08-29

@package-registry-npm-test/package-registry-npm-test (6.6.6)

Published 2022-08-04 13:41:37 +02:00 by markus

Installation

@package-registry-npm-test:registry=
npm install @package-registry-npm-test/package-registry-npm-test@6.6.6
"@package-registry-npm-test/package-registry-npm-test": "6.6.6"

About this package

package-registry-npm-test

A minimal example of how to publish and use npm packages with the gitea npm package registry.

Use the gitea npm registry

Get a personal access token (or https://git.rkcsd.com/user/settings/applications):

curl -XPOST -H "Content-Type: application/json"  -k -d '{"name":"npm"}' \
    -u {username}:{password} https://gitea.your.host/api/v1/users/{username}/tokens

Setup the private registry:

# Tell npm which registry to use for the scope
npm config set @package-registry-npm-test:registry https://git.rkcsd.com/api/packages/{owner}/npm/
# Tell npm how to authenticate for the registry
npm config set -- '//git.rkcsd.com/api/packages/{owner}/npm/:_authToken' "{token}"

Note that the visibility of the package is tied to the visibility of the owner, which is always a user or organization.

See https://github.com/go-gitea/gitea/issues/20596

Publish to the package registry

Publish from the root of the package:

npm publish

Note that files that are listed in .npmignore are not published. If a .npmignore does NOT exist .gitignore is used like .npmignore.

Install from the package registry

Install the package:

npm install -g @package-registry-npm-test/package-registry-npm-test@6.6.6

Verify this README did not lie to you (npm is a confusing mess and npm link does not link the binary automatically for me; look for the package in $NPM_CONFIG_PREFIX/libs):

$ package-registry-npm-test
hello world

Drone CI

Build Status

Refer to the .drone.yml for additional information.

Details
npm
2022-08-04 13:41:37 +02:00
22
Jonas Kattendick
MIT
latest
1.5 KiB
Assets (1)
Versions (1) View all
6.6.6 2022-08-04