Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Created moon project for diff-generator in tools directory #344

Merged
merged 101 commits into from
Aug 7, 2024

Conversation

shirlsli
Copy link
Collaborator

@shirlsli shirlsli commented May 31, 2024

Description

This commit contains the setup of the diff generating tool using the node-tool template.

Related Issue

This project intends to improve diff generation between two schemas.

Motivation and Context

The motivation behind this project is to improve the diff generation between two schemas. Currently, the diff generation is inaccurate. For example, schema values that aren't deleted get marked as deleted.

How Has This Been Tested?

The project hasn't been tested yet, because this PR only contains the project setup.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Copy link

changeset-bot bot commented May 31, 2024

🦋 Changeset detected

Latest commit: 9459e3a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@adobe/token-diff-generator Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@GarthDB
Copy link
Member

GarthDB commented May 31, 2024

Run report for 9459e3a9

Total time: 41.2s | Comparison time: 1m 15s | Estimated savings: 34.6s (45.6% faster)

Action Time Status Info
🟩 SyncWorkspace 5.1ms Passed
⬛️ SetupToolchain(node:~20.12) 1.3s Skipped
🟩 SyncProject(node, diff) 0.2ms Passed
🟩 SyncProject(node, tokens) 0.3ms Passed
🟩 SyncProject(node, root) 0.3ms Passed
🟩 SyncProject(node, visualizer) 0.2ms Passed
🟩 SyncProject(node, csvGenerator) 0.2ms Passed
🟩 SyncProject(node, site) 0.2ms Passed
🟩 RunTask(site:copySchema) 29.6ms Passed
🟩 InstallWorkspaceDeps(node:~20.12) 6.1s Passed
🟩 RunTask(site:clean) 186.5ms Passed
🟩 RunTask(csvGenerator:generateCSV) 268.2ms Passed
🟩 RunTask(tokens:buildManifest) 272.4ms Passed
🟩 RunTask(diff:diff) 122ms Passed
🟩 RunTask(csvGenerator:test) 1.8s Passed
🟩 RunTask(root:test) 2.6s Passed
🟩 RunTask(visualizer:typescript) 6.5s Passed
🟩 RunTask(diff:test) 7.5s Passed
🟩 RunTask(visualizer:build) 3.8s Passed
🟩 RunTask(site:build) 25.1s Passed
And 5 more...
Expanded report
Action Time Status Info
🟩 RunTask(site:export) 82.1ms Passed
🟩 RunTask(tokens:buildTokens) 27.8s Passed
🟩 RunTask(tokens:build) 14.9ms Passed
🟩 RunTask(tokens:generateDiffResult) 1.3s Passed
🟩 RunTask(tokens:test) 3.1s Passed
Touched files
.changeset/small-radios-mate.md
.moon/workspace.yml
README.md
docs/site/public/schemas/token-types/color-set.json
docs/site/public/schemas/token-types/scale-set.json
packages/tokens/test/snapshots/deprecateExpress.test.js.md
packages/tokens/test/snapshots/deprecateExpress.test.js.snap
pnpm-lock.yaml
tools/diff-generator/README.md
tools/diff-generator/moon.yml
tools/diff-generator/package-lock.json
tools/diff-generator/package.json
tools/diff-generator/src/lib/added-token-detection.js
tools/diff-generator/src/lib/cli.js
tools/diff-generator/src/lib/deleted-token-detection.js
tools/diff-generator/src/lib/deprecated-token-detection.js
tools/diff-generator/src/lib/file-import.js
tools/diff-generator/src/lib/index.js
tools/diff-generator/src/lib/renamed-token-detection.js
tools/diff-generator/src/lib/updated-token-detection.js
tools/diff-generator/test/addedToken.test.js
tools/diff-generator/test/cli.test.js
tools/diff-generator/test/deletedToken.test.js
tools/diff-generator/test/deprecatedToken.test.js
tools/diff-generator/test/fileImport.test.js
tools/diff-generator/test/renamedToken.test.js
tools/diff-generator/test/snapshots/cli.test.js.md
tools/diff-generator/test/snapshots/cli.test.js.snap
tools/diff-generator/test/snapshots/file-import.test.js.md
tools/diff-generator/test/snapshots/file-import.test.js.snap
tools/diff-generator/test/snapshots/fileImport.test.js.md
tools/diff-generator/test/snapshots/fileImport.test.js.snap
tools/diff-generator/test/test-cli-outputs/expected-added-property.txt
tools/diff-generator/test/test-cli-outputs/expected-all-tokens.txt
tools/diff-generator/test/test-cli-outputs/expected-branch-release-compare.txt
tools/diff-generator/test/test-cli-outputs/expected-branches-added.txt
tools/diff-generator/test/test-cli-outputs/expected-branches-changes.txt
tools/diff-generator/test/test-cli-outputs/expected-branches-deleted.txt
tools/diff-generator/test/test-cli-outputs/expected-deleted-property-token.txt
tools/diff-generator/test/test-cli-outputs/expected-deleted-property.txt
tools/diff-generator/test/test-cli-outputs/expected-main-branch.txt
tools/diff-generator/test/test-cli-outputs/expected-non-schema-property.txt
tools/diff-generator/test/test-cli-outputs/expected-release-branch-compare.txt
tools/diff-generator/test/test-cli-outputs/expected-renamed-added-deleted-deprecated.txt
tools/diff-generator/test/test-cli-outputs/expected-renamed-added-deleted.txt
tools/diff-generator/test/test-cli-outputs/expected-renamed-property-token.txt
tools/diff-generator/test/test-schemas/added-deleted-set-token-property.json
tools/diff-generator/test/test-schemas/added-deprecated-token.json
tools/diff-generator/test/test-schemas/added-inner-value-token.json
tools/diff-generator/test/test-schemas/added-non-schema-property-token.json
tools/diff-generator/test/test-schemas/added-property-set-token.json
tools/diff-generator/test/test-schemas/added-renamed-tokens.json
tools/diff-generator/test/test-schemas/added-set-token.json
tools/diff-generator/test/test-schemas/added-set-tokens-out-of-order.json
tools/diff-generator/test/test-schemas/basic-multiple-updated-token.json
tools/diff-generator/test/test-schemas/basic-original-token.json
tools/diff-generator/test/test-schemas/basic-renamed-set-token.json
tools/diff-generator/test/test-schemas/basic-renamed-token.json
tools/diff-generator/test/test-schemas/basic-set-token-property.json
tools/diff-generator/test/test-schemas/basic-set-token.json
tools/diff-generator/test/test-schemas/basic-updated-set-token.json
tools/diff-generator/test/test-schemas/basic-updated-token.json
tools/diff-generator/test/test-schemas/deleted-set-token.json
tools/diff-generator/test/test-schemas/deleted-set-tokens.json
tools/diff-generator/test/test-schemas/deprecated-token.json
tools/diff-generator/test/test-schemas/entire-schema-renamed.json
tools/diff-generator/test/test-schemas/entire-schema.json
tools/diff-generator/test/test-schemas/inner-key-added-token.json
tools/diff-generator/test/test-schemas/inner-key-tokens.json
tools/diff-generator/test/test-schemas/new-token.json
tools/diff-generator/test/test-schemas/renamed-added-deleted-deprecated-tokens.json
tools/diff-generator/test/test-schemas/renamed-added-deleted-deprecated-updated-reverted-tokens.json
tools/diff-generator/test/test-schemas/renamed-added-deleted-deprecated-updated-tokens.json
tools/diff-generator/test/test-schemas/renamed-added-deleted-property-set-token.json
tools/diff-generator/test/test-schemas/renamed-added-deleted-set-tokens.json
tools/diff-generator/test/test-schemas/renamed-added-deleted-tokens.json
tools/diff-generator/test/test-schemas/several-added-tokens.json
tools/diff-generator/test/test-schemas/several-deprecated-tokens.json
tools/diff-generator/test/test-schemas/several-original-tokens.json
tools/diff-generator/test/test-schemas/several-renamed-deprecated-tokens.json
tools/diff-generator/test/test-schemas/several-renamed-set-tokens.json
tools/diff-generator/test/test-schemas/several-renamed-tokens.json
tools/diff-generator/test/test-schemas/several-renamed-updated-set-tokens.json
tools/diff-generator/test/test-schemas/several-set-tokens.json
tools/diff-generator/test/test-schemas/several-updated-set-tokens.json
tools/diff-generator/test/tokenDiff.test.js
tools/diff-generator/test/updatedToken.test.js

