[web] esm-check-migration to lookup scripts and migrations (#20736)

* [web] `esm-check-migration` to lookup scripts and migrations

* Remove unnecessary minimist default

GitOrigin-RevId: 55b0900d2d1dc2669e297ddc778dcd236c2912a7
This commit is contained in:
Miguel Serrano 2024-10-01 15:35:14 +02:00 committed by Copybot
parent cd6631c105
commit a6016ff984

View file

@ -2,7 +2,7 @@ const fs = require('fs')
const path = require('path')
const minimist = require('minimist')
const APP_CODE_PATH = ['app', 'modules']
const APP_CODE_PATH = ['app', 'modules', 'migrations', 'scripts']
const {
_: args,
@ -17,7 +17,6 @@ const {
json: 'j',
},
default: {
_: ['app', 'modules'],
files: false,
help: false,
json: false,
@ -85,8 +84,8 @@ function collectJsFiles(dir, files = []) {
if (stat.isDirectory()) {
const basename = path.basename(fullPath)
// skipping 'test' and 'frontend' directories from search
if (basename !== 'test' && basename !== 'frontend') {
// skipping directories from search
if (!['test', 'frontend', 'node_modules'].includes(basename)) {
collectJsFiles(fullPath, files)
}
} else if (