@backstage/cli 0.15.1 → 0.15.2-next.0

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.
Files changed (65) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/config/eslint-factory.js +286 -0
  3. package/config/eslint.backend.js +4 -87
  4. package/config/eslint.js +4 -93
  5. package/dist/cjs/{Lockfile-35661afa.cjs.js → Lockfile-276d1251.cjs.js} +1 -1
  6. package/dist/cjs/{PackageGraph-c403b5ba.cjs.js → PackageGraph-5c819ded.cjs.js} +23 -5
  7. package/dist/cjs/{backend-96651fe4.cjs.js → backend-ba5674b1.cjs.js} +2 -2
  8. package/dist/cjs/{build-d5b1d23b.cjs.js → build-355c6499.cjs.js} +30 -15
  9. package/dist/cjs/{build-7612765e.cjs.js → build-88c2fd94.cjs.js} +18 -9
  10. package/dist/cjs/{build-8b4ede1e.cjs.js → build-a0c2eb61.cjs.js} +15 -7
  11. package/dist/cjs/{build-63ad510e.cjs.js → build-cfb16c7d.cjs.js} +15 -7
  12. package/dist/cjs/{buildBackend-3c883d5a.cjs.js → buildBackend-3d0f6b8d.cjs.js} +9 -9
  13. package/dist/cjs/{buildWorkspace-f48879a3.cjs.js → buildWorkspace-e8b34b75.cjs.js} +19 -10
  14. package/dist/cjs/{bump-d5154b31.cjs.js → bump-06e432bb.cjs.js} +16 -7
  15. package/dist/cjs/{bundle-14c7b995.cjs.js → bundle-4401df64.cjs.js} +19 -10
  16. package/dist/cjs/{bundle-a85aadf3.cjs.js → bundle-6462d713.cjs.js} +2 -2
  17. package/dist/cjs/{clean-c345be5f.cjs.js → clean-856fd038.cjs.js} +11 -2
  18. package/dist/cjs/{config-1850dcec.cjs.js → config-34e60442.cjs.js} +3 -3
  19. package/dist/cjs/{create-134d31c3.cjs.js → create-9fc62b6e.cjs.js} +14 -5
  20. package/dist/cjs/{createDistWorkspace-f7ad8679.cjs.js → createDistWorkspace-2e59f9c1.cjs.js} +9 -8
  21. package/dist/cjs/{createPlugin-d2ded2b8.cjs.js → createPlugin-b4970fd2.cjs.js} +14 -5
  22. package/dist/cjs/{dev-2639a334.cjs.js → dev-abfdcb35.cjs.js} +15 -6
  23. package/dist/cjs/{diff-01358b78.cjs.js → diff-1644d12b.cjs.js} +11 -2
  24. package/dist/cjs/{docs-8fa5e9d5.cjs.js → docs-5aabd653.cjs.js} +13 -4
  25. package/dist/cjs/{index-9440126d.cjs.js → index-20a8e33f.cjs.js} +23 -14
  26. package/dist/cjs/{index-82dc75e2.cjs.js → index-4c13ec59.cjs.js} +62 -195
  27. package/dist/cjs/{index-eb041be4.cjs.js → index-922d86dd.cjs.js} +21 -12
  28. package/dist/cjs/{index-25dc786c.cjs.js → index-e36e6f30.cjs.js} +11 -2
  29. package/dist/cjs/{info-760ca1f3.cjs.js → info-f667ee33.cjs.js} +18 -8
  30. package/dist/cjs/{install-df5ba2ff.cjs.js → install-4a376c4f.cjs.js} +13 -4
  31. package/dist/cjs/{lint-6690e6b2.cjs.js → lint-228ef900.cjs.js} +11 -2
  32. package/dist/cjs/{lint-d7ceb0e6.cjs.js → lint-5233c048.cjs.js} +13 -4
  33. package/dist/cjs/{lint-12a2e869.cjs.js → lint-7a5f1e5d.cjs.js} +13 -4
  34. package/dist/cjs/{oldBuild-5126399f.cjs.js → oldBuild-65b1b59a.cjs.js} +15 -7
  35. package/dist/cjs/{pack-dc7d56e4.cjs.js → pack-bac37bf2.cjs.js} +11 -2
  36. package/dist/cjs/package-60f06638.cjs.js +129 -0
  37. package/dist/cjs/packageLintConfigs-e1177405.cjs.js +84 -0
  38. package/dist/cjs/{packageRole-e72fd97a.cjs.js → packageRole-fe7f070f.cjs.js} +12 -3
  39. package/dist/cjs/{packageRoles-c39e0b3b.cjs.js → packageRoles-c3085958.cjs.js} +2 -2
  40. package/dist/cjs/{packageScripts-88fcab41.cjs.js → packageScripts-82add064.cjs.js} +13 -4
  41. package/dist/cjs/{packager-b06a8557.cjs.js → packager-517bbb6b.cjs.js} +18 -12
  42. package/dist/cjs/{packages-72812461.cjs.js → packages-954bf3c0.cjs.js} +3 -3
  43. package/dist/cjs/{parallel-d8e5bcbf.cjs.js → parallel-8286d3fa.cjs.js} +1 -1
  44. package/dist/cjs/{paths-4f873870.cjs.js → paths-6403ea49.cjs.js} +5 -5
  45. package/dist/cjs/{print-57d4b62e.cjs.js → print-ccc887c6.cjs.js} +13 -4
  46. package/dist/cjs/{run-2e82fb1f.cjs.js → run-ce45fe5f.cjs.js} +2 -2
  47. package/dist/cjs/{schema-41f244ae.cjs.js → schema-084841cf.cjs.js} +13 -4
  48. package/dist/cjs/{serve-b4fcdcdf.cjs.js → serve-35ba5f65.cjs.js} +19 -10
  49. package/dist/cjs/{serve-2bb43537.cjs.js → serve-5471ff1c.cjs.js} +17 -8
  50. package/dist/cjs/{server-62084647.cjs.js → server-ecae19cc.cjs.js} +2 -2
  51. package/dist/cjs/{svgrTemplate-b7a4ee52.cjs.js → svgrTemplate-550efce6.cjs.js} +1 -1
  52. package/dist/cjs/{tasks-7e48ac21.cjs.js → tasks-ec11e3db.cjs.js} +2 -2
  53. package/dist/cjs/{testCommand-286a868f.cjs.js → testCommand-9dc293a6.cjs.js} +12 -3
  54. package/dist/cjs/validate-4f7c6061.cjs.js +40 -0
  55. package/dist/index.cjs.js +10 -1
  56. package/package.json +8 -9
  57. package/templates/default-backend-plugin/.eslintrc.js +1 -3
  58. package/templates/default-backend-plugin/package.json.hbs +10 -7
  59. package/templates/default-common-plugin-package/.eslintrc.js +1 -3
  60. package/templates/default-common-plugin-package/package.json.hbs +9 -6
  61. package/templates/default-plugin/.eslintrc.js +1 -3
  62. package/templates/default-plugin/package.json.hbs +10 -8
  63. package/templates/scaffolder-module/.eslintrc.js +1 -3
  64. package/templates/scaffolder-module/package.json.hbs +10 -6
  65. package/dist/cjs/validate-0aec1444.cjs.js +0 -31
