@caweb/cli 1.0.0 → 1.0.1
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/lib/caweb.js +6 -3
- package/lib/commands/test.js +3 -1
- package/lib/options.js +46 -9
- package/package.json +13 -11
package/lib/caweb.js
CHANGED
|
@@ -45,9 +45,11 @@ async function runDockerCmd({
|
|
|
45
45
|
).then(
|
|
46
46
|
(result) => {
|
|
47
47
|
if( '' !== result.out ){
|
|
48
|
-
|
|
48
|
+
//spinner.info( result.out )
|
|
49
49
|
}else{
|
|
50
|
-
console.log(result.err)
|
|
50
|
+
//console.log(result.err.replace(/\s*?Container.*Running\n|\n/g, '' ))
|
|
51
|
+
//spinner.preText = result.err.replace(/\s*?Container.*Running\n|\n/g, '' )
|
|
52
|
+
//spinner.warn()
|
|
51
53
|
}
|
|
52
54
|
return result;
|
|
53
55
|
},
|
|
@@ -115,9 +117,10 @@ async function configureCAWeb( environment, config, spinner ) {
|
|
|
115
117
|
Object.entries(config.env[ environment ].config).forEach(([k,v]) => {
|
|
116
118
|
// if the option is prefixed with CAWEB_ and is a valid CAWeb Option.
|
|
117
119
|
if ( `${k}`.startsWith('CAWEB_') && undefined !== CAWEB_OPTIONS[k] ){
|
|
120
|
+
const option = CAWEB_OPTIONS[k];
|
|
118
121
|
// set the option.
|
|
119
122
|
themeOptions.push(
|
|
120
|
-
`wp option set '${
|
|
123
|
+
`wp option set '${option.name}' "${v}"`
|
|
121
124
|
);
|
|
122
125
|
}
|
|
123
126
|
})
|
package/lib/commands/test.js
CHANGED
|
@@ -13,7 +13,7 @@ const loadConfig = require( '@wordpress/env/lib/config/load-config' );
|
|
|
13
13
|
* Internal dependencies
|
|
14
14
|
*/
|
|
15
15
|
const {
|
|
16
|
-
runDockerCmd,
|
|
16
|
+
runDockerCmd, activateCAWeb,
|
|
17
17
|
} = require('../caweb');
|
|
18
18
|
|
|
19
19
|
const { buildWPEnvConfig, buildDockerComposeConfig } = require('../configs');
|
|
@@ -41,7 +41,9 @@ module.exports = async function test({
|
|
|
41
41
|
|
|
42
42
|
try {
|
|
43
43
|
const config = await loadConfig(path.resolve('.'));
|
|
44
|
+
|
|
44
45
|
/*
|
|
46
|
+
await activateCAWeb({spinner, environment})
|
|
45
47
|
let themeOptions = [];
|
|
46
48
|
|
|
47
49
|
Object.entries(config.env[ 'development' ].config).forEach(([k,v]) => {
|
package/lib/options.js
CHANGED
|
@@ -3,15 +3,52 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
const caweb_general_options = {
|
|
6
|
-
CAWEB_TEMPLATE_VER:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
6
|
+
CAWEB_TEMPLATE_VER: {
|
|
7
|
+
name: 'ca_site_version',
|
|
8
|
+
defaultValue: '5.5',
|
|
9
|
+
label: 'State Template Version'
|
|
10
|
+
},
|
|
11
|
+
CAWEB_NAV_MENU_STYLE: {
|
|
12
|
+
name: 'ca_default_navigation_menu',
|
|
13
|
+
defaultValue: 'singlelevel',
|
|
14
|
+
label: 'Header Menu Type'
|
|
15
|
+
},
|
|
16
|
+
CAWEB_COLORSCHEME: {
|
|
17
|
+
name: 'ca_site_color_scheme',
|
|
18
|
+
defaultValue: 'oceanside',
|
|
19
|
+
label: 'Color Scheme'
|
|
20
|
+
},
|
|
21
|
+
CAWEB_TITLE_DISPLAY: {
|
|
22
|
+
name: 'ca_default_post_title_display',
|
|
23
|
+
defaultValue: false,
|
|
24
|
+
label: 'Title Display Default'
|
|
25
|
+
},
|
|
26
|
+
CAWEB_STICKY_NAV: {
|
|
27
|
+
name: 'ca_sticky_navigation',
|
|
28
|
+
defaultValue: false,
|
|
29
|
+
label: 'Sticky Navigation'
|
|
30
|
+
},
|
|
31
|
+
CAWEB_MENU_HOME_LINK: {
|
|
32
|
+
name: 'ca_home_nav_link',
|
|
33
|
+
defaultValue: false,
|
|
34
|
+
label: 'Menu Home Link'
|
|
35
|
+
},
|
|
36
|
+
CAWEB_DISPLAY_POSTS_DATE: {
|
|
37
|
+
name: 'ca_default_post_date_display',
|
|
38
|
+
defaultValue: false,
|
|
39
|
+
label: 'Display Date for Non-Divi Posts'
|
|
40
|
+
},
|
|
41
|
+
CAWEB_X_UA_COMPATIBILITY: {
|
|
42
|
+
name: 'ca_x_ua_compatibility',
|
|
43
|
+
defaultValue: false,
|
|
44
|
+
label: 'Legacy Browser Support'
|
|
45
|
+
},
|
|
46
|
+
CAWEB_FRONTPAGE_SEARCH: {
|
|
47
|
+
name: 'ca_frontpage_search_enabled',
|
|
48
|
+
defaultValue: false,
|
|
49
|
+
label: 'Show Search on Front Page'
|
|
50
|
+
},
|
|
51
|
+
|
|
15
52
|
}
|
|
16
53
|
|
|
17
54
|
const CAWEB_OPTIONS = {
|
package/package.json
CHANGED
|
@@ -1,21 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@caweb/cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "CAWebPublishing Command Line Interface.",
|
|
5
5
|
"main": "lib/env.js",
|
|
6
6
|
"files": [
|
|
7
7
|
"bin",
|
|
8
8
|
"lib"
|
|
9
9
|
],
|
|
10
|
+
"directories": {
|
|
11
|
+
"doc": "docs",
|
|
12
|
+
"lib": "lib"
|
|
13
|
+
},
|
|
10
14
|
"bin": {
|
|
11
15
|
"caweb": "bin/caweb"
|
|
12
16
|
},
|
|
13
17
|
"scripts": {
|
|
14
18
|
"caweb": "caweb",
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
+
"test": "echo \"Error: run tests from root\" && exit 0",
|
|
20
|
+
"prelocaltest": "npm uninstall @caweb/cli",
|
|
21
|
+
"localtest": "npm pack && npm i caweb-cli-%npm_package_version%.tgz",
|
|
22
|
+
"postlocaltest": "del caweb-cli-%npm_package_version%.tgz"
|
|
19
23
|
},
|
|
20
24
|
"repository": {
|
|
21
25
|
"type": "git",
|
|
@@ -30,6 +34,9 @@
|
|
|
30
34
|
"bugs": {
|
|
31
35
|
"url": "https://github.com/CAWebPublishing/caweb-cli/issues"
|
|
32
36
|
},
|
|
37
|
+
"publishConfig": {
|
|
38
|
+
"access": "public"
|
|
39
|
+
},
|
|
33
40
|
"homepage": "https://github.com/CAWebPublishing/caweb-cli#readme",
|
|
34
41
|
"dependencies": {
|
|
35
42
|
"@wordpress/env": "^8.11.0",
|
|
@@ -50,10 +57,5 @@
|
|
|
50
57
|
"COOKIEPATH": "",
|
|
51
58
|
"SITECOOKIEPATH": ""
|
|
52
59
|
}
|
|
53
|
-
}
|
|
54
|
-
"directories": {
|
|
55
|
-
"doc": "docs",
|
|
56
|
-
"lib": "lib"
|
|
57
|
-
},
|
|
58
|
-
"devDependencies": {}
|
|
60
|
+
}
|
|
59
61
|
}
|