@GarthDB
Copy link
Member

GarthDB commented May 31, 2024

Bravest Warriors Applause

Shirley Li and others added 20 commits June 3, 2024 13:09
@shirlsli shirlsli marked this pull request as ready for review July 9, 2024 16:43
Copy link
Member

@GarthDB GarthDB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you also update the root README.md file to include the diff generator in the list of packages in the mono repo? https://github.com/adobe/spectrum-tokens/blob/main/README.md?plain=1#L18

"version": "0.0.1",
"description": "Creates diffs for tokens",
"type": "module",
"private": true,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If "private": true is in this file it won't publish this package to npm. Could you just delete it?

- ava
- --watch
local: true
platform: node
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a task for code coverage? It's in the package.json file, but it's ok to have it here too so it can be run in github actions for as part of moon ci

@@ -0,0 +1,37 @@
{
"name": "diff-generator",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should update this name to include the @adobe org namespace. What do you think of @adobe/token-diff-generator? Or @adobe/token-diff?

@@ -0,0 +1,5 @@
---
"diff-generator": major
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will need to update this to the new package name in tools/diff-generator/package.json.

Installing the package is done preferably with pnpm.

```
pnpm i @adobe/spectrum-tokens/token-diff-generator
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would just be the name in the tools/diff-generator/package.json file. So, pnpm I @adobe/token-diff-generator. NPM doesn't support sub packages like this.

Import the token diff generator as a module per ES6 standards.

```
import tokenDiff from “@adobe/spectrum-tokens/token-diff-generator”;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to the comment above, this would just be the name property in the package.json file.

@shirlsli shirlsli requested a review from GarthDB July 10, 2024 14:52
@GarthDB GarthDB merged commit 9459e3a into main Aug 7, 2024
4 checks passed
@GarthDB GarthDB deleted the diff-generator branch August 7, 2024 22:52
@GarthDB GarthDB mentioned this pull request Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants