Skip to content

Commit

Permalink
[TASK] remove build process from watch cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
dmh committed Nov 23, 2022
1 parent 7dd9f21 commit 6eb1448
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 15 deletions.
10 changes: 0 additions & 10 deletions lib/cmd/watch.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
import { checkNode, checkPackageThemeConsistent } from '../utils/check.js'
import { cleanAssets } from '../compile/clean.js'
import { compileScss } from '../compile/sass.js'
import { compileCss } from '../compile/css.js'
import { compileJs } from '../compile/js.js'
import { watchSrc } from '../compile/watch.js'
import { getAuthConfig } from '../hubspot/auth.js'
import { watchHubspotTheme } from '../hubspot/watch.js'
import { confirmThemeName } from '../hubspot/helpers.js'
import * as utils from '../utils/ui.js'
checkNode()
checkPackageThemeConsistent()

Expand All @@ -23,11 +18,6 @@ checkPackageThemeConsistent()
async function watch (opt) {
await confirmThemeName()
const hubAuth = await getAuthConfig()
const timeStart = utils.startTaskGroup('Build task')
await cleanAssets()
await compileScss()
await Promise.all([compileCss(), compileJs(opt)])
utils.endTaskGroup({ taskName: 'Build task', timeStart })
await watchSrc(opt)
await watchHubspotTheme(hubAuth)
}
Expand Down
6 changes: 2 additions & 4 deletions lib/hubspot/fetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ async function fetchModules (customAuthConfig) {
const dest = `${globals.THEME}/modules`
const mode = cmsMode
const options = {
overwrite: true,
src: 'temporary fix'
overwrite: true
}
logger.setLogLevel(2)
await downloadFileOrFolder({ accountId: hubconf.portals[0].portalId, src, dest, mode, options })
Expand All @@ -54,8 +53,7 @@ async function fetchAll (customAuthConfig) {
const dest = `${globals.THEME}`
const mode = cmsMode
const options = {
overwrite: true,
src: 'temporary fix'
overwrite: true
}
logger.setLogLevel(2)
await downloadFileOrFolder({ accountId: hubconf.portals[0].portalId, src, dest, mode, options })
Expand Down
2 changes: 1 addition & 1 deletion lib/hubspot/watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ async function watchHubspotTheme (customAuthConfig) {
commandOptions: ''
})
watcher
.on('ready', () => console.log(`\n${chalk.green('●')} Watcher is ready and watching ${globals.THEME} - Any changes detected will be automatically uploaded and overwrite the current version in the developer file system.`))
.on('ready', () => console.log(`\n${chalk.green('●')} Watcher is ready and watching ${chalk.green(`${globals.THEME}/*`)}\nAny changes detected will be automatically uploaded and overwrite the current version in the developer file system.`))
.on('add', path => console.log(`${chalk.yellow('──●')} Uploaded file ${chalk.green(path)}`))
.on('change', path => console.log(`${chalk.yellow('──●')} Uploaded file ${chalk.green(path)}`))
.on('unlink', path => console.log(`${chalk.red('●──')} Deleted file ${chalk.green(path)}`))
Expand Down

0 comments on commit 6eb1448

Please sign in to comment.