package/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
1
1
  # @backstage/cli
2
2
 
3
+ ## 0.15.2-next.0
4
+
5
+ ### Patch Changes
6
+
7
+ - 2c528506aa: Added `--since <ref>` flag for `repo build` command.`
8
+ - d3d1b82198: chore(deps): bump `minimatch` from 5.0.0 to 5.0.1
9
+ - e0a69ba49f: build(deps): bump `fs-extra` from 9.1.0 to 10.0.1
10
+ - 44cc7c3b95: Added a new ESLint configuration setup for packages, which utilizes package roles to generate the correct configuration. The new configuration is available at `@backstage/cli/config/eslint-factory`.
11
+
12
+ Introduced a new `backstage-cli migrate package-lint-configs` command, which migrates old lint configurations to use `@backstage/cli/config/eslint-factory`.
13
+
14
+ - b1aacbf96a: Applied the fix from version `0.15.1` of this package, which was part of the `v0.70.1` release of Backstage.
15
+ - d2ecde959b: Package roles are now marked as stable and migration is encouraged. Please check out the [migration guide](https://backstage.io/docs/tutorials/package-role-migration).
16
+
17
+ The new `package`, `repo`, and `migrate` command categories are now marked as stable.
18
+
19
+ Marked all commands that are being replaced by the new `package` and `repo` commands as deprecated.
20
+
21
+ The package templates used by the `create` command have all been updated to use package roles.
22
+
23
+ - f06da37290: The backend development setup now ignores the `"browser"` and `"module"` entry points in `package.json`, and instead always uses `"main"`.
24
+ - 6a1fe077ad: Changed the logic for how modules are marked as external in the Rollup build of packages. Rather than only marking dependencies and build-in Node.js modules as external, all non-relative imports are now considered external.
25
+ - dc6002a7b9: The `--since` flag of repo commands now silently falls back to using the provided `ref` directly if no merge base is available.
26
+ - Updated dependencies
27
+ - @backstage/config-loader@0.9.7-next.0
28
+
3
29
  ## 0.15.1
4
30
 
5
31
  ### Patch Changes
@@ -0,0 +1,286 @@
1
+ /*
2
+ * Copyright 2020 The Backstage Authors
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ const { join: joinPath } = require('path');
18
+
19
+ /**
20
+ * Creates a ESLint configuration that extends the base Backstage configuration.
21
+ * In addition to the standard ESLint configuration options, the `extraConfig`
22
+ * parameter also accepts the following keys:
23
+ *
24
+ * - `tsRules`: Additional ESLint rules to apply to TypeScript
25
+ * - `testRules`: Additional ESLint rules to apply to tests
26
+ * - `restrictedImports`: Additional paths to add to no-restricted-imports
27
+ * - `restrictedSrcImports`: Additional paths to add to no-restricted-imports in src files
28
+ * - `restrictedTestImports`: Additional paths to add to no-restricted-imports in test files
29
+ * - `restrictedSyntax`: Additional patterns to add to no-restricted-syntax
30
+ * - `restrictedSrcSyntax`: Additional patterns to add to no-restricted-syntax in src files
31
+ * - `restrictedTestSyntax`: Additional patterns to add to no-restricted-syntax in test files
32
+ */
33
+ function createConfig(dir, extraConfig = {}) {
34
+ const {
35
+ extends: extraExtends,
36
+ plugins,
37
+ env,
38
+ parserOptions,
39
+ ignorePatterns,
40
+
41
+ rules,
42
+ tsRules,
43
+ testRules,
44
+
45
+ restrictedImports,
46
+ restrictedSrcImports,
47
+ restrictedTestImports,
48
+ restrictedSyntax,
49
+ restrictedSrcSyntax,
50
+ restrictedTestSyntax,
51
+
52
+ ...otherConfig
53
+ } = extraConfig;
54
+
55
+ return {
56
+ ...otherConfig,
57
+ extends: [
58
+ '@spotify/eslint-config-base',
59
+ '@spotify/eslint-config-typescript',
60
+ 'prettier',
61
+ 'plugin:jest/recommended',
62
+ 'plugin:monorepo/recommended',
63
+ ...(extraExtends ?? []),
64
+ ],
65
+ parser: '@typescript-eslint/parser',
66
+ plugins: ['import', ...(plugins ?? [])],
67
+ env: {
68
+ jest: true,
69
+ ...env,
70
+ },
71
+ parserOptions: {
72
+ ecmaVersion: 2018,
73
+ sourceType: 'module',
74
+ lib: require('./tsconfig.json').compilerOptions.lib,
75
+ ...parserOptions,
76
+ },
77
+ ignorePatterns: [
78
+ '.eslintrc.js',
79
+ '**/dist/**',
80
+ '**/dist-types/**',
81
+ ...(ignorePatterns ?? []),
82
+ ],
83
+ rules: {
84
+ 'no-shadow': 'off',
85
+ 'no-redeclare': 'off',
86
+ '@typescript-eslint/no-shadow': 'error',
87
+ '@typescript-eslint/no-redeclare': 'error',
88
+ 'no-undef': 'off',
89
+ 'import/newline-after-import': 'error',
90
+ 'import/no-extraneous-dependencies': [
91
+ 'error',
92
+ {
93
+ devDependencies: dir
94
+ ? [
95
+ `!${joinPath(dir, 'src/**')}`,
96
+ joinPath(dir, 'src/**/*.test.*'),
97
+ joinPath(dir, 'src/**/*.stories.*'),
98
+ joinPath(dir, 'src/setupTests.*'),
99
+ ]
100
+ : [
101
+ // Legacy config for packages that don't provide a dir
102
+ '**/*.test.*',
103
+ '**/*.stories.*',
104
+ '**/src/setupTests.*',
105
+ '**/dev/**',
106
+ ],
107
+ optionalDependencies: true,
108
+ peerDependencies: true,
109
+ bundledDependencies: true,
110
+ },
111
+ ],
112
+ 'no-unused-expressions': 'off',
113
+ '@typescript-eslint/no-unused-expressions': 'error',
114
+ '@typescript-eslint/consistent-type-assertions': 'error',
115
+ '@typescript-eslint/no-unused-vars': [
116
+ 'warn',
117
+ {
118
+ vars: 'all',
119
+ args: 'after-used',
120
+ ignoreRestSiblings: true,
121
+ argsIgnorePattern: '^_',
122
+ },
123
+ ],
124
+
125
+ 'no-restricted-imports': [
126
+ 2,
127
+ {
128
+ paths: [
129
+ ...(restrictedImports ?? []),
130
+ ...(restrictedSrcImports ?? []),
131
+ ],
132
+ // Avoid cross-package imports
133
+ patterns: ['**/../../**/*/src/**', '**/../../**/*/src'],
134
+ },
135
+ ],
136
+
137
+ 'no-restricted-syntax': [
138
+ 'error',
139
+ ...(restrictedSyntax ?? []),
140
+ ...(restrictedSrcSyntax ?? []),
141
+ ],
142
+
143
+ ...rules,
144
+ },
145
+ overrides: [
146
+ {
147
+ files: ['**/*.ts?(x)'],
148
+ rules: {
149
+ '@typescript-eslint/no-unused-vars': 'off',
150
+ 'no-undef': 'off',
151
+ ...tsRules,
152
+ },
153
+ },
154
+ {
155
+ files: ['**/*.test.*', '**/*.stories.*', 'src/setupTests.*', '!src/**'],
156
+ rules: {
157
+ ...testRules,
158
+ 'no-restricted-syntax': [
159
+ 'error',
160
+ ...(restrictedSyntax ?? []),
161
+ ...(restrictedTestSyntax ?? []),
162
+ ],
163
+ 'no-restricted-imports': [
164
+ 2,
165
+ {
166
+ paths: [
167
+ ...(restrictedImports ?? []),
168
+ ...(restrictedTestImports ?? []),
169
+ ],
170
+ // Avoid cross-package imports
171
+ patterns: ['**/../../**/*/src/**', '**/../../**/*/src'],
172
+ },
173
+ ],
174
+ },
175
+ },
176
+ ],
177
+ };
178
+ }
179
+
180
+ /**
181
+ * Creates a ESLint configuration for the given package role.
182
+ * The `extraConfig` parameter accepts the same keys as for the `createConfig` function.
183
+ */
184
+ function createConfigForRole(dir, role, extraConfig = {}) {
185
+ switch (role) {
186
+ case 'common-library':
187
+ return createConfig(dir, extraConfig);
188
+
189
+ case 'web-library':
190
+ case 'frontend':
191
+ case 'frontend-plugin':
192
+ case 'frontend-plugin-module':
193
+ return createConfig(dir, {
194
+ ...extraConfig,
195
+ extends: [
196
+ '@spotify/eslint-config-react',
197
+ ...(extraConfig.extends ?? []),
198
+ ],
199
+ parserOptions: {
200
+ ecmaFeatures: {
201
+ jsx: true,
202
+ },
203
+ ...extraConfig.parserOptions,
204
+ },
205
+ settings: {
206
+ react: {
207
+ version: 'detect',
208
+ },
209
+ ...extraConfig.settings,
210
+ },
211
+ restrictedImports: [
212
+ {
213
+ // Importing the entire MUI icons packages kills build performance as the list of icons is huge.
214
+ name: '@material-ui/icons',
215
+ message: "Please import '@material-ui/icons/<Icon>' instead.",
216
+ },
217
+ {
218
+ name: '@material-ui/icons/', // because this is possible too ._.
219
+ message: "Please import '@material-ui/icons/<Icon>' instead.",
220
+ },
221
+ ...require('module').builtinModules,
222
+ ...(extraConfig.restrictedImports ?? []),
223
+ ],
224
+ tsRules: {
225
+ 'react/prop-types': 0,
226
+ ...extraConfig.tsRules,
227
+ },
228
+ });
229
+
230
+ case 'cli':
231
+ case 'node-library':
232
+ case 'backend':
233
+ case 'backend-plugin':
234
+ case 'backend-plugin-module':
235
+ return createConfig(dir, {
236
+ ...extraConfig,
237
+ globals: {
238
+ __non_webpack_require__: 'readonly',
239
+ ...extraConfig.globals,
240
+ },
241
+ rules: {
242
+ 'no-console': 0, // Permitted in console programs
243
+ 'new-cap': ['error', { capIsNew: false }], // Because Express constructs things e.g. like 'const r = express.Router()'
244
+ ...extraConfig.rules,
245
+ },
246
+ restrictedSyntax: [
247
+ {
248
+ message:
249
+ 'Default import from winston is not allowed, import `* as winston` instead.',
250
+ selector:
251
+ 'ImportDeclaration[source.value="winston"] ImportDefaultSpecifier',
252
+ },
253
+ ...(extraConfig.restrictedSyntax ?? []),
254
+ ],
255
+ restrictedSrcSyntax: [
256
+ {
257
+ message:
258
+ "`__dirname` doesn't refer to the same dir in production builds, try `resolvePackagePath()` from `@backstage/backend-common` instead.",
259
+ selector: 'Identifier[name="__dirname"]',
260
+ },
261
+ ...(extraConfig.restrictedSrcSyntax ?? []),
262
+ ],
263
+ });
264
+ default:
265
+ throw new Error(`Unknown package role ${role}`);
266
+ }
267
+ }
268
+
269
+ /**
270
+ * Creates a ESLint configuration for the package in the given directory.
271
+ * The `extraConfig` parameter accepts the same keys as for the `createConfig` function.
272
+ */
273
+ function createPackageConfig(dir, extraConfig) {
274
+ const pkg = require(joinPath(dir, 'package.json'));
275
+ const role = pkg.backstage?.role;
276
+ if (!role) {
277
+ throw new Error(`Package ${pkg.name} does not have a backstage.role`);
278
+ }
279
+
280
+ return createConfigForRole(dir, role, extraConfig);
281
+ }
282
+
283
+ module.exports = createPackageConfig; // Alias
284
+ module.exports.createConfig = createConfig;
285
+ module.exports.createConfigForRole = createConfigForRole;
286
+ module.exports.createPackageConfig = createPackageConfig;
@@ -14,90 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- const globalRestrictedSyntax = [
18
- {
19
- message:
20
- 'Default import from winston is not allowed, import `* as winston` instead.',
21
- selector:
22
- 'ImportDeclaration[source.value="winston"] ImportDefaultSpecifier',
23
- },
24
- ];
25
-
26
- module.exports = {
27
- extends: [
28
- '@spotify/eslint-config-base',
29
- '@spotify/eslint-config-typescript',
30
- 'prettier',
31
- 'plugin:jest/recommended',
32
- 'plugin:monorepo/recommended',
33
- ],
34
- parser: '@typescript-eslint/parser',
35
- plugins: ['import'],
36
- env: {
37
- jest: true,
38
- },
39
- globals: {
40
- __non_webpack_require__: 'readonly',
41
- },
42
- parserOptions: {
43
- ecmaVersion: 2018,
44
- sourceType: 'module',
45
- lib: require('./tsconfig.json').compilerOptions.lib,
46
- },
47
- ignorePatterns: ['.eslintrc.js', '**/dist/**', '**/dist-types/**'],
48
- rules: {
49
- 'no-shadow': 'off',
50
- 'no-redeclare': 'off',
51
- '@typescript-eslint/no-shadow': 'error',
52
- '@typescript-eslint/no-redeclare': 'error',
53
-
54
- 'no-console': 0, // Permitted in console programs
55
- 'new-cap': ['error', { capIsNew: false }], // Because Express constructs things e.g. like 'const r = express.Router()'
56
- 'import/newline-after-import': 'error',
57
- 'import/no-extraneous-dependencies': [
58
- 'error',
59
- {
60
- devDependencies: ['**/*.test.*', 'src/setupTests.*', 'dev/**'],
61
- optionalDependencies: true,
62
- peerDependencies: true,
63
- bundledDependencies: true,
64
- },
65
- ],
66
- 'no-unused-expressions': 'off',
67
- '@typescript-eslint/no-unused-expressions': 'error',
68
- '@typescript-eslint/no-unused-vars': [
69
- 'warn',
70
- { vars: 'all', args: 'after-used', ignoreRestSiblings: true },
71
- ],
72
- // Avoid cross-package imports
73
- 'no-restricted-imports': [
74
- 2,
75
- { patterns: ['**/../../**/*/src/**', '**/../../**/*/src'] },
76
- ],
77
- // Avoid default import from winston as it breaks at runtime
78
- 'no-restricted-syntax': [
79
- 'error',
80
- {
81
- message:
82
- "`__dirname` doesn't refer to the same dir in production builds, try `resolvePackagePath()` from `@backstage/backend-common` instead.",
83
- selector: 'Identifier[name="__dirname"]',
84
- },
85
- ...globalRestrictedSyntax,
86
- ],
87
- },
88
- overrides: [
89
- {
90
- files: ['**/*.ts?(x)'],
91
- rules: {
92
- '@typescript-eslint/no-unused-vars': 'off',
93
- 'no-undef': 'off',
94
- },
95
- },
96
- {
97
- files: ['*.test.*', 'src/setupTests.*', 'dev/**'],
98
- rules: {
99
- 'no-restricted-syntax': ['error', ...globalRestrictedSyntax],
100
- },
101
- },
102
- ],
103
- };
17
+ module.exports = require('./eslint-factory').createConfigForRole(
18
+ undefined,
19
+ 'node-library',
20
+ );
package/config/eslint.js CHANGED
@@ -14,96 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- module.exports = {
18
- extends: [
19
- '@spotify/eslint-config-base',
20
- '@spotify/eslint-config-react',
21
- '@spotify/eslint-config-typescript',
22
- 'prettier',
23
- 'plugin:jest/recommended',
24
- 'plugin:monorepo/recommended',
25
- ],
26
- parser: '@typescript-eslint/parser',
27
- plugins: ['import'],
28
- env: {
29
- jest: true,
30
- },
31
- parserOptions: {
32
- ecmaVersion: 2018,
33
- ecmaFeatures: {
34
- jsx: true,
35
- },
36
- sourceType: 'module',
37
- lib: require('./tsconfig.json').compilerOptions.lib,
38
- },
39
- settings: {
40
- react: {
41
- version: 'detect',
42
- },
43
- },
44
- ignorePatterns: ['.eslintrc.js', '**/dist/**', '**/dist-types/**'],
45
- rules: {
46
- 'no-shadow': 'off',
47
- 'no-redeclare': 'off',
48
- '@typescript-eslint/no-shadow': 'error',
49
- '@typescript-eslint/no-redeclare': 'error',
50
- 'no-undef': 'off',
51
- 'import/newline-after-import': 'error',
52
- 'import/no-extraneous-dependencies': [
53
- 'error',
54
- {
55
- devDependencies: [
56
- '**/*.test.*',
57
- '**/*.stories.*',
58
- '**/src/setupTests.*',
59
- '**/dev/**',
60
- ],
61
- optionalDependencies: true,
62
- peerDependencies: true,
63
- bundledDependencies: true,
64
- },
65
- ],
66
- 'no-unused-expressions': 'off',
67
- '@typescript-eslint/no-unused-expressions': 'error',
68
- '@typescript-eslint/consistent-type-assertions': 'error',
69
- '@typescript-eslint/no-unused-vars': [
70
- 'warn',
71
- {
72
- vars: 'all',
73
- args: 'after-used',
74
- ignoreRestSiblings: true,
75
- argsIgnorePattern: '^_',
76
- },
77
- ],
78
- 'no-restricted-imports': [
79
- 2,
80
- {
81
- paths: [
82
- {
83
- // Importing the entire MUI icons packages kills build performance as the list of icons is huge.
84
- name: '@material-ui/icons',
85
- message: "Please import '@material-ui/icons/<Icon>' instead.",
86
- },
87
- {
88
- name: '@material-ui/icons/', // because this is possible too ._.
89
- message: "Please import '@material-ui/icons/<Icon>' instead.",
90
- },
91
- ...require('module').builtinModules,
92
- ],
93
- // Avoid cross-package imports
94
- patterns: ['**/../../**/*/src/**', '**/../../**/*/src'],
95
- },
96
- ],
97
- },
98
- overrides: [
99
- {
100
- files: ['**/*.ts?(x)'],
101
- rules: {
102
- // Default to not enforcing prop-types in typescript
103
- 'react/prop-types': 0,
104
- '@typescript-eslint/no-unused-vars': 'off',
105
- 'no-undef': 'off',
106
- },
107
- },
108
- ],
109
- };
17
+ module.exports = require('./eslint-factory').createConfigForRole(
18
+ undefined,
19
+ 'web-library',
20
+ );
@@ -152,4 +152,4 @@ class Lockfile {
152
152
  }
153
153
 
154
154
  exports.Lockfile = Lockfile;
155
- //# sourceMappingURL=Lockfile-35661afa.cjs.js.map
155
+ //# sourceMappingURL=Lockfile-276d1251.cjs.js.map
@@ -2,7 +2,7 @@
2
2
 
3
3
  var path = require('path');
4
4
  var getPackages = require('@manypkg/get-packages');
5
- var index = require('./index-82dc75e2.cjs.js');
5
+ var index = require('./index-4c13ec59.cjs.js');
6
6
  var errors = require('@backstage/errors');
7
7
  var child_process = require('child_process');
8
8
  var util = require('util');
@@ -34,8 +34,13 @@ async function listChangedFiles(ref) {
34
34
  if (!ref) {
35
35
  throw new Error("ref is required");
36
36
  }
37
- const [base] = await runGit("merge-base", "HEAD", ref);
38
- const tracked = await runGit("diff", "--name-only", base);
37
+ let diffRef = ref;
38
+ try {
39
+ const [base] = await runGit("merge-base", "HEAD", ref);
40
+ diffRef = base;
41
+ } catch {
42
+ }
43
+ const tracked = await runGit("diff", "--name-only", diffRef);
39
44
  const untracked = await runGit("ls-files", "--others", "--exclude-standard");
40
45
  return Array.from(/* @__PURE__ */ new Set([...tracked, ...untracked]));
41
46
  }
@@ -61,7 +66,12 @@ class PackageGraph extends Map {
61
66
  publishedLocalDependencies: /* @__PURE__ */ new Map(),
62
67
  localDependencies: /* @__PURE__ */ new Map(),
63
68
  localDevDependencies: /* @__PURE__ */ new Map(),
64
- localOptionalDependencies: /* @__PURE__ */ new Map()
69
+ localOptionalDependencies: /* @__PURE__ */ new Map(),
70
+ allLocalDependents: /* @__PURE__ */ new Map(),
71
+ publishedLocalDependents: /* @__PURE__ */ new Map(),
72
+ localDependents: /* @__PURE__ */ new Map(),
73
+ localDevDependents: /* @__PURE__ */ new Map(),
74
+ localOptionalDependents: /* @__PURE__ */ new Map()
65
75
  });
66
76
  }
67
77
  for (const node of graph.values()) {
@@ -71,6 +81,9 @@ class PackageGraph extends Map {
71
81
  node.allLocalDependencies.set(depName, depPkg);
72
82
  node.publishedLocalDependencies.set(depName, depPkg);
73
83
  node.localDependencies.set(depName, depPkg);
84
+ depPkg.allLocalDependents.set(node.name, node);
85
+ depPkg.publishedLocalDependents.set(node.name, node);
86
+ depPkg.localDependents.set(node.name, node);
74
87
  }
75
88
  }
76
89
  for (const depName of Object.keys(node.packageJson.devDependencies || {})) {
@@ -78,6 +91,8 @@ class PackageGraph extends Map {
78
91
  if (depPkg) {
79
92
  node.allLocalDependencies.set(depName, depPkg);
80
93
  node.localDevDependencies.set(depName, depPkg);
94
+ depPkg.allLocalDependents.set(node.name, node);
95
+ depPkg.localDevDependents.set(node.name, node);
81
96
  }
82
97
  }
83
98
  for (const depName of Object.keys(node.packageJson.optionalDependencies || {})) {
@@ -86,6 +101,9 @@ class PackageGraph extends Map {
86
101
  node.allLocalDependencies.set(depName, depPkg);
87
102
  node.publishedLocalDependencies.set(depName, depPkg);
88
103
  node.localOptionalDependencies.set(depName, depPkg);
104
+ depPkg.allLocalDependents.set(node.name, node);
105
+ depPkg.publishedLocalDependents.set(node.name, node);
106
+ depPkg.localOptionalDependents.set(node.name, node);
89
107
  }
90
108
  }
91
109
  }
@@ -140,4 +158,4 @@ class PackageGraph extends Map {
140
158
  }
141
159
 
142
160
  exports.PackageGraph = PackageGraph;
143
- //# sourceMappingURL=PackageGraph-c403b5ba.cjs.js.map
161
+ //# sourceMappingURL=PackageGraph-5c819ded.cjs.js.map
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var webpack = require('webpack');
4
- var paths = require('./paths-4f873870.cjs.js');
4
+ var paths = require('./paths-6403ea49.cjs.js');
5
5
 
6
6
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
7
7
 
@@ -33,4 +33,4 @@ async function serveBackend(options) {
33
33
  }
34
34
 
35
35
  exports.serveBackend = serveBackend;
36
- //# sourceMappingURL=backend-96651fe4.cjs.js.map
36
+ //# sourceMappingURL=backend-ba5674b1.cjs.js.map