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

[BD-46] feat: move CLI design tokens commands to paragon CLI #2609

Merged

Conversation

monteri
Copy link
Contributor

@monteri monteri commented Sep 8, 2023

Description

Include a description of your changes here, along with a link to any relevant Jira tickets and/or Github issues.

Merge Checklist

  • If your update includes visual changes, have they been reviewed by a designer? Send them a link to the Netlify deploy preview, if applicable.
  • Does your change adhere to the documented style conventions?
  • Do any prop types have missing descriptions in the Props API tables in the documentation site (check deploy preview)?
  • Were your changes tested using all available themes (see theme switcher in the header of the deploy preview, under the "Settings" icon)?
  • Were your changes tested in the example app?
  • Is there adequate test coverage for your changes?
  • Consider whether this change needs to reviewed/QA'ed for accessibility (a11y). If so, please add wittjeff and adamstankiewicz as reviewers on this PR.

Post-merge Checklist

  • Verify your changes were released to NPM at the expected version.
  • If you'd like, share your contribution in #show-and-tell.
  • 🎉 🙌 Celebrate! Thanks for your contribution.

@openedx-webhooks openedx-webhooks added the blended PR is managed through 2U's blended developmnt program label Sep 8, 2023
@openedx-webhooks
Copy link

openedx-webhooks commented Sep 8, 2023

Thanks for the pull request, @monteri!

When this pull request is ready, tag your edX technical lead.

@netlify
Copy link

netlify bot commented Sep 8, 2023

Deploy Preview for paragon-openedx ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit bca0f30
🔍 Latest deploy log https://app.netlify.com/sites/paragon-openedx/deploys/653bba6a3cdbf9000880c741
😎 Deploy Preview https://deploy-preview-2609--paragon-openedx.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@monteri monteri marked this pull request as draft September 8, 2023 14:27
@monteri
Copy link
Contributor Author

monteri commented Sep 8, 2023

I propose to add descriptions for newly added commands after the help command PR will be merged.
#2603

@codecov
Copy link

codecov bot commented Sep 8, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.28%. Comparing base (2eae85c) to head (bca0f30).
Report is 680 commits behind head on alpha.

Additional details and impacted files
@@            Coverage Diff             @@
##            alpha    #2609      +/-   ##
==========================================
+ Coverage   92.09%   93.28%   +1.19%     
==========================================
  Files         215      215              
  Lines        3616     3635      +19     
  Branches      890      898       +8     
==========================================
+ Hits         3330     3391      +61     
+ Misses        281      239      -42     
  Partials        5        5              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@PKulkoRaccoonGang PKulkoRaccoonGang force-pushed the zadorozhnii/design-tokens-cli-commands branch from 7bb10d2 to ff2569c Compare September 27, 2023 09:46
@PKulkoRaccoonGang PKulkoRaccoonGang force-pushed the zadorozhnii/design-tokens-cli-commands branch 3 times, most recently from dfd8156 to b363867 Compare October 4, 2023 07:48
@PKulkoRaccoonGang PKulkoRaccoonGang force-pushed the zadorozhnii/design-tokens-cli-commands branch from b363867 to e9eedf9 Compare October 4, 2023 08:36
@PKulkoRaccoonGang PKulkoRaccoonGang force-pushed the zadorozhnii/design-tokens-cli-commands branch from 140bb96 to 1de83ba Compare October 4, 2023 09:36
Copy link
Contributor

@viktorrusakov viktorrusakov left a comment

Choose a reason for hiding this comment

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

@PKulkoRaccoonGang Left some initial comments, I will try to take another look later today

