feat(MQ-001): initialize pnpm workspace with strict TS lint and vitest

This commit is contained in:
2026-03-06 08:11:55 -06:00
parent 9bd1450f90
commit f2435471af
12 changed files with 1984 additions and 0 deletions

7
.gitignore vendored Normal file
View File

@@ -0,0 +1,7 @@
node_modules
.pnpm-store
coverage
*.log
.env
.env.*
packages/*/dist

32
eslint.config.mjs Normal file
View File

@@ -0,0 +1,32 @@
import tseslintPlugin from '@typescript-eslint/eslint-plugin';
import tseslintParser from '@typescript-eslint/parser';
export default [
{
ignores: ['**/dist/**', '**/node_modules/**', '**/coverage/**'],
},
{
files: ['**/*.ts'],
languageOptions: {
parser: tseslintParser,
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
plugins: {
'@typescript-eslint': tseslintPlugin,
},
rules: {
...tseslintPlugin.configs['recommended-type-checked'].rules,
...tseslintPlugin.configs['stylistic-type-checked'].rules,
'@typescript-eslint/consistent-type-imports': [
'error',
{
prefer: 'type-imports',
},
],
'@typescript-eslint/no-floating-promises': 'error',
},
},
];

18
package.json Normal file
View File

@@ -0,0 +1,18 @@
{
"name": "mosaic-queue-workspace",
"private": true,
"packageManager": "pnpm@10.6.2",
"scripts": {
"lint": "pnpm -r --if-present lint",
"build": "pnpm -r --if-present build",
"test": "pnpm -r --if-present test"
},
"devDependencies": {
"@types/node": "^22.13.10",
"@typescript-eslint/eslint-plugin": "^8.27.0",
"@typescript-eslint/parser": "^8.27.0",
"eslint": "^9.22.0",
"typescript": "^5.8.2",
"vitest": "^3.0.8"
}
}

View File

@@ -0,0 +1,16 @@
{
"name": "@mosaic/queue",
"version": "0.0.1",
"description": "Valkey-backed task queue exposed via CLI and MCP",
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"dist"
],
"scripts": {
"lint": "eslint \"src/**/*.ts\" \"tests/**/*.ts\" \"vitest.config.ts\"",
"build": "tsc -p tsconfig.build.json",
"test": "vitest run"
}
}

View File

@@ -0,0 +1 @@
export const packageVersion = '0.0.1';

View File

@@ -0,0 +1,9 @@
import { describe, expect, it } from 'vitest';
import { packageVersion } from '../src/index.js';
describe('package bootstrap', () => {
it('exposes package version constant', () => {
expect(packageVersion).toBe('0.0.1');
});
});

View File

@@ -0,0 +1,10 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"noEmit": false,
"rootDir": "src",
"outDir": "dist"
},
"include": ["src/**/*.ts"],
"exclude": ["tests/**/*"]
}

View File

@@ -0,0 +1,8 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"noEmit": true,
"rootDir": "."
},
"include": ["src/**/*.ts", "tests/**/*.ts", "vitest.config.ts"]
}

View File

@@ -0,0 +1,8 @@
import { defineConfig } from 'vitest/config';
export default defineConfig({
test: {
environment: 'node',
include: ['tests/**/*.test.ts'],
},
});

1854
pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load Diff

2
pnpm-workspace.yaml Normal file
View File

@@ -0,0 +1,2 @@
packages:
- packages/*

19
tsconfig.base.json Normal file
View File

@@ -0,0 +1,19 @@
{
"compilerOptions": {
"target": "ES2022",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"strict": true,
"noImplicitOverride": true,
"noUncheckedIndexedAccess": true,
"exactOptionalPropertyTypes": true,
"useUnknownInCatchVariables": true,
"forceConsistentCasingInFileNames": true,
"skipLibCheck": true,
"esModuleInterop": true,
"resolveJsonModule": true,
"declaration": true,
"sourceMap": true,
"types": ["node"]
}
}