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

Use npm to manage fomantic and only build needed components #9561

Merged
merged 14 commits into from
Jan 21, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Prev Previous commit
Next Next commit
[misc] devendor fomantic-ui and rebuild upon src or config changes only
Signed-off-by: Jakob Ackermann <[email protected]>
  • Loading branch information
das7pad authored and lunny committed Jan 20, 2020
commit eb3c9ea610c54f4632223b566e480654d94e736b
13 changes: 11 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -481,8 +481,17 @@ $(JS_DEST): node_modules $(JS_SOURCES)
npx webpack

.PHONY: fomantic
fomantic: node-check node_modules
cd web_src/fomantic && npx gulp build
fomantic: $(FOMANTIC_DEST_DIR)
node_modules/fomantic-ui/src: node-check node_modules

# TODO(das7pad): replace with resolve.alias when building fomantic with webpack
node_modules/fomantic-ui/src/theme.config: node_modules/fomantic-ui/src
node_modules/fomantic-ui/src/theme.config: web_src/fomantic/theme.config.less
ln -s ../../../$< $@

$(FOMANTIC_DEST_DIR): node_modules/fomantic-ui/src
$(FOMANTIC_DEST_DIR): node_modules/fomantic-ui/src/theme.config
npx gulp -f node_modules/fomantic-ui/gulpfile.js build

Copy link
Member

Choose a reason for hiding this comment

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

Maybe it is possible to have this as a non-phony target that depends on package-lock.json, so it would only run if dependencies change.

Copy link
Member

@silverwind silverwind Jan 4, 2020

Choose a reason for hiding this comment

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

Also, I'd suggest the target to be adjusted to provide one or more output files, like public/fomantic/semantic.min.js and public/fomantic/semantic.min.css. We can still have a phony fomantic target that depends on that file to trigger it on-demand.

.PHONY: css
css: node-check fomantic $(CSS_DEST)
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
"eslint": "6.8.0",
"eslint-config-airbnb-base": "14.0.0",
"eslint-plugin-import": "2.19.1",
"fomantic-ui": "2.8.3",
"gulp": "4.0.2",
"less": "3.10.3",
"postcss-cli": "7.1.0",
"style-loader": "1.1.2",
Expand Down
2 changes: 1 addition & 1 deletion semantic.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"version": "2.8.3",
"base": "web_src/fomantic",
"base": "node_modules/fomantic-ui",
"paths": {
"source": {
"config": "src/theme.config",
Expand Down
34 changes: 0 additions & 34 deletions web_src/fomantic/gulpfile.js

This file was deleted.

Loading