Skip to content

Commit

Permalink
Merge pull request #396 from Sage/beta
Browse files Browse the repository at this point in the history
Beta
  • Loading branch information
druhill authored Jan 3, 2025
2 parents 4c09bde + c55787a commit 555933d
Show file tree
Hide file tree
Showing 132 changed files with 32,247 additions and 31,387 deletions.
18 changes: 18 additions & 0 deletions .babelrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"sourceType": "unambiguous",
"presets": [
[
"@babel/preset-env",
{
"targets": {
"chrome": 100,
"safari": 15,
"firefox": 91
}
}
],
"@babel/preset-typescript",
"@babel/preset-react"
],
"plugins": []
}
26 changes: 0 additions & 26 deletions .eslintrc.js

This file was deleted.

35 changes: 35 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Build
on:
pull_request:
branches:
- master

jobs:
# Builds token library.
build:
name: Build library
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false

- uses: actions/setup-node@v4
with:
node-version: '20'

- run: yarn install --frozen-lockfile

- name: Append .env
run: |
echo "
FIGMA_ACCESS_TOKEN=${{ secrets.FIGMA_ACCESS_TOKEN }}
FIGMA_FILE_ID=${{ secrets.FIGMA_FILE_ID }}
" >> .env
- name: Build
run: yarn run build
39 changes: 0 additions & 39 deletions .github/workflows/copy-package.yaml

This file was deleted.

21 changes: 7 additions & 14 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,29 @@ on:
pull_request:
branches:
- master
- main

jobs:
run-linters:
name: Run linters
runs-on: ubuntu-latest

steps:
- name: Check out Git repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- uses: actions/setup-node@v2
- uses: actions/setup-node@v4
with:
node-version: '16'
node-version: '20'

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

# Install your linters here
- name: Run linters
uses: wearerequired/lint-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
eslint: true
auto_fix: true
git_name: github-actions[bot]
git_email: github-actions[bot]@users.noreply.github.com

- name: Build project
run: npm run build

- name: Run stylelint
run: npm run stylelint:dist

- name: Download W3C Validator (vnu.jar)
run: wget https://github.com/validator/validator/releases/download/latest/vnu.jar

Expand Down
53 changes: 35 additions & 18 deletions .github/workflows/semantic-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,41 +14,58 @@ jobs:
contents: write
packages: write
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false

- uses: actions/setup-node@v2
- uses: actions/setup-node@v4
with:
node-version: '16'
node-version: '20'

- run: yarn install --frozen-lockfile

- name: Append .env
run: |
echo "
FIGMA_ACCESS_TOKEN=${{ secrets.FIGMA_ACCESS_TOKEN }}
FIGMA_FILE_ID=${{ secrets.FIGMA_FILE_ID }}
" >> .env
- name: Build
run: yarn run build

- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v3.0.1
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
git-user-signingkey: true
git-commit-gpgsign: true
git_user_signingkey: true
git_commit_gpgsign: true

- name: Release package to public NPM registry
run: npx semantic-release@19 --debug
- name: Release package to NPM registries
run: npx semantic-release --debug
env:
GITHUB_TOKEN: ${{ secrets.ADMIN_ACCESS_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GIT_COMMITTER_NAME: Sage Carbon
GIT_COMMITTER_EMAIL: ${{ secrets.GIT_COMMITTER_EMAIL }}

- name: Upload documentation via ftp
uses: SamKirkland/[email protected]
with:
server: ${{ secrets.FTP_HOST }}
username: ${{ secrets.FTP_USERNAME }}
password: ${{ secrets.FTP_PASSWORD }}
local-dir: "./dist/docs/"
server-dir: "./sage/docs/"
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_EMAIL: ${{ secrets.GIT_COMMITTER_EMAIL }}

# GitHub registry - @amanda-mitchell/semantic-release-npm-multiple
GITHUB_NPM_CONFIG_REGISTRY: https://npm.pkg.github.com
GITHUB_NPM_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_NPM_EMAIL: ${{ secrets.GIT_COMMITTER_EMAIL }}

# NpmJS registry - @amanda-mitchell/semantic-release-npm-multiple
PUBLIC_NPM_CONFIG_REGISTRY: https://registry.npmjs.org
PUBLIC_NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
PUBLIC_NPM_EMAIL: ${{ secrets.GIT_COMMITTER_EMAIL }}

# X3 registry - @amanda-mitchell/semantic-release-npm-multiple
X3_NPM_CONFIG_REGISTRY: https://repository.sagex3.com:8443/repository/x3-npm-hosted/
X3_NPM_USERNAME: ${{ secrets.X3_NPM_USER }}
X3_NPM_PASSWORD: ${{ secrets.X3_NPM_PASSWORD }}
X3_NPM_EMAIL: ${{ secrets.GIT_COMMITTER_EMAIL }}

24 changes: 24 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Validate
on:
pull_request:
branches:
- master

jobs:
run-unit-tests:
name: Run unit tests
runs-on: ubuntu-latest

steps:
- name: Check out Git repository
uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: "20"

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

- name: Run tests
run: npm test
1 change: 0 additions & 1 deletion .husky/.gitignore

This file was deleted.

4 changes: 0 additions & 4 deletions .husky/pre-commit

This file was deleted.

10 changes: 10 additions & 0 deletions .mocharc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"parallel": true,
"recursive": true,
"require": ["tsx"],
"spec": [
"scripts/**/*.spec.ts"
],
"extension": ["js", "cjs", "mjs", "ts"]
}

43 changes: 43 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"branches": ["master"],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"@semantic-release/changelog",
{
"changelogFile": "docs/CHANGELOG.md"
}
],
[
"@amanda-mitchell/semantic-release-npm-multiple",
{
"registries": {
"github": {
"changelogFile": "docs/CHANGELOG.md",
"pkgRoot": "dist",
"tarballDir": "dist"
},
"public": {
"changelogFile": "docs/CHANGELOG.md",
"pkgRoot": "dist"
}
}
}
],
[
"@semantic-release/git",
{
"assets": ["docs/CHANGELOG.md", "package.json"]
}
],
[
"@semantic-release/github",
{
"assets": "dist/*.tgz"
}
]
],
"dryRun": false,
"debug": false
}
14 changes: 14 additions & 0 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

{
"extends": ["stylelint-config-standard", "stylelint-config-standard-scss"],
"rules": {
"alpha-value-notation": null,
"color-function-notation": null,
"color-hex-length": null,
"comment-whitespace-inside": null,
"length-zero-no-unit": null,
"scss/comment-no-empty": null,
"scss/operator-no-unspaced": null,
"value-keyword-case": null
}
}
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ Design tokens purpose is to:
- **Keep visual consistency across all components of the library.**

## Docs:
- [Figma tokens github workflow](./docs/figma-github-workflow.md)
- [Pre-transform phase](./docs/pretransform-phase.md)
- [Generating icons](./docs/icons.md)
- [Generating tokens documentation](./docs/tokens-documentation.md)

## Using the design tokens

Expand Down Expand Up @@ -111,4 +108,4 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Copyright (c) 2021 Sage Group Plc. All rights reserved.
Copyright (c) 2024 Sage Group Plc. All rights reserved.
Loading

0 comments on commit 555933d

Please sign in to comment.