ether-code 0.2.3 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/ether.js +22 -14
- package/package.json +1 -1
package/cli/ether.js
CHANGED
|
@@ -6,7 +6,7 @@ const http = require('http')
|
|
|
6
6
|
const { EtherCompiler } = require('./compiler')
|
|
7
7
|
const { Watcher } = require('./watcher')
|
|
8
8
|
|
|
9
|
-
const VERSION = '0.2.
|
|
9
|
+
const VERSION = '0.2.5'
|
|
10
10
|
|
|
11
11
|
const COLORS = {
|
|
12
12
|
reset: '\x1b[0m',
|
|
@@ -248,9 +248,8 @@ function createDevServer(outDir, port) {
|
|
|
248
248
|
})
|
|
249
249
|
})
|
|
250
250
|
|
|
251
|
-
server.listen(port
|
|
252
|
-
|
|
253
|
-
})
|
|
251
|
+
server.listen(port)
|
|
252
|
+
logSuccess(`Serveur démarré sur ${COLORS.cyan}http://localhost:${port}${COLORS.reset}`)
|
|
254
253
|
|
|
255
254
|
server.on('error', (err) => {
|
|
256
255
|
if (err.code === 'EADDRINUSE') {
|
|
@@ -746,9 +745,8 @@ document.addEventListener "DOMContentLoaded", initialiser
|
|
|
746
745
|
logSuccess('Projet initialisé avec succès!')
|
|
747
746
|
console.log('')
|
|
748
747
|
logInfo('Prochaines étapes:')
|
|
749
|
-
console.log(` 1.
|
|
750
|
-
console.log(` 2.
|
|
751
|
-
console.log(` 3. Ouvrir ${COLORS.cyan}http://localhost:3000${COLORS.reset} dans le navigateur`)
|
|
748
|
+
console.log(` 1. Lancer ${COLORS.cyan}ether dev${COLORS.reset} pour le mode développement`)
|
|
749
|
+
console.log(` 2. Éditer les fichiers dans ${COLORS.cyan}src/${COLORS.reset}`)
|
|
752
750
|
console.log('')
|
|
753
751
|
}
|
|
754
752
|
|
|
@@ -819,11 +817,13 @@ async function cmdBuild(options) {
|
|
|
819
817
|
|
|
820
818
|
const duration = Date.now() - startTime
|
|
821
819
|
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
820
|
+
if (!options.quiet) {
|
|
821
|
+
console.log('')
|
|
822
|
+
if (errorCount === 0) {
|
|
823
|
+
logSuccess(`${successCount} fichier(s) compilé(s) en ${duration}ms`)
|
|
824
|
+
} else {
|
|
825
|
+
logWarning(`${successCount} succès, ${errorCount} erreur(s) en ${duration}ms`)
|
|
826
|
+
}
|
|
827
827
|
}
|
|
828
828
|
}
|
|
829
829
|
|
|
@@ -848,13 +848,21 @@ async function cmdDev(options) {
|
|
|
848
848
|
logInfo(`Sortie vers ${outDir}`)
|
|
849
849
|
console.log('')
|
|
850
850
|
|
|
851
|
-
await cmdBuild({ ...options, quiet: true })
|
|
852
|
-
|
|
853
851
|
let devServer = null
|
|
854
852
|
if (!options.noServer) {
|
|
855
853
|
devServer = createDevServer(outDir, port)
|
|
856
854
|
}
|
|
857
855
|
|
|
856
|
+
console.log('')
|
|
857
|
+
logInfo('Compilation initiale...')
|
|
858
|
+
|
|
859
|
+
try {
|
|
860
|
+
await cmdBuild({ ...options, quiet: true })
|
|
861
|
+
logSuccess('Compilation terminée')
|
|
862
|
+
} catch (err) {
|
|
863
|
+
logWarning(`Erreur de compilation: ${err.message}`)
|
|
864
|
+
}
|
|
865
|
+
|
|
858
866
|
console.log('')
|
|
859
867
|
logInfo('En attente de modifications... (Ctrl+C pour arrêter)')
|
|
860
868
|
console.log('')
|