@softlimit/theme-envy 0.1.5-alpha → 0.1.7-alpha
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.
|
@@ -72,7 +72,8 @@ function watch({ mode, verbose }) {
|
|
|
72
72
|
const chokidar = require('chokidar')
|
|
73
73
|
console.log('watching for changes...')
|
|
74
74
|
chokidar.watch(ThemeEnvy.themePath).on('change', (path) => {
|
|
75
|
-
|
|
75
|
+
// pass path to the event so we can use to update files separately
|
|
76
|
+
ThemeEnvy.events.emit('watch:change', path)
|
|
76
77
|
const isJSONTemplate = path.includes('templates/') && path.extname(path) === '.json'
|
|
77
78
|
if (!isJSONTemplate) {
|
|
78
79
|
console.log(`updated: ${path.split(ThemeEnvy.themePath + '/')[1]}`)
|
package/build/requires/assets.js
CHANGED
package/build/requires/config.js
CHANGED
|
@@ -34,7 +34,7 @@ const writeSettingsSchema = () => {
|
|
|
34
34
|
|
|
35
35
|
writeSettingsSchema()
|
|
36
36
|
|
|
37
|
-
ThemeEnvy.events.on('watch:
|
|
37
|
+
ThemeEnvy.events.on('watch:change', () => {
|
|
38
38
|
// clear node cache of ThemeRequired modules
|
|
39
39
|
requiredModules.forEach(module => {
|
|
40
40
|
delete require.cache[require.resolve(module)]
|
|
@@ -23,7 +23,7 @@ const setPreGlobs = () => {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
// uncache all required files after a build is complete so changes can be made to partials and schemas in between watch events
|
|
26
|
-
ThemeEnvy.events.on('watch:
|
|
26
|
+
ThemeEnvy.events.on('watch:change', () => {
|
|
27
27
|
// clear node cache of ThemeRequired modules
|
|
28
28
|
requiredModules.forEach(module => {
|
|
29
29
|
delete require.cache[require.resolve(module)]
|
|
@@ -12,11 +12,11 @@ const { spawn } = require('child_process')
|
|
|
12
12
|
|
|
13
13
|
module.exports = function() {
|
|
14
14
|
const relativeDistPath = path.relative(process.cwd(), ThemeEnvy.outputPath)
|
|
15
|
-
const themePull = ['theme', 'pull', `--store=${ThemeEnvy.store}`, `--path=${relativeDistPath}
|
|
16
|
-
const shopify = spawn('shopify', themePull, { cwd:
|
|
15
|
+
const themePull = ['theme', 'pull', `--store=${ThemeEnvy.store}`, `--path=${relativeDistPath}`, '--only=settings_data.json', '--only=templates/*.json']
|
|
16
|
+
const shopify = spawn('shopify', themePull, { cwd: path.resolve(process.cwd()), stdio: 'inherit' })
|
|
17
17
|
|
|
18
18
|
shopify.on('exit', function() {
|
|
19
|
-
const files = glob.sync(path.resolve(ThemeEnvy.outputPath, '{templates,config,sections}/**/*.json')).filter(file => file.indexOf('settings_schema')
|
|
19
|
+
const files = glob.sync(path.resolve(ThemeEnvy.outputPath, '{templates,config,sections}/**/*.json')).filter(file => file.indexOf('settings_schema') === -1)
|
|
20
20
|
files.forEach(file => fs.copyFileSync(file, file.replace(ThemeEnvy.outputPath, ThemeEnvy.themePath)))
|
|
21
21
|
})
|
|
22
22
|
}
|