@softlimit/theme-envy 0.1.6-alpha → 0.1.8-alpha
Sign up to get free protection for your applications and to get access to all the features.
@@ -19,6 +19,9 @@ module.exports = function(path) {
|
|
19
19
|
if (path.includes('templates/customers')) {
|
20
20
|
return `templates/customers/${filename}`
|
21
21
|
}
|
22
|
+
if (path.includes('templates/metaobject')) {
|
23
|
+
return `templates/metaobject/${filename}`
|
24
|
+
}
|
22
25
|
if (path.includes('templates/') && !path.includes('customers/')) {
|
23
26
|
return `templates/${filename}`
|
24
27
|
}
|
@@ -12,8 +12,8 @@ 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', '--only=sections/*.json']
|
16
|
+
const shopify = spawn('shopify', themePull, { cwd: path.resolve(process.cwd()), stdio: 'inherit' })
|
17
17
|
|
18
18
|
shopify.on('exit', function() {
|
19
19
|
const files = glob.sync(path.resolve(ThemeEnvy.outputPath, '{templates,config,sections}/**/*.json')).filter(file => file.indexOf('settings_schema') === -1)
|
package/ignore/index.js
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
/**
|
2
|
+
* @file Creates a .shopifyignore file in the outputPath directory based on the type of push specified in the argument.
|
3
|
+
* @param {string} type - The type of ignore pattern to use: 'none', 'locales', 'push'
|
4
|
+
*/
|
5
|
+
|
6
|
+
const path = require('path')
|
7
|
+
const fs = require('fs')
|
8
|
+
|
9
|
+
const patterns = {
|
10
|
+
none: '',
|
11
|
+
locales: 'locales/*',
|
12
|
+
push: `locales/*
|
13
|
+
templates/*.json
|
14
|
+
sections/*.json
|
15
|
+
config/settings_data.json
|
16
|
+
`,
|
17
|
+
}
|
18
|
+
|
19
|
+
module.exports = function(type) {
|
20
|
+
if (!fs.existsSync(path.resolve(process.cwd(), 'dist'))) {
|
21
|
+
fs.mkdirSync(path.resolve(process.cwd(), 'dist'))
|
22
|
+
}
|
23
|
+
fs.writeFileSync(path.resolve(process.cwd(), 'dist/.shopifyignore'), patterns[type])
|
24
|
+
}
|
package/index.js
CHANGED
@@ -21,6 +21,7 @@ const themeEnvyCommands = {
|
|
21
21
|
convert: require('#Convert'),
|
22
22
|
dev: require('#Helpers/functions/dev.js'),
|
23
23
|
init: require('#Init'),
|
24
|
+
ignore: require('#Ignore'),
|
24
25
|
new: require('#Helpers/functions/scaffold-new/index.js'),
|
25
26
|
orphans: require('#Helpers/functions/find-orphans.js'),
|
26
27
|
'pull-json': require('#Helpers/functions/pull-json.js'),
|
@@ -188,4 +189,15 @@ program
|
|
188
189
|
scriptMessage(command.name())
|
189
190
|
themeEnvyCommands.convert(source)
|
190
191
|
})
|
192
|
+
|
193
|
+
program
|
194
|
+
.command('ignore')
|
195
|
+
.description('Create a .shopifyignore file in the output directory based on the type of ignore patter specified in the argument')
|
196
|
+
.usage(['[none|locales|push]'])
|
197
|
+
.addArgument(new commander.Argument('[type]', 'The type of ignore pattern to use').choices(['none', 'locales', 'push']))
|
198
|
+
.action((type, options, command) => {
|
199
|
+
scriptMessage(command.name())
|
200
|
+
themeEnvyCommands.ignore(type)
|
201
|
+
})
|
202
|
+
|
191
203
|
program.parse()
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@softlimit/theme-envy",
|
3
|
-
"version": "0.1.
|
3
|
+
"version": "0.1.8-alpha",
|
4
4
|
"description": "Softlimit Shopify Theme Development Environment",
|
5
5
|
"bin": {
|
6
6
|
"theme-envy": "./index.js"
|
@@ -27,6 +27,7 @@
|
|
27
27
|
"#Init/*": "./init/*",
|
28
28
|
"#Init/functions": "./init/functions/index.js",
|
29
29
|
"#Init/functions/*": "./init/functions/*",
|
30
|
+
"#Ignore": "./ignore/index.js",
|
30
31
|
"#LogSymbols": "./helpers/functions/log-symbols.js",
|
31
32
|
"#Root/*": "./*"
|
32
33
|
},
|