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

Create diff generator website project #376

Closed
wants to merge 102 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
906a870
feat: created moon project for diff-generator in tools directory
May 31, 2024
04e85fd
feat: created function to check for renamed tokens in diff based on uuid
May 31, 2024
de11738
test: created very basic and possibly incorrect test for rename checking
May 31, 2024
3f3f432
test: fixed basic rename test and rename function to properly detect …
Jun 3, 2024
1c382f0
test: created more tests to test 2+ tokens and entire existing schema
Jun 3, 2024
c632fa8
feat: detect when new tokens are added and moved looping through sche…
Jun 3, 2024
b7631cd
test: added uuid to opacity-checkerboard-square-dark in test schemas
Jun 3, 2024
9148440
test: created tests for detecting added tokens and fixed added token …
Jun 3, 2024
998cda1
feat: created function to detect deleted tokens and wrote some tests
Jun 4, 2024
25ef7a9
chore: updated pnpm lock file
GarthDB Jun 4, 2024
4dbd551
test: renamed expected output variable names for better future mainta…
Jun 4, 2024
0de714f
Merge branch 'main' of https://github.com/adobe/spectrum-tokens into …
Jun 4, 2024
303867b
Merge branch 'detect-deleted-tokens' of https://github.com/adobe/spec…
Jun 4, 2024
48df9e7
fix: not sure if this will fix the failing github actions test
Jun 4, 2024
67ebecc
feat: created function to detect deprecated tokens with some basic tests
Jun 5, 2024
d5f5412
test: added tests for deprected tokens because i forgot to stage the …
Jun 5, 2024
fd1e90d
docs: added comment to detect deprecated function
Jun 5, 2024
124a5b7
feat: detect when new tokens are added and moved looping through sche…
Jun 3, 2024
9067c10
test: created tests for detecting added tokens and fixed added token …
Jun 3, 2024
2245e20
chore: update pnpm-lock file
GarthDB Jun 5, 2024
a936cb7
Merge branch 'diff-generator' into detect-deleted-tokens
GarthDB Jun 5, 2024
c1b08eb
chore: move functions into separate files for easier individual testing
Jun 5, 2024
ab0ac84
Merge branch 'detect-deleted-tokens' of https://github.com/adobe/spec…
Jun 5, 2024
3f0d4d0
Merge branch 'detect-deleted-tokens' into detect-deprecated-tokens
Jun 5, 2024
667da21
fix: fixed renamed detector to not tokens whose uuids were the same b…
Jun 5, 2024
caf82f5
feat: detects when previously deprecated tokens are marked as not dep…
Jun 6, 2024
67a8c39
feat: created detect updated tokens function and wrote tests for toke…
Jun 6, 2024
5220ced
Merge branch 'main' into detect-updated-tokens
Jun 6, 2024
c97e102
feat: created format result function and wrote e2e tests
Jun 7, 2024
821fb93
chore: moved index.js into lib folder so updating moon yml file
Jun 7, 2024
b64dd58
feat: added uuids to set tokens root
GarthDB Jun 3, 2024
6263332
feat: updated addIds task to add uuids to set tokens
GarthDB Jun 3, 2024
fa067df
chore: added changeset
GarthDB Jun 3, 2024
2e3d66d
chore: release
github-actions[bot] Jun 3, 2024
17d3b6e
ci: testing automated snapshot release
GarthDB Jun 3, 2024
1c092ac
feat: created detect updated tokens function and wrote tests for toke…
Jun 6, 2024
839d34a
feat: created format result function and wrote e2e tests
Jun 7, 2024
5d37148
chore: moved index.js into lib folder so updating moon yml file
Jun 7, 2024
65c28f1
refactor: changed parts of functions that had redundant code
Jun 7, 2024
c884bcc
refactor: changed a double forloop into O(n)
Jun 10, 2024
69b6dcd
refactor: changed detect renamed tokens result to match output of oth…
Jun 10, 2024
fbfbf04
refactor: optimizing code
Jun 10, 2024
a76fdfc
refactor: removed redundant code in updated token detection function
Jun 10, 2024
52b5420
refactor: removed two loops in deprecated tokens detection
Jun 10, 2024
8a78c36
Merge branch 'diff-generator' into shirlsli/diff-generator-code-impro…
shirlsli Jun 10, 2024
f69f27d
chore: renamed token test had extra expected constants when running g…
Jun 10, 2024
c8dff87
chore: realized i did not update expected test output
Jun 10, 2024
857233a
feat: cli for diff generator
Jun 11, 2024
f435cc3
chore: added diff command to bin and made indentations for listed items
Jun 11, 2024
f34f14f
refactor: added user inquiry about undeprecated tokens and return sig…
Jun 11, 2024
46462ec
feat: created file import function to take cli file name inputs and r…
Jun 12, 2024
535fc05
fix: got cli working on example tokens
Jun 12, 2024
468d5b0
refactor: added check for if there are no undeprecated tokens so ques…
Jun 13, 2024
de42080
feat: created function for adding and deleting properties to existing…
Jun 13, 2024
165577f
fix: changed how new properties added to token looks when printed in …
Jun 13, 2024
a36106c
fix: revised property deletion in token and added tests
Jun 13, 2024
053a2b7
fix: when add new property to token cli displays correctly
Jun 13, 2024
754ac08
refactor: made two general formatting functions for cli output
Jun 13, 2024
299b4b7
feat: separates cli report updated output into added, deleted, and up…
Jun 13, 2024
082d415
refactor: changed text colors from chalk defaults to custom hex values
Jun 14, 2024
d3bcad3
chore: commenting out nixt file for now because it is not importing
Jun 14, 2024
35edf82
chore: deleted cli test file for now to pass github pr check
Jun 14, 2024
65a1b93
refactor: missed some chalk.white
Jun 14, 2024
e1ffd7f
chore: debugging nixt setup
Jun 14, 2024
292e552
fix: switched chalk-cli for chalk dependency
GarthDB Jun 14, 2024
d2bb068
test: added test for version number
GarthDB Jun 14, 2024
73e1ee2
test: wrote tests checking for output of cli commands
Jun 17, 2024
f2928b9
refactor: changed tests to snapshots
Jun 17, 2024
c3b77dc
refactor: added comments and replace chalk.white with white everywhere
Jun 17, 2024
689daad
fix: realized earlier refactor refactored something that was not mean…
Jun 17, 2024
3f2a437
feat: created function to fetch tokens from github branches and tags
Jun 18, 2024
1178592
test: basic tests comparing tokens from two branches
Jun 18, 2024
09e8dc6
chore: changed warning content, removed comments, and updated snapshots
Jun 18, 2024
87d2a70
chore: added more styling and changed snapshots to reflect style changes
Jun 18, 2024
0855eab
chore: added branch and version names to cli output
Jun 18, 2024
90bb828
Merge branch 'shirlsli/diff-generator-cli' into shirlsli/diff-generat…
shirlsli Jun 18, 2024
4f5a134
chore: skipping cli version test because works locally but not when r…
Jun 18, 2024
21f55c4
Merge branch 'shirlsli/diff-generator-cli-tests' of https://github.co…
Jun 18, 2024
e45a820
feat: moved functionality in cli into diff generator library for cros…
Jun 21, 2024
ed14745
docs: edited comments
Jun 21, 2024
69a337e
fix: fixed bug with added and deleted properties detection after refa…
Jun 25, 2024
f50bf89
test: added another test to check for added and deleted properties
Jun 26, 2024
3070e31
feat: moved functionality in cli into diff generator library for cros…
Jun 21, 2024
40b50b6
docs: edited comments
Jun 21, 2024
0cd741d
fix: fixed bug with added and deleted properties detection after refa…
Jun 25, 2024
89dd2ea
test: added another test to check for added and deleted properties
Jun 26, 2024
f5d245e
test: checking cli output for when comparing between github tag and b…
Jun 27, 2024
95dcc78
test: added tests to check token comparisons between branch and relea…
Jun 27, 2024
85b5ead
chore: merged branch diff generator cli into diff generator refactor
Jun 27, 2024
16cbd7a
feat: detects renamed keys in tokens
Jun 29, 2024
ad8ee39
feat: prints out renamed properties in cli
Jul 8, 2024
5131bc6
refactor: edited comments and added tests
Jul 9, 2024
02f01ca
fix: forgot to delete parameters in call to function in cli
Jul 9, 2024
a4e6e82
refactor: forgot to uncomment try catch statement after debugging
Jul 9, 2024
8a021e0
build: added changeset for diff generator library and cli
Jul 9, 2024
0c97616
chore: updated readme
Jul 9, 2024
298827a
Merge branch 'main' into diff-generator
GarthDB Jul 9, 2024
536f249
refactor: made requested changes
Jul 9, 2024
d807cab
Merge branch 'diff-generator' of https://github.com/adobe/spectrum-to…
Jul 9, 2024
23e77b2
feat: created project for diff generator website
Jul 9, 2024
fc5bf65
Merge branch 'diff-generator' into shirlsli/diff-generator-website
Jul 9, 2024
4ce67e5
chore: pushing for now because weird error
Jul 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/small-radios-mate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@adobe/token-diff-generator": major
---

