diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..1c4fc18 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,16 @@ +version: 2 +updates: +- package-ecosystem: npm + directory: "/" + target-branch: "develop" + schedule: + interval: daily + time: "19:00" + groups: + storybook: + patterns: + - "@storybook/*" + - storybook + open-pull-requests-limit: 10 + reviewers: + - qld-gov-au/qld-online-dev-team diff --git a/.github/releases.yml b/.github/releases.yml new file mode 100644 index 0000000..dbe71ea --- /dev/null +++ b/.github/releases.yml @@ -0,0 +1,19 @@ +# .github/release.yml +# https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes +# https://docs.github.com/en/issues/using-labels-and-milestones-to-track-work/managing-labels + +changelog: + categories: + - title: Breaking Changes 🛠 + labels: + - Semver-Major + - breaking-change + - title: 🏕 Features + labels: + - '*' + exclude: + labels: + - dependencies + - title: 👒 Dependencies + labels: + - dependencies \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..b71c62c --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,59 @@ +# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created +# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages + +name: Build + +on: + push: + pull_request: +# Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'npm' + registry-url: 'https://registry.npmjs.org' + + - name: Cache node modules + id: cache-npm + uses: actions/cache@v4 + env: + cache-name: cache-node-modules + with: + # npm cache files are stored in `~/.npm` on Linux/macOS + path: ~/.npm + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + ${{ runner.os }}- + + - if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }} + name: List the state of node modules + continue-on-error: true + run: npm list + + + - name: Install #run on lint step (Which is cached) + run: | # Install packages + npm install --prefer-offline --no-audit --ignore-scripts + + # `npm rebuild` will run all those post-install scripts for us. + - name: rebuild and prepare + run: npm rebuild && npm run prepare --if-present + + - run: npm run build + + - run: npm run test + + - uses: actions/upload-artifact@v4.3.1 + with: + name: Tokens + path: ./dist diff --git a/.github/workflows/githubPackage.yml b/.github/workflows/githubPackage.yml new file mode 100644 index 0000000..46b66e9 --- /dev/null +++ b/.github/workflows/githubPackage.yml @@ -0,0 +1,149 @@ +# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created +# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages + +name: Publish NPM Github Package store + +on: + # Allows you to run this workflow manually from the Actions tab +# workflow_dispatch: + # When main is updated (latest) + push: +# branches: +# - 'main' + #On versioned releases + tags: + - v*.*.* + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'npm' + registry-url: 'https://registry.npmjs.org' + + - name: Cache node modules + id: cache-npm + uses: actions/cache@v4 + env: + cache-name: cache-node-modules + with: + # npm cache files are stored in `~/.npm` on Linux/macOS + path: ~/.npm + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + ${{ runner.os }}- + + - if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }} + name: List the state of node modules + continue-on-error: true + run: npm list + + + - name: Install #run on lint step (Which is cached) + run: | # Install packages + npm install --prefer-offline --no-audit --ignore-scripts + + # `npm rebuild` will run all those post-install scripts for us. + - name: rebuild and prepare + run: npm rebuild && npm run prepare --if-present + + - run: npm run build + - run: npm run test + - uses: actions/upload-artifact@v4.3.1 + with: + name: Tokens + path: ./dist + + + publish-gpr: + needs: build + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - uses: actions/checkout@v4 + + - name: Cache node modules + id: cache-npm + uses: actions/cache@v4 + env: + cache-name: cache-node-modules + with: + # npm cache files are stored in `~/.npm` on Linux/macOS + path: ~/.npm + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + ${{ runner.os }}- + + - if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }} + name: List the state of node modules + continue-on-error: true + run: npm list + + + - uses: actions/setup-node@v4 #setup registry to github package repo + with: + node-version: 20 + registry-url: https://npm.pkg.github.com/ + # Defaults to the user or organization that owns the workflow file + #scope: '@${username}' + cache: 'npm' + + + + - name: npm config output (including .npmrc file) + run: | + npm -v + node -v + cat /home/runner/work/_temp/.npmrc + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - run: npm install + - run: npm ci + + - name: "Update package scope, export package name" + id: package_details + run: | + echo "replacing npm scope to repo owner GITHUB_REPOSITORY_OWNER = $GITHUB_REPOSITORY_OWNER" + temp_file=$(mktemp) + package=${GITHUB_REPOSITORY_OWNER,,} + awk -v scope="$package" '{ + if ($0 ~ /"name": "@[a-zA-Z0-9_-]+\//) { + sub(/@[a-zA-Z0-9_-]+\//, "@" scope "/") + } + print + }' package.json > "$temp_file" && mv "$temp_file" package.json + echo "package.json updated" + cat package.json + echo "package=`npm pkg get name`" >> $GITHUB_STATE + + - uses: tobysmith568/npm-publish-latest-tag@v1 + id: latest_tag + with: + package-json: ./package.json + +# - uses: actions/delete-package-versions@v5 +# with: #Delete all except latest 3 package versions excluding major versions as per semver from a repo not having access to package +## owner: 'github' +# package-name: ${{ steps.package_details.outputs.package }} +# package-type: 'npm' +## token: ${{ secrets.GITHUB_PAT }} +# min-versions-to-keep: 3 +# ignore-versions: '^(0|[1-9]\\d*)\\.0\\.0$' +# env: +# NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} + + - run: npm publish --tag ${{ steps.latest_tag.outputs.latest-tag }} + env: + NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/npmjsPackage.yml.disabled b/.github/workflows/npmjsPackage.yml.disabled new file mode 100644 index 0000000..be41cef --- /dev/null +++ b/.github/workflows/npmjsPackage.yml.disabled @@ -0,0 +1,35 @@ +# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created +# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages + +name: Publish NPM Package + +on: + push: + tags: + - v*.*.* + + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 20 + - run: npm ci + - run: npm test + + publish-npm: + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 20 + 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..1db1b85 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,16 @@ +name: Release + +on: + push: + tags: + - v*.*.* + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Release + run: gh release create "${GITHUB_REF#refs/tags/}" --generate-notes + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml new file mode 100644 index 0000000..d4d7843 --- /dev/null +++ b/.github/workflows/update.yml @@ -0,0 +1,93 @@ +## See https://github.com/marella/material-symbols/blob/main/.github/workflows/update.yml where inspiration for this script came from +name: Version Increment + +on: + schedule: + - cron: '23 1 * * MON' # Runs at 01:23 UTC on Monday + workflow_dispatch: + inputs: + force: + description: Force Update + default: '0' + dry: + description: Dry Run + default: '1' + bump: + type: choice + description: Bump Version + options: + - patch + - minor + - major + +jobs: + update: + runs-on: ubuntu-latest + env: + HAVE_GIT_DEPLOY_KEY: ${{ secrets.DEPLOY_KEY != '' }} + steps: + + - uses: actions/checkout@v4 + with: + ssh-key: ${{ secrets.DEPLOY_KEY }} + + - uses: git-actions/set-user@v1 + + - name: Cache node modules + id: cache-npm + uses: actions/cache@v4 + env: + cache-name: cache-node-modules + with: + # npm cache files are stored in `~/.npm` on Linux/macOS + path: ~/.npm + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + ${{ runner.os }}- + + - if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }} + name: List the state of node modules + continue-on-error: true + run: npm list + + + - uses: actions/setup-node@v4 #setup registry to github package repo + with: + node-version: 20 + + + - run: npm ci + + - name: Update + run: | + force="${{ github.event.inputs.force }}" + dry="${{ github.event.inputs.dry }}" + bump="${{ github.event.inputs.bump }}" + if [ "$bump" = "" ]; then + bump="patch" + fi + + # Bump Version + npm version "$bump" + + + - name: Push git tags + if: ${{ env.HAVE_GIT_DEPLOY_KEY == 'true' }} + run: | + dry="${{ github.event.inputs.dry }}" + # Push + if [ "$dry" = "1" ]; then + exit 0 + fi + git push --follow-tags + + - name: Git Commit - Is Skipped + if: ${{ env.HAVE_GIT_DEPLOY_KEY != 'true' }} + run: | + echo "### Deployment config not configured" >> $GITHUB_STEP_SUMMARY + echo "secrets.DEPLOY_KEY not existing, npm version can't be pushed" >> $GITHUB_STEP_SUMMARY + echo "If this is a fork, please setup your own personal service account to publish to your own repo" >> $GITHUB_STEP_SUMMARY + echo "## We recommend using a service account with the least permissions necessary." >> $GITHUB_STEP_SUMMARY + echo "[Learn more about creating and using encrypted secrets](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets)" >> $GITHUB_STEP_SUMMARY \ No newline at end of file diff --git a/.gitignore b/.gitignore index b512c09..3b96b12 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ -node_modules \ No newline at end of file +/node_modules +/node +*.idea +*.iml diff --git a/README.md b/README.md index 822f9fb..446f488 100644 --- a/README.md +++ b/README.md @@ -9,11 +9,26 @@ ### Using this repository: 1. Figma variables are exported to ./figma/tokens.json 2. Run: -```javascript +```bash npm run build-tokens ``` ### Verify outputs -```javascript +```bash npm run test ``` + +### CI +```bash + npm run ci +``` + +## Publish system + +There is two publish subsystems, one is to npmjs and the other is to github repo package + +### Github package repository + + Still work in progress: + * currently missing cleanup prior to publishing latest tag + * needs to publish when a version is cut (including incrementing package.json version if not same) diff --git a/dist/scss/_variables.scss b/dist/scss/_variables.scss index 3ceac3c..e04fb5a 100644 --- a/dist/scss/_variables.scss +++ b/dist/scss/_variables.scss @@ -1,6 +1,6 @@ // Do not edit directly -// Generated on Thu, 18 Apr 2024 07:09:35 GMT +// Generated on Tue, 14 May 2024 23:12:53 GMT $core-default-color-neutral-black: #131212; $core-default-color-neutral-darkest: #222020; @@ -46,12 +46,15 @@ $core-default-opacity-neutral-white-10: 0.1 #ffffff; $core-default-opacity-neutral-light-10: 0.1 #e0e0e0; $core-default-opacity-neutral-black-10: 0.1 #131212; $core-default-opacity-neutral-darkest-10: 0.1 #222020; -$color-default-color-light-background-background-alt: #e8e8e8; -$color-default-color-light-background-background-alt-shade: #e0e0e0; -$color-default-color-light-background-background: #eff4f9; -$color-default-color-light-background-background-shade: #e5eef5; -$color-default-color-light-border-border-alt: #7a7a7a; -$color-default-color-light-border-border: #ccddee; +$color-default-color-light-background-default: #ffffff; +$color-default-color-light-background-default-shade: #f5f5f5; +$color-default-color-light-background-light: #eff4f9; +$color-default-color-light-background-light-shade: #e5eef5; +$color-default-color-light-background-alt: #e8e8e8; +$color-default-color-light-background-alt-shade: #e0e0e0; +$color-default-color-light-border-default: #ebebeb; +$color-default-color-light-border-light: #ccddee; +$color-default-color-light-border-alt: #7a7a7a; $color-default-color-light-action-primary: #09549f; $color-default-color-light-action-primary-hover: #003e7d; $color-default-color-light-action-secondary: #005b23; @@ -60,35 +63,38 @@ $color-default-color-light-link-on-action: #ffffff; $color-default-color-light-link-default: #09549f; $color-default-color-light-link-visited: #551a8b; $color-default-color-light-accent-design-accent: #6BBE27; -$color-default-color-light-focus-focus: #0085B3; +$color-default-color-light-focus-default: #0085B3; $color-default-color-light-underline-default: #3f7ab4; -$color-default-color-light-underline-default-hover: #3f7ab4; +$color-default-color-light-underline-default-hover: #09549F; $color-default-color-light-underline-visited: #8b63b0; $color-default-color-light-underline-visited-hover: #551a8b; -$color-default-color-light-text-heading: #04284c; -$color-default-color-light-text-text: #414141; +$color-default-color-light-text-default: #414141; $color-default-color-light-text-lighter: #636363; -$color-default-color-light-text-site-title: #022a50; -$color-default-color-dark-background-background: #09549F; -$color-default-color-dark-background-background-shade: #04498f; -$color-default-color-dark-background-background-alt: #05325F; -$color-default-color-dark-background-background-alt-shade: #052c53; -$color-default-color-dark-border-border: #1d9ac6; -$color-default-color-dark-border-border-alt: #09acfe; +$color-default-color-light-text-heading: #04284c; +$color-default-color-light-site-title: #022a50; +$color-default-color-light-crest-fill: #1D1D1D; +$color-default-color-dark-background-default: #09549F; +$color-default-color-dark-background-default-shade: #04498f; +$color-default-color-dark-background-alt: #05325F; +$color-default-color-dark-background-alt-shade: #052c53; +$color-default-color-dark-border-default: #1d9ac6; +$color-default-color-dark-border-alt: #09acfe; $color-default-color-dark-action-primary: #78ba00; $color-default-color-dark-action-primary-hover: #add33f; $color-default-color-dark-action-secondary: #FFE500; $color-default-color-dark-action-secondary-hover: #ffef60; -$color-default-color-dark-link-on-action: #121940; $color-default-color-dark-link-default: #ffffff; $color-default-color-dark-link-visited: #e1bbee; +$color-default-color-dark-link-on-action: #121940; $color-default-color-dark-accent-design-accent: #6BBE27; -$color-default-color-dark-focus-focus: #01b0e5; +$color-default-color-dark-focus-default: #01b0e5; $color-default-color-dark-underline-default: #b5cce2; $color-default-color-dark-underline-default-hover: #ffffff; $color-default-color-dark-underline-visited-hover: #EE11BB; $color-default-color-dark-underline-visited: #e1c2ff; -$color-default-color-dark-text-heading: #ffffff; -$color-default-color-dark-text-text: #ffffff; +$color-default-color-dark-underline-visited-hover: #EE11BB; +$color-default-color-dark-text-default: #ffffff; $color-default-color-dark-text-lighter: #deebf9; -$color-default-color-dark-text-site-title: #ffffff; +$color-default-color-dark-text-heading: #ffffff; +$color-default-color-dark-site-title: #ffffff; +$color-default-color-dark-crest-fill: #ffffff; diff --git a/figma/tokens.json b/figma/tokens.json index 65df943..c28f9ce 100644 --- a/figma/tokens.json +++ b/figma/tokens.json @@ -608,6 +608,12 @@ "parent": "Color/Value", "description": "Hover colour for link underline." }, + "visited--hover": { + "value": "#EE11BB", + "type": "color", + "parent": "Color/Value", + "description": "Hover colour for visited link underline." + }, "visited": { "value": "#e1c2ff", "type": "color", @@ -625,7 +631,8 @@ "default": { "value": "#ffffff", "type": "color", - "parent": "Color/Value" + "parent": "Color/Value", + "description": "Heading colours within text. These should be shades of your brand colour and if possible different from primary action and link colours so the user does not interpret them as clickable." }, "lighter": { "value": "#deebf9", diff --git a/package-lock.json b/package-lock.json index 66a8ede..5bd9e4c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,15 +1,16 @@ { - "name": "qgds-designers", - "version": "1.0.0", + "name": "@qgds/qgds-tokens", + "version": "0.0.3", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "qgds-designers", - "version": "1.0.0", + "name": "@qgds/qgds-tokens", + "version": "0.0.3", "license": "ISC", "devDependencies": { "jest": "^29.7.0", + "npm-run-all2": "^6.1.2", "style-dictionary": "^3.9.2" } }, @@ -3059,6 +3060,15 @@ "tmpl": "1.0.5" } }, + "node_modules/memorystream": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", + "integrity": "sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw==", + "dev": true, + "engines": { + "node": ">= 0.10.0" + } + }, "node_modules/merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", @@ -3151,6 +3161,81 @@ "node": ">=0.10.0" } }, + "node_modules/npm-normalize-package-bin": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-3.0.1.tgz", + "integrity": "sha512-dMxCf+zZ+3zeQZXKxmyuCKlIDPGuv8EF940xbkC4kQVDTtqoh6rJFO+JTKSA6/Rwi0getWmtuy4Itup0AMcaDQ==", + "dev": true, + "license": "ISC", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm-run-all2": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/npm-run-all2/-/npm-run-all2-6.1.2.tgz", + "integrity": "sha512-WwwnS8Ft+RpXve6T2EIEVpFLSqN+ORHRvgNk3H9N62SZXjmzKoRhMFg3I17TK3oMaAEr+XFbRirWS2Fn3BCPSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.2.1", + "cross-spawn": "^7.0.3", + "memorystream": "^0.3.1", + "minimatch": "^9.0.0", + "pidtree": "^0.6.0", + "read-package-json-fast": "^3.0.2", + "shell-quote": "^1.7.3" + }, + "bin": { + "npm-run-all": "bin/npm-run-all/index.js", + "npm-run-all2": "bin/npm-run-all/index.js", + "run-p": "bin/run-p/index.js", + "run-s": "bin/run-s/index.js" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0", + "npm": ">= 8" + } + }, + "node_modules/npm-run-all2/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/npm-run-all2/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/npm-run-all2/node_modules/minimatch": { + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz", + "integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/npm-run-path": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", @@ -3362,6 +3447,19 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/pidtree": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/pidtree/-/pidtree-0.6.0.tgz", + "integrity": "sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g==", + "dev": true, + "license": "MIT", + "bin": { + "pidtree": "bin/pidtree.js" + }, + "engines": { + "node": ">=0.10" + } + }, "node_modules/pirates": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz", @@ -3444,6 +3542,30 @@ "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", "dev": true }, + "node_modules/read-package-json-fast": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/read-package-json-fast/-/read-package-json-fast-3.0.2.tgz", + "integrity": "sha512-0J+Msgym3vrLOUB3hzQCuZHII0xkNGCtz/HJH9xZshwv9DbDwkw1KaE3gx/e2J5rpEY5rtOy6cyhKOPrkP7FZw==", + "dev": true, + "license": "ISC", + "dependencies": { + "json-parse-even-better-errors": "^3.0.0", + "npm-normalize-package-bin": "^3.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/read-package-json-fast/node_modules/json-parse-even-better-errors": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-3.0.1.tgz", + "integrity": "sha512-aatBvbL26wVUCLmbWdCpeu9iF5wOyWpagiKkInA+kfws3sWdBrTnsvN2CKcyCYyUrc7rebNBlK6+kteg7ksecg==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -3541,6 +3663,16 @@ "node": ">=8" } }, + "node_modules/shell-quote": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.1.tgz", + "integrity": "sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/signal-exit": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", diff --git a/package.json b/package.json index a40738a..a7de0e4 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,12 @@ { - "name": "qgds-tokens", - "version": "1.0.0", + "name": "@qgds/qgds-tokens", + "version": "0.0.3", "description": "This repository is configured to sync tokens via Figma.", "main": "index.js", "scripts": { "build-tokens": "style-dictionary build", + "build": "npm run build-tokens", + "ci": "npm-run-all build test", "test": "jest tests/" }, "keywords": [], @@ -12,6 +14,7 @@ "license": "ISC", "devDependencies": { "jest": "^29.7.0", - "style-dictionary": "^3.9.2" + "style-dictionary": "^3.9.2", + "npm-run-all2": "^6.1.2" } } diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..93d9c3d --- /dev/null +++ b/pom.xml @@ -0,0 +1,130 @@ + + + 4.0.0 + + + au.gov.qld.qgds + 1.0.0-SNAPSHOT + qgds-tokens + pom + + + 1.15.0 + v20.12.0 + 10.5.0 + + + + + + maven-clean-plugin + 3.3.2 + + + + ${basedir}/dist + true + + **/* + + + + + + + + + + + + + + + + + + + + + com.github.eirslett + frontend-maven-plugin + ${frontend-maven-plugin.version} + + + install node and npm + + install-node-and-npm + + + ${node.version} + ${npm.version} + + + + npm install + + npm + + generate-resources + + install + + + + + + + + + + + + + + npm test + + npm + + test + + run test + + + + + + + + + + + + + + + + + + + + + + + + + npm package + + npm + + package + + run build + + + + + + + diff --git a/tests/verifyCount.test.js b/tests/verifyCount.test.js index d86e4b7..7d5573a 100644 --- a/tests/verifyCount.test.js +++ b/tests/verifyCount.test.js @@ -3,7 +3,7 @@ const path = require('path'); describe('SCSS Properties Count', () => { it('should verify the total number of SCSS variables (x)', () => { - const filePath = path.join(__dirname, '../dist/qld-variables.scss'); + const filePath = path.join(__dirname, '../dist/scss/_variables.scss'); const fileContent = fs.readFileSync(filePath, 'utf8'); // Regex to match SCSS properties @@ -11,7 +11,7 @@ describe('SCSS Properties Count', () => { const regex = /\$[a-zA-Z0-9-]+:/g; const match = fileContent.match(regex); - const expectedPropertyCount = 100; // Example expected count. Adjust this as necessary. + const expectedPropertyCount = 90; // Example expected count. Adjust this as necessary. expect(match).toHaveLength(expectedPropertyCount); }); });