Repository navigation
docs(gamut-docs): move the docs site onto the color system #67
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
Open
dreamwasp
wants to merge
94
commits into
cass-gmt-1825-color-behavior
Choose a base branch
from
cass-gmt-1825-color-site
base: cass-gmt-1825-color-behavior
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
94 commits
Select commit
Hold shift + click to select a range
399c188
docs(gamut-docs): add the color system concept page
dreamwasp ed1f8a6
docs(gamut-docs): list the rebuilt admin, platform, percipio and lxSt…
dreamwasp e5165c3
Merge branch 'cass-gmt-1825-color-legacy-brands' into cass-gmt-1825-c…
dreamwasp 41c22f7
docs(gamut-docs): navy and beige unpinned; status alerts carry their ink
dreamwasp fcd29d1
docs(gamut-docs): percipioTheme is removed; five brands ship
dreamwasp f11a9dd
Merge remote-tracking branch 'origin/cass-gmt-1825-color-legacy-brand…
dreamwasp fe7333e
docs(gamut-docs): color system page follows design's sandbox update
dreamwasp 0c54a72
Merge cass-gmt-1825-color-legacy-brands into cass-gmt-1825-color-docs
dreamwasp bdab784
docs(gamut-docs): skillsoftTheme replaces percipioTheme; 204 componen…
dreamwasp 1f4d7fa
Merge branch 'cass-gmt-1825-color-legacy-brands' into cass-gmt-1825-c…
dreamwasp 2d9af71
Merge remote-tracking branch 'origin/cass-gmt-1825-color-legacy-brand…
dreamwasp 75a06be
Merge branch 'cass-gmt-1825-color-white-label' into cass-gmt-1825-col…
dreamwasp ed87041
docs(gamut-docs): color system page covers per-brand CSS and building…
dreamwasp ab01baf
Merge branch 'cass-gmt-1825-color-white-label' into cass-gmt-1825-col…
dreamwasp 47d1213
Merge branch 'cass-gmt-1825-color-docs' into cass-gmt-1825-color-site
dreamwasp 5086aa2
docs(gamut-docs): move the docs site onto the color system
dreamwasp 3e08400
refactor: use the singular --color- prefix for color variables
dreamwasp c30e2cb
refactor: use the singular --color- prefix for color variables
dreamwasp 6590fa7
Merge remote-tracking branch 'origin/cass-gmt-1825-color-legacy-brand…
dreamwasp c737460
fix(gamut-styles): preload each font file once
dreamwasp ef89118
fix(gamut-styles): preload each font file once
dreamwasp 069f6f1
docs(gamut-agent-tools): cover color-roles in the scope-swap skill
dreamwasp 841147d
docs(gamut-agent-tools): cover color-roles in the scope-swap skill
dreamwasp 1b5a4fc
docs(gamut-agent-tools): rename the scope-swap skill to gamut-migrati…
dreamwasp ee7f571
docs(gamut-agent-tools): point the README at the gamut-migration skill
dreamwasp 7712bcd
docs(gamut-agent-tools): drop a duplicated sentence in the migration …
dreamwasp 312dd33
docs(gamut-agent-tools): rename the scope-swap skill to gamut-migrati…
dreamwasp c7e9801
docs(gamut-agent-tools): point the README at the gamut-migration skill
dreamwasp 6195ab8
docs(gamut-agent-tools): drop a duplicated sentence in the migration …
dreamwasp 8124769
docs(gamut-codemods): point the README at the gamut-migration skill
dreamwasp 33bfc9a
feat(gamut-codemods): add required peers to scope-swap
dreamwasp 10834c5
docs(gamut-agent-tools): cover the migration gaps in the gamut-migrat…
dreamwasp 4b7f0ea
docs(gamut-agent-tools): cover the migration gaps in the gamut-migrat…
dreamwasp fe13dfa
docs(gamut-codemods): document the added peers
dreamwasp c43cce4
docs(gamut-agent-tools): explain the palette defaults in the gamut-mi…
dreamwasp f916969
docs(gamut-agent-tools): explain the palette defaults in the gamut-mi…
dreamwasp 25b3269
docs(gamut-agent-tools): add hyper and yellow guidance to the gamut-m…
dreamwasp 0f0b2b8
docs(gamut-agent-tools): add hyper and yellow guidance to the gamut-m…
dreamwasp cf98537
docs(gamut-agent-tools): add blue-500 guidance to the gamut-migration…
dreamwasp b97fc5c
docs(gamut-agent-tools): add blue-500 guidance to the gamut-migration…
dreamwasp a7dc219
docs(gamut-agent-tools): work through open color decisions with the u…
dreamwasp 45df730
docs(gamut-agent-tools): work through open color decisions with the u…
dreamwasp 3de67b7
docs(gamut-agent-tools): stop adding stylis by hand; cover the duplic…
dreamwasp eeb48e1
docs(gamut-agent-tools): stop adding stylis by hand; cover the duplic…
dreamwasp affc466
fix(gamut-codemods): stop adding stylis as a peer
dreamwasp 9adb2a9
docs(gamut-agent-tools): add Video peers only for apps that import Video
dreamwasp be2a19d
docs(gamut-agent-tools): add Video peers only for apps that import Video
dreamwasp 366f13e
feat(gamut-codemods): add vidstack and react-player only for apps tha…
dreamwasp 284d888
docs(gamut-codemods): the Video peers apply only to apps that import …
dreamwasp 7971516
Merge branch 'stack-white' into stack-docs
dreamwasp c1ce7f0
Merge branch 'stack-behavior' into stack-site
dreamwasp ed6e005
Merge branch 'stack-docs' into stack-site
dreamwasp cc84dcd
merge: bring the behavior and docs layers into the site branch
dreamwasp 1a45c88
Merge remote-tracking branch 'origin/main' into stack-docs
dreamwasp 68f96a0
Merge remote-tracking branch 'origin/main' into stack-site
dreamwasp 947de85
Merge branch 'stack-behavior' into stack-site
dreamwasp 00400bb
Merge branch 'stack-docs' into stack-site
dreamwasp e9607d3
Merge branch 'stack-white' into stack-docs
dreamwasp e998634
Merge branch 'stack-behavior' into stack-site
dreamwasp a59e9b0
Merge branch 'stack-behavior' into stack-site
dreamwasp 7dc4381
Merge remote-tracking branch 'origin/main' into stack-docs
dreamwasp 2728b83
Merge remote-tracking branch 'origin/main' into stack-site
dreamwasp a55ade6
Merge branch 'stack-behavior' into stack-site
dreamwasp 7182867
Merge branch 'stack-white' into stack-docs
dreamwasp c5dfcb8
Merge branch 'stack-docs' into stack-site
dreamwasp 404f3a8
Merge branch 'stack-white' into stack-docs
dreamwasp b26083a
Merge branch 'stack-behavior' into stack-site
dreamwasp fd29895
Merge branch 'stack-docs' into stack-site
dreamwasp 111c48e
Merge branch 'stack-behavior' into stack-site
dreamwasp 8be6a9d
Merge branch 'stack-docs' into stack-site
dreamwasp 11c1e5b
Merge branch 'stack-white' into stack-docs
dreamwasp 24437f5
Merge branch 'stack-behavior' into stack-site
dreamwasp 5227597
style(badge): use the warning ramp for the yellow gradient stop
dreamwasp 479a0e3
Merge commit '32e726434' into stack-site
dreamwasp c777e81
Merge commit '32e726434' into stack-docs
dreamwasp cb5826a
Merge branch 'cass-gmt-1825-color-site' of github.com:Codecademy/skil…
dreamwasp b7ad33e
feat(gamut-docs): load skillsoft theme fonts on the docs site
dreamwasp f1235eb
Merge branch 'cass-gmt-1825-color-white-label' into cass-gmt-1825-col…
dreamwasp 414010e
Merge branch 'cass-gmt-1825-color-behavior' into cass-gmt-1825-color-…
dreamwasp dab7ff6
Merge branch 'cass-gmt-1825-color-docs' into cass-gmt-1825-color-site
dreamwasp 4092e13
docs(gamut-docs): add disabled fields to the color system's role table
dreamwasp 879e11c
Merge branch 'cass-gmt-1825-color-docs' into cass-gmt-1825-color-site
dreamwasp 7003c4f
Merge branch 'cass-gmt-1825-color-behavior' into cass-gmt-1825-color-…
dreamwasp 2d73ebf
Merge branch 'cass-gmt-1825-color-behavior' into cass-gmt-1825-color-…
dreamwasp f4ec813
merge: bring the updated behavior into site
dreamwasp c00b544
merge: bring cass-gmt-1825-color-behavior into cass-gmt-1825-color-site
dreamwasp 25d6a79
merge: bring cass-gmt-1825-color-behavior into site
dreamwasp 4b4c162
Merge remote-tracking branch 'origin/cass-gmt-1825-color-behavior' in…
dreamwasp 1f79f5f
Merge remote-tracking branch 'origin/cass-gmt-1825-color-behavior' in…
dreamwasp 6e5aafd
Merge remote-tracking branch 'origin/cass-gmt-1825-color-behavior' in…
dreamwasp 25d5e00
Merge remote-tracking branch 'origin/cass-gmt-1825-color-behavior' in…
dreamwasp 36ef9ef
Merge remote-tracking branch 'origin/cass-gmt-1825-color-behavior' in…
dreamwasp 700830d
merge: bring the brand override fixes from white-label (from cass-gmt…
dreamwasp 24e9986
Merge remote-tracking branch 'origin/cass-gmt-1825-color-behavior' in…
dreamwasp 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
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,58 @@ | ||
| import fs from 'node:fs'; | ||
| import path from 'node:path'; | ||
|
|
||
| import { walk } from './leftovers'; | ||
|
|
||
| /* | ||
| Whether the source under a directory imports gamut, under either scope or | ||
| any of its subpaths. A worker in a repo that also has a gamut app never | ||
| imports it, and warnings about gamut's behaviour don't apply there. | ||
| */ | ||
| const SOURCE = /\.(m?[jt]sx?|c[jt]s|mdx?)$/; | ||
| const GAMUT_SPECIFIER = /['"`](?:@codecademy|@skillsoft)\/gamut[\w./-]*['"`]/; | ||
|
|
||
| const GAMUT_VIDEO_PATH = | ||
| /['"`](?:@codecademy|@skillsoft)\/gamut\/Video[\w/-]*['"`]/; | ||
| const IMPORT = | ||
| /import\s[^;]*?from\s*['"`]((?:@codecademy|@skillsoft)\/gamut[\w./-]*)['"`]/g; | ||
|
|
||
| const VIDEO_NAME = /\b(?:Video|VideoProps|MarkdownVideo)\b/; | ||
|
|
||
| /* True when the file imports a Video name from gamut, or reaches the Video subpath. */ | ||
| const usesVideoIn = (source: string) => { | ||
| if (GAMUT_VIDEO_PATH.test(source)) return true; | ||
| for (const match of source.matchAll(IMPORT)) { | ||
| const clause = match[0].slice(0, match[0].lastIndexOf('from')); | ||
| if (VIDEO_NAME.test(clause)) return true; | ||
| } | ||
| return false; | ||
| }; | ||
|
|
||
| const containsGamut = (dir: string, test: (source: string) => boolean) => { | ||
| for (const file of walk(dir)) { | ||
| if (!SOURCE.test(file)) continue; | ||
| if (test(fs.readFileSync(file, 'utf8'))) return true; | ||
| } | ||
| return false; | ||
| }; | ||
|
|
||
| const memoizedPer = (test: (source: string) => boolean) => { | ||
| const seen = new Map<string, boolean>(); | ||
| return (file: string) => { | ||
| const dir = path.dirname(file); | ||
| let known = seen.get(dir); | ||
| if (known === undefined) { | ||
| known = containsGamut(dir, test); | ||
| seen.set(dir, known); | ||
| } | ||
| return known; | ||
| }; | ||
| }; | ||
|
|
||
| export const videoUsage = () => memoizedPer(usesVideoIn); | ||
|
|
||
| /* | ||
| One check per run: each directory is walked once, however many files in | ||
| it ask. The CLI makes one of these and hands each file a closure over it. | ||
| */ | ||
| export const gamutUsage = () => | ||
| memoizedPer((source) => GAMUT_SPECIFIER.test(source)); | ||
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
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
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
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
7 changes: 7 additions & 0 deletions
7
...ges/gamut-codemods/src/migrations/package-json/__testfixtures__/required-peers.input.json
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,7 @@ | ||
| { | ||
| "name": "app", | ||
| "dependencies": { | ||
| "@codecademy/gamut": "^73.0.0", | ||
| "react": "^18.3.0" | ||
| } | ||
| } |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good to know, I'll update the prop name stack to include this info!