diff --git a/general/src/composables/LICENSE.ts b/general/src/composables/LICENSE.ts index 6165a18..9c0e6a0 100644 --- a/general/src/composables/LICENSE.ts +++ b/general/src/composables/LICENSE.ts @@ -3,7 +3,7 @@ import * as Path from 'path'; import {composable, handlebars} from '@magicspace/core'; -import type {ResolvedOptions} from '../library'; +import type {ResolvedOptions} from '../library/index.js'; import {LICENSE_TEMPLATES_DIR} from './@constants'; diff --git a/general/src/composables/README.md.ts b/general/src/composables/README.md.ts index 475f0d2..e656235 100644 --- a/general/src/composables/README.md.ts +++ b/general/src/composables/README.md.ts @@ -2,7 +2,11 @@ import * as Path from 'path'; import {composable, handlebars} from '@magicspace/core'; -import type {BadgesOptions, LicenseName, ResolvedOptions} from '../library'; +import type { + BadgesOptions, + LicenseName, + ResolvedOptions, +} from '../library/index.js'; import {TEMPLATES_DIR} from './@constants'; diff --git a/general/src/composables/ci.yaml.ts b/general/src/composables/ci.yaml.ts index 2deba82..d0629a9 100644 --- a/general/src/composables/ci.yaml.ts +++ b/general/src/composables/ci.yaml.ts @@ -1,6 +1,6 @@ import {composable, yaml} from '@magicspace/core'; -import type {ResolvedOptions} from '../library'; +import type {ResolvedOptions} from '../library/index.js'; export default composable( ({defaultBranch, packageManager}) => { diff --git a/general/src/composables/gitignore.ts b/general/src/composables/gitignore.ts index 56de48e..bea3236 100644 --- a/general/src/composables/gitignore.ts +++ b/general/src/composables/gitignore.ts @@ -1,7 +1,7 @@ import type {Composable, TextFile} from '@magicspace/core'; import {composable, text} from '@magicspace/core'; -import type {ResolvedOptions} from '../library'; +import type {ResolvedOptions} from '../library/index.js'; const PACKAGE_MANAGER_IGNORE_ENTRIES_DICT = { pnpm: undefined, diff --git a/general/src/composables/package.json.ts b/general/src/composables/package.json.ts index 8eb1caa..7644d97 100644 --- a/general/src/composables/package.json.ts +++ b/general/src/composables/package.json.ts @@ -3,9 +3,10 @@ import * as Path from 'path'; import type {JSONFileOptions} from '@magicspace/core'; import {composable, json} from '@magicspace/core'; import {fetchPackageVersions} from '@magicspace/utils'; -import _ from 'lodash'; -import type {ResolvedOptions} from '../library'; +import type {ResolvedOptions} from '../library/index.js'; + +const hasOwnProperty = Object.prototype.hasOwnProperty; const JSON_OPTIONS: JSONFileOptions = { /** @link https://docs.npmjs.com/files/package.json */ @@ -128,7 +129,7 @@ export default composable( }; for (const {name, alias} of packagesSortedByName) { - if (alias !== undefined && !scripts.hasOwnProperty(alias)) { + if (alias !== undefined && !hasOwnProperty.call(scripts, alias)) { scripts[alias] = WORKSPACE_ALIAS_DICT[packageManager](name); } } @@ -157,6 +158,7 @@ export default composable( ...packages.map(packageOptions => json( Path.join(packageOptions.resolvedDir, 'package.json'), + // eslint-disable-next-line @typescript-eslint/no-explicit-any (data: any) => { return { ...data, diff --git a/general/src/composables/pnpm-workspace.yaml.ts b/general/src/composables/pnpm-workspace.yaml.ts index a2745de..fd6f302 100644 --- a/general/src/composables/pnpm-workspace.yaml.ts +++ b/general/src/composables/pnpm-workspace.yaml.ts @@ -1,6 +1,6 @@ import {composable, yaml} from '@magicspace/core'; -import type {ResolvedOptions} from '../library'; +import type {ResolvedOptions} from '../library/index.js'; export default composable( ({packageManager, packagesDir, packages}) => { diff --git a/general/src/composables/prettierignore.ts b/general/src/composables/prettierignore.ts index d01fbba..a6eb0e8 100644 --- a/general/src/composables/prettierignore.ts +++ b/general/src/composables/prettierignore.ts @@ -1,6 +1,6 @@ import {composable, text} from '@magicspace/core'; -import type {ResolvedOptions} from '../library'; +import type {ResolvedOptions} from '../library/index.js'; const PACKAGE_MANAGER_IGNORE_ENTRIES_DICT = { pnpm: ['pnpm-lock.yaml'], diff --git a/general/src/composables/prettierrc.ts b/general/src/composables/prettierrc.ts index 85328da..75d2823 100644 --- a/general/src/composables/prettierrc.ts +++ b/general/src/composables/prettierrc.ts @@ -1,6 +1,6 @@ import {composable, json} from '@magicspace/core'; -import type {PrettierOptions, ResolvedOptions} from '../library'; +import type {PrettierOptions, ResolvedOptions} from '../library/index.js'; const DEFAULT_PRETTIER_OPTIONS: PrettierOptions = { printWidth: 80, diff --git a/general/src/library/index.ts b/general/src/library/index.ts index 5572d69..b4e4e0d 100644 --- a/general/src/library/index.ts +++ b/general/src/library/index.ts @@ -1,3 +1,3 @@ export {default} from './boilerplate'; -export * from './boilerplate'; -export * from './examples'; +export * from './boilerplate.js'; +export * from './examples.js'; diff --git a/typescript/src/composables/entrances.ts.ts b/typescript/src/composables/entrances.ts.ts index 2332f4f..a83c624 100644 --- a/typescript/src/composables/entrances.ts.ts +++ b/typescript/src/composables/entrances.ts.ts @@ -2,7 +2,7 @@ import * as Path from 'path'; import {composable, handlebars} from '@magicspace/core'; -import type {ResolvedOptions} from '../library'; +import type {ResolvedOptions} from '../library/index.js'; import {TEMPLATES_DIR} from './@constants'; diff --git a/typescript/src/composables/eslintrc.ts b/typescript/src/composables/eslintrc.ts index 2862d6e..ebea98e 100644 --- a/typescript/src/composables/eslintrc.ts +++ b/typescript/src/composables/eslintrc.ts @@ -1,12 +1,12 @@ import * as Path from 'path'; import {composable, json} from '@magicspace/core'; -import _ from 'lodash'; -import type {ResolvedOptions} from '../library'; +import type {ResolvedOptions} from '../library/index.js'; export default composable(({resolvedProjects: projects}) => { return [ + // eslint-disable-next-line @typescript-eslint/no-explicit-any json('.eslintrc.json', (data: any) => { return { ...data, @@ -22,6 +22,7 @@ export default composable(({resolvedProjects: projects}) => { }; }), ...projects.map(project => + // eslint-disable-next-line @typescript-eslint/no-explicit-any json(Path.join(project.inDir, '.eslintrc.json'), (data: any) => { return { ...data, diff --git a/typescript/src/composables/gitignore.ts b/typescript/src/composables/gitignore.ts index 6ad53ba..606753f 100644 --- a/typescript/src/composables/gitignore.ts +++ b/typescript/src/composables/gitignore.ts @@ -1,6 +1,6 @@ import {composable, text} from '@magicspace/core'; -import type {ResolvedOptions} from '../library'; +import type {ResolvedOptions} from '../library/index.js'; export default composable(({bldDirNames}) => bldDirNames.length > 0 diff --git a/typescript/src/composables/index.ts.ts b/typescript/src/composables/index.ts.ts index 7b37996..c31beb0 100644 --- a/typescript/src/composables/index.ts.ts +++ b/typescript/src/composables/index.ts.ts @@ -3,7 +3,7 @@ import * as Path from 'path'; import {composable, handlebars} from '@magicspace/core'; import _ from 'lodash'; -import type {ResolvedOptions} from '../library'; +import type {ResolvedOptions} from '../library/index.js'; import {TEMPLATES_DIR} from './@constants'; diff --git a/typescript/src/composables/npmignore.ts b/typescript/src/composables/npmignore.ts index 8154b56..ee4de98 100644 --- a/typescript/src/composables/npmignore.ts +++ b/typescript/src/composables/npmignore.ts @@ -3,7 +3,7 @@ import * as Path from 'path'; import {composable, text} from '@magicspace/core'; import _ from 'lodash'; -import type {ResolvedOptions} from '../library'; +import type {ResolvedOptions} from '../library/index.js'; export default composable( async ({resolvedProjects: projects}) => { diff --git a/typescript/src/composables/package.json.ts b/typescript/src/composables/package.json.ts index cf98f23..c8ba2aa 100644 --- a/typescript/src/composables/package.json.ts +++ b/typescript/src/composables/package.json.ts @@ -8,12 +8,12 @@ import { } from '@magicspace/utils'; import _ from 'lodash'; -import type {ResolvedPackageOptions} from '../../../general/bld/library'; import type { + ResolvedPackageOptions, PackageExports, ResolvedOptions, ResolvedTypeScriptProjectOptions, -} from '../library'; +} from '../library/index.js'; const ROOT_DEV_DEPENDENCY_DICT = { rimraf: '5', @@ -58,6 +58,7 @@ export default composable( ]); return [ + // eslint-disable-next-line @typescript-eslint/no-explicit-any json('package.json', (data: any) => { let {scripts = {}} = data; @@ -70,7 +71,7 @@ export default composable( if (rimrafPattern) { rimrafScript = `rimraf ${ - /[\*{]/.test(rimrafPattern) ? '--glob ' : '' + /[*{]/.test(rimrafPattern) ? '--glob ' : '' }${rimrafPattern}`; } } @@ -114,6 +115,7 @@ export default composable( }; }), ...packagesWithTypeScriptProject.map(packageOptions => + // eslint-disable-next-line @typescript-eslint/no-explicit-any json(packageOptions.packageJSONPath, (data: any) => { const referencedPackageNames = _.compact( _.union( diff --git a/typescript/src/composables/prettierignore.ts b/typescript/src/composables/prettierignore.ts index ad06861..b097208 100644 --- a/typescript/src/composables/prettierignore.ts +++ b/typescript/src/composables/prettierignore.ts @@ -1,6 +1,6 @@ import {composable, text} from '@magicspace/core'; -import type {ResolvedOptions} from '../library'; +import type {ResolvedOptions} from '../library/index.js'; export default composable(({bldDirNames}) => bldDirNames.length > 0 diff --git a/typescript/src/composables/tsconfig.json.ts b/typescript/src/composables/tsconfig.json.ts index 957d9a2..dfd2df0 100644 --- a/typescript/src/composables/tsconfig.json.ts +++ b/typescript/src/composables/tsconfig.json.ts @@ -4,7 +4,7 @@ import type {JSONFileOptions} from '@magicspace/core'; import {composable, json} from '@magicspace/core'; import _ from 'lodash'; -import type {ResolvedOptions} from '../library'; +import type {ResolvedOptions} from '../library/index.js'; const JSON_OPTIONS: JSONFileOptions = { sortKeys: [ diff --git a/typescript/src/composables/vscode-settings.json.ts b/typescript/src/composables/vscode-settings.json.ts index 059c6fd..8db65aa 100644 --- a/typescript/src/composables/vscode-settings.json.ts +++ b/typescript/src/composables/vscode-settings.json.ts @@ -1,10 +1,11 @@ import {composable, json} from '@magicspace/core'; import {extendObjectProperties} from '@magicspace/utils'; -import type {ResolvedOptions} from '../library'; +import type {ResolvedOptions} from '../library/index.js'; export default composable( async ({resolvedProjects: projects}) => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any return json('.vscode/settings.json', (data: any) => { data = extendObjectProperties( data, diff --git a/typescript/src/library/boilerplate.ts b/typescript/src/library/@boilerplate.ts similarity index 86% rename from typescript/src/library/boilerplate.ts rename to typescript/src/library/@boilerplate.ts index 34c8ce6..0c3385e 100644 --- a/typescript/src/library/boilerplate.ts +++ b/typescript/src/library/@boilerplate.ts @@ -2,7 +2,7 @@ import * as Path from 'path'; import {boilerplate, composables} from '@magicspace/core'; -import general from '../../../general/bld/library'; +import general from '../../../general/bld/library/index.js'; import type {Options} from './options'; import {resolveOptions} from './options'; diff --git a/typescript/src/library/index.ts b/typescript/src/library/index.ts index b6689c7..e562c94 100644 --- a/typescript/src/library/index.ts +++ b/typescript/src/library/index.ts @@ -1,5 +1,4 @@ -export {default} from './boilerplate'; +export {default} from './@boilerplate.js'; -export * from './options'; -export * from './boilerplate'; -export * from './examples'; +export * from './examples.js'; +export * from './options.js'; diff --git a/typescript/src/library/options.ts b/typescript/src/library/options.ts index 8eb8f23..29d401a 100644 --- a/typescript/src/library/options.ts +++ b/typescript/src/library/options.ts @@ -7,12 +7,12 @@ import type {OmitValueOfKey} from 'tslang'; import type { ResolvedOptions as ResolvedGeneralOptions, ResolvedPackageOptions as ResolvedGeneralPackageOptions, -} from '../../../general/bld/library'; +} from '../../../general/bld/library/index.js'; import { Options as GeneralOptions, PackageOptions as GeneralPackageOptions, resolveOptions as resolveGeneralOptions, -} from '../../../general/bld/library'; +} from '../../../general/bld/library/index.js'; export const TypeScriptProjectReferenceOptions = x.object({ package: x.string,