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

feature/issue 23 Styleguide and Design System #36

Merged
merged 61 commits into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from 46 commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
abe5642
Add files via upload
Auhseh Apr 12, 2024
46c7d16
Add files via upload
Auhseh Apr 12, 2024
9a0e1b7
Update styleguide.mdx
Auhseh Apr 12, 2024
91f4cd9
Update styleguide.mdx
Auhseh Apr 12, 2024
710018c
Add files via upload
Auhseh Apr 12, 2024
3b2e9e3
Update theme.css
Auhseh Apr 12, 2024
d29c81a
install geist font from npm
thescientist13 Apr 13, 2024
27911c7
patch CSS url bundling from Greenwood
thescientist13 Apr 13, 2024
915fea7
Update documentation.mdx
Auhseh Apr 15, 2024
0554044
Update documentation.mdx
Auhseh Apr 15, 2024
9358f53
Update documentation.mdx
Auhseh Apr 15, 2024
8c0ac1c
Rename documentation.mdx to Documentation.mdx
Auhseh Apr 15, 2024
b377879
Update and rename techstack.mdx to Techstack.mdx
Auhseh Apr 15, 2024
309e81f
Update Techstack.mdx
Auhseh Apr 15, 2024
9491079
Update Documentation.mdx
Auhseh Apr 15, 2024
2393125
Update theme.css
Auhseh Apr 15, 2024
67ba0ba
Update styleguide.mdx
Auhseh Apr 15, 2024
2dcfa53
Update Documentation.mdx
Auhseh Apr 15, 2024
efa6881
Update and rename styleguide.mdx to Styleguide.mdx
Auhseh Apr 15, 2024
f703b8a
Update Styleguide.mdx
Auhseh Apr 15, 2024
da0bb55
Update Styleguide.mdx
Auhseh Apr 15, 2024
7073e75
Update Styleguide.mdx
Auhseh Apr 15, 2024
92f5a6f
Update Styleguide.mdx
Auhseh Apr 15, 2024
cda893e
Update Styleguide.mdx
Auhseh Apr 15, 2024
6e34c1c
Update Styleguide.mdx
Auhseh Apr 15, 2024
3b0194a
Update Styleguide.mdx
Auhseh Apr 15, 2024
53b729f
Update Styleguide.mdx
Auhseh Apr 15, 2024
80e73fa
Update theme.css
Auhseh Apr 15, 2024
ae52e8c
Update Styleguide.mdx
Auhseh Apr 15, 2024
a354955
Update theme.css
Auhseh Apr 15, 2024
0d944c3
Update Styleguide.mdx
Auhseh Apr 15, 2024
f3fdabe
Update Styleguide.mdx
Auhseh Apr 15, 2024
527af66
Update Styleguide.mdx
Auhseh Apr 15, 2024
b25bacc
Update Documentation.mdx
Auhseh Apr 15, 2024
ffef8b2
Update Styleguide.mdx
Auhseh Apr 15, 2024
1c3754c
Update Styleguide.mdx
Auhseh Apr 15, 2024
a5f5df2
Create test
Auhseh Apr 17, 2024
a0e272d
Add files via upload
Auhseh Apr 17, 2024
68c8ce4
Delete src/assets/test
Auhseh Apr 17, 2024
6be9c5a
Add files via upload
Auhseh Apr 17, 2024
7f6bd7d
Add files via upload
Auhseh Apr 17, 2024
e0ed7f9
Add files via upload
Auhseh Apr 17, 2024
fe08535
Update Techstack.mdx
Auhseh Apr 17, 2024
a8deb02
final tweaks to styleguide
thescientist13 Apr 18, 2024
7fc204d
file renaming
thescientist13 Apr 18, 2024
9232578
naming conventions
thescientist13 Apr 18, 2024
572e6e6
Create readme.md
Auhseh Apr 19, 2024
eea7c3f
Update readme.md
Auhseh Apr 19, 2024
603248b
Update readme.md
Auhseh Apr 19, 2024
4c8696e
Update readme.md
Auhseh Apr 19, 2024
6864906
Update readme.md
Auhseh Apr 19, 2024
63aa30e
Delete src/assets/emphasis_splash.svg
Auhseh Apr 19, 2024
544eea9
Delete src/assets/Grid wh.svg
Auhseh Apr 19, 2024
fadeff8
Delete src/assets/github-logo.svg
Auhseh Apr 19, 2024
f17bd98
Add files via upload
Auhseh Apr 19, 2024
0cc9f80
Add files via upload
Auhseh Apr 19, 2024
7c99eca
Add files via upload
Auhseh Apr 19, 2024
406c583
Rename Emphasis_splash.svg to Emphasis-splash.svg
Auhseh Apr 19, 2024
4bba42d
Update readme.md
Auhseh Apr 19, 2024
c56aafe
misc file renaming and final styleguide docs tweaks
thescientist13 Apr 19, 2024
d8f9b73
add border box default
thescientist13 Apr 26, 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
597 changes: 476 additions & 121 deletions package-lock.json

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@
"story:build": "storybook build",
"story:serve": "npm run clean && npm run story:build && http-server ./storybook-static",
"test": "wtr",
"test:tdd": "npm run test -- --watch"
"test:tdd": "npm run test -- --watch",
"postinstall": "patch-package"
},
"dependencies": {
"geist": "^1.2.0"
},
"devDependencies": {
"@chromatic-com/storybook": "^1.3.1",
Expand All @@ -39,6 +43,7 @@
"@web/test-runner-junit-reporter": "^0.7.1",
"http-server": "^14.1.1",
"lit": "^3.1.2",
"patch-package": "^8.0.0",
"rimraf": "^5.0.5",
"storybook": "^8.0.6",
"vite": "^5.2.8"
Expand Down
71 changes: 71 additions & 0 deletions patches/@greenwood+cli+0.29.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
diff --git a/node_modules/@greenwood/cli/src/plugins/resource/plugin-standard-css.js b/node_modules/@greenwood/cli/src/plugins/resource/plugin-standard-css.js
index d52c723..2aedcc3 100644
--- a/node_modules/@greenwood/cli/src/plugins/resource/plugin-standard-css.js
+++ b/node_modules/@greenwood/cli/src/plugins/resource/plugin-standard-css.js
@@ -5,10 +5,14 @@
*
*/
import fs from 'fs';
+import path from 'path';
import { parse, walk } from 'css-tree';
import { ResourceInterface } from '../../lib/resource-interface.js';
+import { normalizePathnameForWindows } from '../../lib/resource-utils.js';
+import { hashString } from '../../lib/hashing-utils.js';

-function bundleCss(body, url, projectDirectory) {
+function bundleCss(body, url, compilation) {
+ const { projectDirectory, outputDir, userWorkspace } = compilation.context;
const ast = parse(body, {
onParseError(error) {
console.log(error.formattedMessage);
@@ -29,10 +33,40 @@ function bundleCss(body, url, projectDirectory) {
: new URL(value, url);
const importContents = fs.readFileSync(resolvedUrl, 'utf-8');

- optimizedCss += bundleCss(importContents, url, projectDirectory);
+ optimizedCss += bundleCss(importContents, url, compilation);
} else {
optimizedCss += `@import url('${value}');`;
}
+ } else if (type === 'Url' && this.atrule?.name !== 'import') {
+ if (value.startsWith('http') || value.startsWith('//')) {
+ optimizedCss += `url('${value}')`;
+ return;
+ }
+
+ const basePath = compilation.config.basePath === '' ? '/' : `${compilation.config.basePath}/`;
+ let barePath = value.replace(/\.\.\//g, '').replace('./', '');
+
+ if (barePath.startsWith('/')) {
+ barePath = barePath.replace('/', '');
+ }
+
+ const locationUrl = barePath.startsWith('node_modules')
+ ? new URL(`./${barePath}`, projectDirectory)
+ : new URL(`./${barePath}`, userWorkspace);
+ const hash = hashString(fs.readFileSync(locationUrl, 'utf-8'));
+ const ext = barePath.split('.').pop();
+ const hashedRoot = barePath.replace(`.${ext}`, `.${hash}.${ext}`);
+
+ fs.mkdirSync(normalizePathnameForWindows(new URL(`./${path.dirname(barePath)}/`, outputDir)), {
+ recursive: true
+ });
+
+ fs.promises.copyFile(
+ locationUrl,
+ new URL(`./${hashedRoot}`, outputDir)
+ );
+
+ optimizedCss += `url('${basePath}${hashedRoot}')`;
} else if (type === 'Atrule' && name !== 'import') {
optimizedCss += `@${name} `;
} else if (type === 'TypeSelector') {
@@ -238,7 +272,7 @@ class StandardCssResource extends ResourceInterface {

async optimize(url, response) {
const body = await response.text();
- const optimizedBody = bundleCss(body, url, this.compilation.context.projectDirectory);
+ const optimizedBody = bundleCss(body, url, this.compilation);

return new Response(optimizedBody);
}
48 changes: 48 additions & 0 deletions src/assets/Grid wh.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions src/assets/api-routes.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions src/assets/build-ssg.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions src/assets/center grid.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions src/assets/copy-button.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions src/assets/emphasis_splash.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/assets/github-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading