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

Nouvelle initialisation de l'application #47

Closed
hrenaud opened this issue Aug 19, 2024 · 5 comments
Closed

Nouvelle initialisation de l'application #47

hrenaud opened this issue Aug 19, 2024 · 5 comments
Assignees
Labels
Electron app enhancement New feature or request

Comments

@hrenaud
Copy link
Collaborator

hrenaud commented Aug 19, 2024

Pour gérer le problème #46, une nouvelle manière d'initialiser l'application doit être mise en place.

  1. Une méthode qui déclenche depuis le front tout le process gérer par le back;
  2. Le back utilise une méthode pour informer le front de la lecture des valeurs nécessaires où des erreurs via sendConfigDatasToFront: (callback) => ConfigData
  3. Mise en place d'un object de transport ConfigData.

Process à mettre en place:
EcoindexApp.drawio.pdf

@hrenaud hrenaud added enhancement New feature or request Electron app labels Aug 19, 2024
@hrenaud hrenaud added this to the Lancement electron App milestone Aug 19, 2024
@hrenaud hrenaud self-assigned this Aug 19, 2024
hrenaud added a commit that referenced this issue Aug 27, 2024
hrenaud added a commit that referenced this issue Aug 27, 2024
@hrenaud
Copy link
Collaborator Author

hrenaud commented Aug 27, 2024

Normalement, c'est OK, à tester sur:

  • Windows
  • Windows, sans NodeJS
  • Windows, pas admin
  • Mac
  • Mac, sans NodeJS
  • Mac pas admin

@hrenaud
Copy link
Collaborator Author

hrenaud commented Aug 28, 2024

Descendre le test à NodeJS 18

@hrenaud
Copy link
Collaborator Author

hrenaud commented Aug 28, 2024

quand update du plugin reste à step 5/7

[2024-08-28 10:05:47.985] [debug] (front/App)                                           initializeApplication start 🚀
[2024-08-28 10:05:47.986] [debug] (front/App)                                           wait 30s
[2024-08-28 10:05:47.990] [info]  (main/initialization)                                 forceInitialisation false
[2024-08-28 10:05:47.990] [info]  (main/initialization)                                 Initialization start...
[2024-08-28 10:05:47.990] [info]  (main/initialization)                                 0. Is first launch?
[2024-08-28 10:05:47.990] [info]  (main/initialization)                                 1. Node installed start...
[2024-08-28 10:05:47.990] [debug] (main/multi)                                          handleisNodeInstalled started 🚀
[2024-08-28 10:05:47.990] [debug] (main/multi)                                          Try childProcess on [
  '/Applications/EcoindexApp.app/Contents/Resources/scripts/darwin/get-node.sh'
]
[2024-08-28 10:05:47.991] [debug] (main/handleIsJsonConfigFileExist)                    handleIsJsonConfigFileExist: JSON missing in folder in /Users/renaudheluin
[2024-08-28 10:05:47.993] [info]  (front/App)                                           isJsonConfigFileExist false
[2024-08-28 10:05:47.999] [debug] (front/renderer)                                      Ask which node launched...
[2024-08-28 10:05:48.071] [debug] (main/multi)                                          Node installed Child process disconnected
[2024-08-28 10:05:48.071] [debug] (main/multi)                                          isNodeInstalled exited: 0; signal: null
[2024-08-28 10:05:48.072] [debug] (main/multi)                                          isNodeInstalled closed: 0
[2024-08-28 10:05:48.072] [debug] (main/multi)                                          Node installed done 🚀
[2024-08-28 10:05:48.078] [debug] (main/initialization/initIsNodeInstalled)             {
  type: 'node_installed',
  result: true,
  message: 'Node is Installed in /opt/homebrew/opt/nvm/versions/node/v20.12.0/bin/node'
}
[2024-08-28 10:05:48.078] [info]  (main/initialization)                                 {
  "type": "node_installed",
  "result": "true",
  "message": "Node is Installed in /opt/homebrew/opt/nvm/versions/node/v20.12.0/bin/node"
}
[2024-08-28 10:05:48.078] [info]  (main/initialization)                                 2. Node Version upper or equal to 20 start...
[2024-08-28 10:05:48.078] [debug] (main/multi)                                          handlegetNodeVersion started 🚀
[2024-08-28 10:05:48.078] [debug] (main/multi)                                          Try childProcess on [
  '/Applications/EcoindexApp.app/Contents/Resources/scripts/darwin/get-node-version.sh'
]
[2024-08-28 10:05:48.071] [debug] (front/renderer)                                      /opt/homebrew/opt/nvm/versions/node/v20.12.0/bin/node
[2024-08-28 10:05:48.078] [debug] (front/App)                                           sendDatasToFront is a ConfigData {
  type: 'node_installed',
  result: true,
  message: 'Node is Installed in /opt/homebrew/opt/nvm/versions/node/v20.12.0/bin/node'
}
[2024-08-28 10:05:48.080] [debug] (front/App)                                           sendConfigDatasToFront {
  type: 'node_installed',
  result: true,
  message: 'Node is Installed in /opt/homebrew/opt/nvm/versions/node/v20.12.0/bin/node'
}
[2024-08-28 10:05:48.080] [debug] (front/App)                                           wait 30s
[2024-08-28 10:05:48.080] [debug] (front/App)                                           sleep reseted.
[2024-08-28 10:05:48.081] [info]  (front/App)                                           Verify configuration step 1/7
[2024-08-28 10:05:48.085] [debug] (front/renderer)                                      Ask node -v launched...
[2024-08-28 10:05:48.162] [debug] (front/renderer)                                      v20.12.0
[2024-08-28 10:05:48.163] [debug] (main/multi)                                          Node version Child process disconnected
[2024-08-28 10:05:48.163] [debug] (main/multi)                                          getNodeVersion exited: 0; signal: null
[2024-08-28 10:05:48.163] [debug] (main/multi)                                          getNodeVersion closed: 0
[2024-08-28 10:05:48.163] [debug] (main/multi)                                          Node version done 🚀
[2024-08-28 10:05:48.163] [debug] (main/initialization/initIsNodeNodeVersionOK)         { type: 'node_version_is_ok', result: true, message: 'v20.12.0' }
[2024-08-28 10:05:48.163] [info]  (main/initialization)                                 {
  "type": "node_version_is_ok",
  "result": "true",
  "message": "v20.12.0"
}
[2024-08-28 10:05:48.164] [info]  (main/initialization)                                 3. Get Npm Dir...
[2024-08-28 10:05:48.167] [info]  (main/initialization)                                 {
  "type": "npmDir",
  "result": "/opt/homebrew/opt/nvm/versions/node/v20.12.0/lib/node_modules"
}
[2024-08-28 10:05:48.167] [info]  (main/initialization)                                 4. Get User HomeDir...
[2024-08-28 10:05:48.167] [info]  (main/initialization)                                 {
  "type": "homeDir",
  "result": "/Users/renaudheluin"
}
[2024-08-28 10:05:48.167] [info]  (main/initialization)                                 5. Get Last used WorkDir or fallback in User HomeDir ...
[2024-08-28 10:05:48.167] [info]  (main/initialization)                                 {
  "type": "workDir",
  "result": "/Users/renaudheluin"
}
[2024-08-28 10:05:48.167] [info]  (main/initialization)                                 6. Is a Puppeteer Browser installed ...
[2024-08-28 10:05:48.163] [debug] (front/App)                                           sendDatasToFront is a ConfigData { type: 'node_version_is_ok', result: true, message: 'v20.12.0' }
[2024-08-28 10:05:48.165] [debug] (front/App)                                           sendConfigDatasToFront { type: 'node_version_is_ok', result: true, message: 'v20.12.0' }
[2024-08-28 10:05:48.165] [debug] (front/App)                                           wait 30s
[2024-08-28 10:05:48.165] [debug] (front/App)                                           sleep reseted.
[2024-08-28 10:05:48.165] [info]  (front/App)                                           Verify configuration step 2/7
[2024-08-28 10:05:48.167] [debug] (front/App)                                           sendDatasToFront is a ConfigData {
  type: 'npmDir',
  result: '/opt/homebrew/opt/nvm/versions/node/v20.12.0/lib/node_modules'
}
[2024-08-28 10:05:48.168] [debug] (front/App)                                           sendDatasToFront is a ConfigData { type: 'homeDir', result: '/Users/renaudheluin' }
[2024-08-28 10:05:48.169] [debug] (front/App)                                           sendConfigDatasToFront { type: 'homeDir', result: '/Users/renaudheluin' }
[2024-08-28 10:05:48.169] [debug] (front/App)                                           wait 30s
[2024-08-28 10:05:48.170] [debug] (front/App)                                           sleep reseted.
[2024-08-28 10:05:48.170] [info]  (front/App)                                           Verify configuration step 3/7
[2024-08-28 10:05:48.170] [debug] (front/App)                                           sendDatasToFront is a ConfigData { type: 'workDir', result: '/Users/renaudheluin' }
[2024-08-28 10:05:48.170] [debug] (front/App)                                           sendConfigDatasToFront { type: 'workDir', result: '/Users/renaudheluin' }
[2024-08-28 10:05:48.170] [debug] (front/App)                                           wait 30s
[2024-08-28 10:05:48.170] [debug] (front/App)                                           sleep reseted.
[2024-08-28 10:05:48.170] [info]  (front/App)                                           Verify configuration step 4/7
[2024-08-28 10:05:48.172] [debug] (main/handleIsJsonConfigFileExist)                    handleIsJsonConfigFileExist: JSON missing in folder in /Users/renaudheluin
[2024-08-28 10:05:48.172] [info]  (front/App)                                           isJsonConfigFileExist false
[2024-08-28 10:05:48.922] [info]  (main/initialization)                                 Puppeteer Browser allready installed, no need to install it
[2024-08-28 10:05:48.922] [info]  (main/initialization)                                 {
  "type": "puppeteer_browser_installed",
  "result": "Chrome/127.0.6533.99",
  "message": "Puppeteer Browser installed=Chrome/127.0.6533.99"
}
[2024-08-28 10:05:48.922] [info]  (main/initialization)                                 7.1 Is a Plugin installed on host ...
[2024-08-28 10:05:48.922] [debug] (front/App)                                           sendDatasToFront is a ConfigData {
  type: 'puppeteer_browser_installed',
  result: 'Chrome/127.0.6533.99',
  message: 'Puppeteer Browser installed=Chrome/127.0.6533.99'
}
[2024-08-28 10:05:48.923] [debug] (front/App)                                           sendConfigDatasToFront {
  type: 'puppeteer_browser_installed',
  result: 'Chrome/127.0.6533.99',
  message: 'Puppeteer Browser installed=Chrome/127.0.6533.99'
}
[2024-08-28 10:05:48.923] [debug] (front/App)                                           wait 30s
[2024-08-28 10:05:48.923] [debug] (front/App)                                           sleep reseted.
[2024-08-28 10:05:48.924] [info]  (front/App)                                           Verify configuration step 5/7
[2024-08-28 10:05:49.249] [debug] (main/initialization/initPluginIsIntalled)            version installed: 4.0.3
[2024-08-28 10:05:49.249] [info]  (main/initialization)                                 {
  "type": "plugin_installed",
  "result": "4.0.3",
  "message": "plugin allready installed"
}
[2024-08-28 10:05:49.250] [info]  (main/initialization)                                 7.2 Plugin is Installed on host ...
[2024-08-28 10:05:49.250] [info]  (main/initialization)                                 7.2 Check plugin last version on registry ...
[2024-08-28 10:05:49.250] [debug] (main/initialization/initPluginGetLastVersion)        Check latest version of lighthouse-plugin-ecoindex on registry.
[2024-08-28 10:05:49.250] [debug] (front/App)                                           sendDatasToFront is a ConfigData {
  type: 'plugin_installed',
  message: 'plugin allready installed',
  result: '4.0.3'
}
[2024-08-28 10:05:50.447] [debug] (main/initialization/initPluginGetLastVersion)        latest version: 4.1.1
[2024-08-28 10:05:50.447] [debug] (main/initialization/initPluginGetLastVersion)        Update from version:4.0.3 to latest version:4.1.1 needed
[2024-08-28 10:05:50.447] [info]  (main/initialization)                                 {
  "type": "plugin_installed",
  "result": "4.1.1",
  "message": "Update from version:4.0.3 to latest version:4.1.1 needed"
}
[2024-08-28 10:05:50.447] [debug] (front/App)                                           sendDatasToFront is a ConfigData {
  type: 'plugin_installed',
  result: '4.1.1',
  message: 'Update from version:4.0.3 to latest version:4.1.1 needed'
}
[2024-08-28 10:05:50.453] [debug] (front/App)                                           sendConfigDatasToFront {
  type: 'appReady',
  result: true,
  message: 'All initialization process ended successfully'
}
[2024-08-28 10:05:50.453] [debug] (front/App)                                           initializeApplication ended with OK 👍 status.

@hrenaud
Copy link
Collaborator Author

hrenaud commented Aug 30, 2024

Gestion des droits bloquants

Tester plus tôt les droits d'écriture (avant browser a cause de puppetter).

  1. Si droits OK, on laisse le déroulé actuel ;
  2. Si droits KO, on test les éléments à mettre à jour / installer et on fait tout ensemble pour ne demander qu'une fois le MDP.

Attention sur la fusion, on n'a pas autant de step, il va falloir gérer la popin d'étapes. L'install va durer plus longtemps, donc gérer le bouton reload.
Voir si on ne peut pas écouter les étapes et mettre une string qui permettrait de lancer l'avancement de la popin.

⚠︎ Les Stop ne sont pas gérés sur plugin et browser

hrenaud added a commit that referenced this issue Aug 31, 2024
hrenaud added a commit that referenced this issue Sep 1, 2024
…omponent Nouvelle initialisation de l'application #47
@hrenaud
Copy link
Collaborator Author

hrenaud commented Sep 3, 2024

Le sujet est transféré dans le nouveau repo dédié cnumr/EcoindexApp#2

@hrenaud hrenaud closed this as completed Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Electron app enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant