Skip to content

Commit

Permalink
fix(utils): bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
jackdbd committed May 18, 2022
1 parent fd700d2 commit a11bec9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 77 deletions.
48 changes: 2 additions & 46 deletions packages/checks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,52 +2,8 @@

Functions to check inputs (i.e. predicates).

## Build

Build this library:

```sh
npm run build -w packages/checks
```

## Test

```sh
npm run test -w packages/checks
```

## Publish

### Artifact Registry
## Installation

```sh
npm run publish:artifact-registry -w packages/checks
npm install @jackdbd/checks
```

Check that the correct version of this package is now published on Artifact Registry:

```sh
gcloud artifacts versions list \
--project $GCP_PROJECT_ID \
--repository $ARTIFACT_REGISTRY_NPM_REPOSITORY_ID \
--location $ARTIFACT_REGISTRY_NPM_REPOSITORY_LOCATION \
--package @jackdbd/checks
```

### npmjs

Download a package previously published to Artifact Registry, and publish it to [npmjs](https://www.npmjs.com/) too:

```sh
# refresh the token for Artifact Registry
npx google-artifactregistry-auth --repo-config .npmrc --credential-config ~/.npmrc

# https://stackoverflow.com/a/10856211/3036129
(export PACKAGE=checks; VERSION=$(cat ./packages/$PACKAGE/package.json | jq '.version' | sed -e 's/"//g'); ./scripts/publish/artifact-registry-to-npm.sh jackdbd $PACKAGE $VERSION)
```

[Unpublish](https://docs.npmjs.com/policies/unpublish) a version of a package published to npmjs:

```sh
(export PACKAGE=checks; VERSION=1.0.2; ./scripts/publish/unpublish-from-npm.sh jackdbd $PACKAGE $VERSION)
```
30 changes: 2 additions & 28 deletions packages/utils/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,8 @@

Miscellaneous utility functions.

## Build

Build this library:

```sh
npm run build -w packages/utils
```

## Test

```sh
npm run test -w packages/utils
```

## Publish

### Artifact Registry

```sh
npm run publish:artifact-registry -w packages/utils
```

Check that the correct version of this package is now published on Artifact Registry:
## Installation

```sh
gcloud artifacts versions list \
--project $GCP_PROJECT_ID \
--repository $ARTIFACT_REGISTRY_NPM_REPOSITORY_ID \
--location $ARTIFACT_REGISTRY_NPM_REPOSITORY_LOCATION \
--package @jackdbd/utils
npm install @jackdbd/utils
```
7 changes: 4 additions & 3 deletions scripts/publish/npm.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,10 @@ if (npm_access_token === undefined) {
}
await $`echo //registry.npmjs.org/:_authToken=${npm_access_token} > ${tmp_dir}/package/.npmrc`

console.log(chalk.yellow(`Files you are about to publish to npmjs`))
await $`tree -a -L 3 ${tmp_dir}/package`
console.log(
chalk.yellow(`You are about to publish @${scope}/${pkg}@${version} to npmjs`)
)
await $`tree -L 3 ${tmp_dir}/package`

let should_publish_to_npm = await question(
chalk.yellow(`Confirm publish to npmjs? (y: yes, n: no) `),
Expand All @@ -64,7 +66,6 @@ let should_publish_to_npm = await question(

if (should_publish_to_npm === 'y') {
console.log(chalk.yellow(`Publish @${scope}/${pkg}:${version} to npmjs`))
// await $`cd ${tmp_dir}/package && npm publish . --access public --dry-run`
await $`cd ${tmp_dir}/package && npm publish . --access public`
console.log(chalk.green(`Published @${scope}/${pkg}:${version} to npmjs`))
} else {
Expand Down

0 comments on commit a11bec9

Please sign in to comment.