Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove private GitHub package registry usage #123

Merged
merged 4 commits into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,4 @@ enableGlobalCache: false

nodeLinker: node-modules

npmScopes:
siteimprove:
npmRegistryServer: "https://npm.pkg.github.com"

yarnPath: .yarn/releases/yarn-4.6.0.cjs
31 changes: 1 addition & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,37 +16,8 @@ This repository contains a Command Line Interface for Alfa.

### Setup

To build the project, a recent version of [Node.js](https://nodejs.org/en/) is required in addition to the [Yarn](https://yarnpkg.com/) package manager. Once installed, login to the `@siteimprove` scope, if you aren't already, to ensure that all dependencies can be fetched:
To build the project, a recent version of [Node.js](https://nodejs.org/en/) is required in addition to the [Yarn](https://yarnpkg.com/) package manager. Once installed, do:

```sh
yarn npm login --scope siteimprove
```

> :warning: This command must be run from the root of the repository as the registry address of the `@siteimprove` scope is defined in the [local Yarn configuration](.yarnrc.yml).

You will be prompted for your GitHub username and a personal access token. If you don't already have an access token, [generate a new one](https://github.com/settings/tokens/new "Generate a personal access token") with the `read:packages` permission and paste it into the prompt.


>- **If that does not work** run
> ```
> yarn config set --home "npmRegistries['https://npm.pkg.github.com'].npmAuthToken" <your-token>
> ```
> It will create a file `.yarnrc.yml` on your machine. This is a private file for your user, only. It will most likely be saved in a path like `C:\Users\<username>\.yarnrc.yml`
>
> - **If that fails** and the file content is different than the below code then you can manually update the file. MAKE SURE to edit your own `.yarnrc.yml` file, not the one in this repository. The reason is because your `npmAuthTokens` should never be committed to a shared repository - keep it secret on your local machine.
>
> ```
> npmRegistries:
> "https://npm.pkg.github.com":
> npmAuthToken: <your-token>
>
> npmScopes:
> siteimprove:
> npmAuthToken: <your-token>
> ```

Once authenticated, do:

```sh
yarn install
```
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"@changesets/cli": "^2.26.1",
"@microsoft/api-documenter": "^7.25.3",
"@microsoft/api-extractor": "^7.47.0",
"@siteimprove/alfa-cli": "workspace:^0.76.2",
"@siteimprove/alfa-cli": "workspace:^",
"@siteimprove/alfa-toolchain": "^0.97.0",
"@types/async": "^3.2.5",
"@types/node": "^20.14.9",
Expand Down
8 changes: 0 additions & 8 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["config:base", "github>siteimprove/alfa//config/alfa-renovate"],
"npmrc": "@siteimprove:registry=https://npm.pkg.github.com/",
"hostRules": [
{
"hostType": "npm",
"matchHost": "https://npm.pkg.github.com/",
"token": "{{ secrets.RENOVATE_TOKEN }}"
}
],
"packageRules": [
{
"description": [
Expand Down
Loading
Loading