fomantic / Fomantic-UI

Fomantic-UI is the official community fork of Semantic-UI
https://fomantic-ui.com
MIT License
3.57k stars 332 forks source link

Issue with autoInstall=true and semantic 2.9.1, command "npm install" does not suffice #2660

Closed Ikaer closed 1 year ago

Ikaer commented 1 year ago

Bug Report

I have an issue with autoInstall and fomantic 2.9.1, it does not seems to work. It was working with 2.8.1

Steps to reproduce

1. Create the following structure: image content of package.json:

{
  "name": "componentframework",
  "version": "1.0.4",
  "description": "",
  "main": "component.js",
  "author": "",
  "license": "ISC",
  "dependencies": {
    "fomantic-ui": "2.9.1"
  },
  "devDependencies": {}
}

content of semantic.json

{
  "base": "semantic\\",
  "paths": {
    "source": {
      "config": "src/theme.config",
      "definitions": "src/definitions/",
      "site": "src/site/",
      "themes": "src/themes/"
    },
    "output": {
      "packaged": "\\dist\\lib\\",
      "uncompressed": "\\dist\\components\\uncompressed\\",
      "compressed": "\\dist\\components\\compressed\\",
      "themes": "\\dist\\themes\\"
    },
    "clean": "dist/"
  },
  "permission": false,
  "autoInstall": true,
  "rtl": false,
  "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"],
  "version": "2.9.0"
}

Note that I changed the base folder.

  1. run "npm install"
    
    npm WARN deprecated gulp-util@3.0.8: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
    npm WARN deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
    npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
    npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
    npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
    npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
    npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated

es5-ext@0.10.62 postinstall G:\Users\xlefebvre\testinstallfomantic\node_modules\es5-ext node -e "try{require('./_postinstall')}catch(e){}" || exit 0

npm notice created a lockfile as package-lock.json. You should commit this file. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules\chokidar\node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) npm WARN componentframework@1.0.4 No description npm WARN componentframework@1.0.4 No repository field.

added 737 packages from 421 contributors and audited 738 packages in 19.345s

53 packages are looking for funding run npm fund for details

found 7 vulnerabilities (6 high, 1 critical) run npm audit fix to fix them, or npm audit for details

3. here the structure after that:
4. 
![image](https://user-images.githubusercontent.com/7936075/212971734-31f3152d-ac4b-4d72-a06b-5702726665de.png)

## Expected result
after npm install, a folder "semantic" should be created containt dist, src and stuff.
Here are the steps just by changing the version of fomantic in package.json to 2.8.1 and with the exact same structure (one file package.json, one file semantic.json)
1. run "npm install"

npm WARN deprecated gulp-util@3.0.8: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5 npm WARN deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2. npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated

fomantic-ui@2.8.1 install G:\Users\xlefebvre\testinstallfomantic\node_modules\fomantic-ui gulp install

[18:31:43] Using gulpfile G:\Users\xlefebvre\testinstallfomantic\node_modules\fomantic-ui\gulpfile.js [18:31:43] Starting 'install'... Cannot locate files to update at path: G:\Users\xlefebvre\testinstallfomantic\semantic\src\definitions Running installer [18:31:43] Starting 'run setup'... [18:31:43] Finished 'run setup' after 1.41 ms [18:31:43] Starting 'create install files'... Auto-Installing (Without User Interaction)

Installing to semantic\ Copying UI definitions Copying UI themes Copying gulp tasks Adding theme files Creating gulpfile.js Creating site theme folder G:\Users\xlefebvre\testinstallfomantic\semantic\src\site\ [18:31:44] Starting 'create theme.config'... Adjusting @siteFolder to: site/ Creating src/theme.config (LESS config) G:\Users\xlefebvre\testinstallfomantic\semantic\src\theme.config [18:31:44] Finished 'create theme.config' after 25 ms [18:31:44] Starting 'create semantic.json'... Extending config file (semantic.json) G:\Users\xlefebvre\testinstallfomantic\semantic.json [18:31:44] Finished 'create semantic.json' after 38 ms [18:31:44] Finished 'create install files' after 682 ms [18:31:44] Starting 'clean up install'...

[18:31:44] Starting 'build'... Building Semantic [18:31:44] Starting 'build-css'... [18:31:44] Starting 'Building uncompressed CSS'... [18:31:44] Starting 'Building compressed CSS'... [18:31:45] Created: ....\semantic\dist\components\compressed\reset.min.css [18:31:45] Created: ....\semantic\dist\components\uncompressed\reset.css [...] [18:32:09] Created: ....\semantic\dist\themes\material\assets\fonts\icons.woff2 [18:32:09] Finished 'Building Assets' after 146 ms [18:32:09] Finished 'build-assets' after 148 ms [18:32:09] Finished 'build' after 25 s [18:32:09] Finished 'clean up install' after 25 s [18:32:09] Finished 'install' after 26 s

es5-ext@0.10.62 postinstall G:\Users\xlefebvre\testinstallfomantic\node_modules\es5-ext node -e "try{require('./_postinstall')}catch(e){}" || exit 0

npm notice created a lockfile as package-lock.json. You should commit this file. npm WARN notsup Unsupported engine for fomantic-ui@2.8.1: wanted: {"node":">=10.15.3","npm":"6.4.1"} (current: {"node":"12.22.1","npm":"6.14.12"}) npm WARN notsup Not compatible with your version of node/npm: fomantic-ui@2.8.1 npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules\chokidar\node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) npm WARN @octokit/plugin-request-log@1.0.4 requires a peer of @octokit/core@>=3 but none is installed. You must install peer dependencies yourself. npm WARN componentframework@1.0.4 No description npm WARN componentframework@1.0.4 No repository field.

