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

Extracts component styles as Tailwind plugins #18

Merged
merged 11 commits into from
Sep 28, 2023

Conversation

AlanBreck
Copy link
Collaborator

No description provided.

@AlanBreck AlanBreck requested a review from petemill August 11, 2022 21:32
@AlanBreck AlanBreck changed the title WIP: extracts component styles as Tailwind plugins Extracts component styles as Tailwind plugins Aug 24, 2022
@AlanBreck AlanBreck force-pushed the extract-component-styles branch from 037efce to 4b918af Compare August 24, 2022 18:53
Copy link
Collaborator

@fallaciousreasoning fallaciousreasoning left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks pretty good to me (and I'm stoked that we'll be able to use Tailwind!).

@socket-security
Copy link

socket-security bot commented Jul 14, 2023

New dependencies detected. Learn more about Socket for GitHub ↗︎

Packages Version New capabilities Transitives Size Publisher
postcss-sort-media-queries 4.2.1 None +1 34.1 kB yunusga

const cssAsJs = postcssJs.objectify(root)

return writeFile(
join(config.buildPath, 'plugins', `${fileParts.name}Component.js`),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
[semgrep] Detected possible user input going into a path.join or path.resolve function. This could possibly lead to a path traversal vulnerability, where the attacker can access arbitrary files stored in the file system. Instead, be sure to sanitize or validate user input first.

Source: https://semgrep.dev/r/javascript.lang.security.audit.path-traversal.path-join-resolve-traversal.path-join-resolve-traversal


Cc @thypon @bcaller

@fallaciousreasoning
Copy link
Collaborator

Looks like format is failing - running npm run format should fix it 😄

@@ -5,6 +5,9 @@ const postcss = require('postcss')

const cssFiles = ['variables.css']

const genPluginFilePath = (file, config) =>
join(config.buildPath, 'plugins', `_${file}.ts`)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
[semgrep] Detected possible user input going into a path.join or path.resolve function. This could possibly lead to a path traversal vulnerability, where the attacker can access arbitrary files stored in the file system. Instead, be sure to sanitize or validate user input first.

Source: https://semgrep.dev/r/javascript.lang.security.audit.path-traversal.path-join-resolve-traversal.path-join-resolve-traversal


Cc @thypon @bcaller

@AlanBreck AlanBreck force-pushed the extract-component-styles branch from 8a79230 to f74fb10 Compare August 23, 2023 21:33
@AlanBreck AlanBreck temporarily deployed to staging August 23, 2023 21:34 — with GitHub Actions Inactive
@github-actions
Copy link
Contributor

👋 Thanks for Submitting! This PR is available for preview at the link below.

✅ PR tip preview: https://18.pr.leo.bravesoftware.com/
✅ Commit preview: https://18.pr.leo.bravesoftware.com/commit-f9ddb6526ea6ed62f1d62a7cd1ba9f958dcbca6f/

Variables Diff
--- ./tokens/css/variables.old.css	2023-08-23 21:36:39.246926648 +0000
+++ ./tokens/css/variables.css	2023-08-23 21:35:55.610908822 +0000
@@ -1,6 +1,6 @@
 /**
  * Do not edit directly
- * Generated on Wed Aug 23 2023 19:58:56 GMT+0000 (Coordinated Universal Time)
+ * Generated on Wed Aug 23 2023 21:35:55 GMT+0000 (Coordinated Universal Time)
  */
 
 :root {

@AlanBreck AlanBreck force-pushed the extract-component-styles branch from 050bec3 to a2924c2 Compare August 29, 2023 22:24
@AlanBreck AlanBreck temporarily deployed to staging August 29, 2023 22:24 — with GitHub Actions Inactive
@AlanBreck AlanBreck force-pushed the extract-component-styles branch from a2924c2 to bde3e4e Compare August 29, 2023 23:26
@AlanBreck AlanBreck temporarily deployed to staging August 29, 2023 23:26 — with GitHub Actions Inactive
Co-authored-by: Jay Harris <[email protected]>
@github-actions
Copy link
Contributor

👋 Thanks for Submitting! This PR is available for preview at the link below.

✅ PR tip preview: https://18.pr.leo.bravesoftware.com/
✅ Commit preview: https://18.pr.leo.bravesoftware.com/commit-bde3e4e6cc1017cae9966603ab766e801f5bf024/

Variables Diff
--- ./tokens/css/variables.old.css	2023-08-29 23:28:04.867956166 +0000
+++ ./tokens/css/variables.css	2023-08-29 23:27:24.829616830 +0000
@@ -1,6 +1,6 @@
 /**
  * Do not edit directly
- * Generated on Tue Aug 29 2023 22:01:19 GMT+0000 (Coordinated Universal Time)
+ * Generated on Tue Aug 29 2023 23:27:24 GMT+0000 (Coordinated Universal Time)
  */
 
 :root {

@AlanBreck AlanBreck temporarily deployed to staging August 29, 2023 23:30 — with GitHub Actions Inactive
@github-actions
Copy link
Contributor

👋 Thanks for Submitting! This PR is available for preview at the link below.

✅ PR tip preview: https://18.pr.leo.bravesoftware.com/
✅ Commit preview: https://18.pr.leo.bravesoftware.com/commit-dafdfd6fb5655990ba1847520493661b40395562/

Variables Diff
--- ./tokens/css/variables.old.css	2023-08-29 23:31:33.441230125 +0000
+++ ./tokens/css/variables.css	2023-08-29 23:31:01.025096186 +0000
@@ -1,6 +1,6 @@
 /**
  * Do not edit directly
- * Generated on Tue Aug 29 2023 22:01:19 GMT+0000 (Coordinated Universal Time)
+ * Generated on Tue Aug 29 2023 23:31:01 GMT+0000 (Coordinated Universal Time)
  */
 
 :root {

@fallaciousreasoning
Copy link
Collaborator

Does this fix #4?

@AlanBreck
Copy link
Collaborator Author

Does this fix #4?

It sounds like it might, but I'm not certain.

@AlanBreck AlanBreck temporarily deployed to staging September 7, 2023 18:22 — with GitHub Actions Inactive
@AlanBreck AlanBreck force-pushed the extract-component-styles branch from 7f43ebd to 98e60f0 Compare September 7, 2023 18:23
@github-actions
Copy link
Contributor

github-actions bot commented Sep 7, 2023

👋 Thanks for Submitting! This PR is available for preview at the link below.

✅ PR tip preview: https://18.pr.leo.bravesoftware.com/
✅ Commit preview: https://18.pr.leo.bravesoftware.com/commit-7f43ebde2521341a258eaf40ec3e5c671efb10a0/

Variables Diff
--- ./tokens/css/variables.old.css	2023-09-07 18:24:26.083004949 +0000
+++ ./tokens/css/variables.css	2023-09-07 18:23:51.138332856 +0000
@@ -1,6 +1,6 @@
 /**
  * Do not edit directly
- * Generated on Wed Sep 06 2023 21:27:54 GMT+0000 (Coordinated Universal Time)
+ * Generated on Thu Sep 07 2023 18:23:51 GMT+0000 (Coordinated Universal Time)
  */
 
 :root {

@AlanBreck AlanBreck temporarily deployed to staging September 7, 2023 18:26 — with GitHub Actions Inactive
@github-actions
Copy link
Contributor

github-actions bot commented Sep 7, 2023

👋 Thanks for Submitting! This PR is available for preview at the link below.

✅ PR tip preview: https://18.pr.leo.bravesoftware.com/
✅ Commit preview: https://18.pr.leo.bravesoftware.com/commit-98e60f0e0bd0d0cd9a71810a642b5e27bf8d1e13/

Variables Diff
--- ./tokens/css/variables.old.css	2023-09-07 18:28:27.170340742 +0000
+++ ./tokens/css/variables.css	2023-09-07 18:27:38.742108830 +0000
@@ -1,6 +1,6 @@
 /**
  * Do not edit directly
- * Generated on Wed Sep 06 2023 21:27:54 GMT+0000 (Coordinated Universal Time)
+ * Generated on Thu Sep 07 2023 18:27:38 GMT+0000 (Coordinated Universal Time)
  */
 
 :root {

Copy link
Collaborator

@fallaciousreasoning fallaciousreasoning left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@AlanBreck AlanBreck force-pushed the extract-component-styles branch from 98e60f0 to fbe77c8 Compare September 28, 2023 21:45
@AlanBreck AlanBreck temporarily deployed to staging September 28, 2023 21:45 — with GitHub Actions Inactive
@github-actions
Copy link
Contributor

👋 Thanks for Submitting! This PR is available for preview at the link below.

✅ PR tip preview: https://18.pr.nala.bravesoftware.com/
✅ Commit preview: https://18.pr.nala.bravesoftware.com/commit-fbe77c8c17f3a0cb6a8858d02f9252c83447fb5b/

Variables Diff
--- ./tokens/css/variables.old.css	2023-09-28 21:46:51.510420868 +0000
+++ ./tokens/css/variables.css	2023-09-28 21:46:10.385932891 +0000
@@ -1,6 +1,6 @@
 /**
  * Do not edit directly
- * Generated on Thu Sep 28 2023 21:25:54 GMT+0000 (Coordinated Universal Time)
+ * Generated on Thu Sep 28 2023 21:46:10 GMT+0000 (Coordinated Universal Time)
  */
 
 :root {

@AlanBreck AlanBreck merged commit 74ac237 into main Sep 28, 2023
@AlanBreck AlanBreck deleted the extract-component-styles branch September 28, 2023 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants