@w5s/dev 3.2.3 → 3.3.2

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.
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["exists","constants","existsSync"],"sources":["../src/directory.ts","../src/ESLintConfig.ts","../src/file.ts","../src/block.ts","../src/interopDefault.ts","../src/json.ts","../src/meta.ts","../src/Project.ts","../src/ProjectScript.ts","../src/exec.ts","../src/yarnConfig.ts","../src/yarnVersion.ts"],"sourcesContent":["import { existsSync, mkdirSync, rmSync } from 'node:fs';\nimport { access, constants, mkdir, rm } from 'node:fs/promises';\n\nasync function exists(path: string) {\n try {\n await access(path, constants.F_OK);\n return true;\n } catch {\n return false;\n }\n}\n\nexport interface DirectoryOptions {\n /**\n * Directory path\n */\n readonly path: string;\n\n /**\n * Directory target state\n */\n readonly state: 'present' | 'absent';\n}\n\n/**\n * Ensure directory is present/absent\n *\n * @example\n * ```ts\n * await directory({\n * path: 'foo/bar',\n * state: 'present',\n * })\n * ```\n *\n * @param options\n */\nexport async function directory(options: DirectoryOptions): Promise<void> {\n const { path, state } = options;\n const isPresent = await exists(path);\n if (state === 'present') {\n if (!isPresent) {\n await mkdir(path, { recursive: true });\n }\n } else if (isPresent) {\n await rm(path, { recursive: true });\n }\n}\n\n/**\n * Ensure directory is present/absent\n *\n * @example\n * ```ts\n * await directorySync({\n * path: 'foo/bar',\n * state: 'present',\n * })\n * ```\n *\n * @param options\n */\nexport function directorySync(options: DirectoryOptions): void {\n const { path, state } = options;\n const isPresent = existsSync(path);\n if (state === 'present') {\n if (!isPresent) {\n mkdirSync(path, { recursive: true });\n }\n } else if (isPresent) {\n rmSync(path, { recursive: true });\n }\n}\n","import type { ESLint } from 'eslint';\n\nfunction toArray<T>(value: T[] | T | undefined): T[] {\n if (value == null) {\n return [];\n }\n if (Array.isArray(value)) {\n return value;\n }\n return [value];\n}\n\nfunction concatArray<T>(left: T[] | T | undefined, right: T[] | T | undefined): T[] {\n return [...toArray(left), ...toArray(right)];\n}\n\nexport namespace ESLintConfig {\n /**\n *\n * @param configs\n */\n export function concat(...configs: ESLint.ConfigData[]): ESLint.ConfigData {\n return configs.reduce(\n (returnValue, config) => ({\n ...returnValue,\n ...config,\n env: { ...returnValue.env, ...config.env },\n extends: concatArray(returnValue.extends, config.extends),\n globals: { ...returnValue.globals, ...config.globals },\n overrides: concatArray(returnValue.overrides, config.overrides),\n parserOptions: { ...returnValue.parserOptions, ...config.parserOptions },\n plugins: concatArray(returnValue.plugins, config.plugins),\n rules: { ...returnValue.rules, ...config.rules },\n settings: { ...returnValue.settings, ...config.settings },\n }),\n {\n env: {},\n extends: [],\n globals: {},\n overrides: [],\n parserOptions: {},\n plugins: [],\n rules: {},\n settings: {},\n },\n );\n }\n\n /**\n * Always return 'off'. `_status` is the previous rule value.\n *\n * @param _status\n */\n export function fixme(_status: string | number | [string | number, ...any[]] | undefined) {\n return 'off' as const;\n }\n\n /**\n * Renames rules in the given object according to the given map.\n *\n * Given a map `{ 'old-prefix': 'new-prefix' }`, and a rule object\n * `{ 'old-prefix/rule-name': 'error' }`, this function will return\n * `{ 'new-prefix/rule-name': 'error' }`.\n *\n * @param rules The object containing the rules to rename.\n * @param map The object containing the rename map.\n */\n export function renameRules(rules: Record<string, any>, map: Record<string, string>): Record<string, any> {\n return Object.fromEntries(\n Object.entries(rules).map(([key, value]) => {\n for (const [from, to] of Object.entries(map)) {\n if (key.startsWith(`${from}/`)) return [to + key.slice(from.length), value];\n else if (from === '' && !key.includes('/') && to !== '') return [to + key, value];\n }\n return [key, value];\n }),\n );\n }\n}\n","import { readFile, rm, writeFile, access } from 'node:fs/promises';\nimport { accessSync, constants, readFileSync, rmSync, writeFileSync } from 'node:fs';\n\nasync function exists(path: string) {\n try {\n await access(path, constants.F_OK);\n return true;\n } catch {\n return false;\n }\n}\n\nfunction existsSync(path: string) {\n try {\n accessSync(path, constants.F_OK);\n return true;\n } catch {\n return false;\n }\n}\n\nexport interface FileOptions {\n /**\n * File path\n */\n readonly path: string;\n\n /**\n * File target state\n */\n readonly state: 'present' | 'absent';\n\n /**\n * File content mapping function\n *\n */\n readonly update?: ((content: string) => string | undefined) | undefined;\n\n /**\n * File encoding\n */\n readonly encoding?: BufferEncoding;\n}\n\n/**\n * Ensure file is present/absent with content initialized or modified with `update\n *\n * @example\n * ```ts\n * await file({\n * path: 'foo/bar',\n * state: 'present',\n * update: (content) => content + '_test', // This will append '_test' after current content\n * })\n * ```\n *\n * @param options\n */\nexport async function file(options: FileOptions): Promise<void> {\n const { path, state, update, encoding = 'utf8' } = options;\n if (state === 'present') {\n const isPresent = await exists(path);\n const previousContent = isPresent ? await readFile(path, encoding) : '';\n const newContent = update == null ? '' : update(previousContent);\n if (newContent != null) {\n await writeFile(path, newContent, encoding);\n }\n } else {\n await rm(path, { force: true });\n }\n}\n\n/**\n * Ensure file is present/absent with content initialized or modified with `update\n *\n * @example\n * ```ts\n * fileSync({\n * path: 'foo/bar',\n * state: 'present',\n * update: (content) => content + '_test', // This will append '_test' after current content\n * })\n * ```\n *\n * @param options\n */\nexport function fileSync(options: FileOptions): void {\n const { path, state, update, encoding = 'utf8' } = options;\n if (state === 'present') {\n const isPresent = existsSync(path);\n const previousContent = isPresent ? readFileSync(path, encoding) : '';\n const newContent = update == null ? '' : update(previousContent);\n if (newContent != null) {\n writeFileSync(path, newContent, encoding);\n }\n } else {\n rmSync(path, { force: true });\n }\n}\n","import { type FileOptions, file, fileSync } from './file.js';\n\nexport interface BlockOptions {\n /**\n * The marker builder function that will take either `markerBegin` or `markerEnd`\n *\n * @default '# ${mark} MANAGED BLOCK'\n */\n marker?: (mark: 'Begin' | 'End') => string;\n\n /**\n * File path\n */\n path: string;\n\n /**\n * Block content to insert\n */\n block: string;\n\n /**\n * Insert position\n */\n insertPosition?: ['before', 'BeginningOfFile' | RegExp] | ['after', 'EndOfFile' | RegExp];\n\n /**\n * Block target state\n */\n state?: 'present' | 'absent';\n}\n\nconst EOF = 'EndOfFile';\nconst BOF = 'BeginningOfFile';\nconst insertAt = (str: string, index: number, toInsert: string) => str.slice(0, index) + toInsert + str.slice(index);\nconst matchLast = (string: string, regexp: RegExp) => {\n const matcher = new RegExp(regexp.source, `${regexp.flags}g`);\n let firstIndex = -1;\n let lastIndex = -1;\n let matches;\n\n while (true) {\n matches = matcher.exec(string);\n if (matches == null) {\n break;\n }\n firstIndex = matches.index;\n lastIndex = matcher.lastIndex;\n }\n return { firstIndex, lastIndex };\n};\n\nfunction toFileOptions(options: BlockOptions): FileOptions {\n const {\n marker = (mark) => `# ${mark.toUpperCase()} MANAGED BLOCK`,\n path,\n block: blockName,\n insertPosition = ['after', EOF],\n state = 'present',\n } = options;\n\n const EOL = '\\n';\n const beginBlock = marker('Begin');\n const endBlock = marker('End');\n\n /**\n * @param content\n */\n function findBlock(content: string) {\n const startIndex = content.indexOf(beginBlock);\n const endIndex = content.indexOf(endBlock) + endBlock.length;\n\n return {\n endIndex,\n exists: startIndex !== -1 && endIndex >= 0,\n startIndex,\n };\n }\n\n function apply(fullContent: string, blockContent: string) {\n const found = findBlock(fullContent);\n const remove = state === 'absent';\n const replaceBlock = remove ? '' : beginBlock + EOL + blockContent + EOL + endBlock;\n const [positionDirection, positionAnchor] = insertPosition;\n\n if (found.exists) {\n return fullContent.slice(0, found.startIndex) + replaceBlock + fullContent.slice(found.endIndex);\n }\n if (remove) {\n return fullContent;\n }\n switch (positionDirection) {\n case 'before': {\n if (positionAnchor !== BOF) {\n const { firstIndex } = matchLast(fullContent, positionAnchor);\n if (firstIndex >= 0) {\n return insertAt(fullContent, firstIndex, replaceBlock + EOL);\n }\n }\n\n // Beginning of file\n return replaceBlock + EOL + fullContent;\n }\n case 'after': {\n // insert\n if (positionAnchor !== EOF) {\n const { lastIndex } = matchLast(fullContent, positionAnchor);\n if (lastIndex >= 0) {\n return insertAt(fullContent, lastIndex, EOL + replaceBlock);\n }\n }\n\n // end of file\n return fullContent + EOL + replaceBlock;\n }\n\n default: {\n throw new Error(`Unsupported position ${String(positionDirection)}`);\n }\n }\n }\n\n return {\n path,\n state: 'present',\n update: (sourceContent) => apply(sourceContent, blockName),\n };\n}\n\n/**\n * Replace asynchronously a block in file that follows pattern :\n *\n * marker(markerBegin)\n * ...\n * marker(markerEnd)\n *\n * @param options\n */\nexport function block(options: BlockOptions) {\n return file(toFileOptions(options));\n}\n\n/**\n * Replace synchronously a block in file that follows pattern :\n *\n * marker(markerBegin)\n * ...\n * marker(markerEnd)\n *\n * @param options\n */\nexport function blockSync(options: BlockOptions) {\n return fileSync(toFileOptions(options));\n}\n","const getDefaultOrElse = (_: any) => _?.default ?? _;\n\n/**\n * Resolves a module or promise-like object, returning the default export if available.\n *\n * @example\n * ```ts\n * // modules.ts\n * export default {\n * foo: true\n * };\n * // Async API\n * const modPromise = import('./module');\n * interopDefault(modPromise); // == Promise.resolve({ foo: true })\n * // Sync API\n * const mod = await import('./module');\n * interopDefault(mod); // == { foo: true }\n * ```\n *\n * @template T - The type of the module or promise-like object.\n * @param m The module or promise-like object to resolve.\n */\nexport function interopDefault<T>(m: PromiseLike<T>): Promise<T extends { default: infer U } ? U : T>;\nexport function interopDefault<T>(m: T): T extends { default: infer U } ? U : T;\nexport function interopDefault<T>(m: T | PromiseLike<T>): Promise<T extends { default: infer U } ? U : T> {\n // @ts-ignore We know what we are doing\n return m != null && typeof m.then === 'function' ? Promise.resolve(m).then(getDefaultOrElse) : getDefaultOrElse(m);\n}\n","import { type FileOptions, file, fileSync } from './file.js';\n\nexport type JSONValue = null | number | string | boolean | JSONValue[] | { [key: string]: JSONValue };\n\nexport interface JSONOption<V = JSONValue> {\n /**\n * File path\n */\n readonly path: string;\n\n /**\n * File target state\n */\n readonly state: 'present' | 'absent';\n\n /**\n * File content mapping function\n */\n readonly update?: ((content: V | undefined) => V | undefined) | undefined;\n\n /**\n * File encoding\n */\n readonly encoding?: BufferEncoding;\n}\n\nfunction toFileOption<Value>({ update, ...otherOptions }: JSONOption<Value>): FileOptions {\n return {\n ...otherOptions,\n\n update:\n update == null\n ? update\n : (content) => {\n const jsonValue = content === '' ? undefined : (JSON.parse(content) as Value);\n\n return JSON.stringify(update(jsonValue));\n },\n };\n}\n\n/**\n * Ensure file is present/absent asynchronously with content value initialized or modified with `update`\n *\n * @param options\n */\nexport async function json<Value>(options: JSONOption<Value>): Promise<void> {\n return file(toFileOption(options));\n}\n\n/**\n * Ensure file is present/absent synchronously with content value initialized or modified with `update`\n *\n * @param options\n */\nexport function jsonSync<Value>(options: JSONOption<Value>): void {\n return fileSync(toFileOption(options));\n}\n","export const meta = Object.freeze({\n // @ts-ignore - these variables are injected at build time\n name: (typeof __PACKAGE_NAME__ === 'undefined' ? '' : __PACKAGE_NAME__) as string,\n // @ts-ignore - these variables are injected at build time\n version: (typeof __PACKAGE_VERSION__ === 'undefined' ? '' : __PACKAGE_VERSION__) as string,\n // @ts-ignore - these variables are injected at build time\n buildNumber: 1 as number, // (typeof __PACKAGE_BUILD_NUMBER__ === 'undefined' ? 0 : __PACKAGE_BUILD_NUMBER__) as number,\n});\n","import type { LanguageId } from './LanguageId.js';\n\nfunction escapeRegExp(value: string) {\n // eslint-disable-next-line unicorn/prefer-string-raw\n return value.replaceAll(/[$()*+.?[\\\\\\]^{|}]/g, '\\\\$&'); // $& means the whole matched string\n}\n\nexport namespace Project {\n /**\n * A type of a file extension\n */\n export type Extension = `.${string}`;\n\n /**\n * Object hash of all well-known file extension category to file extensions mapping\n */\n export type ExtensionRegistry = { [K in LanguageId]: readonly Extension[] };\n\n /**\n * Supported ECMA version\n *\n * @example\n * ```ts\n * Project.ecmaVersion() // 2022\n * ```\n */\n export function ecmaVersion() {\n return 2022 as const;\n }\n\n const registry: ExtensionRegistry = {\n css: ['.css'],\n graphql: ['.gql', '.graphql'],\n javascript: ['.js', '.cjs', '.mjs'],\n javascriptreact: ['.jsx'],\n jpeg: ['.jpg', '.jpeg'],\n json: ['.json'],\n jsonc: ['.jsonc'],\n less: ['.less'],\n markdown: ['.markdown', '.mdown', '.mkd', '.md'],\n sass: ['.sass'],\n scss: ['.scss'],\n typescript: ['.ts', '.cts', '.mts'],\n typescriptreact: ['.tsx'],\n vue: ['.vue'],\n yaml: ['.yaml', '.yml'],\n };\n\n /**\n * Return a list of extensions\n *\n * @example\n * ```ts\n * Project.queryExtensions(['javascript']); // ['.js', '.cjs', ...]\n * Project.queryExtensions(['typescript', 'typescriptreact']); // ['.ts', '.mts', ..., '.tsx']\n * ```\n *\n * @param languages\n */\n export function queryExtensions(languages: LanguageId[]): readonly Extension[] {\n return languages\n .reduce<Extension[]>((previousValue, currentValue) =>\n // eslint-disable-next-line unicorn/prefer-spread\n previousValue.concat(registry[currentValue] ?? ([] as Extension[])), [])\n // eslint-disable-next-line unicorn/no-array-sort\n .sort();\n }\n\n /**\n * Supported file extensions\n *\n * @example\n * ```ts\n * Project.sourceExtensions() // ['.ts', '.js', ...]\n * ```\n */\n export function sourceExtensions() {\n return queryExtensions(['javascript', 'javascriptreact', 'typescript', 'typescriptreact']);\n }\n\n const RESOURCE_EXTENSIONS: readonly Extension[] = Object.freeze([\n '.gif',\n '.png',\n '.svg',\n ...queryExtensions(['css', 'graphql', 'jpeg', 'less', 'sass', 'sass', 'yaml']),\n ]);\n\n /**\n * Resource file extensions\n *\n * @example\n * ```ts\n * Project.resourceExtensions() // ['.css', '.sass', ...]\n * ```\n */\n export function resourceExtensions() {\n return RESOURCE_EXTENSIONS;\n }\n\n const IGNORED = Object.freeze([\n 'node_modules/',\n 'build/',\n 'cjs/',\n 'coverage/',\n 'dist/',\n 'dts/',\n 'esm/',\n 'lib/',\n 'mjs/',\n 'umd/',\n ]);\n\n /**\n * Files and folders to always ignore\n *\n * @example\n * ```ts\n * IGNORED // ['node_modules/', 'build/', ...]\n * ```\n */\n export function ignored() {\n return IGNORED;\n }\n\n /**\n * Return a RegExp that will match any list of extensions\n *\n * @param extensions\n * @example\n * ```ts\n * Project.extensionsToMatcher(['.js', '.ts']) // RegExp = /(\\.js|\\.ts)$/\n * ```\n */\n export function extensionsToMatcher(extensions: readonly Extension[]): RegExp {\n return new RegExp(`(${extensions.map(escapeRegExp).join('|')})$`);\n }\n\n /**\n * Return a glob matcher that will match any list of extensions\n *\n * @param extensions\n * @example\n * ```ts\n * Project.extensionsToGlob(['.js', '.ts']) // '*.+(js|ts)'\n * ```\n */\n export function extensionsToGlob(extensions: readonly Extension[]): string {\n return `*.+(${extensions.map((_) => _.replace(/^\\./, '')).join('|')})`;\n }\n}\n","/**\n * Project common scripts\n */\nexport const ProjectScript = {\n Build: 'build',\n Clean: 'clean',\n CodeAnalysis: 'code-analysis',\n Coverage: 'coverage',\n Develop: 'develop',\n Docs: 'docs',\n Format: 'format',\n Install: 'install',\n Lint: 'lint',\n Prepare: 'prepare',\n Release: 'release',\n Rescue: 'rescue',\n Spellcheck: 'spellcheck',\n Test: 'test',\n Validate: 'validate',\n} as const;\nexport type ProjectScript = (typeof ProjectScript)[keyof typeof ProjectScript];\n","import { spawn, spawnSync } from 'node:child_process';\n\nexport interface ExecOptions {\n /**\n * Current working directory\n */\n cwd?: string;\n\n /**\n * Stdio options\n */\n stdio?: 'inherit' | 'pipe' | 'ignore';\n}\n\n/**\n * Runs a command in a shell and returns a promise that resolves with an object\n * containing the stdout and stderr strings.\n *\n * @param command The command to run\n * @param args The arguments to pass to the command\n * @param options\n * @returns A promise that resolves with an object like `{ stdout: string, stderr: string }`\n */\nexport function execSync(\n command: string,\n args: ReadonlyArray<string>,\n options?: ExecOptions,\n): { stdout: string; stderr: string } {\n const result = spawnSync(command, args, { ...options });\n const encoding = 'utf8';\n\n return { stdout: result.stdout.toString(encoding), stderr: result.stderr.toString(encoding) };\n}\n\n/**\n * Runs a command in a shell and returns a promise that resolves with an object\n * containing the stdout and stderr strings.\n *\n * @param command The command to run\n * @param args The arguments to pass to the command\n * @param options\n */\nexport async function exec(\n command: string,\n args: ReadonlyArray<string>,\n options?: ExecOptions,\n): Promise<{ stdout: string; stderr: string }> {\n return new Promise((resolve, reject) => {\n const encoding = 'utf8';\n const child = spawn(command, args, { ...options });\n let stdout = '';\n let stderr = '';\n\n // Capture the stdout and stderr streams\n if (child.stdout != null) {\n child.stdout.on('data', (data) => {\n stdout += data.toString(encoding);\n });\n }\n if (child.stderr != null) {\n child.stderr.on('data', (data) => {\n stderr += data.toString(encoding);\n });\n }\n // Handle process exit\n child.on('close', (_code) => {\n resolve({ stdout, stderr });\n });\n\n // Handle errors\n child.on('error', reject);\n });\n}\n","import { exec, execSync } from './exec.js';\n\nexport interface YarnConfigOptions {\n /**\n * Configuration key\n */\n readonly key: string;\n\n /**\n * Option target state\n */\n readonly state: 'present' | 'absent';\n\n /**\n * File content mapping function\n *\n */\n readonly update?: ((content: string) => string | undefined) | undefined;\n}\n\n/**\n * Synchronous version of {@link yarnConfig}\n *\n * @param options\n * @example\n * yarnConfigSync({\n * key: 'nodeLinker',\n * state: 'present',\n * update: (content) => content.replace('node-modules', 'hoisted'),\n * })\n */\nexport function yarnConfigSync(options: YarnConfigOptions) {\n const { key, state, update } = options;\n if (state === 'present') {\n const { stdout } = execSync('yarn', ['config', 'get', String(key)]);\n execSync('yarn', ['config', 'set', String(key), `${update == null ? '' : update(stdout)}`]);\n } else {\n execSync('yarn', ['config', 'unset']);\n }\n}\n\n/**\n * Set/Unset yarn configuration value\n *\n * @param options\n * @example\n * await yarnConfig({\n * key: 'nodeLinker',\n * state: 'present',\n * update: (content) => content.replace('node-modules', 'hoisted'),\n * })\n */\nexport async function yarnConfig(options: YarnConfigOptions): Promise<void> {\n const { key, state, update } = options;\n if (state === 'present') {\n const { stdout } = await exec('yarn', ['config', 'get', String(key)]);\n await exec('yarn', ['config', 'set', String(key), `${update == null ? '' : update(stdout)}`]);\n } else {\n await exec('yarn', ['config', 'unset']);\n }\n}\n","import { exec, execSync } from './exec.js';\n\nexport type YarnVersionKind = 'berry' | 'classic';\n\nexport interface YarnVersionOptions {\n /**\n * Option target state\n */\n readonly state: 'present' | 'absent';\n\n /**\n * Version mapping function\n *\n */\n readonly update?: (() => YarnVersionKind | undefined) | undefined;\n}\n\n/**\n * Synchronous version of {@link yarnVersion}\n *\n * @param options\n * @example\n * yarnVersionSync({\n * state: 'present',\n * update: () => 'berry', // or 'classic'\n * })\n */\nexport function yarnVersionSync(options: YarnVersionOptions) {\n const { state, update } = options;\n if (state === 'present') {\n execSync('yarn', ['set', 'version', `${update == null ? 'berry' : update()}`]);\n } else {\n // TODO: remove yarn.lock\n throw new Error('Not implemented');\n }\n}\n\n/**\n * Set/Unset yarn configuration value\n *\n * @param options\n * @example\n * await yarnVersion({\n * state: 'present',\n * update: () => 'berry', // or 'classic'\n * })\n */\nexport async function yarnVersion(options: YarnVersionOptions): Promise<void> {\n const { state, update } = options;\n if (state === 'present') {\n await exec('yarn', ['set', 'version', `${update == null ? 'berry' : update()}`]);\n } else {\n // TODO: remove yarn.lock\n throw new Error('Not implemented');\n }\n}\n"],"mappings":";;;;AAGA,eAAeA,SAAO,MAAc;AAClC,KAAI;AACF,QAAM,OAAO,MAAMC,YAAU,KAAK;AAClC,SAAO;SACD;AACN,SAAO;;;;;;;;;;;;;;;;AA6BX,eAAsB,UAAU,SAA0C;CACxE,MAAM,EAAE,MAAM,UAAU;CACxB,MAAM,YAAY,MAAMD,SAAO,KAAK;AACpC,KAAI,UAAU;MACR,CAAC,UACH,OAAM,MAAM,MAAM,EAAE,WAAW,MAAM,CAAC;YAE/B,UACT,OAAM,GAAG,MAAM,EAAE,WAAW,MAAM,CAAC;;;;;;;;;;;;;;;AAiBvC,SAAgB,cAAc,SAAiC;CAC7D,MAAM,EAAE,MAAM,UAAU;CACxB,MAAM,YAAY,WAAW,KAAK;AAClC,KAAI,UAAU;MACR,CAAC,UACH,WAAU,MAAM,EAAE,WAAW,MAAM,CAAC;YAE7B,UACT,QAAO,MAAM,EAAE,WAAW,MAAM,CAAC;;;;ACpErC,SAAS,QAAW,OAAiC;AACnD,KAAI,SAAS,KACX,QAAO,EAAE;AAEX,K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GAAO,OAAO,IAAI;GAAE,GAAG,UAAU,OAAO,KAAK,OAAO,OAAO;GAAG,CAAC;OAE7F,OAAM,KAAK,QAAQ,CAAC,UAAU,QAAQ,CAAC;;;;;;;;;;;;;;AC/B3C,SAAgB,gBAAgB,SAA6B;CAC3D,MAAM,EAAE,OAAO,WAAW;AAC1B,KAAI,UAAU,UACZ,UAAS,QAAQ;EAAC;EAAO;EAAW,GAAG,UAAU,OAAO,UAAU,QAAQ;EAAG,CAAC;KAG9E,OAAM,IAAI,MAAM,kBAAkB;;;;;;;;;;;;AActC,eAAsB,YAAY,SAA4C;CAC5E,MAAM,EAAE,OAAO,WAAW;AAC1B,KAAI,UAAU,UACZ,OAAM,KAAK,QAAQ;EAAC;EAAO;EAAW,GAAG,UAAU,OAAO,UAAU,QAAQ;EAAG,CAAC;KAGhF,OAAM,IAAI,MAAM,kBAAkB"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/ESLintConfig.ts","../src/interopDefault.ts","../src/meta.ts","../src/Project.ts","../src/ProjectScript.ts"],"sourcesContent":["import type { ESLint } from 'eslint';\n\nfunction toArray<T>(value: T[] | T | undefined): T[] {\n if (value == null) {\n return [];\n }\n if (Array.isArray(value)) {\n return value;\n }\n return [value];\n}\n\nfunction concatArray<T>(left: T[] | T | undefined, right: T[] | T | undefined): T[] {\n return [...toArray(left), ...toArray(right)];\n}\n\n/**\n *\n * @param configs\n */\nfunction concat(...configs: ESLint.ConfigData[]): ESLint.ConfigData {\n return configs.reduce(\n (returnValue, config) => ({\n ...returnValue,\n ...config,\n env: { ...returnValue.env, ...config.env },\n extends: concatArray(returnValue.extends, config.extends),\n globals: { ...returnValue.globals, ...config.globals },\n overrides: concatArray(returnValue.overrides, config.overrides),\n parserOptions: { ...returnValue.parserOptions, ...config.parserOptions },\n plugins: concatArray(returnValue.plugins, config.plugins),\n rules: { ...returnValue.rules, ...config.rules },\n settings: { ...returnValue.settings, ...config.settings },\n }),\n {\n env: {},\n extends: [],\n globals: {},\n overrides: [],\n parserOptions: {},\n plugins: [],\n rules: {},\n settings: {},\n },\n );\n}\n\n/**\n * Always return 'off'. `_status` is the previous rule value.\n *\n * @param _status\n */\nfunction fixme(_status: string | number | [string | number, ...any[]] | undefined) {\n return 'off' as const;\n}\n\n/**\n * Renames rules in the given object according to the given map.\n *\n * Given a map `{ 'old-prefix': 'new-prefix' }`, and a rule object\n * `{ 'old-prefix/rule-name': 'error' }`, this function will return\n * `{ 'new-prefix/rule-name': 'error' }`.\n *\n * @param rules The object containing the rules to rename.\n * @param map The object containing the rename map.\n */\nfunction renameRules(rules: Record<string, any>, map: Record<string, string>): Record<string, any> {\n return Object.fromEntries(\n Object.entries(rules).map(([key, value]) => {\n for (const [from, to] of Object.entries(map)) {\n if (key.startsWith(`${from}/`)) return [to + key.slice(from.length), value];\n else if (from === '' && !key.includes('/') && to !== '') return [to + key, value];\n }\n return [key, value];\n }),\n );\n}\n\n/**\n * @namespace\n */\nexport const ESLintConfig = Object.freeze({\n concat,\n fixme,\n renameRules,\n});\n","const getDefaultOrElse = (_: any) => _?.default ?? _;\n\n/**\n * Resolves a module or promise-like object, returning the default export if available.\n *\n * @example\n * ```ts\n * // modules.ts\n * export default {\n * foo: true\n * };\n * // Async API\n * const modPromise = import('./module');\n * interopDefault(modPromise); // == Promise.resolve({ foo: true })\n * // Sync API\n * const mod = await import('./module');\n * interopDefault(mod); // == { foo: true }\n * ```\n *\n * @template T - The type of the module or promise-like object.\n * @param m The module or promise-like object to resolve.\n */\nexport function interopDefault<T>(m: PromiseLike<T>): Promise<T extends { default: infer U } ? U : T>;\nexport function interopDefault<T>(m: T): T extends { default: infer U } ? U : T;\nexport function interopDefault<T>(m: T | PromiseLike<T>): Promise<T extends { default: infer U } ? U : T> {\n // @ts-ignore We know what we are doing\n return m != null && typeof m.then === 'function' ? Promise.resolve(m).then(getDefaultOrElse) : getDefaultOrElse(m);\n}\n","export const meta = Object.freeze({\n // @ts-ignore - these variables are injected at build time\n name: (typeof __PACKAGE_NAME__ === 'undefined' ? '' : __PACKAGE_NAME__) as string,\n // @ts-ignore - these variables are injected at build time\n version: (typeof __PACKAGE_VERSION__ === 'undefined' ? '' : __PACKAGE_VERSION__) as string,\n // @ts-ignore - these variables are injected at build time\n buildNumber: 1 as number, // (typeof __PACKAGE_BUILD_NUMBER__ === 'undefined' ? 0 : __PACKAGE_BUILD_NUMBER__) as number,\n});\n","import type { LanguageId } from './LanguageId.js';\n\n/**\n * A type of a file extension\n */\nexport type Extension = `.${string}`;\n\n/**\n * Object hash of all well-known file extension category to file extensions mapping\n */\nexport type ExtensionRegistry = { [K in LanguageId]: readonly Extension[] };\n\nfunction escapeRegExp(value: string) {\n // eslint-disable-next-line unicorn/prefer-string-raw\n return value.replaceAll(/[$()*+.?[\\\\\\]^{|}]/g, '\\\\$&'); // $& means the whole matched string\n}\n\n/**\n * Supported ECMA version\n *\n * @example\n * ```ts\n * Project.ecmaVersion() // 2022\n * ```\n */\nfunction ecmaVersion() {\n return 2022 as const;\n}\n\nconst registry: ExtensionRegistry = {\n css: ['.css'],\n graphql: ['.gql', '.graphql'],\n javascript: ['.js', '.cjs', '.mjs'],\n javascriptreact: ['.jsx'],\n jpeg: ['.jpg', '.jpeg'],\n json: ['.json'],\n jsonc: ['.jsonc'],\n less: ['.less'],\n markdown: ['.markdown', '.mdown', '.mkd', '.md'],\n sass: ['.sass'],\n scss: ['.scss'],\n typescript: ['.ts', '.cts', '.mts'],\n typescriptreact: ['.tsx'],\n vue: ['.vue'],\n yaml: ['.yaml', '.yml'],\n};\n\n/**\n * Return a list of extensions\n *\n * @example\n * ```ts\n * Project.queryExtensions(['javascript']); // ['.js', '.cjs', ...]\n * Project.queryExtensions(['typescript', 'typescriptreact']); // ['.ts', '.mts', ..., '.tsx']\n * ```\n *\n * @param languages\n */\nfunction queryExtensions(languages: LanguageId[]): readonly Extension[] {\n return languages\n .reduce<Extension[]>((previousValue, currentValue) =>\n // eslint-disable-next-line unicorn/prefer-spread\n previousValue.concat(registry[currentValue] ?? ([] as Extension[])), [])\n // eslint-disable-next-line unicorn/no-array-sort\n .sort();\n}\n\n/**\n * Supported file extensions\n *\n * @example\n * ```ts\n * Project.sourceExtensions() // ['.ts', '.js', ...]\n * ```\n */\nfunction sourceExtensions() {\n return queryExtensions(['javascript', 'javascriptreact', 'typescript', 'typescriptreact']);\n}\n\nconst RESOURCE_EXTENSIONS: readonly Extension[] = Object.freeze([\n '.gif',\n '.png',\n '.svg',\n ...queryExtensions(['css', 'graphql', 'jpeg', 'less', 'sass', 'sass', 'yaml']),\n]);\n\n/**\n * Resource file extensions\n *\n * @example\n * ```ts\n * Project.resourceExtensions() // ['.css', '.sass', ...]\n * ```\n */\nfunction resourceExtensions() {\n return RESOURCE_EXTENSIONS;\n}\n\nconst IGNORED = Object.freeze([\n 'node_modules/',\n 'build/',\n 'cjs/',\n 'coverage/',\n 'dist/',\n 'dts/',\n 'esm/',\n 'lib/',\n 'mjs/',\n 'umd/',\n]);\n\n/**\n * Files and folders to always ignore\n *\n * @example\n * ```ts\n * IGNORED // ['node_modules/', 'build/', ...]\n * ```\n */\nfunction ignored() {\n return IGNORED;\n}\n\n/**\n * Return a RegExp that will match any list of extensions\n *\n * @param extensions\n * @example\n * ```ts\n * Project.extensionsToMatcher(['.js', '.ts']) // RegExp = /(\\.js|\\.ts)$/\n * ```\n */\nfunction extensionsToMatcher(extensions: readonly Extension[]): RegExp {\n return new RegExp(`(${extensions.map(escapeRegExp).join('|')})$`);\n}\n\n/**\n * Return a glob matcher that will match any list of extensions\n *\n * @param extensions\n * @example\n * ```ts\n * Project.extensionsToGlob(['.js', '.ts']) // '*.+(js|ts)'\n * ```\n */\nfunction extensionsToGlob(extensions: readonly Extension[]): string {\n return `*.+(${extensions.map((_) => _.replace(/^\\./, '')).join('|')})`;\n}\n\nexport const Project = Object.freeze({\n ecmaVersion,\n extensionsToGlob,\n extensionsToMatcher,\n ignored,\n queryExtensions,\n resourceExtensions,\n sourceExtensions,\n});\n","/**\n * Project common scripts\n */\nexport const ProjectScript = {\n Build: 'build',\n Clean: 'clean',\n CodeAnalysis: 'code-analysis',\n Coverage: 'coverage',\n Develop: 'develop',\n Docs: 'docs',\n Format: 'format',\n Install: 'install',\n Lint: 'lint',\n Prepare: 'prepare',\n Release: 'release',\n Rescue: 'rescue',\n Spellcheck: 'spellcheck',\n Test: 'test',\n Typecheck: 'typecheck',\n Validate: 'validate',\n} as const;\nexport type ProjectScript = (typeof ProjectScript)[keyof typeof ProjectScript];\n"],"mappings":";AAEA,SAAS,QAAW,OAAiC;CACnD,IAAI,SAAS,MACX,OAAO,CAAC;CAEV,IAAI,MAAM,QAAQ,KAAK,GACrB,OAAO;CAET,OAAO,CAAC,KAAK;AACf;AAEA,SAAS,YAAe,MAA2B,OAAiC;CAClF,OAAO,CAAC,GAAG,QAAQ,IAAI,GAAG,GAAG,QAAQ,KAAK,CAAC;AAC7C;;;;;AAMA,SAAS,OAAO,GAAG,SAAiD;CAClE,OAAO,QAAQ,QACZ,aAAa,YAAY;EACxB,GAAG;EACH,GAAG;EACH,KAAK;GAAE,GAAG,YAAY;GAAK,GAAG,OAAO;EAAI;EACzC,SAAS,YAAY,YAAY,SAAS,OAAO,OAAO;EACxD,SAAS;GAAE,GAAG,YAAY;GAAS,GAAG,OAAO;EAAQ;EACrD,WAAW,YAAY,YAAY,WAAW,OAAO,SAAS;EAC9D,eAAe;GAAE,GAAG,YAAY;GAAe,GAAG,OAAO;EAAc;EACvE,SAAS,YAAY,YAAY,SAAS,OAAO,OAAO;EACxD,OAAO;GAAE,GAAG,YAAY;GAAO,GAAG,OAAO;EAAM;EAC/C,UAAU;GAAE,GAAG,YAAY;GAAU,GAAG,OAAO;EAAS;CAC1D,IACA;EACE,KAAK,CAAC;EACN,SAAS,CAAC;EACV,SAAS,CAAC;EACV,WAAW,CAAC;EACZ,eAAe,CAAC;EAChB,SAAS,CAAC;EACV,OAAO,CAAC;EACR,UAAU,CAAC;CACb,CACF;AACF;;;;;;AAOA,SA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WAAW;CACX,UAAU;AACZ"}
package/package.json CHANGED
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "name": "@w5s/dev",
3
- "version": "3.2.3",
3
+ "version": "3.3.2",
4
4
  "description": "Shared development constants and functions",
5
5
  "keywords": [
6
6
  "config",
7
7
  "dev"
8
8
  ],
9
- "homepage": "https://github.com/w5s/project-config/blob/main/packagesdev#readme",
9
+ "homepage": "https://github.com/w5s/project-config/blob/main/packages/dev#readme",
10
10
  "bugs": {
11
11
  "url": "https://github.com/w5s/project-config/issues"
12
12
  },
13
13
  "repository": {
14
14
  "type": "git",
15
- "url": "git@github.com:w5s/project-config.git",
15
+ "url": "git+ssh@github.com:w5s/project-config.git",
16
16
  "directory": "packages/dev"
17
17
  },
18
18
  "license": "MIT",
@@ -48,11 +48,11 @@
48
48
  "@types/eslint": "^9.0.0"
49
49
  },
