Skip to content

Commit

Permalink
Remove build & source data for v1 tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasoppermann committed Apr 19, 2024
1 parent d2f69e0 commit c4e1275
Show file tree
Hide file tree
Showing 46 changed files with 50 additions and 3,452 deletions.
5 changes: 5 additions & 0 deletions .changeset/four-bulldogs-search.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/primitives': major
---

remove v1 tokens and build process
4 changes: 0 additions & 4 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
CHANGELOG.md


# Ignore all files relating to v1 tokens
# TODO: Remove after v1 tokens have been removed
data/
dist/
src/@types/
scripts/lib/
scripts/build.ts
3 changes: 0 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ jobs:
- name: Install dependencies
run: npm ci --no-audit --no-fund --ignore-scripts

- name: Build v1 tokens
run: npm run build

- name: Build v8 tokens
run: npm run build:v8

Expand Down
72 changes: 37 additions & 35 deletions .github/workflows/consumer_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,47 +20,49 @@ jobs:
name: Primer Brand
runs-on: ubuntu-latest
steps:
- name: Checkout current repo
uses: actions/checkout@v4
- run: |
echo "Re-enable this workflow when primer/brand has been updated to usev8 tokens"
# - name: Checkout current repo
# uses: actions/checkout@v4

- name: Checkout Primer Brand repo
uses: actions/checkout@v4
with:
repository: primer/brand
path: ${{env.TEST_FOLDER}}
# - name: Checkout Primer Brand repo
# uses: actions/checkout@v4
# with:
# repository: primer/brand
# path: ${{env.TEST_FOLDER}}

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 20
# - name: Set up Node
# uses: actions/setup-node@v4
# with:
# node-version: 20

- name: Caching dependencies
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
# - name: Caching dependencies
# uses: actions/cache@v4
# with:
# path: ~/.npm
# key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
# restore-keys: |
# ${{ runner.os }}-node-

- name: Install local dependencies
run: npm install --legacy-peer-deps --ignore-scripts
# - name: Install local dependencies
# run: npm install --legacy-peer-deps --ignore-scripts

- name: Install consumer dependencies (reference)
run: pushd ${{env.TEST_FOLDER}}; npm install --legacy-peer-deps; popd
# - name: Install consumer dependencies (reference)
# run: pushd ${{env.TEST_FOLDER}}; npm install --legacy-peer-deps; popd

- name: Build and pack
run: npm pack
# - name: Build and pack
# run: npm pack

- name: Retrieving package version
id: package-version
uses: martinbeentjes/npm-get-version-action@main
# - name: Retrieving package version
# id: package-version
# uses: martinbeentjes/npm-get-version-action@main

- name: Installing local build
run: |
cd ${{env.TEST_FOLDER}}
cp ../primer-primitives-${{ steps.package-version.outputs.current-version}}.tgz ./
cp ../primer-primitives-${{ steps.package-version.outputs.current-version}}.tgz ./packages/design-tokens
npm install primer-primitives-${{steps.package-version.outputs.current-version}}.tgz --workspace packages/design-tokens
# - name: Installing local build
# run: |
# cd ${{env.TEST_FOLDER}}
# cp ../primer-primitives-${{ steps.package-version.outputs.current-version}}.tgz ./
# cp ../primer-primitives-${{ steps.package-version.outputs.current-version}}.tgz ./packages/design-tokens
# npm install primer-primitives-${{steps.package-version.outputs.current-version}}.tgz --workspace packages/design-tokens

- name: Build consumer tokens
run: pushd ${{env.TEST_FOLDER}}; npm run build --workspace=packages/design-tokens; popd
# - name: Build consumer tokens
# run: pushd ${{env.TEST_FOLDER}}; npm run build --workspace=packages/design-tokens; popd
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ jobs:
with:
node_version: 20
install: npm ci --legacy-peer-deps --no-audit --no-fund && npm run install:storybook
build: npm run build && npm run build:next && cd docs/storybook && npm run build:prod
build: npm run build:next && cd docs/storybook && npm run build:prod
output_dir: docs/public

2 changes: 1 addition & 1 deletion .github/workflows/deploy_preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
with:
node_version: 20
install: npm ci --no-audit --no-fund --ignore-scripts && npm run install:storybook
build: npm run build && npm run build:next && cd docs/storybook && npm run build:preview
build: npm run build:next && cd docs/storybook && npm run build:preview
output_dir: docs/public

