-
Notifications
You must be signed in to change notification settings - Fork 96
[WNMGDS-395] Build-docs and dev-server scripts #659
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
Conversation
* Process md files in the core package, add frontmatter attribute path * Rename base to styles * Move grid files to core * Remove 'Layout' section from doc site * Move color palette and layout doc files to docs package, update gulp tasks to support KSS in docs package * Move support files to core and remove generics folder * Stop using support in core and allow for absolute path css importing from core/src * Remove support and layout directories * Remove generator-cmsgov package * Update developer files * Remove sass add version gulp task and simplify gulp scripts * Rename style to design * Update backstop js files * PR feedback * Undo eslint change * Move variables and mixins into settings folder * Fix linter
* Removing Select files * Remove right to left * Remove deprecated props like fieldRef * Fix dialog snap * Fix snaps
… and docs path as arguments instead of hard-coding them or trying to compile all packages
…. Updated the scripts to send the output to docs/dist while respecting the `rootPath` override
…nly does cleaning, babel transpiling, and json copying right now, but the framework is here. I'm avoiding using the central `gulp/index.js` to create a shared config in favor of configuring tasks explicitly with command line arguments that we parse in the script that npx/yarn executes.
…ask doesn't seem to be working yet.
…use we're only going to have one now with different commands
… with the recommended alternatives (https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5)
…be outdated. Removed unused stuff and cleaned up the logging. Also cleaned up the task definitions for the build module
…pt to move fonts and images from src to dist. And when building child design systems (packages that aren't our core package), it will copy the fonts and images from the core package in node_modules into the child design system's dist folder.
…or the css stats function and added helpful error messaging around skiplatest functionality. Instead of just throwing a bunch of filesystem errors, it will say why it errored and suggest using `--skiplatest` if appropriate.
…build script only
* Update readmes and documentation * Reorganize CSS files * Rename core folder to cmsds and update package.json * Add back layout to docs package and fix broken links * Add migration documentation * PR feedback and other misc documentation changes * Rename cmsds folder to design-system * Remove core and layout dep from docs package
…e parameters. This makes it so much easier to compose them without having to preconfigure all the tasks with the right parameters, especially when certain parameters may or may not exist depending on which tasks you plan on using. This should be much simpler overall because it's just plain JavaScript. We still use gulp for the streaming transform pipelines, but at a high level, it's just JavaScript.
A note here that I had a lot of trouble figuring out how to consistently detect when a gulp stream had ended. It ended up being a combination of `{ readable: false, writeable: false }` for the `finished` function and placing the `pipe(count(...))` before the `pipe(gulp.dest(...))`. I tried a lot of different methods of detecting stream ends before I realized that it was a combination of those two things.
… print usage if you don't specify a command or specify an invalid one
… start changing them. Refactored the `gulp/webpack.js` module to not use gulp tasks
…gic to work for child DS
c30b9b4 to
e753c0b
Compare
|
I downloaded your latest version of the child design system and ran |
|
☝️ I got the same error as Patrick did |
|
It looks like the docs.css is not working on the child ds like it does the core doc site. changing the order of this index.scss fixes it but I don't think that's what we want to do |
|
@line47 Could you elaborate on that? Do you mean overriding the default documentation isnt working for the child DS? |
…ble naming consistent, add new name option
|
@bernardwang this all for running a child ds.
Here is a screenshot of the wide nav I also noticed that the css is not being minimized (should it be?) http://localhost:3000/index.css |
6104783 to
072a9b8
Compare
|
@pwolfert I think I know which error you are talking about, it should be fixed in the latest commit! @line47 The CSS wont be minimized unless we pass in |
|
Child design system build and start scripts work! LGTM |
|
This is fantastic and working as expected! I can make all the modifications called out in the lists above for both the core and child DS. The left nav is no longer an issue for me, not sure what was up there. One small issue I found: I do get the terminal message however the changes are not visible I was adding this to the |
|
@line47 I tested it on the core and child DS and adding this seemed to work for me. |




TODO
cmsds build-docsbuilds src and then builds the docs package into html pagescmsds build-docsruns webpack statically after building src and docscmsds startruns webpack dev server and watches for changes to build the source package or the docsbuild-docsscript in child design systems.Summary
build-scriptscommand to thedesign-system-scriptspackage.yarn buildscript alias in package.json to execute the new build scriptHow to test
Core CMSDS:
yarn installyarn buildto builddesign-systemanddesign-system-docsyarn startto build, serve, and watch files for the doc sitea. React component in
design-systemis updatedb. React component prop documentation in
design-systemis updatedc. HTML and React component examples in
design-systemare updatedd. Documentation content
design-systemis updated (i.e..docs.scssfile)e. CSS in
design-systemis updatedf. React component in
design-system-docsis updatedg. CSS in
design-system-docsis updatedChild DS
Download and extract
child-design-system-example .zip
Make sure
child-design-system-exampleis in the same directory containing the core CMSDS repo, aka adjacent to thedesign-systemrepo folder.Run
yarn install(This will alsonpm linkthe core ds packages)Go through the same tests listed above for the core CMSDS
Additionally test these overrides:
a. Overriding a core React component and prop docs, ensuring it is outputted in the
dist(i.e.src/Button/Button.jsx)b. Overriding a core React documentation (i.e.
src/Button/_Button.docs.scss)c. Overriding core DS css (i.e.
src/Button/Button.scss)d. Adding new DS components, documentation and css (i.e.
src/NewBadge)e. Overriding doc site css (i.e.
docs/example.scssordocs/index.scss)