@elliemae/ds-codemods 3.27.0-next.9 → 3.27.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.
@@ -21,7 +21,8 @@ export const getDeprecatedUsageReportQuestions = (originalOptions) => {
21
21
  extraOptions.push({
22
22
  type: 'input',
23
23
  name: 'gitIgnorePath',
24
- message: 'Please provide the path to the .gitignore file',
24
+ message:
25
+ 'Please provide the path to the .gitignore file (if a non-matching path is provided, node_modules, dist and build will be ignored)',
25
26
  default: './.gitignore',
26
27
  });
27
28
  }
@@ -22,7 +22,11 @@ export const deprecatedComponentsUsageReport = (options) => {
22
22
  // in case we want to expand it in the future we can store it in the map...
23
23
  // const problematicFiles = new Map();
24
24
 
25
- let csvRows = [`${options.codebaseName ? 'Codebase Name,' : ''}Legacy Component,Legacy Package,Filename,File Path`];
25
+ let csvRows = [
26
+ `${
27
+ options.codebaseName ? 'Codebase Name,' : ''
28
+ }Legacy Component,Legacy Package,Filename,File Path,Effort Size,Story Points`,
29
+ ];
26
30
  filesToParse.forEach((filePath) => {
27
31
  const fileReport = checkFileForDeprecatedComponents(filePath);
28
32
  if (fileReport.isFileProblematic) {
@@ -8,6 +8,7 @@ import {
8
8
  LEGACY_WITH_NEW_MEDIUM_MIGRATION_EFFORT,
9
9
  LEGACY_WITH_NEW_LARGE_MIGRATION_EFFORT,
10
10
  DISMISSED_WITH_EXAMPLE,
11
+ STORYPOINTS_TO_EFFORT,
11
12
  } from '../../../constants/index.mjs';
12
13
 
13
14
  /**
@@ -210,18 +211,22 @@ export const checkFileForDeprecatedComponents = (filePath) => {
210
211
  * @returns {string} - csv row
211
212
  */
212
213
  const generateCsvRowFromMatchedEffort = (matchedEffort, filePath, codebaseName) => {
214
+ // `${options.codebaseName ? 'Codebase Name,' : ''}Legacy Component,Legacy Package,Filename,File Path,Effort Size,Story Points`
213
215
  const { matchingEffortMetainfo } = matchedEffort;
214
216
  // matchingEffortMetainfo type is deprecatedEffortMapEntry | dismissedWithExampleEntry
215
217
  // they share 'component' and 'oldPackage' properties and for the current use case we only care about those
216
218
  // if we want to expand the csv in the future we have to take care of this difference in the types
217
- const { component, oldPackage } = matchingEffortMetainfo;
219
+ const { component, oldPackage, storyPoints } = matchingEffortMetainfo;
220
+ const { tshirt } = STORYPOINTS_TO_EFFORT[storyPoints];
218
221
  const filename = filePath.split('/').pop();
219
222
  const cwdFolders = process.cwd().split('/');
220
223
  const pathFolders = filePath.split('/');
221
224
  const latestMatchingFolderIndx = pathFolders.findIndex((folder, indx) => folder !== cwdFolders[indx]);
222
225
  const filePathFolders = pathFolders.slice(latestMatchingFolderIndx);
223
226
  const reducedFilePath = filePathFolders.join('/');
224
- return `${codebaseName ? `${codebaseName},` : ''}${component},${oldPackage},${filename},${reducedFilePath}`;
227
+ return `${
228
+ codebaseName ? `${codebaseName},` : ''
229
+ }${component},${oldPackage},${filename},${reducedFilePath},${tshirt},${storyPoints}`;
225
230
  };
226
231
  /**
227
232
  * Helper function to generate a list of csv rows from a given file report
@@ -113,7 +113,7 @@ export const DEPRECATED_PACKAGES = {
113
113
  /* eslint-disable max-len, prettier/prettier */
114
114
 
115
115
  /**
116
- * @type {object<string, SeverityTag>}
116
+ * @type {objectstring, SeverityTag>}
117
117
  * @property {SeverityTag} SEVERITY_TAGS.A11Y_LIMITATIONS
118
118
  * @property {SeverityTag} SEVERITY_TAGS.TOOLING_BLOCKER
119
119
  * @property {SeverityTag} SEVERITY_TAGS.UNMANTAINED
@@ -133,14 +133,17 @@ const SEVERITY_TAGS = {
133
133
  description:
134
134
  'The component is based in third-party-packages that makes changing tools like jest, styled-compoents, etc... impossible' },
135
135
 
136
- UNMANTAINED:{ name: 'UNMANTAINED', severity: 'P3', severityInteger: 3,
136
+ UNMANTAINED:{
137
+ name: 'UNMANTAINED', severity: 'P3', severityInteger: 3,
137
138
  description:
138
139
  'The component company-wise is low priority and has not received any meaningful attention in more than 8 months' },
139
140
 
140
- FRAGILE:{ name: 'FRAGILE', severity: 'P3', severityInteger: 3,
141
+ FRAGILE:{
142
+ name: 'FRAGILE', severity: 'P3', severityInteger: 3,
141
143
  description: 'The component is extremely fragile and not extensible' },
142
144
 
143
- KNOWN_ISSUES:{ name: 'KNOWN_ISSUES', severity: 'P3', severityInteger: 3,
145
+ KNOWN_ISSUES:{
146
+ name: 'KNOWN_ISSUES', severity: 'P3', severityInteger: 3,
144
147
  description: 'The component has known issues that cannot be fixed' },
145
148
  };
146
149
 
@@ -151,102 +154,102 @@ const SEVERITY_TAGS = {
151
154
  export const LEGACY_WITH_NEW_SMALL_MIGRATION_EFFORT = [
152
155
  { component: 'DSModal', oldPackage: '@elliemae/ds-modal',
153
156
  newComponent: 'DSDialog', newPackage: '@elliemae/ds-dialog',
154
- tags:[ SEVERITY_TAGS.A11Y_LIMITATIONS ],
157
+ tags:[ SEVERITY_TAGS.A11Y_LIMITATIONS ], storyPoints: "100",
155
158
  },
156
159
 
157
160
  { component: 'DSButton', oldPackage: '@elliemae/ds-button',
158
161
  newComponent: 'DSButtonV3', newPackage: '@elliemae/ds-button',
159
- tags:[ SEVERITY_TAGS.A11Y_LIMITATIONS ],
162
+ tags:[ SEVERITY_TAGS.A11Y_LIMITATIONS ], storyPoints: "50",
160
163
  },
161
164
 
162
165
  { component: 'DSCircularProgressIndicator', oldPackage: '@elliemae/ds-circular-progress-indicator',
163
166
  newComponent: 'DSCircularIndeterminateIndicator', newPackage: '@elliemae/ds-circular-progress-indicator',
164
- tags:[ SEVERITY_TAGS.A11Y_LIMITATIONS ],
167
+ tags:[ SEVERITY_TAGS.A11Y_LIMITATIONS ], storyPoints: "50",
165
168
  },
166
169
 
167
170
  { component: 'DSButtonV2', oldPackage: '@elliemae/ds-button',
168
171
  newComponent: 'DSButtonV3', newPackage: '@elliemae/ds-button',
169
- tags:[ SEVERITY_TAGS.A11Y_LIMITATIONS ],
172
+ tags:[ SEVERITY_TAGS.A11Y_LIMITATIONS ], storyPoints: "50",
170
173
  },
171
174
 
172
175
  { component: 'DSTooltipV2', oldPackage: '@elliemae/ds-tooltip',
173
176
  newComponent: 'DSTooltipV3', newPackage: '@elliemae/ds-tooltip',
174
- tags:[ SEVERITY_TAGS.A11Y_LIMITATIONS ],
177
+ tags:[ SEVERITY_TAGS.A11Y_LIMITATIONS ], storyPoints: "50",
175
178
  },
176
179
 
177
180
  { component: 'DSSeparator', oldPackage: '@elliemae/ds-separator',
178
181
  newComponent: 'DSSeparatorV2', newPackage: '@elliemae/ds-separator',
179
- tags:[ SEVERITY_TAGS.A11Y_LIMITATIONS ],
182
+ tags:[ SEVERITY_TAGS.A11Y_LIMITATIONS ], storyPoints: "50",
180
183
  },
181
184
 
182
185
  { component: 'DSFormItemLayout', oldPackage: '@elliemae/ds-form',
183
186
  newComponent: 'DSFormLayoutBlockItem', newPackage: '@elliemae/ds-form-layout-blocks',
184
- tags:[ SEVERITY_TAGS.A11Y_LIMITATIONS ],
187
+ tags:[ SEVERITY_TAGS.A11Y_LIMITATIONS ], storyPoints: "100",
185
188
  },
186
189
 
187
190
  { component: 'DSTooltip', oldPackage: '@elliemae/ds-tooltip',
188
191
  newComponent: 'DSTooltipV3', newPackage: '@elliemae/ds-tooltip',
189
- tags:[ SEVERITY_TAGS.A11Y_LIMITATIONS ],
192
+ tags:[ SEVERITY_TAGS.A11Y_LIMITATIONS ], storyPoints: "50",
190
193
  },
191
194
 
192
195
  { component: 'DSToggle', oldPackage: '@elliemae/ds-toggle',
193
196
  newComponent: 'DSControlledToggle', newPackage: '@elliemae/ds-controlled-form',
194
- tags:[ SEVERITY_TAGS.A11Y_LIMITATIONS ],
197
+ tags:[ SEVERITY_TAGS.A11Y_LIMITATIONS ], storyPoints: "100",
195
198
  },
196
199
 
197
200
  { component: 'DSDateInput', oldPackage: '@elliemae/ds-form',
198
201
  newComponent: 'DSControlledDateTimePicker', newPackage: '@elliemae/ds-controlled-form',
199
- tags:[ SEVERITY_TAGS.A11Y_LIMITATIONS ],
202
+ tags:[ SEVERITY_TAGS.A11Y_LIMITATIONS ], storyPoints: "100",
200
203
  },
201
204
 
202
205
  { component: 'DSDateInputV2', oldPackage: '@elliemae/ds-form',
203
206
  newComponent: 'DSControlledDateTimePicker', newPackage: '@elliemae/ds-controlled-form',
204
- tags:[ SEVERITY_TAGS.A11Y_LIMITATIONS ],
207
+ tags:[ SEVERITY_TAGS.A11Y_LIMITATIONS ], storyPoints: "100",
205
208
  },
206
209
 
207
210
  { component: 'DSComboBox2', oldPackage: '@elliemae/ds-form',
208
211
  newComponent: 'DSComboBoxV3', newPackage: '@elliemae/ds-controlled-form',
209
- tags:[ SEVERITY_TAGS.A11Y_LIMITATIONS ],
212
+ tags:[ SEVERITY_TAGS.A11Y_LIMITATIONS ], storyPoints: "100",
210
213
  },
211
214
 
212
215
  { component: 'DSComboBoxV1', oldPackage: '@elliemae/ds-form',
213
216
  newComponent: 'DSComboBoxV3', newPackage: '@elliemae/ds-controlled-form',
214
- tags:[ SEVERITY_TAGS.A11Y_LIMITATIONS ],
217
+ tags:[ SEVERITY_TAGS.A11Y_LIMITATIONS ], storyPoints: "150",
215
218
  },
216
219
 
217
220
  { component: 'DSComboBox', oldPackage: '@elliemae/ds-form',
218
221
  newComponent: 'DSComboBoxV3', newPackage: '@elliemae/ds-controlled-form',
219
- tags:[ SEVERITY_TAGS.A11Y_LIMITATIONS ],
222
+ tags:[ SEVERITY_TAGS.A11Y_LIMITATIONS ], storyPoints: "50",
220
223
  },
221
224
 
222
225
  { component: 'DSPill', oldPackage: '@elliemae/ds-pills',
223
226
  newComponent: 'DSPillV2', newPackage: '@elliemae/ds-pills-v2',
224
- tags:[ SEVERITY_TAGS.A11Y_LIMITATIONS ],
227
+ tags:[ SEVERITY_TAGS.A11Y_LIMITATIONS ], storyPoints: "50",
225
228
  },
226
229
 
227
230
  { component: 'DSCheckbox', oldPackage: '@elliemae/ds-form',
228
231
  newComponent: 'DSControlledCheckbox', newPackage: '@elliemae/ds-controlled-form',
229
- tags:[ SEVERITY_TAGS.A11Y_LIMITATIONS ],
232
+ tags:[ SEVERITY_TAGS.A11Y_LIMITATIONS ], storyPoints: "150",
230
233
  },
231
234
 
232
235
  { component: 'DSInputGroup', oldPackage: '@elliemae/ds-form',
233
236
  newComponent: 'DSInputGroup', newPackage: '@elliemae/ds-controlled-form',
234
- tags:[ SEVERITY_TAGS.A11Y_LIMITATIONS ],
237
+ tags:[ SEVERITY_TAGS.A11Y_LIMITATIONS ], storyPoints: "50",
235
238
  },
236
239
 
237
240
  { component: 'DSRadio', oldPackage: '@elliemae/ds-form',
238
241
  newComponent: 'DSControlledRadio', newPackage: '@elliemae/ds-controlled-form',
239
- tags:[ SEVERITY_TAGS.A11Y_LIMITATIONS ],
242
+ tags:[ SEVERITY_TAGS.A11Y_LIMITATIONS ], storyPoints: "150",
240
243
  },
241
244
 
242
245
  { component: 'DSTextBox', oldPackage: '@elliemae/ds-form',
243
246
  newComponent: 'DSInputText', newPackage: '@elliemae/ds-controlled-form',
244
- tags:[ SEVERITY_TAGS.A11Y_LIMITATIONS ],
247
+ tags:[ SEVERITY_TAGS.A11Y_LIMITATIONS ], storyPoints: "150",
245
248
  },
246
249
 
247
250
  { component: 'DSLargeInputText', oldPackage: '@elliemae/ds-form',
248
251
  newComponent: 'DSControlledLargeTextInput', newPackage: '@elliemae/ds-controlled-form',
249
- tags:[ SEVERITY_TAGS.A11Y_LIMITATIONS ],
252
+ tags:[ SEVERITY_TAGS.A11Y_LIMITATIONS ], storyPoints: "150",
250
253
  },
251
254
  ];
252
255
  /**
@@ -256,42 +259,42 @@ export const LEGACY_WITH_NEW_SMALL_MIGRATION_EFFORT = [
256
259
  export const LEGACY_WITH_NEW_MEDIUM_MIGRATION_EFFORT = [
257
260
  { component: 'DSDropdownMenu', oldPackage: '@elliemae/ds-dropdownmenu',
258
261
  newComponent: 'DSDropdownMenuV2', newPackage: '@elliemae/ds-dropdown-menu-v2',
259
- tags:[ SEVERITY_TAGS.A11Y_LIMITATIONS ],
262
+ tags:[ SEVERITY_TAGS.A11Y_LIMITATIONS ], storyPoints: "250",
260
263
  },
261
264
 
262
265
  { component: 'Minitoolbar', oldPackage: '@elliemae/ds-mini-toolbar',
263
266
  newComponent: 'DSToolbarV2', newPackage: '@elliemae/ds-toolbar-v2',
264
- tags:[ SEVERITY_TAGS.A11Y_LIMITATIONS ],
267
+ tags:[ SEVERITY_TAGS.A11Y_LIMITATIONS ], storyPoints: "250",
265
268
  },
266
269
 
267
270
  { component: 'DSToolbar', oldPackage: '@elliemae/ds-toolbar',
268
271
  newComponent: 'DSToolbarV2', newPackage: '@elliemae/ds-toolbar',
269
- tags:[ SEVERITY_TAGS.A11Y_LIMITATIONS ],
272
+ tags:[ SEVERITY_TAGS.A11Y_LIMITATIONS ], storyPoints: "200",
270
273
  },
271
274
 
272
275
  { component: 'DSDatePicker', oldPackage: '@elliemae/ds-date-picker',
273
276
  newComponent: 'DSControlledDateTimePicker', newPackage: '@elliemae/ds-controlled-form',
274
- tags:[ SEVERITY_TAGS.A11Y_LIMITATIONS ],
277
+ tags:[ SEVERITY_TAGS.A11Y_LIMITATIONS ], storyPoints: "250",
275
278
  },
276
279
 
277
280
  { component: 'DSDateRangePicker', oldPackage: '@elliemae/ds-date-range-picker',
278
281
  newComponent: 'DSControlledDateRangePicker', newPackage: '@elliemae/ds-controlled-form',
279
- tags:[ SEVERITY_TAGS.A11Y_LIMITATIONS ],
282
+ tags:[ SEVERITY_TAGS.A11Y_LIMITATIONS ], storyPoints: "250",
280
283
  },
281
284
 
282
285
  { component: 'DSTimeInput', oldPackage: '@elliemae/ds-form',
283
286
  newComponent: 'DSControlledDateTimePicker', newPackage: '@elliemae/ds-controlled-form',
284
- tags:[ SEVERITY_TAGS.A11Y_LIMITATIONS ],
287
+ tags:[ SEVERITY_TAGS.A11Y_LIMITATIONS ], storyPoints: "250",
285
288
  },
286
289
 
287
290
  { component: 'DSTimePicker', oldPackage: '@elliemae/ds-time-picker',
288
291
  newComponent: 'DSControlledDateTimePicker', newPackage: '@elliemae/ds-controlled-form',
289
- tags:[ SEVERITY_TAGS.A11Y_LIMITATIONS ],
292
+ tags:[ SEVERITY_TAGS.A11Y_LIMITATIONS ], storyPoints: "250",
290
293
  },
291
294
 
292
295
  { component: 'DSInputMask', oldPackage: '@elliemae/ds-form',
293
296
  newComponent: 'DSInputText', newPackage: '@elliemae/ds-controlled-form',
294
- tags:[ SEVERITY_TAGS.A11Y_LIMITATIONS ],
297
+ tags:[ SEVERITY_TAGS.A11Y_LIMITATIONS ], storyPoints: "250",
295
298
  },
296
299
  ]
297
300
 
@@ -299,12 +302,12 @@ export const LEGACY_WITH_NEW_MEDIUM_MIGRATION_EFFORT = [
299
302
  export const LEGACY_WITH_NEW_LARGE_MIGRATION_EFFORT = [
300
303
  { component: 'DSShuttle', oldPackage: '@elliemae/ds-shuttle',
301
304
  newComponent: 'DSShuttleV2', newPackage: '@elliemae/ds-shuttle-v2',
302
- tags:[ SEVERITY_TAGS.A11Y_LIMITATIONS ],
305
+ tags:[ SEVERITY_TAGS.A11Y_LIMITATIONS ], storyPoints: "500",
303
306
  },
304
307
 
305
308
  { component: 'DataGrid', oldPackage: '@elliemae/ds-data-grid',
306
309
  newComponent: 'DataTable', newPackage: '@elliemae/ds-data-table',
307
- tags:[ SEVERITY_TAGS.A11Y_LIMITATIONS ],
310
+ tags:[ SEVERITY_TAGS.A11Y_LIMITATIONS ], storyPoints: "500",
308
311
  },
309
312
  ];
310
313
 
@@ -314,18 +317,51 @@ export const LEGACY_WITH_NEW_LARGE_MIGRATION_EFFORT = [
314
317
  */
315
318
  /* prettier-ignore */
316
319
  export const DISMISSED_WITH_EXAMPLE = [
317
- { component: 'DSButtonGroup', oldPackage: 'ds-button-group' },
318
- { component: 'DSCardArray', oldPackage: 'ds-card-array' },
319
- { component: 'DSLabelValue', oldPackage: 'ds-label-value' },
320
- { component: 'DSDateRangeSelector', oldPackage: 'ds-date-range-selector' },
321
- { component: 'DSInputProtected', oldPackage: 'ds-form' },
322
- { component: 'DSGroupBox', oldPackage: 'ds-group-box' },
323
- { component: 'DSFilterBar', oldPackage: 'ds-filterbar' },
324
- { component: 'DSDateTimeRecurrenceSelector', oldPackage: 'ds-date-time-recurrence-picker' },
325
- { component: 'DSNumberRangeField', oldPackage: 'ds-number-range-field' },
326
- { component: 'DSPageNumber', oldPackage: 'ds-page-number' },
327
- { component: 'DSSearchField', oldPackage: 'ds-search-field' },
320
+ { component: 'DSButtonGroup', oldPackage: 'ds-button-group',
321
+ storyPoints: "300",
322
+ },
323
+ { component: 'DSCardArray', oldPackage: 'ds-card-array',
324
+ storyPoints: "300",
325
+ },
326
+ { component: 'DSLabelValue', oldPackage: 'ds-label-value',
327
+ storyPoints: "300",
328
+ },
329
+ { component: 'DSDateRangeSelector', oldPackage: 'ds-date-range-selector',
330
+ storyPoints: "300",
331
+ },
332
+ { component: 'DSInputProtected', oldPackage: 'ds-form',
333
+ storyPoints: "300",
334
+ },
335
+ { component: 'DSGroupBox', oldPackage: 'ds-group-box',
336
+ storyPoints: "300",
337
+ },
338
+ { component: 'DSFilterBar', oldPackage: 'ds-filterbar',
339
+ storyPoints: "300",
340
+ },
341
+ { component: 'DSDateTimeRecurrenceSelector', oldPackage: 'ds-date-time-recurrence-picker',
342
+ storyPoints: "300",
343
+ },
344
+ { component: 'DSNumberRangeField', oldPackage: 'ds-number-range-field',
345
+ storyPoints: "300",
346
+ },
347
+ { component: 'DSPageNumber', oldPackage: 'ds-page-number',
348
+ storyPoints: "300",
349
+ },
350
+ { component: 'DSSearchField', oldPackage: 'ds-search-field',
351
+ storyPoints: "300",
352
+ },
328
353
  ];
354
+
355
+ /* prettier-ignore */
356
+ export const STORYPOINTS_TO_EFFORT = {
357
+ 50: { tshirt: 'SMALL' },
358
+ 100: { tshirt: 'SMALL' },
359
+ 150: { tshirt: 'MEDIUM' },
360
+ 200: { tshirt: 'MEDIUM' },
361
+ 250: { tshirt: 'LARGE' },
362
+ 300: { tshirt: 'LARGE' },
363
+ 500: { tshirt: 'EXTRA-LARGE' },
364
+ };
329
365
  /* eslint-enable max-len, prettier/prettier */
330
366
  /*********************************************************************************************
331
367
  Formatting is back on :)
@@ -4,4 +4,5 @@ export {
4
4
  LEGACY_WITH_NEW_MEDIUM_MIGRATION_EFFORT,
5
5
  LEGACY_WITH_NEW_LARGE_MIGRATION_EFFORT,
6
6
  DISMISSED_WITH_EXAMPLE,
7
+ STORYPOINTS_TO_EFFORT,
7
8
  } from './deprecatedPackages.mjs';
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable max-lines */
2
2
  /* eslint-disable indent */
3
3
  import path from 'path';
4
- import { readdirSync, readFileSync } from 'fs';
4
+ import { readdirSync, readFileSync, existsSync } from 'fs';
5
5
  import { logCurrMemoryUsage, logMemoryUsageDiff } from './debugHelpers.mjs';
6
6
  import ignore from 'ignore'; // used to filter out files that match the git ignore patterns
7
7
 
@@ -175,19 +175,34 @@ export const fullFilesPaths = (startingPath, debug = false) => {
175
175
  **/
176
176
  export const filePathsWithGitIgnore = (options) => {
177
177
  const { startingDirPath, gitIgnorePath, debug = false, fileExtensions = '.js,.jsx,.ts,.tsx,.mjs' } = options;
178
- // we generate a list of patterns to ignore from the .gitignore file.
179
- const gitIgnoreFileContent = readFileSync(generatePathFromCurrentFolder(gitIgnorePath), 'utf8');
180
- const gitIgnoreFileContentLines = gitIgnoreFileContent.split(/\r?\n/);
181
- // remove empty and commented lines
182
- const gitPatterns = gitIgnoreFileContentLines.filter((line) => line !== '' && !line.startsWith('#'));
178
+ // we check if the gitIgnore path is a folder path or a file path. If it is a folder path we append .gitignore
179
+ const gitIgnorePathCleaned = gitIgnorePath.endsWith('.gitignore') ? gitIgnorePath : `${gitIgnorePath}/.gitignore`;
180
+ const gitIgnorePathAdapted = generatePathFromCurrentFolder(gitIgnorePathCleaned);
183
181
 
182
+ // we check if the gitIgnore file exists
183
+ // if it does not we instead default to opinionated defaults gitPatterns
184
+ let gitIgnorePatterns = ['node_modules', 'dist', 'build'];
185
+
186
+ if (existsSync(gitIgnorePathAdapted)) {
187
+ // we generate a list of patterns to ignore from the .gitignore file.
188
+ const gitIgnoreFileContent = readFileSync(gitIgnorePathAdapted, 'utf8');
189
+ const gitIgnoreFileContentLines = gitIgnoreFileContent.split(/\r?\n/);
190
+ // remove empty and commented lines
191
+ gitIgnorePatterns = gitIgnoreFileContentLines.filter((line) => line !== '' && !line.startsWith('#'));
192
+ } else {
193
+ // we log a warning if the gitIgnore file does not exist saying that we are using opinionated defaults
194
+ console.warn(
195
+ `WARNING: the gitIgnore file does not exist at ${gitIgnorePathAdapted}.
196
+ Using opinionated defaults instead.(node_modules, dist, build)`,
197
+ );
198
+ }
184
199
  // console.log('--------------- ----------------- filtering as we go:');
185
- // const files = fullFilesPathsWithIgnore(startingDirPath, gitPatterns, debug);
200
+ // const files = fullFilesPathsWithIgnore(startingDirPath, gitIgnorePatterns, debug);
186
201
  // console.log(files.length);
187
202
 
188
203
  // Based on my testing, filtering at the end results in way better performance than filtering as we go...
189
204
  // console.log('--------------- ----------------- filtering at the end:');
190
- ig.add(gitPatterns);
205
+ ig.add(gitIgnorePatterns);
191
206
  const nonGitIgnoredFiles = fullFilesPaths(startingDirPath, debug).filter(ig.createFilter());
192
207
  // we only want files matching the file extensions
193
208
  const files = nonGitIgnoredFiles.filter((filePath) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-codemods",
3
- "version": "3.27.0-next.9",
3
+ "version": "3.27.0",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Code Mods",
6
6
  "files": [