Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 14 additions & 16 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,36 +9,34 @@ updates:
day: friday
time: "04:00"
groups:
npm-eslint-dependencies:
npm-biome-dependencies:
patterns:
- "eslint"
- "eslint-*"
- "@eslint/*"
- "typescript-eslint"
- "@biomejs/*"
npm-commitlint-dependencies:
patterns:
- "@commitlint/*"
npm-prettier-dependencies:
npm-typescript-dependencies:
patterns:
- "prettier-*"
- "prettier"
- "@prettier/*"
- "typescript"
- "ts-node"
- "@types/node"
npm-react-dependencies:
patterns:
- "react"
- "react-*"
- "react-dom"
- "@types/react"
- "@types/react-*"
npm-testing-library-dependencies:
npm-testing-dependencies:
patterns:
- "@testing-library/*"
npm-jest-dependencies:
- "vitest"
- "@vitest/*"
- "jsdom"
npm-workspace-tooling-dependencies:
patterns:
- "jest"
- "@types/jest"
- "@types/jest-*"
- "ts-jest"
- "jest-*"
- "lerna"
- "rimraf"

- package-ecosystem: github-actions
directory: "/"
Expand Down
31 changes: 8 additions & 23 deletions nx.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,16 @@
{
"targetDefaults": {
"build": {
"dependsOn": [
"^build"
],
"outputs": [
"{projectRoot}/dist"
],
"dependsOn": ["^build"],
"outputs": ["{projectRoot}/dist"],
"cache": true
},
"test:unit": {
"outputs": [
"{projectRoot}/src/**/__snapshots__"
],
"outputs": ["{projectRoot}/src/**/__snapshots__"],
"cache": true
},
"test:e2e": {
"outputs": [
"{projectRoot}/src/**/__snapshots__"
],
"outputs": ["{projectRoot}/src/**/__snapshots__"],
"cache": true
},
"test:coverage": {
Expand All @@ -31,25 +23,18 @@
"lint": {
"cache": true
},
"jest": {
"lint:ci": {
"cache": true
},
"test": {
"cache": true,
"outputs": [
"{projectRoot}/src/**/__snapshots__"
]
"outputs": ["{projectRoot}/src/**/__snapshots__"]
}
},
"$schema": "./node_modules/nx/schemas/nx-schema.json",
"namedInputs": {
"default": [
"{projectRoot}/**/*",
"sharedGlobals"
],
"default": ["{projectRoot}/**/*", "sharedGlobals"],
"sharedGlobals": [],
"production": [
"default"
]
"production": ["default"]
}
}
4 changes: 2 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@
"test:unit": "vitest run spec.ts",
"test:e2e": "vitest run e2e.spec.ts",
"test:coverage": "vitest run --coverage",
"lint": "biome lint src",
"lint": "biome lint --error-on-warnings src",
"lint:fix": "biome check --write src",
"lint:ci": "biome check src"
"lint:ci": "biome check --error-on-warnings src"
},
"bugs": {
"url": "https://github.com/escemi-tech/ts-dev-tools/issues"
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/__snapshots__/core.e2e.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ Installation done!"
exports[`E2E - core > Simple project > Installs core package 2`] = `
{
"build": "tsc --noEmit",
"check": "biome check --write .",
"check": "biome check --error-on-warnings --write .",
"dev": "vite",
"format": "biome format --write .",
"lint": "biome lint .",
"lint": "biome lint --error-on-warnings .",
"prepare": "ts-dev-tools install",
"preview": "vite preview",
"test": "vitest run",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ import { join } from "node:path";
import { CmdService } from "../../services/CmdService";
import { FileService } from "../../services/FileService";
import { GitService } from "../../services/GitService";
import { PackageJson } from "../../services/PackageJson";
import {
PackageJson,
type PackageJsonContent,
} from "../../services/PackageJson";
import {
createProjectForTestFile,
deleteTestProject,
Expand Down Expand Up @@ -174,9 +177,9 @@ describe("Migration 20260311120000-migrate-to-biome", () => {
PackageJson.fromDirPath(testProjectDir).getContent();
expect(migratedPackageJson.eslintConfig).toBeUndefined();
expect(migratedPackageJson.scripts).toMatchObject({
check: "biome check --write .",
check: "biome check --error-on-warnings --write .",
format: "biome format --write .",
lint: "biome lint .",
lint: "biome lint --error-on-warnings .",
});
});

Expand Down Expand Up @@ -228,9 +231,9 @@ describe("Migration 20260311120000-migrate-to-biome", () => {
expect(
PackageJson.fromDirPath(testProjectDir).getContent().scripts,
).toMatchObject({
check: "biome check --write .",
check: "biome check --error-on-warnings --write .",
format: "biome format --write .",
lint: "biome lint .",
lint: "biome lint --error-on-warnings .",
});
});

Expand Down Expand Up @@ -316,7 +319,7 @@ export default tsDevToolsCore;
.spyOn(PackageJson.prototype, "setContent")
.mockImplementation(function mockSetContent(
this: PackageJson,
content,
content: PackageJsonContent,
) {
originalSetContent.call(this, content);
if (existsSync(eslintConfigFilePath)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ const BIOME_INIT_COMMAND = "npx @biomejs/biome init";

const OLD_PRE_COMMIT_COMMAND =
"npx --no-install lint-staged && npx --no-install pretty-quick --staged";
const NEW_PRE_COMMIT_COMMAND = "npx --no-install biome check --staged --write";
const NEW_PRE_COMMIT_COMMAND =
"npx --no-install biome check --error-on-warnings --staged --write";

const MANAGED_ESLINT_MARKERS = [
"tsDevToolsCore",
Expand Down Expand Up @@ -73,8 +74,8 @@ export const up: MigrationUpFunction = async (
packageJsonContent.scripts = {
...packageJsonContent.scripts,
format: "biome format --write .",
lint: "biome lint .",
check: "biome check --write .",
lint: "biome lint --error-on-warnings .",
check: "biome check --error-on-warnings --write .",
};

packageJson.setContent(packageJsonContent);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ exports[`Migration 20260311120000-migrate-to-biome > Up > should migrate ts-dev-
{
"license": "MIT",
"scripts": {
"check": "biome check --write .",
"check": "biome check --error-on-warnings --write .",
"format": "biome format --write .",
"lint": "biome lint .",
"lint": "biome lint --error-on-warnings .",
},
"version": "1.0.0",
}
Expand Down Expand Up @@ -55,7 +55,7 @@ exports[`Migration 20260311120000-migrate-to-biome > Up > should migrate ts-dev-

# Created by ts-dev-tools (https://escemi-tech.github.io/ts-dev-tools/)

npx --no-install biome check --staged --write"
npx --no-install biome check --error-on-warnings --staged --write"
`;

exports[`Migration 20260311120000-migrate-to-biome > Up > should not overwrite an existing biome config 1`] = `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ exports[`Migration 20260604100000-migrate-to-vitest > should migrate generated J
"license": "MIT",
"scripts": {
"build": "tsc --noEmit",
"check": "biome check --write .",
"check": "biome check --error-on-warnings --write .",
"format": "biome format --write .",
"lint": "biome lint .",
"lint": "biome lint --error-on-warnings .",
"prepare": "ts-dev-tools install",
"test": "vitest run",
"test:ci": "npm run test:cov",
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/services/CmdService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { spawn } from "node:child_process";
import { existsSync, statSync } from "node:fs";

export class CmdService {
private constructor() {}

static execCmd(
args: string | string[],
cwd?: string,
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/services/CorePackageService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { resolve } from "node:path";
import { PackageJson } from "./PackageJson";

export class CorePackageService {
private constructor() {}

static getPackageRootPath() {
return resolve(__dirname, "../..");
}
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/services/DuplicateDependenciesService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { type Plugin, PluginService } from "./PluginService";
type DuplicateDependencies = Map<string, Set<string>>;

export class DuplicateDependenciesService {
private constructor() {}

static executeDeduplication(absoluteProjectDir: string): void {
console.info(`Checking for duplicate dev dependencies...`);

Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/services/FileService.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { copyFileSync, existsSync, readFileSync, writeFileSync } from "node:fs";

export class FileService {
private constructor() {}

static fileExists(filePath: string): boolean {
return existsSync(filePath);
}
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/services/GitService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import { PROJECT_NAME, PROJECT_URL } from "../constants";
import { CmdService } from "./CmdService";

export class GitService {
private constructor() {}

static GIT_HOOK_MODE = 0o755;
static GIT_HOOK_TEMPLATE = `#!/bin/sh

Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/services/MigrationsService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ export type Migration = { fullname: string; shortname: string; path: string };
export type MigrationUpFunction = (absoluteProjectDir: string) => Promise<void>;

export class MigrationsService {
private constructor() {}

static MIGRATION_BUILT_PATH = "dist/install/migrations";

static async executeMigrations(
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/services/PackageJsonMerge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import type {
} from "./PackageJson";

export class PackageJsonMerge {
private constructor() {}

static merge(
source: PackageJsonContent,
update: PackageJsonContent,
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/services/PackageManagerService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import { YarnPackageManagerAdapter } from "./package-manager/YarnPackageManagerA
export { PackageManagerType } from "./package-manager/PackageManagerType";

export class PackageManagerService {
private constructor() {}

static detectPackageManager(dirPath: string): PackageManagerType {
if (existsSync(join(dirPath, "yarn.lock"))) {
return PackageManagerType.yarn;
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/services/PeerDependenciesService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ type PackageWithPath = {
};

export class PeerDependenciesService {
private constructor() {}

static DEPENDENCIES_FOLDER = "node_modules";

static async executeResolution(absoluteProjectDir: string): Promise<void> {
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/services/PluginService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ export type Plugin = {
};

export class PluginService {
private constructor() {}

static packageNameIsPlugin(packageName: string) {
return packageName.match(new RegExp(`^${PACKAGE_BASE_NAME}/.*$`));
}
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/services/SymlinkDependenciesService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import { PackageManagerService } from "./PackageManagerService";
import { type Plugin, PluginService } from "./PluginService";

export class SymlinkDependenciesService {
private constructor() {}

static DEPENDENCIES_FOLDER = "node_modules";

static async executeSymlinking(absoluteProjectDir: string): Promise<void> {
Expand Down
4 changes: 2 additions & 2 deletions packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@
"test:unit": "vitest run spec.ts",
"test:e2e": "vitest run e2e.spec.ts",
"test:coverage": "vitest run --coverage",
"lint": "biome lint src",
"lint": "biome lint --error-on-warnings src",
"lint:fix": "biome check --write src",
"lint:ci": "biome check src"
"lint:ci": "biome check --error-on-warnings src"
},
"bugs": {
"url": "https://github.com/escemi-tech/ts-dev-tools/issues"
Expand Down
4 changes: 2 additions & 2 deletions packages/react/src/__snapshots__/react.e2e.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,10 @@ Installation done!"
exports[`E2E - react > Simple project > Installs react package 2`] = `
{
"build": "tsc --noEmit",
"check": "biome check --write .",
"check": "biome check --error-on-warnings --write .",
"dev": "vite",
"format": "biome format --write .",
"lint": "biome lint .",
"lint": "biome lint --error-on-warnings .",
"prepare": "ts-dev-tools install",
"preview": "vite preview",
"test": "vitest run",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ exports[`Migration 20260604100001-migrate-to-vitest > should migrate generated R
"license": "MIT",
"scripts": {
"build": "tsc --noEmit",
"check": "biome check --write .",
"check": "biome check --error-on-warnings --write .",
"format": "biome format --write .",
"lint": "biome lint .",
"lint": "biome lint --error-on-warnings .",
"prepare": "ts-dev-tools install",
"test": "vitest run",
"test:ci": "npm run test:cov",
Expand Down
Loading