bin/paragon-scripts.js Show resolved Hide resolved
Comment on lines 184 to 187
if (command === HELP_COMMAND) {
helpCommand(COMMANDS);
helpCommand(COMMANDS, commandArgs);
return;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you can remove this code if you define help's executor as follows:

 help: {
    executor: (args) => helpCommand(COMMANDS, args),
    ...

then try / catch below will be able to correctly execute help command

Copy link
Contributor

Choose a reason for hiding this comment

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

Corrected

Comment on lines 140 to 142
ora().succeed(chalk.underline.bold.green(`Stylesheets for ${capitalize(name)} build successfully!`));
// eslint-disable-next-line no-console
console.log();
Copy link
Contributor

@viktorrusakov viktorrusakov Oct 19, 2023

Choose a reason for hiding this comment

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

You can avoid using console.log by adding \n to the previous line ora().succeed(chalk.underline.bold.green("Stylesheets for ${capitalize(name)} build successfully!\n"));

Also, right now it says the following when I run the command
image

I think it would be better to change the wording to something like this
image
just a suggestion (although I think we definitely need to add word theme somewhere, just saying Light / Core is not enough I think)

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, it looks better

Comment on lines 154 to 159
function buildScssCommand(commandArgs) {
const argv = minimist(commandArgs);
const corePath = argv.corePath || path.resolve(process.cwd(), 'styles/scss/core/core.scss');
const themesPath = argv.themesPath || path.resolve(process.cwd(), 'styles/css/themes');
const outDir = argv.outDir || './dist';
const defaultThemeVariants = argv.defaultThemeVariants ? argv.defaultThemeVariants.split(',') : ['light'];
Copy link
Contributor

Choose a reason for hiding this comment

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

Reading through minimist docs I found that you can provide default values to args, I think we should try doing that, right now it looks a little dirty

this seems to work for me locally (also, I don't think you need to split defaultThemeVariants)

function buildScssCommand(commandArgs) {
  const defaultArgs = {
    corePath: path.resolve(process.cwd(), 'styles/scss/core/core.scss'),
    themesPath: path.resolve(process.cwd(), 'styles/css/themes'),
    outDir: './dist',
    defaultThemeVariants: 'light',
  };

  const {
    corePath,
    themesPath,
    outDir,
    defaultThemeVariants,
  } = minimist(commandArgs, { default: defaultArgs });

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks

@PKulkoRaccoonGang PKulkoRaccoonGang force-pushed the zadorozhnii/design-tokens-cli-commands branch from 37ee123 to db966ac Compare October 20, 2023 10:19
README.md Outdated
Comment on lines 64 to 67
- `paragon install-theme [theme]`: Installs the specific [@edx/brand](https://github.com/edx/brand-edx.org) package.
- `build-tokens`: Build Paragon's design tokens.
- `replace-variables`: Replace SCSS variables usages or definitions to CSS variables and vice versa in `.scss` files.
- `build-scss`: Compile Paragon's core and themes SCSS into CSS.
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we prefer paragon command-name or just command-name for the README? I'm happy either way, but I think it should be consistent.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, it makes sense to be consistent, updated it to paragon command-name format

README.md Outdated
@@ -61,7 +61,10 @@ The Paragon CLI (Command Line Interface) is a tool that provides various utility

### Available Commands

- `paragon install-theme [theme]`: Installs the specific @edx/brand package.
- `paragon install-theme [theme]`: Installs the specific [@edx/brand](https://github.com/edx/brand-edx.org) package.
Copy link
Contributor

Choose a reason for hiding this comment

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

This should reference the openedx brand package instead of the edx.org one

https://github.com/openedx/brand-openedx

Copy link
Contributor

Choose a reason for hiding this comment

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

Good point, updated, thanks.

@viktorrusakov viktorrusakov merged commit 75580fd into openedx:alpha Oct 30, 2023
8 checks passed
@openedx-webhooks
Copy link

@monteri 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future.

@edx-semantic-release
Copy link
Contributor

🎉 This PR is included in version 22.0.0-alpha.12 🎉

The release is available on:

Your semantic-release bot 📦🚀

@openedx-semantic-release-bot

🎉 This PR is included in version 23.0.0-alpha.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

PKulkoRaccoonGang added a commit that referenced this pull request Aug 1, 2024
* feat: move cli design tokens to paragon cli

* feat: update paths for build-tokens.js

* feat: added descriptions for CLI commands

* refactor: removed commander implementation

* refactor: added build-scss process status

* feat: added ora compilation status

* refactor: code refactoring

* feat: added help description for single command

* refactor: after review

* refactor: refactoring after review

* chore: update docs and cli params parsing

---------

Co-authored-by: monteri <lansevermore>
Co-authored-by: PKulkoRaccoonGang <peter.kulko@raccoongang.com>
Co-authored-by: Viktor Rusakov <vrusakov66@gmail.com>
PKulkoRaccoonGang added a commit that referenced this pull request Aug 4, 2024
* feat: move cli design tokens to paragon cli

* feat: update paths for build-tokens.js

* feat: added descriptions for CLI commands

* refactor: removed commander implementation

* refactor: added build-scss process status

* feat: added ora compilation status

* refactor: code refactoring

* feat: added help description for single command

* refactor: after review

* refactor: refactoring after review

* chore: update docs and cli params parsing

---------

Co-authored-by: monteri <lansevermore>
Co-authored-by: PKulkoRaccoonGang <peter.kulko@raccoongang.com>
Co-authored-by: Viktor Rusakov <vrusakov66@gmail.com>
PKulkoRaccoonGang added a commit that referenced this pull request Aug 4, 2024
* feat: move cli design tokens to paragon cli

* feat: update paths for build-tokens.js

* feat: added descriptions for CLI commands

* refactor: removed commander implementation

* refactor: added build-scss process status

* feat: added ora compilation status

* refactor: code refactoring

* feat: added help description for single command

* refactor: after review

* refactor: refactoring after review

* chore: update docs and cli params parsing

---------

Co-authored-by: monteri <lansevermore>
Co-authored-by: PKulkoRaccoonGang <peter.kulko@raccoongang.com>
Co-authored-by: Viktor Rusakov <vrusakov66@gmail.com>
PKulkoRaccoonGang added a commit that referenced this pull request Aug 5, 2024
* feat: move cli design tokens to paragon cli

* feat: update paths for build-tokens.js

* feat: added descriptions for CLI commands

* refactor: removed commander implementation

* refactor: added build-scss process status

* feat: added ora compilation status

* refactor: code refactoring

* feat: added help description for single command

* refactor: after review

* refactor: refactoring after review

* chore: update docs and cli params parsing

---------

Co-authored-by: monteri <lansevermore>
Co-authored-by: PKulkoRaccoonGang <peter.kulko@raccoongang.com>
Co-authored-by: Viktor Rusakov <vrusakov66@gmail.com>
@openedx-semantic-release-bot

🎉 This PR is included in version 23.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blended PR is managed through 2U's blended developmnt program released on @alpha released
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

7 participants