From b0186eaca0bd372fc1e1b17edfcf591221a8a15b Mon Sep 17 00:00:00 2001 From: Jeffrey de Looff Date: Fri, 24 Jun 2022 15:14:33 +0200 Subject: [PATCH 1/5] chore: clean up yarn.lock --- yarn.lock | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/yarn.lock b/yarn.lock index 2eb291e..a9d1358 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1189,14 +1189,6 @@ "@typescript-eslint/typescript-estree" "5.29.0" debug "^4.3.4" -"@typescript-eslint/scope-manager@5.27.1": - version "5.27.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.27.1.tgz#4d1504392d01fe5f76f4a5825991ec78b7b7894d" - integrity sha512-fQEOSa/QroWE6fAEg+bJxtRZJTH8NTskggybogHt4H9Da8zd4cJji76gA5SBlR0MgtwF7rebxTbDKB49YUCpAg== - dependencies: - "@typescript-eslint/types" "5.27.1" - "@typescript-eslint/visitor-keys" "5.27.1" - "@typescript-eslint/scope-manager@5.29.0": version "5.29.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.29.0.tgz#2a6a32e3416cb133e9af8dcf54bf077a916aeed3" @@ -1214,29 +1206,11 @@ debug "^4.3.4" tsutils "^3.21.0" -"@typescript-eslint/types@5.27.1": - version "5.27.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.27.1.tgz#34e3e629501349d38be6ae97841298c03a6ffbf1" - integrity sha512-LgogNVkBhCTZU/m8XgEYIWICD6m4dmEDbKXESCbqOXfKZxRKeqpiJXQIErv66sdopRKZPo5l32ymNqibYEH/xg== - "@typescript-eslint/types@5.29.0": version "5.29.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.29.0.tgz#7861d3d288c031703b2d97bc113696b4d8c19aab" integrity sha512-X99VbqvAXOMdVyfFmksMy3u8p8yoRGITgU1joBJPzeYa0rhdf5ok9S56/itRoUSh99fiDoMtarSIJXo7H/SnOg== -"@typescript-eslint/typescript-estree@5.27.1": - version "5.27.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.27.1.tgz#7621ee78607331821c16fffc21fc7a452d7bc808" - integrity sha512-DnZvvq3TAJ5ke+hk0LklvxwYsnXpRdqUY5gaVS0D4raKtbznPz71UJGnPTHEFo0GDxqLOLdMkkmVZjSpET1hFw== - dependencies: - "@typescript-eslint/types" "5.27.1" - "@typescript-eslint/visitor-keys" "5.27.1" - debug "^4.3.4" - globby "^11.1.0" - is-glob "^4.0.3" - semver "^7.3.7" - tsutils "^3.21.0" - "@typescript-eslint/typescript-estree@5.29.0": version "5.29.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.29.0.tgz#e83d19aa7fd2e74616aab2f25dfbe4de4f0b5577" @@ -1262,14 +1236,6 @@ eslint-scope "^5.1.1" eslint-utils "^3.0.0" -"@typescript-eslint/visitor-keys@5.27.1": - version "5.27.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.27.1.tgz#05a62666f2a89769dac2e6baa48f74e8472983af" - integrity sha512-xYs6ffo01nhdJgPieyk7HAOpjhTsx7r/oB9LWEhwAXgwn33tkr+W8DI2ChboqhZlC4q3TC6geDYPoiX8ROqyOQ== - dependencies: - "@typescript-eslint/types" "5.27.1" - eslint-visitor-keys "^3.3.0" - "@typescript-eslint/visitor-keys@5.29.0": version "5.29.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.29.0.tgz#7a4749fa7ef5160c44a451bf060ac1dc6dfb77ee" From d55b3c8273cf225692eb46ff03de3a828df3ae80 Mon Sep 17 00:00:00 2001 From: Jeffrey de Looff Date: Fri, 24 Jun 2022 15:21:40 +0200 Subject: [PATCH 2/5] ci: set-up npmjs deploy workflow --- .github/workflows/deploy.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..91a95cf --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,18 @@ +name: Publish Package to npmjs +on: + release: + types: [created] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: "18.x" + registry-url: "https://registry.npmjs.org" + - run: npm ci + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} From 6267517c0eea0378471fce670f3d0608b7610506 Mon Sep 17 00:00:00 2001 From: Jeffrey de Looff Date: Fri, 24 Jun 2022 15:29:13 +0200 Subject: [PATCH 3/5] docs: adds installation instructions to README --- README.md | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3254434..565e45b 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,17 @@ +[![npm version](https://badge.fury.io/js/@makerstreet%2Fdesign-tokens.svg)](https://badge.fury.io/js/@makerstreet%2Fdesign-tokens) + # Elements Design Tokens > Design System code generation for Elements projects with Figma Tokens and Style Dictionary -# Goal of this library +## Contents + +- [Goal of this library](#goal-of-this-library) +- [Supported platforms](#supported-platforms) +- [Installation](#installation) +- [CLI Usage](#cli-Usage) + +## Goal of this library At Elements we use Figma to create our designs. By using the [Figma Tokens](https://www.figmatokens.com/) plugin we define design tokens by with all the values needed to construct and maintain a design system for a project. @@ -12,6 +21,26 @@ With this library you can generate the theme code for a specific platform. - Android with Compose UI +## Installation + +You can install it globally: + +```bash +$ npm install -g @makerstreet/design-tokens +``` + +Or as a dev dependency: + +```bash +$ npm install -D @makerstreet/design-tokens +``` + +If you use yarn: + +```bash +$ yarn add @makerstreet/design-tokens --dev +``` + ## CLI Usage ```bash From 5c0d44846f2f4366cfc588e7f8e0f4356c325795 Mon Sep 17 00:00:00 2001 From: Jeffrey de Looff Date: Thu, 30 Jun 2022 11:37:08 +0200 Subject: [PATCH 4/5] ci: uses semantic-release for deployment --- .github/workflows/deploy.yml | 18 ------------------ .github/workflows/release.yml | 29 +++++++++++++++++++++++++++++ package.json | 9 +++------ 3 files changed, 32 insertions(+), 24 deletions(-) delete mode 100644 .github/workflows/deploy.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml deleted file mode 100644 index 91a95cf..0000000 --- a/.github/workflows/deploy.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: Publish Package to npmjs -on: - release: - types: [created] - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: "18.x" - registry-url: "https://registry.npmjs.org" - - run: npm ci - - run: npm publish - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..6f42146 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,29 @@ +name: Publish Package to npmjs + +on: + push: + branches: [main] + +jobs: + release: + name: Release + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: 18.x + + - name: Install dependencies + run: yarn install --frozen-lockfile + + - name: Release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + run: npx semantic-release diff --git a/package.json b/package.json index 421a29b..940ff46 100644 --- a/package.json +++ b/package.json @@ -28,17 +28,14 @@ "commitmsg": "validate-commit-msg", "build": "tsc && yarn copy-files", "test": "jest", - "predocs": "rm -rf docs/", - "docs": "esdoc -c .esdoc.json", - "prepack": "npm run build", - "prepublish": "npm run build", - "semantic-release": "semantic-release pre && npm run publish && semantic-release post", + "prepublish": "yarn build", "prettier": "prettier", "prettier-write": "yarn prettier -- --parser typescript --no-semi --trailing-comma all --write --print-width 120", "prettier-project": "yarn prettier-write -- 'lib/**/*.{ts,tsx}'", "lint": "eslint \"lib/**/*.ts\"", "local": "sudo npm i -g && elements-design-tokens", - "copy-files": "copyfiles -u 1 src/**/*.ejs dist/" + "copy-files": "copyfiles -u 1 src/**/*.ejs dist/", + "semantic-release": "semantic-release" }, "license": "MIT", "engines": { From e8d2c141d4cc79dfdfb03619b39bad96d7456ae0 Mon Sep 17 00:00:00 2001 From: Jeffrey de Looff Date: Thu, 30 Jun 2022 11:44:05 +0200 Subject: [PATCH 5/5] chore: adds semantic-release branches config --- package.json | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 940ff46..59f938a 100644 --- a/package.json +++ b/package.json @@ -95,5 +95,21 @@ "\\.snap$", "/node_modules/" ] - } + }, + "release":{ + "branches": [ + "+([0-9])?(.{+([0-9]),x}).x", + "main", + "next", + "next-major", + { + "name": "beta", + "prerelease": true + }, + { + "name": "alpha", + "prerelease": true + } + ] + } }