-
Notifications
You must be signed in to change notification settings - Fork 0
/
wp.config.sample.ts
executable file
·128 lines (124 loc) · 2.81 KB
/
wp.config.sample.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
/**
* The default WordPress admin user configuration for both local and live environments.
* @constant
* @type {{ username: string; password: string; localUsername: string; localPassword: string; local: string; live: string }}
*/
const WP_ADMIN_USER = {
username: 'live_username',
password: 'live_password',
localUsername: 'admin',
localPassword: 'password',
local: 'http://localhost',
live: 'https://example.org'
} as const;
/**
* Extracted environment variables related to WordPress configuration.
* Uses default values if environment variables are not set.
* @constant
* @type {{
* WP_USERNAME: string;
* WP_PASSWORD: string;
* WP_BASE_URL: string;
* WP_ROOT_DIR: string;
* WP_ENV_TYPE: ServerType;
* WP_DOCKER_CONTAINER: string;
* WP_DOCKER_ROOT_DIR: string;
* WP_SSH_USERNAME: string;
* WP_SSH_ADDRESS: string;
* WP_SSH_KEY: string;
* WP_SSH_ROOT_DIR: string;
* }}
*/
const {
WP_USERNAME = process.env.npm_config_env !== undefined ? WP_ADMIN_USER.localUsername : WP_ADMIN_USER.username,
WP_PASSWORD = process.env.npm_config_env !== undefined ? WP_ADMIN_USER.localPassword : WP_ADMIN_USER.password,
WP_BASE_URL = process.env.npm_config_env !== undefined ? WP_ADMIN_USER.local : WP_ADMIN_USER.live,
WP_ROOT_DIR = '',
WP_ENV_TYPE = '',
WP_DOCKER_CONTAINER = '',
WP_DOCKER_ROOT_DIR = '',
WP_SSH_USERNAME = '',
WP_SSH_ADDRESS = '',
WP_SSH_KEY = '',
WP_SSH_ROOT_DIR = ''
} = process.env;
/**
* Exported Scenario urls to be used for visual regression testing with backstopjs
* @exports
* @type {{
* [key: string]: {
* path?: string,
* disableJs?: boolean,
* theme?: string,
* mobile?: boolean
* }
* }}
*/
const SCENARIO_URLS = {
/**
* The value will hold the url paths
*/
home: {
path: ''
},
llcss: {
path: 'lazyload_css_background_images'
},
noJsLlcss: {
path: 'lazyload_css_background_images',
disableJs: true
},
elementorLlcss: {
path: 'elementor-overlay'
},
delayJs: {
path: ''
},
delayJsMobile: {
path: '',
mobile: true,
},
doubleColon: {
path: 'll_bg_css_double_colon'
},
singleColon: {
path: 'll_bg_css_single_colon'
}
}
/**
* Exported WordPress environment configuration.
* @exports
* @type {{
* WP_USERNAME: string;
* WP_PASSWORD: string;
* WP_BASE_URL: string;
* WP_ROOT_DIR: string;
* WP_ENV_TYPE: ServerType;
* WP_DOCKER_CONTAINER: string;
* WP_DOCKER_ROOT_DIR: string;
* WP_SSH_USERNAME: string;
* WP_SSH_ADDRESS: string;
* WP_SSH_KEY: string;
* WP_SSH_ROOT_DIR: string;
* SCENARIO_URLS: {
* home: string;
* llcss: string;
* noJsLlcss: string;
* elementorLlcss: string;
* }
* }}
*/
export {
WP_USERNAME,
WP_PASSWORD,
WP_BASE_URL,
WP_ROOT_DIR,
WP_ENV_TYPE,
WP_DOCKER_CONTAINER,
WP_DOCKER_ROOT_DIR,
WP_SSH_USERNAME,
WP_SSH_ADDRESS,
WP_SSH_KEY,
WP_SSH_ROOT_DIR,
SCENARIO_URLS
};