post_storybook:
Expand Down
107 changes: 0 additions & 107 deletions .github/workflows/diff.yml

This file was deleted.

13 changes: 2 additions & 11 deletions .github/workflows/hasChanged.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,10 @@ on:
outputs:
outputAffected:
description: "Boolean value indicating changes in any file or folder that has an effect on the output"
value: ${{ jobs.hasChanged.outputs.oldTokens || jobs.hasChanged.outputs.src || jobs.hasChanged.outputs.buildScripts }}
value: ${{ jobs.hasChanged.outputs.src || jobs.hasChanged.outputs.buildScripts }}
tokens:
description: "Boolean value indicating change in src/tokens folder"
value: ${{ jobs.hasChanged.outputs.tokens }}
oldTokens:
description: "Boolean value indicating change in data folder"
value: ${{ jobs.hasChanged.outputs.oldTokens }}
src:
description: "Boolean value indicating change in src folder"
value: ${{ jobs.hasChanged.outputs.src }}
Expand All @@ -37,7 +34,6 @@ jobs:
outputs:
outputAffected: ${{ steps.filter.outputs.outputAffected }}
tokens: ${{ steps.filter.outputs.tokens }}
oldTokens: ${{ steps.filter.outputs.oldTokens }}
src: ${{ steps.filter.outputs.src }}
scripts: ${{ steps.filter.outputs.scripts }}
buildScripts: ${{ steps.filter.outputs.buildScripts }}
Expand All @@ -52,32 +48,27 @@ jobs:
filters: |
tokens:
- 'src/tokens/**'
oldTokens:
- 'data/**'
src:
- 'src/**/**.ts'
- 'src/**/**.json'
- 'src/**/**.json5'
scripts:
- 'scripts/**'
buildScripts:
- 'scripts/build.ts'
- 'scripts/buildTokens.ts'
- 'scripts/themes.config.ts'
- 'tsconfig.json'
- 'tsconfig.build.json'
- 'package.json'
dependencies:
- 'package.json'
- 'package-lock.json'
docs:
- 'docs/**'
- name: Detecting changes that effect output
if: steps.filter.outputs.tokens == 'true' || steps.filter.outputs.oldTokens == 'true' || steps.filter.outputs.src == 'true' || steps.filter.outputs.scripts == 'true' || steps.filter.outputs.dependencies == 'true' || steps.filter.outputs.docs == 'true'
if: steps.filter.outputs.tokens == 'true' || steps.filter.outputs.src == 'true' || steps.filter.outputs.scripts == 'true' || steps.filter.outputs.dependencies == 'true' || steps.filter.outputs.docs == 'true'
run: |
echo Changes detected
echo - tokens: ${{ steps.filter.outputs.tokens }}
echo - oldTokens: ${{ steps.filter.outputs.oldTokens }}
echo - src: ${{ steps.filter.outputs.src }}
echo - scripts: ${{ steps.filter.outputs.scripts }}
echo - buildScripts: ${{ steps.filter.outputs.buildScripts }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
run: npm ci --no-audit --no-fund && pushd docs; npm ci --no-audit --no-fund; popd

- name: Build tokens
run: npm run build
run: npm run build:next

- id: get-access-token
uses: camertron/github-app-installation-auth-action@v1
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/release_canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ jobs:
- name: Install dependencies
run: npm ci --no-audit --no-fund --include=dev

- name: Build tokens
run: npm run build

- name: Build v8 tokens
run: npm run build:v8

Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/release_candidate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ jobs:
- name: Install dependencies
run: npm ci --no-audit --no-fund --include=dev

- name: Build tokens
run: npm run build

- name: Build tokens v8
run: npm run build:v8

Expand Down
2 changes: 1 addition & 1 deletion .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
npm run build & npm run test
npm run build:next & npm run test
npm run tokenJson:check
if npm run lint ; then
echo "Lint check passed"
Expand Down
3 changes: 0 additions & 3 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,3 @@ dist/
coverage/
storybook-static

# Ignore all files relating to v1 tokens
# TODO: Remove after v1 tokens have been removed
data/
7 changes: 0 additions & 7 deletions data/colors/deprecated.json

This file was deleted.

21 changes: 0 additions & 21 deletions data/colors/index.ts

This file was deleted.

1 change: 0 additions & 1 deletion data/colors/prefix

This file was deleted.

Loading

0 comments on commit c4e1275

Please sign in to comment.