Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .moon/workspace.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ projects:
transform-tokens-json: "tools/transform-tokens-json"
root: "."
diff: "tools/diff-generator"
tdiff: "docs/token-diff"
vcs:
manager: "git"
defaultBranch: "main"
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 = */
27 changes: 27 additions & 0 deletions docs/token-diff/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
## 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

# api keys
github-api-key.ts
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 reduce 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`
44 changes: 44 additions & 0 deletions docs/token-diff/demo/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<!doctype html>
<html lang="en-GB" class="spectrum spectrum--medium spectrum--light">
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, viewport-fit=cover"
/>
<style>
:host {
overflow-x: hidden;
}
body {
background: #fafafa;
margin: 0;
}
.page {
display: flex;
height: 100vh;
width: 100vw;
overflow-y: hidden;
}
</style>
<link rel="preconnect" href="https://use.typekit.net" />
<link rel="dns-prefetch" href="https://use.typekit.net" />
<link rel="stylesheet" href="https://use.typekit.net/evk7lzt.css" />
</head>
<body>
<div id="demo"></div>

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

render(
html` <page-container></page-container> `,
document.querySelector('#demo'),
);
</script>
</body>
</html>
1 change: 1 addition & 0 deletions docs/token-diff/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
declare module '@adobe/token-diff-generator';
36 changes: 36 additions & 0 deletions docs/token-diff/moon.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# 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
type: application
tags:
- docs
- token-diff
fileGroups:
sources:
- "src/**/*"
config:
- "tsconfig.json"
- "web-dev-server.config.js"
tasks:
build:
command:
- build
deps:
- ~:typescript
platform: node
inputs:
- "config"
- "@globs(sources)"
outputs:
- "/token-diff"
typescript:
command: tsc
platform: node
104 changes: 104 additions & 0 deletions docs/token-diff/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
{
"name": "token-diff",
"description": "Webcomponent token-diff following open-wc recommendations",
"license": "MIT",
"author": "token-diff",
"version": "0.0.0",
"type": "module",
"main": "dist/src/index.js",
"module": "dist/src/index.js",
"exports": {
".": "./dist/src/index.js",
"./token-diff.js": "./dist/src/token-diff.js"
},
"scripts": {
"analyze": "cem analyze --litelement",
"start": "tsc && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"web-dev-server\"",
"build": "tsc && npm run analyze -- --exclude dist",
"prepublish": "tsc && npm run analyze -- --exclude dist",
"lint": "eslint --ext .ts,.html . --ignore-path .gitignore && prettier \"**/*.ts\" --check --ignore-path .gitignore",
"format": "eslint --ext .ts,.html . --fix --ignore-path .gitignore && prettier \"**/*.ts\" --write --ignore-path .gitignore",
"prepare": "husky"
},
"dependencies": {
"@adobe/token-diff-generator": "workspace:*",
"@spectrum-css/button": "^13.1.1",
"@spectrum-css/icon": "^7.1.1",
"@spectrum-css/page": "^7.1.4",
"@spectrum-css/tokens": "^13.2.0",
"@spectrum-css/typography": "^5.1.5",
"@spectrum-web-components/action-button": "0.45.0",
"@spectrum-web-components/action-group": "^0.45.0",
"@spectrum-web-components/button": "0.45.0",
"@spectrum-web-components/card": "^0.45.0",
"@spectrum-web-components/dialog": "0.45.0",
"@spectrum-web-components/divider": "0.45.0",
"@spectrum-web-components/field-label": "^0.45.0",
"@spectrum-web-components/icons-ui": "0.45.0",
"@spectrum-web-components/icons-workflow": "0.45.0",
"@spectrum-web-components/menu": "^0.45.0",
"@spectrum-web-components/overlay": "0.45.0",
"@spectrum-web-components/picker": "^0.45.0",
"@spectrum-web-components/popover": "0.45.0",
"@spectrum-web-components/sidenav": "^0.45.0",
"@spectrum-web-components/styles": "0.45.0",
"@spectrum-web-components/table": "0.45.0",
"@spectrum-web-components/tabs": "0.45.0",
"@spectrum-web-components/theme": "0.45.0",
"@spectrum-web-components/toast": "0.45.0",
"@spectrum-web-components/underlay": "0.45.0",
"@types/node": "v20.12.2",
"@types/promise-fs": "^2.1.5",
"@vaadin/router": "^1.7.5",
"lit": "^3.1.4",
"tmp-promise": "^3.0.3",
"tslib": "^2.6.3"
},
"devDependencies": {
"@custom-elements-manifest/analyzer": "^0.10.3",
"@open-wc/eslint-config": "^12.0.3",
"@types/jquery": "^3.5.30",
"@typescript-eslint/eslint-plugin": "^7.16.0",
"@typescript-eslint/parser": "^7.16.0",
"@web/dev-server": "^0.4.6",
"concurrently": "^8.2.2",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"husky": "^9.0.11",
"lint-staged": "^15.2.7",
"prettier": "^3.3.2",
"typescript": "^5.5.3"
},
"customElements": "custom-elements.json",
"eslintConfig": {
"parser": "@typescript-eslint/parser",
"extends": [
"@open-wc",
"prettier"
],
"plugins": [
"@typescript-eslint"
],
"rules": {
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "error",
"import/no-unresolved": "off",
"import/extensions": [
"error",
"always",
{
"ignorePackages": true
}
]
}
},
"prettier": {
"singleQuote": true,
"arrowParens": "avoid"
},
"lint-staged": {
"*.ts": [
"prettier --write"
]
}
}
Loading
Loading