-
Notifications
You must be signed in to change notification settings - Fork 11
chore(docs): add design md file #195
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| # Elements design artifacts | ||
|
|
||
| This private workspace project owns build-time design analysis and generated artifacts that describe the NVIDIA Elements design system as a whole. | ||
|
|
||
| ## DESIGN.md | ||
|
|
||
| `src/design-md.js` resolves maintained Elements theme tokens and combines them with reviewed design and component guidance. The build writes the result to `dist/DESIGN.md`. | ||
|
|
||
| Run `pnpm build` to generate the internal artifact. Run `pnpm sync:root` when an intentional generator change should update the checked-in `DESIGN.md` at the repository root. | ||
|
|
||
| Tests verify that the built and repository artifacts match the generator. The site consumes the built artifact and publishes it at `/DESIGN.md`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| import { nodeJavaScriptConfig } from '@internals/eslint'; | ||
|
|
||
| /** @type {import('eslint').Linter.Config[]} */ | ||
| export default [ | ||
| ...nodeJavaScriptConfig, | ||
| { | ||
| files: ['src/design-md.js'], | ||
| rules: { | ||
| 'max-lines': 'off', | ||
| 'max-lines-per-function': 'off' | ||
| } | ||
| } | ||
| ]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,106 @@ | ||
| { | ||
| "name": "@internals/design", | ||
| "version": "0.0.0", | ||
| "private": true, | ||
| "description": "Build-time analysis and generated design artifacts for NVIDIA Elements.", | ||
| "type": "module", | ||
| "scripts": { | ||
| "ci": "wireit", | ||
| "build": "wireit", | ||
| "sync:root": "wireit", | ||
| "lint": "wireit", | ||
| "lint:fix": "wireit", | ||
| "test": "wireit", | ||
| "test:spec": "wireit" | ||
| }, | ||
| "exports": { | ||
| "./DESIGN.md": "./dist/DESIGN.md" | ||
| }, | ||
| "devDependencies": { | ||
| "@google/design.md": "0.4.0", | ||
| "@internals/eslint": "workspace:*", | ||
| "@nvidia-elements/themes": "workspace:*", | ||
| "eslint": "catalog:", | ||
| "vitest": "catalog:" | ||
| }, | ||
| "wireit": { | ||
| "ci": { | ||
| "dependencies": [ | ||
| "lint", | ||
| "test" | ||
| ] | ||
| }, | ||
| "build": { | ||
| "command": "node ./scripts/write-design-md.js dist/DESIGN.md", | ||
| "files": [ | ||
| "src/design-md.js", | ||
| "scripts/write-design-md.js", | ||
| "../../themes/dist/index.json", | ||
| "package.json" | ||
| ], | ||
| "output": [ | ||
| "dist/DESIGN.md" | ||
| ], | ||
| "dependencies": [ | ||
| { | ||
| "script": "../../themes:build", | ||
| "cascade": false | ||
| } | ||
| ] | ||
| }, | ||
| "sync:root": { | ||
| "command": "node ./scripts/write-design-md.js ../../../DESIGN.md", | ||
| "files": [ | ||
| "src/design-md.js", | ||
| "../../themes/dist/index.json" | ||
| ], | ||
| "output": [ | ||
| "./dist/DESIGN.md" | ||
| ], | ||
|
coryrylan marked this conversation as resolved.
|
||
| "dependencies": [ | ||
| "build" | ||
| ] | ||
| }, | ||
| "lint": { | ||
| "command": "eslint -c ./eslint.config.js --color --cache --cache-location .eslintcache/", | ||
| "files": [ | ||
| "src/**/*.js", | ||
| "src/**/*.ts", | ||
| "scripts/**/*.js", | ||
| "eslint.config.js" | ||
| ], | ||
| "output": [], | ||
| "dependencies": [ | ||
| "../eslint:ci" | ||
| ] | ||
| }, | ||
| "lint:fix": { | ||
| "command": "eslint -c ./eslint.config.js --fix", | ||
| "dependencies": [ | ||
| "../eslint:ci" | ||
| ] | ||
| }, | ||
| "test": { | ||
| "command": "vitest run", | ||
| "files": [ | ||
| "dist/DESIGN.md", | ||
| "src/**/*.test.js" | ||
| ], | ||
| "output": [], | ||
| "dependencies": [ | ||
| "build", | ||
| "test:spec" | ||
| ] | ||
| }, | ||
| "test:spec": { | ||
| "command": "designmd lint dist/DESIGN.md", | ||
| "files": [ | ||
| "dist/DESIGN.md" | ||
| ], | ||
| "output": [], | ||
| "dependencies": [ | ||
| "build" | ||
| ] | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| import { promises as fsp } from 'node:fs'; | ||
| import nodePath from 'node:path'; | ||
| import { createDesignMdContent } from '../src/design-md.js'; | ||
|
|
||
| const outputPath = nodePath.resolve(process.argv[2] ?? 'dist/DESIGN.md'); | ||
|
|
||
| await fsp.mkdir(nodePath.dirname(outputPath), { recursive: true }); | ||
| await fsp.writeFile(outputPath, createDesignMdContent(), 'utf-8'); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.