Initial release of the token diff generator library and cli
2 changes: 2 additions & 0 deletions .moon/workspace.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ projects:
site: "docs/site"
root: "."
csvGenerator: tools/token-csv-generator
diff: "tools/diff-generator"
tdiff: "docs/tdiff"
vcs:
manager: "git"
defaultBranch: "main"
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Packages in this monorepo:
- [Spectrum Tokens](packages/tokens/) design tokens for Spectrum, Adobe's design system.
- [Spectrum Token Visualizer Tool](docs/visualizer/) a visualizer for inspecting tokens. Published as a [static site](https://opensource.adobe.com/spectrum-tokens/visualizer/), not an NPM package.
- [Spectrum Tokens Docs](docs/site/) a static site to show the component options API and other token data.
- [Spectrum Token Diff Generator](tools/diff-generator/) a library and cli tool that reports changes made between two schema/releases/branches.

## Setup monorepo locally

Expand Down
29 changes: 29 additions & 0 deletions docs/token-diff/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org

root = true


[*]

# Change these settings to your own preference
indent_style = space
indent_size = 2

# We recommend you to keep these unchanged
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

[*.json]
indent_size = 2

[*.{html,js,md}]
block_comment_start = /**
block_comment = *
block_comment_end = */
24 changes: 24 additions & 0 deletions docs/token-diff/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
## editors
/.idea
/.vscode

## system files
.DS_Store

## npm
/node_modules/
/npm-debug.log

## testing
/coverage/

## temp folders
/.tmp/

# build
/_site/
/dist/
/out-tsc/

storybook-static
custom-elements.json
1 change: 1 addition & 0 deletions docs/token-diff/.husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
./node_modules/.bin/lint-staged
21 changes: 21 additions & 0 deletions docs/token-diff/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 token-diff

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
48 changes: 48 additions & 0 deletions docs/token-diff/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# \<token-diff>

This webcomponent follows the [open-wc](https://github.com/open-wc/open-wc) recommendation.

## Installation

```bash
npm i token-diff
```

## Usage

```html
<script type="module">
import 'token-diff/token-diff.js';
</script>

<token-diff></token-diff>
```

## Linting and formatting

To scan the project for linting and formatting errors, run

```bash
npm run lint
```

To automatically fix linting and formatting errors, run

```bash
npm run format
```


## Tooling configs

For most of the tools, the configuration is in the `package.json` to minimize the amount of files in your project.

If you customize the configuration a lot, you can consider moving them to individual files.

## Local Demo with `web-dev-server`

```bash
npm start
```

To run a local development server that serves the basic demo located in `demo/index.html`
32 changes: 32 additions & 0 deletions docs/token-diff/demo/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!doctype html>
<html lang="en-GB">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
<style>
body {
background: #fafafa;
}
</style>
</head>
<body>
<div id="demo"></div>

<script type="module">
import { html, render } from 'lit';
import '../src/components/token-diff.js';
import '../src/nav-bar.js';

const header = 'Hello owc World!';
render(
html`
<nav-bar></nav-bar>
<token-diff .header=${header}>
some light-dom
</token-diff>
`,
document.querySelector('#demo')
);
</script>
</body>
</html>
Binary file added docs/token-diff/images/adobe_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions docs/token-diff/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { NavBar } from './src/NavBar.js';
export { TokenDiff } from './src/components/TokenDiff.js';
61 changes: 61 additions & 0 deletions docs/token-diff/moon.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Copyright 2024 Adobe. All rights reserved.
# This file is licensed to you under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. You may obtain a copy
# of the License at http://www.apache.org/licenses/LICENSE-2.0

# Unless required by applicable law or agreed to in writing, software distributed under
# the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
# OF ANY KIND, either express or implied. See the License for the specific language
# governing permissions and limitations under the License.
$schema: "https://moonrepo.dev/schemas/project.json"
stack: "frontend"
tags:
- docs
- token-diff
fileGroups:
target:
- "/token-diff"
tasks:
copySchema:
command:
- cp
- -r
- ../../packages/tokens/schemas
- public/
platform: system
inputs:
- /packages/tokens/schemas/**/*.json
outputs:
- public/schemas
build:
command:
- next
- build
platform: node
deps:
- ~:copySchema
outputs:
- "/token-diff"
clean:
command:
- rimraf
- -g
- "../../token-diff"
platform: node
inputs:
- "@globs(target)"
start:
command:
- next
- dev
local: true
platform: node
deps:
- ~:build
export:
platform: node
deps:
- ~:clean
- ~:build
outputs:
- "/token-diff"
Loading
Loading