Closed mattiapv closed 1 year ago
Does npx gulp build
work instead?
Does
npx gulp build
work instead?
Yes. I also edited semantic.json
to add few components and ran the build task
. New components are in the dist
folder.
I also tried to delete semantic.json
but I got same error. It keeps looking for './src/_site'
folder that doesn't exist.
The error is not present if I clone the repo.
So, according to the docs, you should run
npx gulp build
but not
npx gulp install
As you said in your previous post, npx gulp build
is working , i am confused, if you still have an issue 🤔 . Maybe @ColinFrick could step in otherwise?
What I'm saying is that some tasks are broken if I run them after installing fomantic using npm install fomantic-ui
. Since installing via NPM is in the documentation I guess the gulp tasks should work.
The tasks that are broken are: install, clean, version
As I said before if I clone or download
the repo all tasks are working and there is the ./src/_site
folder
Same here. Trying to update fomantic-ui
npm update fomantic-ui
cd semantic
npx gulp install
It recognizes my existing semantic.json, but doesn't try to preserve the settings from it.
[11:19:47] Starting 'run setup'...
? It looks like you have a semantic.json file already. (Use arrow keys)
❯ Yes, extend my current settings.
Skip install
No matter which path I take I get the error at the start of this thread.
Installing
------------------------------
Site folder exists, merging files (no overwrite) src/site/
[11:20:27] 'create install files' errored after 1.31 ms
[11:20:27] Error: ENOENT: no such file or directory, stat './src/_site'
at Object.statSync (node:fs:1596:3)
at exports.copyDirSyncRecursive (/home/rosensama/PycharmProjects/projcomp/client/node_modules/wrench-sui/lib/wrench.js:244:23)
at /home/rosensama/PycharmProjects/projcomp/client/semantic/tasks/install.js:339:12
at taskWrapper (/home/rosensama/PycharmProjects/projcomp/client/node_modules/undertaker/lib/set-task.js:13:15)
at bound (node:domain:433:15)
at runBound (node:domain:444:12)
at asyncRunner (/home/rosensama/PycharmProjects/projcomp/client/node_modules/async-done/index.js:55:18)
at process.processTicksAndRejections (node:internal/process/task_queues:77:11)
If I manually create ./src/_site
, not matter whether I pick automatic or custom, I now get this:
Installing
------------------------------
Site folder exists, merging files (no overwrite) src/site/
[11:20:59] Starting 'create theme.config'...
Adjusting @siteFolder to: site/
Modifying src/theme.config (LESS config) src/theme.config
[11:20:59] Finished 'create theme.config' after 15 ms
[11:20:59] Starting 'create semantic.json'...
Creating config file (semantic.json) semantic.json
[11:20:59] 'create semantic.json' errored after 4.07 ms
[11:20:59] Error: File not found with singular glob: /home/rosensama/PycharmProjects/projcomp/client/semantic/semantic.json.example (if this was purposeful, use `allowEmpty` option)
at Glob.<anonymous> (/home/rosensama/PycharmProjects/projcomp/client/node_modules/glob-stream/readable.js:84:17)
at Object.onceWrapper (node:events:628:26)
at Glob.emit (node:events:513:28)
at Glob.emit (node:domain:489:12)
at Glob._finish (/home/rosensama/PycharmProjects/projcomp/client/node_modules/glob/glob.js:194:8)
at done (/home/rosensama/PycharmProjects/projcomp/client/node_modules/glob/glob.js:179:14)
at Glob._processSimple2 (/home/rosensama/PycharmProjects/projcomp/client/node_modules/glob/glob.js:688:12)
at /home/rosensama/PycharmProjects/projcomp/client/node_modules/glob/glob.js:676:10
at Glob._stat2 (/home/rosensama/PycharmProjects/projcomp/client/node_modules/glob/glob.js:772:12)
at lstatcb_ (/home/rosensama/PycharmProjects/projcomp/client/node_modules/glob/glob.js:764:12)
[11:20:59] 'create install files' errored after 21 ms
[11:20:59] 'install' errored after 1.69 s
If I select the Custom path, it doesn't suggest my current settings as defaults. Here (dist/)
should be (../public/dist/)
[11:23:00] Starting 'run setup'...
? It looks like you have a semantic.json file already. Yes, extend my current settings.
? Set-up Semantic UI Custom (Customize all src/dist values)
? What components should we include in the package? reset, site, button, container, divider, emoji, flag, header, icon, image, input, label, list, loader, rail, reveal, segment, step, breadcrumb, form, grid, menu,
message, table, ad, card, comment, feed, item, statistic, accordion, calendar, checkbox, dimmer, dropdown, embed, modal, nag, placeholder, popup, progress, slider, rating, search, shape, sidebar, sticky, tab, text,
toast, transition, api, form, state, visibility
? Should we set permissions on outputted files? No
? Do you use a RTL (Right-To-Left) language? No
? Where should we put your site folder? src/site
? Where should we output a packaged version? (dist/)
My existing semantic.json
{
"base": "semantic/",
"paths": {
"source": {
"config": "src/theme.config",
"definitions": "src/definitions/",
"site": "src/site/",
"themes": "src/themes/"
},
"output": {
"packaged": "../public/dist/",
"uncompressed": "../public/dist/components/",
"compressed": "../public/dist/components/",
"themes": "../public/dist/themes/"
},
"clean": "../public/dist/"
},
"permission": "744",
"autoInstall": false,
"rtl": false,
"version": "2.8.8",
"components": ["reset", "site", "button", "container", "divider", "emoji", "flag", "header", "icon", "image", "input", "label", "list", "loader", "rail", "reveal", "segment", "step", "breadcrumb", "form", "grid", "menu", "message", "table", "ad", "card", "comment", "feed", "item", "statistic", "accordion", "calendar", "checkbox", "dimmer", "dropdown", "embed", "modal", "nag", "placeholder", "popup", "progress", "slider", "rating", "search", "shape", "sidebar", "sticky", "tab", "text", "toast", "transition", "api", "form", "state", "visibility", "reset", "site", "button", "container", "divider", "emoji", "flag", "header", "icon", "image", "input", "label", "list", "loader", "rail", "reveal", "segment", "step", "breadcrumb", "form", "grid", "menu", "message", "table", "ad", "card", "comment", "feed", "item", "statistic", "accordion", "calendar", "checkbox", "dimmer", "dropdown", "embed", "modal", "nag", "placeholder", "popup", "progress", "slider", "rating", "search", "shape", "sidebar", "sticky", "tab", "text", "toast", "transition", "api", "form", "state", "visibility"]
}
I tried removing my semantic.json file and semantic directory and follow the documantion.
$ cd node_modules/fomantic-ui
$ npx gulp install
It creates semantic.json along with the source and output paths under node_modules. The semantic.json has some of the custom paths I selected, but not all:
base
is set to ""
instead of the expected "semantic"
output.themes
and it's set to "dist/themes"
clean
is NOT set to output.packaged
and is instead "dist/"
semantic.json.example
to set base
to "semantic"
to make it easier to copy the install output directory later, it's ignored.So my current fomantic-ui update procedure is:
mv semantic semantic.bak
rm -rf node_modules/fomantic-ui
npm install fomantic-ui
cd node_modules/fomantic-ui
npx gulp install
cd ../..
(package.json is in the resulting directory)semantic.json
with the updated components
entry from node_modules/fomantic-ui/semantic.json
mkdir semantic
cp -r node_modules/fomantic-ui/gulpfile.js node_modules/fomantic-ui/src/ node_modules/fomantic-ui/tasks/ semantic/
cd semantic
npx gulp build
There are many mentioned issues here, so lets summarize:
npx gulp install
has to run inside the node_modules/fomantic-ui
folder as mentioned in the docs. Running it inside any custom folder (which is created on first npx gulp install
) leads to the mentioned "Error: ENOENT: no such file or directory, stat './src/_site'" as the "_site" folder is definately only available inside the original node_modules/fomantic-ui folder. The _site folder will be copied as boilerplace to the users custom folder as "site" (without underscore) for you to do custom themingnpx gulp install
inside node_modules/fomantic-ui , i cannot reproduce the original authors issue as on a "custom install" everything gets overridden/merged inside the sematic.json as expected.Original issue is now fixed by #2675 by telling the user when npx gulp install
is run in the wrong folder
Thanks for the prompt response. I'll see how it goes on the next update.
Bug Report
When I run
npx gulp install
I can't complete the task because I get an error. I can change fomantic settings only by editingsemantic.json
. I found only this https://github.com/fomantic/Fomantic-UI/pull/179#issuecomment-437681591.Steps to reproduce
npm install fomantic-ui
My folder looks like this
Version
Fomantic: 2.8.4 Gulp: 4.0.2 Node: 12.16.3 NPM: 6.14.5