-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TASK] big refactoring, update dependencies
- Loading branch information
Showing
47 changed files
with
3,836 additions
and
4,022 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,2 @@ | ||
import { config } from '../config/config.js' | ||
import { build } from './build.js' | ||
|
||
build({ config }) | ||
build() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,25 @@ | ||
import { checkNode, checkPackageThemeConsistent } from '../utils/check.js' | ||
import { cleanVendorFolder } from '../compile/clean.js' | ||
import '../utils/check.js' | ||
import * as ui from '../utils/ui.js' | ||
import { cleanVendorDestFolder } from '../compile/clean.js' | ||
import { compileScss } from '../compile/sass.js' | ||
import { compileCss } from '../compile/css.js' | ||
import { compileJs } from '../compile/js.js' | ||
import { confirmThemeName } from '../hubspot/helpers.js' | ||
import { compileFieldsJs } from '../hubspot/fields.js' | ||
import * as utils from '../utils/ui.js' | ||
checkNode() | ||
checkPackageThemeConsistent() | ||
|
||
/** | ||
* #### Build/compile all src CSS/JS/SCSS files | ||
* @async | ||
* @memberof Theme_Commands | ||
* @param {Object} [opt] - local theme based config | ||
* @returns undefined | ||
* @example | ||
* node build/build.js | ||
*/ | ||
async function build (opt) { | ||
await confirmThemeName() | ||
const timeStart = utils.startTaskGroup('Build task') | ||
await cleanVendorFolder() | ||
async function build () { | ||
const timeStart = ui.startTaskGroup('Build') | ||
await cleanVendorDestFolder() | ||
await compileScss() | ||
await Promise.all([compileCss(), compileJs(opt), compileFieldsJs()]) | ||
utils.endTaskGroup({ taskName: 'Build task', timeStart }) | ||
await compileCss() | ||
await compileJs() | ||
await compileFieldsJs() | ||
ui.endTaskGroup({ taskName: 'Build', timeStart }) | ||
} | ||
|
||
export { build } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
import { hubspotFetchAll } from './fetchAll.js' | ||
import { hubspotFetchAll } from './fetch.js' | ||
hubspotFetchAll() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import '../utils/check.js' | ||
import themeName from '../hubspot/theme.js' | ||
import { fetch } from '../hubspot/fetch.js' | ||
import { loadAuthConfig } from '../hubspot/auth/auth.js' | ||
import * as ui from '../utils/ui.js' | ||
|
||
/** | ||
* #### Fetch all theme files | ||
* @async | ||
* @memberof Theme_Commands | ||
* @returns undefined | ||
*/ | ||
async function hubspotFetchAll () { | ||
const timeStart = ui.startTaskGroup(`Fetch all from ${themeName}`) | ||
const hubAuthData = await loadAuthConfig(themeName) | ||
await fetch(hubAuthData, themeName) | ||
ui.endTaskGroup({ taskName: `Fetch all from ${themeName}`, timeStart }) | ||
} | ||
|
||
export { hubspotFetchAll } |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,20 @@ | ||
import { checkNode, checkPackageThemeConsistent } from '../utils/check.js' | ||
import '../utils/check.js' | ||
import themeName from '../hubspot/theme.js' | ||
import { fetchModules } from '../hubspot/fetch.js' | ||
import { globals } from '../config/globals.js' | ||
import { getAuthConfig } from '../hubspot/auth.js' | ||
import { confirmThemeName } from '../hubspot/helpers.js' | ||
import * as utils from '../utils/ui.js' | ||
checkNode() | ||
checkPackageThemeConsistent() | ||
import { loadAuthConfig } from '../hubspot/auth/auth.js' | ||
import * as ui from '../utils/ui.js' | ||
|
||
/** | ||
* #### Fetch Modules from HUBSPOT cms portall | ||
* #### Fetch only modules from HubSpot theme | ||
* @async | ||
* @memberof Theme_Commands | ||
* @returns undefined | ||
* @example | ||
* node build/fetchModules.js | ||
*/ | ||
async function hubspotFetchModules () { | ||
await confirmThemeName() | ||
const hubAuth = await getAuthConfig() | ||
const timeStart = utils.startTaskGroup(`Fetch modules from ${globals.THEME_NAME}`) | ||
await fetchModules(hubAuth) | ||
utils.endTaskGroup({ taskName: `Fetch modules from ${globals.THEME_NAME}`, timeStart }) | ||
const timeStart = ui.startTaskGroup(`Fetch modules from ${themeName}`) | ||
const hubAuthData = await loadAuthConfig(themeName) | ||
await fetchModules(hubAuthData, themeName) | ||
ui.endTaskGroup({ taskName: `Fetch modules from ${themeName}`, timeStart }) | ||
} | ||
|
||
export { hubspotFetchModules } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,17 @@ | ||
import { checkNode, checkPackageThemeConsistent } from '../utils/check.js' | ||
import '../utils/check.js' | ||
import { compileFieldsJs } from '../hubspot/fields.js' | ||
import { confirmThemeName } from '../hubspot/helpers.js' | ||
import * as utils from '../utils/ui.js' | ||
checkNode() | ||
checkPackageThemeConsistent() | ||
import * as ui from '../utils/ui.js' | ||
|
||
/** | ||
* #### 'Compile fields.js to fields.json | ||
* @async | ||
* @memberof Theme_Commands | ||
* @param {Object} [opt] - local theme based config | ||
* @returns undefined | ||
*/ | ||
async function fields (opt) { | ||
await confirmThemeName() | ||
const timeStart = utils.startTaskGroup('Compile fields.js to fields.json') | ||
async function fields () { | ||
const timeStart = ui.startTaskGroup('Compile fields.js') | ||
await compileFieldsJs() | ||
utils.endTaskGroup({ taskName: 'Compile fields.js to fields.json', timeStart }) | ||
ui.endTaskGroup({ taskName: 'Compile fields.js', timeStart }) | ||
} | ||
|
||
export { fields } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
import { config } from '../config/config.js' | ||
import { lighthouse } from './lighthouse.js' | ||
lighthouse({ config }) | ||
lighthouse() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,20 @@ | ||
import * as T from '../config/types.js' // eslint-disable-line | ||
import { checkNode, checkPackageThemeConsistent } from '../utils/check.js' | ||
import { lighthouseScore } from '../hubspot/lighthouse-score.js' | ||
// import { globals } from '../config/globals.js' | ||
import { getAuthConfig } from '../hubspot/auth.js' | ||
import { confirmThemeName } from '../hubspot/helpers.js' | ||
import * as utils from '../utils/ui.js' | ||
checkNode() | ||
checkPackageThemeConsistent() | ||
import '../utils/check.js' | ||
import themeName from '../hubspot/theme.js' | ||
import { lighthouseScore } from '../hubspot/lighthouse.js' | ||
import { loadAuthConfig } from '../hubspot/auth/auth.js' | ||
import * as ui from '../utils/ui.js' | ||
|
||
/** | ||
* #### Get Lighthouse Score for theme | ||
* @async | ||
* @memberof Theme_Commands | ||
* @param {T.THEME_BUILD_OPTIONS} opt - local theme based config | ||
* @returns undefined | ||
* @example | ||
* node build/lighthouseScore.js | ||
*/ | ||
async function lighthouse (opt) { | ||
await confirmThemeName() | ||
const hubAuth = await getAuthConfig() | ||
const timeStart = utils.startTaskGroup('Lighthouse') | ||
await lighthouseScore(hubAuth, opt) | ||
utils.endTaskGroup({ taskName: 'Lighthouse', timeStart }) | ||
async function lighthouse () { | ||
const timeStart = ui.startTaskGroup(`Lighthouse tests for ${themeName}`) | ||
const hubAuthData = await loadAuthConfig(themeName) | ||
await lighthouseScore(hubAuthData, themeName) | ||
ui.endTaskGroup({ taskName: `Lighthouse tests for ${themeName}`, timeStart }) | ||
} | ||
|
||
export { lighthouse } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,2 @@ | ||
import { config } from '../config/config.js' | ||
import { upload } from './upload.js' | ||
|
||
upload({ config }) | ||
upload() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,30 @@ | ||
import { checkNode, checkPackageThemeConsistent } from '../utils/check.js' | ||
import '../utils/check.js' | ||
import themeName from '../hubspot/theme.js' | ||
import { loadAuthConfig } from '../hubspot/auth/auth.js' | ||
import { uploadTheme } from '../hubspot/upload.js' | ||
import { cleanVendorFolder } from '../compile/clean.js' | ||
import { cleanVendorDestFolder } from '../compile/clean.js' | ||
import { compileScss } from '../compile/sass.js' | ||
import { compileCss } from '../compile/css.js' | ||
import { compileJs } from '../compile/js.js' | ||
import { globals } from '../config/globals.js' | ||
import { getAuthConfig } from '../hubspot/auth.js' | ||
import { confirmThemeName } from '../hubspot/helpers.js' | ||
import { compileFieldsJs } from '../hubspot/fields.js' | ||
import * as utils from '../utils/ui.js' | ||
checkNode() | ||
checkPackageThemeConsistent() | ||
import * as ui from '../utils/ui.js' | ||
|
||
/** | ||
* #### Upload theme to HUBSPOT cms portall | ||
* @async | ||
* @memberof Theme_Commands | ||
* @param {object} [opt] - local theme based config | ||
* @returns undefined | ||
* @example | ||
* node build/upload.js | ||
*/ | ||
async function upload (opt) { | ||
await confirmThemeName() | ||
const hubAuth = await getAuthConfig() | ||
const timeStart = utils.startTaskGroup(`Upload ${globals.THEME_NAME}`) | ||
await cleanVendorFolder() | ||
async function upload () { | ||
const timeStart = ui.startTaskGroup(`Upload ${themeName}`) | ||
const hubAuthData = await loadAuthConfig(themeName) | ||
await cleanVendorDestFolder() | ||
await compileScss() | ||
await Promise.all([compileCss(), compileJs(opt), compileFieldsJs()]) | ||
await uploadTheme(hubAuth) | ||
utils.endTaskGroup({ taskName: `Upload ${globals.THEME_NAME}`, timeStart }) | ||
await compileCss() | ||
await compileJs() | ||
await compileFieldsJs() | ||
await uploadTheme(hubAuthData, themeName) | ||
ui.endTaskGroup({ taskName: `Upload ${themeName}`, timeStart }) | ||
} | ||
|
||
export { upload } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,20 @@ | ||
import { checkNode, checkPackageThemeConsistent } from '../utils/check.js' | ||
import { marketplaceValidate } from '../hubspot/marketplace-validate.js' | ||
import { globals } from '../config/globals.js' | ||
import { getAuthConfig } from '../hubspot/auth.js' | ||
import { confirmThemeName } from '../hubspot/helpers.js' | ||
import * as utils from '../utils/ui.js' | ||
checkNode() | ||
checkPackageThemeConsistent() | ||
import '../utils/check.js' | ||
import themeName from '../hubspot/theme.js' | ||
import { marketplaceValidate } from '../hubspot/validate.js' | ||
import { loadAuthConfig } from '../hubspot/auth/auth.js' | ||
import * as ui from '../utils/ui.js' | ||
|
||
/** | ||
* #### Theme Validation | ||
* @async | ||
* @memberof Theme_Commands | ||
* @returns undefined | ||
* @example | ||
* node build/validate.js | ||
*/ | ||
async function validate () { | ||
await confirmThemeName() | ||
const hubAuth = await getAuthConfig() | ||
const timeStart = utils.startTaskGroup(`Validation for ${globals.THEME_NAME}`) | ||
await marketplaceValidate(hubAuth) | ||
utils.endTaskGroup({ taskName: `Validation for ${globals.THEME_NAME}`, timeStart }) | ||
const timeStart = ui.startTaskGroup(`Validate ${themeName}`) | ||
const hubAuthData = await loadAuthConfig(themeName) | ||
await marketplaceValidate(hubAuthData, themeName) | ||
ui.endTaskGroup({ taskName: `Validate ${themeName}`, timeStart }) | ||
} | ||
|
||
export { validate } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,2 @@ | ||
import { config } from '../config/config.js' | ||
import { watch } from './watch.js' | ||
|
||
watch({ config }) | ||
watch() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,19 @@ | ||
import { checkNode, checkPackageThemeConsistent } from '../utils/check.js' | ||
import { watchSrc } from '../compile/watch.js' | ||
import { getAuthConfig } from '../hubspot/auth.js' | ||
import '../utils/check.js' | ||
import themeName from '../hubspot/theme.js' | ||
import { watchVendor } from '../compile/watch.js' | ||
import { watchHubspotTheme } from '../hubspot/watch.js' | ||
import { confirmThemeName } from '../hubspot/helpers.js' | ||
checkNode() | ||
checkPackageThemeConsistent() | ||
import { loadAuthConfig } from '../hubspot/auth/auth.js' | ||
|
||
/** | ||
* #### Run watch process with css/js/scss compilation | ||
* @async | ||
* @memberof Theme_Commands | ||
* @param {object} [opt] - local theme based config | ||
* @returns undefined | ||
* @example | ||
* node build/watch.js | ||
*/ | ||
async function watch (opt) { | ||
await confirmThemeName() | ||
const hubAuth = await getAuthConfig() | ||
await watchSrc(opt) | ||
await watchHubspotTheme(hubAuth) | ||
async function watch () { | ||
const hubAuthData = await loadAuthConfig(themeName) | ||
await watchVendor() | ||
await watchHubspotTheme(hubAuthData, themeName) | ||
} | ||
|
||
export { watch } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.