added 703 packages from 427 contributors and audited 704 packages in 44.512s

24 packages are looking for funding run npm fund for details

found 7 vulnerabilities (2 moderate, 4 high, 1 critical) run npm audit fix to fix them, or npm audit for details


2. after just the command "npm install", the structure is correct:
![image](https://user-images.githubusercontent.com/7936075/212971026-777dda75-55c6-4e9d-98ad-d992512d9a47.png)
![image](https://user-images.githubusercontent.com/7936075/212971061-adae0fc0-bf0f-49b8-b5a4-b0f9b05e8ccb.png)

## Actual result
If a file semantic.json is present with autoInstall=true, "npm install" does not suffice to create the appropriate structure.
Ikaer commented 1 year ago

Not sure if it can help, but I refine where the problem appears in npm version history 2.8.8 ok 2.9.0-beta.150 ok 2.9.0-beta.238 ok 2.9.0-beta.260 ok 2.9.0-beta.262 ok 2.9.0-beta.263 ok 2.9.0-beta.264 ko (03/20/2022) 2.9.0-beta.267 ko 2.9.0-beta.275 ko 2.9.0-beta.282 ko 2.9.0-beta.327 ko 2.9.0 ko

based on the publish date, it seems that this is the commit in question: https://github.com/fomantic/Fomantic-UI/commit/f5f1dd861860451ac40be3a36018033176d36f9d

from my understanding of the PR, I need now to call "npx gulp install" or "npx gulp build" after the "npm install" . So I try this with the version 2.9.0-beta.264, effectively the command "npx gulp install" works without user interaction and put things in the right folder.
I can work with that, but the problem is that 2.9.1 prompt choices when autoinstall is enabled, creating issues with CD/CI image

Again by using npm version history:

2.9.0 ok 2.9.1-beta.15 ok 2.9.1-beta.20 ok 2.9.1-beta.22 ok 2.9.1-beta.23 ko (12/12/2022) 2.9.1-beta.24 ko 2.9.1-beta.29 ko 2.9.1 ko

But there was a lot of big commits that day, I didn't find an obvious commit explaining why I have this problem.

lubber-de commented 1 year ago

Thanks for the detailed investigation, so i was able to detect the causing change. 👍🏼 Fixed by #2672

However, as written in the docs for 2.9.0, manual run of npx/yarn gulp install/build is intented as of #2272

Ikaer commented 1 year ago

Yes, it's fine by me to add an extra command in the build pipeline. Thanks for your fix :)

hugopeek commented 1 year ago

Nice detective work @Ikaer, thanks :+1:

And thanks for the quick fix @lubber-de. Maybe this could be released as a hotfix 2.9.2 version? Because newcomers will be left hanging now with an unfinished installation...