Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Gulp install doesn't extend current settings #1485

Closed
mattiapv opened this issue May 26, 2020 · 9 comments
Closed

Gulp install doesn't extend current settings #1485

mattiapv opened this issue May 26, 2020 · 9 comments
Labels
type/build Anything related to the build process type/usage Any support issues asking for help
Milestone

Comments

@mattiapv
Copy link

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 editing semantic.json.
I found only this #179 (comment).

Steps to reproduce

  1. Install fomantic-ui using npm install fomantic-ui
  2. Complete setup.
  3. Run again npx gulp install.
Installing
Site folder exists, merging files (no overwrite) src/site/
[23:03:40] 'create install files' errored after 2.26 ms
[23:03:40] Error: ENOENT: no such file or directory, stat './src/_site'
    at Object.statSync (fs.js:933:3)
    at Object.exports.copyDirSyncRecursive (/Users/Mattia/Desktop/fomantic-ui/node_modules/wrench-sui/lib/wrench.js:244:23)
    at /Users/Mattia/Desktop/fomantic-ui/semantic/tasks/install.js:339:12
    at create install files (/Users/Mattia/Desktop/fomantic-ui/node_modules/undertaker/lib/set-task.js:13:15)
    at bound (domain.js:426:14)
    at runBound (domain.js:439:12)
    at asyncRunner (/Users/Mattia/Desktop/fomantic-ui/node_modules/async-done/index.js:55:18)
    at processTicksAndRejections (internal/process/task_queues.js:79:11)
[23:03:40] 'install' errored after 11 s

asciicast

My folder looks like this

node_modules
semantic
package-lock.json
package.json
semantic.json

Version

Fomantic: 2.8.4
Gulp: 4.0.2
Node: 12.16.3
NPM: 6.14.5

@mattiapv mattiapv added state/awaiting-investigation Anything which needs more investigation state/awaiting-triage Any issues or pull requests which haven't yet been triaged type/bug Any issue which is a bug or PR which fixes a bug labels May 26, 2020
@lubber-de
Copy link
Member

Does npx gulp build work instead?

@mattiapv
Copy link
Author

mattiapv commented May 26, 2020

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.

@lubber-de
Copy link
Member

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?

@mattiapv
Copy link
Author

mattiapv commented May 27, 2020

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

@lubber-de lubber-de added type/build Anything related to the build process and removed state/awaiting-triage Any issues or pull requests which haven't yet been triaged labels May 27, 2020
@lubber-de lubber-de added the Hacktoberfest Issues for Hacktoberfest! label Sep 22, 2020
@lubber-de lubber-de added tag/help-wanted Issues which need help to fix or implement and removed Hacktoberfest Issues for Hacktoberfest! labels Nov 13, 2020
@lubber-de lubber-de added the Hacktoberfest Issues for Hacktoberfest! label Sep 15, 2021
@rosensama
Copy link

Same here. Trying to update fomantic-ui

  1. npm update fomantic-ui
  2. cd semantic
  3. 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"]
}

@rosensama
Copy link

rosensama commented Jan 22, 2023

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"
  • I'm not prompted for output.themes and it's set to "dist/themes"
  • clean is NOT set to output.packaged and is instead "dist/"
  • Even if I edit 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:

  1. mv semantic semantic.bak
  2. rm -rf node_modules/fomantic-ui
  3. npm install fomantic-ui
  4. cd node_modules/fomantic-ui
  5. npx gulp install
  6. Select Automatic install
  7. Complete the install
  8. cd ../.. (package.json is in the resulting directory)
  9. Update semantic.json with the updated components entry from node_modules/fomantic-ui/semantic.json
  10. mkdir semantic
  11. cp -r node_modules/fomantic-ui/gulpfile.js node_modules/fomantic-ui/src/ node_modules/fomantic-ui/tasks/ semantic/
  12. cd semantic
  13. npx gulp build

@lubber-de
Copy link
Member

lubber-de commented Jan 23, 2023

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 theming
  • when running npx 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.
  • We fixed a bug in 2.9.1 (fix(build): fix path creation to avoid always using default settings #2672 ) which might lead into upgrade issues also mentioned here

@lubber-de lubber-de added type/usage Any support issues asking for help and removed type/bug Any issue which is a bug or PR which fixes a bug tag/help-wanted Issues which need help to fix or implement state/awaiting-investigation Anything which needs more investigation Hacktoberfest Issues for Hacktoberfest! labels Jan 23, 2023
@lubber-de
Copy link
Member

Original issue is now fixed by #2675 by telling the user when npx gulp install is run in the wrong folder

@lubber-de lubber-de added this to the 2.9.2 milestone Jan 23, 2023
@lubber-de lubber-de added the tag/next-release/nightly Any issue which has a corresponding PR which has been merged and is available in the nightly build label Jan 23, 2023
@rosensama
Copy link

Thanks for the prompt response. I'll see how it goes on the next update.

@lubber-de lubber-de removed the tag/next-release/nightly Any issue which has a corresponding PR which has been merged and is available in the nightly build label Feb 3, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
type/build Anything related to the build process type/usage Any support issues asking for help
Projects
None yet
Development

No branches or pull requests

3 participants