-
Notifications
You must be signed in to change notification settings - Fork 50
/
package.json
executable file
·203 lines (203 loc) · 9.98 KB
/
package.json
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
{
"name": "wp-reactjs-multi-starter",
"private": true,
"engines": {
"node": ">=10.15.3",
"yarn": ">=1.19"
},
"workspaces": {
"packages": [
"plugins/*",
"packages/*"
],
"nohoist": [
"**/grunt*"
]
},
"db-snapshot": [
"wp_posts",
"wp_postmeta"
],
"scripts": {
"postinstall": "patch-package --patch-dir common/patch-package",
"bootstrap": "yarn install$(test $CI && echo ' --frozen-lockfile') --network-concurrency 15 && lerna link && lerna run bootstrap && patch-package --patch-dir common/patch-package",
"docker:start": "yarn docker-compose up --build -d && concurrently --raw \"yarn docker-compose logs -f -t --tail=10\" \"yarn --silent wp-wait && yarn --silent docker:start:dev\"",
"docker:start:dev": "concurrently --raw \"TS_NODE_PROJECT=common/tsconfig.json yarn parallel-webpack --no-stats --config common/webpack.multi.ts --watch\" \"WORKSPACE_COMMAND='IS_DOCKER_START_COMMAND=1 yarn dev' yarn --silent workspace:concurrently\"",
"docker:stop": "yarn docker-compose stop",
"docker:rm": "yarn docker-compose down",
"docker:purge": "yarn docker-compose down -v",
"debug:php:generate": "yarn ts-node common/generate-launch-json.ts && prettier --write .vscode/launch.json",
"debug:php:start": "yarn --silent wp-cli:root '(pecl list | grep xdebug || pecl install xdebug) && docker-php-ext-enable xdebug.so && /etc/init.d/apache2 reload'",
"debug:php:stop": "yarn --silent wp-cli:root 'rm -f /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini && /etc/init.d/apache2 reload'",
"docker-compose": "PLUGIN_SLUGS=$(yarn --silent workspace:slugs) COMPOSE_PATH_SEPARATOR=: COMPOSE_FILE=./devops/docker-compose/docker-compose.yml:./devops/docker-compose/docker-compose.local.yml:$(COMPOSE_CONTEXT=local yarn --silent workspace:compose-files) COMPOSE_PROJECT_NAME=${npm_package_name} yarn --silent exposedotenv docker-compose",
"docker-compose:name": "echo $(docker inspect -f '{{.Name}}' $(yarn --silent docker-compose --log-level ERROR ps -q ${DCOMPOSE_SERVICE_NAME}) | cut -c2-)",
"docker-compose:name-wordpress": "DCOMPOSE_SERVICE_NAME=wordpress yarn --silent docker-compose:name",
"wp-cli": "yarn --silent docker-compose$(test $CI && echo ':e2e' || echo ' --log-level ERROR') exec ${WP_CLI_CONTAINER_ARGS:='--user 33:33'} -T wordpress /bin/bash -c",
"wp-cli:root": "WP_CLI_CONTAINER_ARGS='--user 0' yarn --silent wp-cli",
"wp-wait": "timeout=500 docker exec -e REST_ENDPOINT=$(cd plugins && ls | head -1) ${WP_WAIT_CONTAINER:=$(yarn --silent docker-compose:name-wordpress)} bash -c 'while [ \"$(curl --insecure -s -o /dev/null -w ''%{http_code}'' localhost/wp-json/$REST_ENDPOINT/v1/plugin)\" != \"200\" ]; do sleep 2; done'",
"db:snapshot": "yarn --silent wp-cli \"wp db export - --tables=$(node -e 'console.log(require(`./package.json`)[`db-snapshot`].join(`,`))')\" >",
"db:snapshot-import-on-startup": "yarn --silent db:snapshot ./devops/scripts/startup.sql",
"db:snapshot-import": "yarn --silent wp-cli \"wp db import /scripts/startup.sql\"",
"docker-compose:e2e": "PLUGIN_SLUGS=$(yarn --silent workspace:slugs) COMPOSE_PATH_SEPARATOR=: COMPOSE_FILE=./devops/docker-compose/docker-compose.yml:./devops/docker-compose/docker-compose.e2e.yml:$(COMPOSE_CONTEXT=e2e yarn --silent workspace:compose-files) COMPOSE_PROJECT_NAME=${npm_package_name}-ci-${JOB_PACKAGE_NAME}-${CI_COMMIT_REF_SLUG} yarn --silent exposedotenv docker-compose --log-level ERROR",
"docker-compose:e2e:name": "echo $(docker inspect -f '{{.Name}}' $(yarn --silent docker-compose:e2e ps -q ${DCOMPOSE_SERVICE_NAME}) | cut -c2-)",
"docker-compose:e2e:name-wordpress": "DCOMPOSE_SERVICE_NAME=wordpress yarn --silent docker-compose:e2e:name",
"docker-compose:traefik": "PLUGIN_SLUGS=$(yarn --silent workspace:slugs) COMPOSE_PATH_SEPARATOR=: COMPOSE_FILE=./devops/docker-compose/docker-compose.yml:./devops/docker-compose/docker-compose.traefik.yml:$(COMPOSE_CONTEXT=traefik yarn --silent workspace:compose-files) COMPOSE_PROJECT_NAME=${npm_package_name}-traefik-${CI_COMMIT_REF_SLUG} yarn --silent exposedotenv docker-compose --log-level ERROR",
"docker-compose:traefik:name": "echo $(docker inspect -f '{{.Name}}' $(yarn --silent docker-compose:traefik ps -q ${DCOMPOSE_SERVICE_NAME}) | cut -c2-)",
"docker-compose:traefik:name-wordpress": "DCOMPOSE_SERVICE_NAME=wordpress yarn --silent docker-compose:traefik:name",
"workspace:lint": "eslint \"common/**/*.{jsx,js,tsx,ts}\" && ./packages/utils/vendor/bin/phpcs common/ --standard=./common/phpcs.xml && yarn --silent workspaces run lint",
"workspace:concurrently": "node -e \"require('concurrently')('$(yarn --silent lerna list --all -p --loglevel silent | tr -s '\r\n' ',')'.split(',').filter(Boolean).map(d => 'cd \\'' + d + '\\' && ' + process.env.WORKSPACE_COMMAND), { raw: true })\"",
"workspace:compose-files": "find plugins/*/devops packages/*/devops | grep \"^\\(plugins\\|packages\\)/.*/devops/docker-compose/docker-compose\\.\\(yml\\|$COMPOSE_CONTEXT\\)\" | sed -n -e 'H;${x;s/\\n/:.\\//g;s/^ //;p;}' | sed -e 's/:*$//' | sed -e 's/^://' ",
"workspace:slugs": "find plugins/* -maxdepth 0 2>/dev/null | sed -n -e 'H;${x;s/\\n/ /g;s/^ //;p;}' | sed 's/plugins\\///g'",
"exposedotenv": "env $(cat ./common/.env-default | xargs) env $(cat ./.env 2>/dev/null | xargs)",
"preversion": "(test \"${CI_JOB_NAME}\" != \"semver\" && WORKSPACE_COMMAND=\"yarn --silent grunt composer:disclaimer\" yarn --silent workspace:concurrently && lerna exec --concurrency 1 -- yarn grunt yarn:disclaimer && git add \"*LICENSE_3RD_PARTY*\") || :"
},
"license-check": {
"spdx": [
"MIT",
"ISC",
"BSD-2-Clause",
"BSD-3-Clause",
"Apache-2.0",
"Artistic-2.0",
"WTFPL",
"CC-0",
"CC0-1.0",
"MPL-2.0",
"ZLib",
"Unlicense",
"GPL-2.0",
"GPL-2.0-or-later",
"GPL-3",
"GPL-3.0-or-later",
"LGPL-3.0-or-later"
],
"packages": [
"ignore-packages-here@1.0.0"
]
},
"lerna": {
"npmClient": "yarn",
"useWorkspaces": true,
"version": "independent",
"command": {
"version": {
"conventionalCommits": true,
"conventionalChangelog": {
"context": {
"linkReferences": false,
"linkCompare": false
},
"writerOpts": {
"transform": {
"hash": null
},
"commitPartial": "*{{#if scope}} **{{scope}} :**{{~/if}} {{#if subject}}{{~subject}}{{~else}}{{~header}}{{~/if}}\n"
}
},
"createRelease": "gitlab",
"message": "chore(release): publish [ci skip]",
"allowBranch": "master"
}
},
"ignoreChanges": [
"packages/*/devops/**/*",
"packages/*/scripts/**/*",
"packages/*/test/**/*",
"packages/*/*.md",
"packages/*/tsconfig.json",
"plugins/*/devops/**/*",
"plugins/*/scripts/**/*",
"plugins/*/test/**/*",
"plugins/*/wordpress.org/**/*",
"plugins/*/*.md",
"plugins/*/tsconfig.json"
]
},
"eslintConfig": {
"extends": [
"./common/.eslintrc"
]
},
"eslintIgnore": [
"common/create-wp-react-app",
"node_modules",
".yarn-integrity",
".yarn"
],
"lint-staged": {
"*.{js,jsx,ts,tsx}": [
"prettier --write",
"eslint --fix"
],
"*.php": [
"prettier --write",
"./packages/utils/vendor/bin/phpcs --standard=./common/phpcs.xml",
"./packages/utils/vendor/bin/phpcbf --standard=./common/phpcs.xml"
]
},
"husky": {
"hooks": {
"pre-commit": "lint-staged",
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
},
"commitlint": {
"extends": [
"@commitlint/config-conventional"
],
"rules": {
"header-max-length": [
2,
"always",
140
]
}
},
"prettier": {
"arrowParens": "always",
"printWidth": 120,
"useTabs": false,
"tabWidth": 4,
"endOfLine": "lf",
"trailingComma": "none",
"overrides": [
{
"files": "*.php",
"options": {
"singleQuote": true,
"trailingCommaPHP": false,
"braceStyle": "1tbs"
}
}
]
},
"devDependencies": {
"@commitlint/cli": "^9.0.1",
"@commitlint/config-conventional": "^9.0.1",
"@prettier/plugin-php": "^0.14.2",
"@prettier/plugin-xml": "^0.7.2",
"@types/grunt": "^0.4.25",
"@types/rimraf": "^3.0.0",
"@typescript-eslint/eslint-plugin": "^3.4.0",
"@typescript-eslint/parser": "^3.4.0",
"concurrently": "^5.2.0",
"dotenv": "^8.2.0",
"eslint": "^7.3.1",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-jest": "^23.17.1",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-react": "^7.20.1",
"husky": "^4.2.5",
"lerna": "^3.22.1",
"lint-staged": "^10.2.11",
"node-gitlab-ci": "^0.2.0",
"parallel-webpack": "^2.6.0",
"patch-package": "^6.2.2",
"php-parser": "^3.0.1",
"postinstall-postinstall": "^2.1.0",
"prettier": "^2.0.5",
"rimraf": "^3.0.2",
"typescript": "~3.9.5"
}
}