/
nx.json
188 lines (188 loc) · 4.99 KB
/
nx.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
{
"$schema": "./node_modules/nx/schemas/nx-schema.json",
"cli": {
"warnings": {
"versionMismatch": true
},
"packageManager": "yarn",
"analytics": false
},
"pluginsConfig": {
"@nx/js": {
"analyzeSourceFiles": false
}
},
"namedInputs": {
"core": ["{projectRoot}/*.css", "{projectRoot}/themes/*.css"],
"scripts": ["{projectRoot}/stories/*.js"],
"docs": ["{projectRoot}/metadata/*.yml"],
"stylelint": [
"{workspaceRoot}/.stylelintignore",
"{workspaceRoot}/stylelint.config.js",
"{workspaceRoot}/plugins/stylelint-*/index.js"
],
"eslint": ["{workspaceRoot}/.eslintrc.js"],
"prettier": ["{workspaceRoot}/.prettierrc"],
"tools": [
"{projectRoot}/*.json",
"{workspaceRoot}/postcss.config.js",
"{workspaceRoot}/plugins/postcss-*/index.js"
]
},
"targetDefaults": {
"clean": {
"cache": true,
"inputs": [
"{projectRoot}/dist/*.{css,json}",
"{projectRoot}/dist/**/*.{css,json}",
"{projectRoot}/dist/*.map",
"{projectRoot}/dist/**/*.map",
{ "externalDependencies": ["rimraf"] }
],
"outputs": [],
"executor": "nx:run-commands",
"options": {
"commands": [
"rimraf {projectRoot}/dist",
"test -d {projectRoot}/dist && echo \"Error: dist directory could not be removed\" && exit 1 || exit 0"
],
"parallel": false
}
},
"build": {
"cache": true,
"dependsOn": [
"^build",
"clean"
],
"inputs": [
"core",
"tools",
"!{projectRoot}/stories/*.js",
{ "externalDependencies": ["postcss"] },
{ "env": "NODE_ENV" }
],
"outputs": [
"{projectRoot}/dist/*.{css,json}",
"{projectRoot}/dist/themes/*.css",
"{projectRoot}/dist/*.map",
"{projectRoot}/dist/themes/*.css.map",
"{projectRoot}/metadata/mods.md"
],
"executor": "nx:run-commands",
"options": {
"commands": [
"node -e 'require(\"./tasks/component-builder.js\").default()'"
]
}
},
"compare": {
"cache": true,
"dependsOn": ["build"],
"inputs": [
"{workspaceRoot}/tasks/compare-compiled-output.js",
{ "dependentTasksOutputFiles": "dist/*.css", "transitive": true },
{
"externalDependencies": [
"fast-glob",
"tar",
"lodash",
"nunjucks",
"rimraf",
"npm-registry-fetch",
"yargs",
"diff",
"diff2html",
"colors"
]
},
{ "env": "NODE_ENV" }
],
"outputs": ["{workspaceRoot}/.diff-output"],
"executor": "nx:run-commands",
"options": {
"commands": [
"node ./tasks/compare-compiled-output.js $NX_TASK_TARGET_PROJECT"
]
}
},
"lint": {
"cache": true,
"inputs": [
"core",
"scripts",
"stylelint",
"eslint",
"prettier",
{ "externalDependencies": ["stylelint", "eslint", "prettier"] }
],
"executor": "nx:run-commands",
"options": {
"commands": [
"stylelint --cache --allow-empty-input --report-descriptionless-disables --report-invalid-scope-disables --report-needless-disables {projectRoot}/*.css {projectRoot}/**/*.css --ignore-pattern {projectRoot}/dist",
"eslint --cache --no-error-on-unmatched-pattern --report-unused-disable-directives {projectRoot}/*.{js,json} {projectRoot}/**/*.{js,json} --ignore-pattern {projectRoot}/dist || exit 0"
]
}
},
"format": {
"cache": true,
"inputs": [
"core",
"scripts",
"stylelint",
"eslint",
"prettier",
{ "externalDependencies": ["stylelint", "eslint", "prettier"] }
],
"executor": "nx:run-commands",
"options": {
"commands": [
"prettier --write --cache --log-level error --ignore-unknown --no-error-on-unmatched-pattern {projectRoot}/*.css {projectRoot}/**/*.css && stylelint --fix --cache --allow-empty-input {projectRoot}/*.css {projectRoot}/**/*.css",
"eslint --fix --cache --no-error-on-unmatched-pattern {projectRoot}/*.json {projectRoot}/stories/*.js",
"prettier --write --cache --log-level error --ignore-unknown --no-error-on-unmatched-pattern {projectRoot}/*.{yml,md} {projectRoot}/**/*.{yml,md}"
]
}
},
"test": {
"cache": true,
"inputs": ["scripts", "tools", { "externalDependencies": ["chromatic"] }],
"executor": "nx:run-commands",
"options": {
"cwd": ".storybook",
"commands": [
"chromatic --only-changed --build-script-name build --junit-report"
]
},
"configurations": {
"scope": {
"commands": [
"chromatic --build-script-name build --junit-report --only-story-names"
]
},
"plugins": {
"inputs": [
"{projectRoot}/index.js",
"{projectRoot}/test.js",
"{projectRoot}/expected/*.css",
"{projectRoot}/fixtures/*.css"
],
"cwd": "{projectRoot}",
"commands": ["ava test.js"]
}
}
},
"validate": {
"inputs": [
"{workspaceRoot}/schemas/documentation.schema.json",
"docs",
{ "externalDependencies": ["pajv"] }
],
"executor": "nx:run-commands",
"options": {
"commands": [
"test -e {projectRoot}/metadata && pajv validate -s ./schemas/documentation.schema.json -d \"{projectRoot}/metadata/*.yml\" || exit 0"
]
}
}
}
}