diff --git a/.changeset/wicked-planes-talk.md b/.changeset/wicked-planes-talk.md new file mode 100644 index 000000000..4f04a76e8 --- /dev/null +++ b/.changeset/wicked-planes-talk.md @@ -0,0 +1,5 @@ +--- +"@tokens-studio/graph-engine-nodes-design-tokens": patch +--- + +Fixes the incorrectly typed Tokenset Schema diff --git a/.github/workflows/pr-ci.yml b/.github/workflows/pr-ci.yml index cf474a6c8..876506b5a 100644 --- a/.github/workflows/pr-ci.yml +++ b/.github/workflows/pr-ci.yml @@ -1,6 +1,8 @@ name: CI -on: pull_request +on: + pull_request: + types: [opened, synchronize] env: HUSKY: 0 @@ -16,9 +18,82 @@ concurrency: cancel-in-progress: true jobs: + + + changes: + runs-on: ubuntu-latest + env: + TURBO_RUN_FILTER: ${{ github.event_name == 'pull_request' && '...[origin/master]' || '...[HEAD^]' }} + # Required permissions + permissions: + pull-requests: read + # Set job outputs to values from filter step + outputs: + flat: ${{ steps.flat.outputs.result }} + steps: + - name: Check out code + uses: actions/checkout@v3 + with: + fetch-depth: 0 + lfs: true + - name: Setup Node.js environment + uses: actions/setup-node@v4 + with: + cache: 'npm' + node-version: 20 + - name: Install turbo@1.13.3 & glob + run: | + npm i -g turbo@1.13.3 glob + echo "PATH=$(npm config get config):$PATH" >> $GITHUB_ENV + + - name: Verify turbo installation + shell: bash + run: | + source $GITHUB_ENV + turbo --version + - name: Debug TURBO_RUN_FILTER + run: echo "TURBO_RUN_FILTER is $TURBO_RUN_FILTER" + - name: Validate JSON Output + run: | + content=$(turbo build --filter=$TURBO_RUN_FILTER --dry-run=json) + echo $content | jq . + - name: Debug turbo command + run: | + set -x + turbo build --filter=$TURBO_RUN_FILTER --dry-run=json + set +x + - name: Verify turbo installation + run: which turbo + + - name: Debug content + run: | + content=`turbo build --filter=$TURBO_RUN_FILTER --dry-run=json` + echo "Content is: $content" + - name: Changeset + id: changeset + run: | + content=`turbo build --filter=$TURBO_RUN_FILTER --dry-run=json` + content="${content//'%'/'%25'}" + content="${content//$'\n'/'%0A'}" + content="${content//$'\r'/'%0D'}" + echo "::set-output name=result::$content" + - name: Flat output + id: flat + run: | + filteredPkgs=`turbo build --filter=$TURBO_RUN_FILTER --dry-run=json | node ./scripts/diff.js` + echo "::set-output name=result::$filteredPkgs" + echo "$filteredPkgs" + + verify: name: Verify changes + needs: changes runs-on: ubuntu-latest + if: ${{ needs.changes.outputs.flat != '[]' }} + defaults: + run: + shell: bash + working-directory: ./out steps: - name: Check out code uses: actions/checkout@v3 @@ -32,7 +107,10 @@ jobs: cache: "yarn" - name: Install turbo - run: yarn global add turbo@1.9.8 + run: yarn global add turbo@1.13.3 + - name: prune + run: turbo prune ${{ needs.changes.outputs.flat }} + working-directory: ./ - name: Turbo Cache id: turbo-cache diff --git a/out/.gitkeep b/out/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/package.json b/package.json index b59d06b20..26023cc77 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "husky": "^8.0.3", "lint-staged": "^13.2.1", "listr2": "5.0.8", - "turbo": "^1.9.8" + "turbo": "^1.13.3" }, "packageManager": "yarn@1.22.19" } diff --git a/packages/nodes-design-tokens/src/schemas/index.ts b/packages/nodes-design-tokens/src/schemas/index.ts index ab0843448..c1f788f5a 100644 --- a/packages/nodes-design-tokens/src/schemas/index.ts +++ b/packages/nodes-design-tokens/src/schemas/index.ts @@ -89,11 +89,7 @@ export const TOKEN_SET = 'https://schemas.tokens.studio/tokenSet.json'; export const TokenSetSchema: SchemaObject = { $id: TOKEN_SET, title: 'Token Set', - type: 'object', - properties: { - name: StringSchema, - token: StringSchema - } + type: 'object' }; export const LEONARDO_COLOR = diff --git a/scripts/diff.js b/scripts/diff.js new file mode 100644 index 000000000..2c008bca1 --- /dev/null +++ b/scripts/diff.js @@ -0,0 +1,24 @@ +const stdin = process.openStdin(); + +let data = ''; + +stdin.on('data', function (chunk) { + data += chunk; +}); + +stdin.on('end', function () { + const input = JSON.parse(data); + const flatpack = input.tasks.reduce((acc, task) => { + if (task.command == '\u003cNONEXISTENT\u003e') { + return acc; + } + + if (task.cache.status == 'MISS') { + acc.push(task.package); + } + return acc; + }, []); + + const uniq = [...new Set(flatpack)]; + console.log(uniq.join(' ')); +}); diff --git a/yarn.lock b/yarn.lock index 9ddfe7a3a..5f1621632 100644 --- a/yarn.lock +++ b/yarn.lock @@ -21482,7 +21482,7 @@ turbo-windows-arm64@1.13.4: resolved "https://registry.yarnpkg.com/turbo-windows-arm64/-/turbo-windows-arm64-1.13.4.tgz#0adfddb0d6c167a46ecff646666e347a7d372d76" integrity sha512-u5A+VOKHswJJmJ8o8rcilBfU5U3Y1TTAfP9wX8bFh8teYF1ghP0EhtMRLjhtp6RPa+XCxHHVA2CiC3gbh5eg5g== -turbo@^1.9.8: +turbo@^1.13.3: version "1.13.4" resolved "https://registry.yarnpkg.com/turbo/-/turbo-1.13.4.tgz#06767fff53f0aae43f78e12e5ac7d5e7652d40d0" integrity sha512-1q7+9UJABuBAHrcC4Sxp5lOqYS5mvxRrwa33wpIyM18hlOCpRD/fTJNxZ0vhbMcJmz15o9kkVm743mPn7p6jpQ==