Skip to content

Commit

Permalink
first pass at npm publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
emma-sg committed Aug 26, 2024
1 parent 92a14bb commit 19a667c
Show file tree
Hide file tree
Showing 9 changed files with 995 additions and 8 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
14 changes: 14 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.0.2/schema.json",
"changelog": [
"@changesets/changelog-github",
{ "repo": "webrecorder/hickory" }
],
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
35 changes: 35 additions & 0 deletions .github/workflows/npm-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Publish Package to npmjs

on:
push:
branches:
- main

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
build-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "20.x"
registry-url: "https://registry.npmjs.org"
cache: "yarn"

- name: Yarn Install
run: yarn install --frozen-lockfile

- name: Yarn Build
run: yarn workspaces run build

- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
# This expects you to have a script called release which does a build for your packages and calls changeset publish
publish: yarn version
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
7 changes: 7 additions & 0 deletions packages/icons/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# @webrecorder/icons

## 0.0.2

### Patch Changes

- Initial changeset setup
8 changes: 5 additions & 3 deletions packages/icons/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
{
"name": "@webrecorder/icons",
"version": "1.0.0",
"version": "0.0.2",
"private": true,
"description": "Webrecorder's custom icons",
"main": "index.js",
"type": "module",
"repository": "https://github.com/webrecorder/hickory",
"license": "AGPL-3.0-or-later",
"devDependencies": {
"@iconify/tools": "^4.0.5"
},
"scripts": {
"build": "node --no-warnings=ExperimentalWarning scripts/build.js"
"build": "node --no-warnings=ExperimentalWarning scripts/build.js",
"prepublishOnly": "yarn build",
"publish": "npm publish dist"
}
}
7 changes: 7 additions & 0 deletions packages/tokens/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# @webrecorder/tokens

## 0.0.2

### Patch Changes

- Initial changeset setup
7 changes: 4 additions & 3 deletions packages/tokens/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
{
"name": "@webrecorder/tokens",
"version": "1.0.0",
"version": "0.0.2",
"description": "Webrecorder's design tokens",
"main": "index.js",
"type": "module",
"repository": "https://github.com/webrecorder/hickory",
"license": "AGPL-3.0-or-later",
"scripts": {
"build": "node --no-warnings=ExperimentalWarning scripts/build.js"
"build": "node --no-warnings=ExperimentalWarning scripts/build.js",
"prepublishOnly": "yarn build",
"publish": "npm publish"
}
}
2 changes: 1 addition & 1 deletion packages/tokens/scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const output = await prettier.format(
{ parser: "babel" }
);

const path = join("dist", "theme.js");
const path = join("dist", "tw-theme.js");

await mkdir(dirname(path), { recursive: true });

Expand Down
Loading

0 comments on commit 19a667c

Please sign in to comment.