50
50
  "engines": {
51
- "node": ">=20.0.0"
51
+ "node": ">=22.0.0"
52
52
  },
53
53
  "publishConfig": {
54
54
  "access": "public"
55
55
  },
56
56
  "sideEffect": false,
57
- "gitHead": "4e72e6d3c7b204e0f08c3f44817d48ad0d44ea33"
57
+ "gitHead": "ab7987a57772b2e7fb3ef7eb4cadb3cedd9cc9ae"
58
58
  }
@@ -14,66 +14,73 @@ function concatArray<T>(left: T[] | T | undefined, right: T[] | T | undefined):
14
14
  return [...toArray(left), ...toArray(right)];
15
15
  }
16
16
 
17
- export namespace ESLintConfig {
18
- /**
19
- *
20
- * @param configs
21
- */
22
- export function concat(...configs: ESLint.ConfigData[]): ESLint.ConfigData {
23
- return configs.reduce(
24
- (returnValue, config) => ({
25
- ...returnValue,
26
- ...config,
27
- env: { ...returnValue.env, ...config.env },
28
- extends: concatArray(returnValue.extends, config.extends),
29
- globals: { ...returnValue.globals, ...config.globals },
30
- overrides: concatArray(returnValue.overrides, config.overrides),
31
- parserOptions: { ...returnValue.parserOptions, ...config.parserOptions },
32
- plugins: concatArray(returnValue.plugins, config.plugins),
33
- rules: { ...returnValue.rules, ...config.rules },
34
- settings: { ...returnValue.settings, ...config.settings },
35
- }),
36
- {
37
- env: {},
38
- extends: [],
39
- globals: {},
40
- overrides: [],
41
- parserOptions: {},
42
- plugins: [],
43
- rules: {},
44
- settings: {},
45
- },
46
- );
47
- }
17
+ /**
18
+ *
19
+ * @param configs
20
+ */
21
+ function concat(...configs: ESLint.ConfigData[]): ESLint.ConfigData {
22
+ return configs.reduce(
23
+ (returnValue, config) => ({
24
+ ...returnValue,
25
+ ...config,
26
+ env: { ...returnValue.env, ...config.env },
27
+ extends: concatArray(returnValue.extends, config.extends),
28
+ globals: { ...returnValue.globals, ...config.globals },
29
+ overrides: concatArray(returnValue.overrides, config.overrides),
30
+ parserOptions: { ...returnValue.parserOptions, ...config.parserOptions },
31
+ plugins: concatArray(returnValue.plugins, config.plugins),
32
+ rules: { ...returnValue.rules, ...config.rules },
33
+ settings: { ...returnValue.settings, ...config.settings },
34
+ }),
35
+ {
36
+ env: {},
37
+ extends: [],
38
+ globals: {},
39
+ overrides: [],
40
+ parserOptions: {},
41
+ plugins: [],
42
+ rules: {},
43
+ settings: {},
44
+ },
45
+ );
46
+ }
48
47
 
49
- /**
50
- * Always return 'off'. `_status` is the previous rule value.
51
- *
52
- * @param _status
53
- */
54
- export function fixme(_status: string | number | [string | number, ...any[]] | undefined) {
55
- return 'off' as const;
56
- }
48
+ /**
49
+ * Always return 'off'. `_status` is the previous rule value.
50
+ *
51
+ * @param _status
52
+ */
53
+ function fixme(_status: string | number | [string | number, ...any[]] | undefined) {
54
+ return 'off' as const;
55
+ }
57
56
 
58
- /**
59
- * Renames rules in the given object according to the given map.
60
- *
61
- * Given a map `{ 'old-prefix': 'new-prefix' }`, and a rule object
62
- * `{ 'old-prefix/rule-name': 'error' }`, this function will return
63
- * `{ 'new-prefix/rule-name': 'error' }`.
64
- *
65
- * @param rules The object containing the rules to rename.
66
- * @param map The object containing the rename map.
67
- */
68
- export function renameRules(rules: Record<string, any>, map: Record<string, string>): Record<string, any> {
69
- return Object.fromEntries(
70
- Object.entries(rules).map(([key, value]) => {
71
- for (const [from, to] of Object.entries(map)) {
72
- if (key.startsWith(`${from}/`)) return [to + key.slice(from.length), value];
73
- else if (from === '' && !key.includes('/') && to !== '') return [to + key, value];
74
- }
75
- return [key, value];
76
- }),
77
- );
78
- }
57
+ /**
58
+ * Renames rules in the given object according to the given map.
59
+ *
60
+ * Given a map `{ 'old-prefix': 'new-prefix' }`, and a rule object
61
+ * `{ 'old-prefix/rule-name': 'error' }`, this function will return
62
+ * `{ 'new-prefix/rule-name': 'error' }`.
63
+ *
64
+ * @param rules The object containing the rules to rename.
65
+ * @param map The object containing the rename map.
66
+ */
67
+ function renameRules(rules: Record<string, any>, map: Record<string, string>): Record<string, any> {
68
+ return Object.fromEntries(
69
+ Object.entries(rules).map(([key, value]) => {
70
+ for (const [from, to] of Object.entries(map)) {
71
+ if (key.startsWith(`${from}/`)) return [to + key.slice(from.length), value];
72
+ else if (from === '' && !key.includes('/') && to !== '') return [to + key, value];
73
+ }
74
+ return [key, value];
75
+ }),
76
+ );
79
77
  }
78
+
79
+ /**
80
+ * @namespace
81
+ */
82
+ export const ESLintConfig = Object.freeze({
83
+ concat,
84
+ fixme,
85
+ renameRules,
86
+ });
package/src/Project.ts CHANGED
@@ -1,150 +1,158 @@
1
1
  import type { LanguageId } from './LanguageId.js';
2
2
 
3
+ /**
4
+ * A type of a file extension
5
+ */
6
+ export type Extension = `.${string}`;
7
+
8
+ /**
9
+ * Object hash of all well-known file extension category to file extensions mapping
10
+ */
11
+ export type ExtensionRegistry = { [K in LanguageId]: readonly Extension[] };
12
+
3
13
  function escapeRegExp(value: string) {
4
14
  // eslint-disable-next-line unicorn/prefer-string-raw
5
15
  return value.replaceAll(/[$()*+.?[\\\]^{|}]/g, '\\$&'); // $& means the whole matched string
6
16
  }
7
17
 
8
- export namespace Project {
9
- /**
10
- * A type of a file extension
11
- */
12
- export type Extension = `.${string}`;
13
-
14
- /**
15
- * Object hash of all well-known file extension category to file extensions mapping
16
- */
17
- export type ExtensionRegistry = { [K in LanguageId]: readonly Extension[] };
18
-
19
- /**
20
- * Supported ECMA version
21
- *
22
- * @example
23
- * ```ts
24
- * Project.ecmaVersion() // 2022
25
- * ```
26
- */
27
- export function ecmaVersion() {
28
- return 2022 as const;
29
- }
18
+ /**
19
+ * Supported ECMA version
20
+ *
21
+ * @example
22
+ * ```ts
23
+ * Project.ecmaVersion() // 2022
24
+ * ```
25
+ */
26
+ function ecmaVersion() {
27
+ return 2022 as const;
28
+ }
30
29
 
31
- const registry: ExtensionRegistry = {
32
- css: ['.css'],
33
- graphql: ['.gql', '.graphql'],
34
- javascript: ['.js', '.cjs', '.mjs'],
35
- javascriptreact: ['.jsx'],
36
- jpeg: ['.jpg', '.jpeg'],
37
- json: ['.json'],
38
- jsonc: ['.jsonc'],
39
- less: ['.less'],
40
- markdown: ['.markdown', '.mdown', '.mkd', '.md'],
41
- sass: ['.sass'],
42
- scss: ['.scss'],
43
- typescript: ['.ts', '.cts', '.mts'],
44
- typescriptreact: ['.tsx'],
45
- vue: ['.vue'],
46
- yaml: ['.yaml', '.yml'],
47
- };
30
+ const registry: ExtensionRegistry = {
31
+ css: ['.css'],
32
+ graphql: ['.gql', '.graphql'],
33
+ javascript: ['.js', '.cjs', '.mjs'],
34
+ javascriptreact: ['.jsx'],
35
+ jpeg: ['.jpg', '.jpeg'],
36
+ json: ['.json'],
37
+ jsonc: ['.jsonc'],
38
+ less: ['.less'],
39
+ markdown: ['.markdown', '.mdown', '.mkd', '.md'],
40
+ sass: ['.sass'],
41
+ scss: ['.scss'],
42
+ typescript: ['.ts', '.cts', '.mts'],
43
+ typescriptreact: ['.tsx'],
44
+ vue: ['.vue'],
45
+ yaml: ['.yaml', '.yml'],
46
+ };
48
47
 
49
- /**
50
- * Return a list of extensions
51
- *
52
- * @example
53
- * ```ts
54
- * Project.queryExtensions(['javascript']); // ['.js', '.cjs', ...]
55
- * Project.queryExtensions(['typescript', 'typescriptreact']); // ['.ts', '.mts', ..., '.tsx']
56
- * ```
57
- *
58
- * @param languages
59
- */
60
- export function queryExtensions(languages: LanguageId[]): readonly Extension[] {
61
- return languages
62
- .reduce<Extension[]>((previousValue, currentValue) =>
63
- // eslint-disable-next-line unicorn/prefer-spread
64
- previousValue.concat(registry[currentValue] ?? ([] as Extension[])), [])
65
- // eslint-disable-next-line unicorn/no-array-sort
66
- .sort();
67
- }
48
+ /**
49
+ * Return a list of extensions
50
+ *
51
+ * @example
52
+ * ```ts
53
+ * Project.queryExtensions(['javascript']); // ['.js', '.cjs', ...]
54
+ * Project.queryExtensions(['typescript', 'typescriptreact']); // ['.ts', '.mts', ..., '.tsx']
55
+ * ```
56
+ *
57
+ * @param languages
58
+ */
59
+ function queryExtensions(languages: LanguageId[]): readonly Extension[] {
60
+ return languages
61
+ .reduce<Extension[]>((previousValue, currentValue) =>
62
+ // eslint-disable-next-line unicorn/prefer-spread
63
+ previousValue.concat(registry[currentValue] ?? ([] as Extension[])), [])
64
+ // eslint-disable-next-line unicorn/no-array-sort
65
+ .sort();
66
+ }
68
67
 
69
- /**
70
- * Supported file extensions
71
- *
72
- * @example
73
- * ```ts
74
- * Project.sourceExtensions() // ['.ts', '.js', ...]
75
- * ```
76
- */
77
- export function sourceExtensions() {
78
- return queryExtensions(['javascript', 'javascriptreact', 'typescript', 'typescriptreact']);
79
- }
68
+ /**
69
+ * Supported file extensions
70
+ *
71
+ * @example
72
+ * ```ts
73
+ * Project.sourceExtensions() // ['.ts', '.js', ...]
74
+ * ```
75
+ */
76
+ function sourceExtensions() {
77
+ return queryExtensions(['javascript', 'javascriptreact', 'typescript', 'typescriptreact']);
78
+ }
80
79
 
81
- const RESOURCE_EXTENSIONS: readonly Extension[] = Object.freeze([
82
- '.gif',
83
- '.png',
84
- '.svg',
85
- ...queryExtensions(['css', 'graphql', 'jpeg', 'less', 'sass', 'sass', 'yaml']),
86
- ]);
80
+ const RESOURCE_EXTENSIONS: readonly Extension[] = Object.freeze([
81
+ '.gif',
82
+ '.png',
83
+ '.svg',
84
+ ...queryExtensions(['css', 'graphql', 'jpeg', 'less', 'sass', 'sass', 'yaml']),
85
+ ]);
87
86
 
88
- /**
89
- * Resource file extensions
90
- *
91
- * @example
92
- * ```ts
93
- * Project.resourceExtensions() // ['.css', '.sass', ...]
94
- * ```
95
- */
96
- export function resourceExtensions() {
97
- return RESOURCE_EXTENSIONS;
98
- }
87
+ /**
88
+ * Resource file extensions
89
+ *
90
+ * @example
91
+ * ```ts
92
+ * Project.resourceExtensions() // ['.css', '.sass', ...]
93
+ * ```
94
+ */
95
+ function resourceExtensions() {
96
+ return RESOURCE_EXTENSIONS;
97
+ }
99
98
 
100
- const IGNORED = Object.freeze([
101
- 'node_modules/',
102
- 'build/',
103
- 'cjs/',
104
- 'coverage/',
105
- 'dist/',
106
- 'dts/',
107
- 'esm/',
108
- 'lib/',
109
- 'mjs/',
110
- 'umd/',
111
- ]);
99
+ const IGNORED = Object.freeze([
100
+ 'node_modules/',
101
+ 'build/',
102
+ 'cjs/',
103
+ 'coverage/',
104
+ 'dist/',
105
+ 'dts/',
106
+ 'esm/',
107
+ 'lib/',
108
+ 'mjs/',
109
+ 'umd/',
110
+ ]);
112
111
 
113
- /**
114
- * Files and folders to always ignore
115
- *
116
- * @example
117
- * ```ts
118
- * IGNORED // ['node_modules/', 'build/', ...]
119
- * ```
120
- */
121
- export function ignored() {
122
- return IGNORED;
123
- }
112
+ /**
113
+ * Files and folders to always ignore
114
+ *
115
+ * @example
116
+ * ```ts
117
+ * IGNORED // ['node_modules/', 'build/', ...]
118
+ * ```
119
+ */
120
+ function ignored() {
121
+ return IGNORED;
122
+ }
124
123
 
125
- /**
126
- * Return a RegExp that will match any list of extensions
127
- *
128
- * @param extensions
129
- * @example
130
- * ```ts
131
- * Project.extensionsToMatcher(['.js', '.ts']) // RegExp = /(\.js|\.ts)$/
132
- * ```
133
- */
134
- export function extensionsToMatcher(extensions: readonly Extension[]): RegExp {
135
- return new RegExp(`(${extensions.map(escapeRegExp).join('|')})$`);
136
- }
124
+ /**
125
+ * Return a RegExp that will match any list of extensions
126
+ *
127
+ * @param extensions
128
+ * @example
129
+ * ```ts
130
+ * Project.extensionsToMatcher(['.js', '.ts']) // RegExp = /(\.js|\.ts)$/
131
+ * ```
132
+ */
133
+ function extensionsToMatcher(extensions: readonly Extension[]): RegExp {
134
+ return new RegExp(`(${extensions.map(escapeRegExp).join('|')})$`);
135
+ }
137
136
 
138
- /**
139
- * Return a glob matcher that will match any list of extensions
140
- *
141
- * @param extensions
142
- * @example
143
- * ```ts
144
- * Project.extensionsToGlob(['.js', '.ts']) // '*.+(js|ts)'
145
- * ```
146
- */
147
- export function extensionsToGlob(extensions: readonly Extension[]): string {
148
- return `*.+(${extensions.map((_) => _.replace(/^\./, '')).join('|')})`;
149
- }
137
+ /**
138
+ * Return a glob matcher that will match any list of extensions
139
+ *
140
+ * @param extensions
141
+ * @example
142
+ * ```ts
143
+ * Project.extensionsToGlob(['.js', '.ts']) // '*.+(js|ts)'
144
+ * ```
145
+ */
146
+ function extensionsToGlob(extensions: readonly Extension[]): string {
147
+ return `*.+(${extensions.map((_) => _.replace(/^\./, '')).join('|')})`;
150
148
  }
149
+
150
+ export const Project = Object.freeze({
151
+ ecmaVersion,
152
+ extensionsToGlob,
153
+ extensionsToMatcher,
154
+ ignored,
155
+ queryExtensions,
156
+ resourceExtensions,
157
+ sourceExtensions,
158
+ });
@@ -16,6 +16,7 @@ export const ProjectScript = {
16
16
  Rescue: 'rescue',
17
17
  Spellcheck: 'spellcheck',
18
18
  Test: 'test',
19
+ Typecheck: 'typecheck',
19
20
  Validate: 'validate',
20
21
  } as const;
21
22
  export type ProjectScript = (typeof ProjectScript)[keyof typeof ProjectScript];
package/src/index.ts CHANGED
@@ -1,12 +1,6 @@
1
- export * from './directory.js';
2
1
  export * from './ESLintConfig.js';
3
- export * from './block.js';
4
- export * from './file.js';
5
2
  export * from './interopDefault.js';
6
3
  export * from './LanguageId.js';
7
- export * from './json.js';
8
4
  export * from './meta.js';
9
5
  export * from './Project.js';
10
6
  export * from './ProjectScript.js';
11
- export * from './yarnConfig.js';
12
- export * from './yarnVersion.js';
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../src/directory.ts","../src/ESLintConfig.ts","../src/block.ts","../src/file.ts","../src/interopDefault.ts","../src/LanguageId.ts","../src/json.ts","../src/meta.ts","../src/Project.ts","../src/ProjectScript.ts","../src/yarnConfig.ts","../src/yarnVersion.ts"],"mappings":";;;UAYiB,gBAAA;;;AAAjB;WAIW,IAAA;;;;WAKA,KAAA;AAAA;;;;;;;;AAyCX;;;;;;iBAzBsB,SAAA,CAAU,OAAA,EAAS,gBAAA,GAAmB,OAAA;;ACrB5D;;;;;;;;;;;;iBD8CgB,aAAA,CAAc,OAAA,EAAS,gBAAA;;;kBC9CtB,YAAA;;ADJjB;;;WCSkB,MAAA,CAAA,GAAU,OAAA,EAAS,MAAA,CAAO,UAAA,KAAe,MAAA,CAAO,UAAA;EDAlD;AAgBhB;;;;EAhBgB,SCgCE,KAAA,CAAM,OAAA;EDhBQ;;;;AAyBhC;;;;;;EAzBgC,SC8Bd,WAAA,CAAY,KAAA,EAAO,MAAA,eAAqB,GAAA,EAAK,MAAA,mBAAyB,MAAA;AAAA;;;UCjEvE,YAAA;;;AFUjB;;;EEJE,MAAA,IAAU,IAAA;EFaI;AAgBhB;;EExBE,IAAA;EFwBiE;;;EEnBjE,KAAA;EFmBiE;;AAyBnE;EEvCE,cAAA,kCAAgD,MAAA,4BAAkC,MAAA;;;;EAKlF,KAAA;AAAA;;ADZF;;;;;;;;iBCyHgB,KAAA,CAAM,OAAA,EAAS,YAAA,GAAY,OAAA;;;;;;;;;;iBAa3B,SAAA,CAAU,OAAA,EAAS,YAAA;;;UCjIlB,WAAA;;;AHTjB;WGaW,IAAA;;;;WAKA,KAAA;EHOoB;;;;EAAA,SGDpB,MAAA,KAAW,OAAA;EHCsC;;;EAAA,SGIjD,QAAA,GAAW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