Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/update index ci project updates #44

Merged
merged 9 commits into from
Apr 29, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
feat: add vitest configuration
rsaz committed Apr 28, 2024
commit c1e45217bd098fe70fe6545997bdc18af46648e8
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
dist/
bin/
5 changes: 3 additions & 2 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -16,11 +16,12 @@ module.exports = {
jest: true,
},
ignorePatterns: [
"./bin/*",
"bin/*",
"node_modules/*",
"expressots.config.ts",
"commitlint.config.ts",
"./vitest.config.ts",
"vitest.config.ts",
".eslintrc.cjs",
],
rules: {
"@typescript-eslint/interface-name-prefix": "off",
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -44,7 +44,7 @@
"lint": "eslint \"./src/**/*.ts\"",
"lint:fix": "eslint \"./src/**/*.ts\" --fix",
"release": "release-it",
"test": "vitest run --report default",
"test": "vitest run --reporter default",
"test:watch": "vitest",
"coverage": "vitest run --coverage"
},
@@ -79,11 +79,12 @@
"eslint-config-prettier": "9.1.0",
"husky": "9.0.11",
"prettier": "3.2.5",
"reflect-metadata": "0.2.2",
"release-it": "16.3.0",
"typescript": "5.2.2",
"rimraf": "5.0.5",
"shx": "^0.3.4",
"ts-node-dev": "^2.0.0",
"shx": "0.3.4",
"ts-node-dev": "2.0.0",
"typescript": "5.2.2",
"vite": "5.2.8",
"vite-tsconfig-paths": "4.3.2",
"vitest": "1.4.0"
7 changes: 7 additions & 0 deletions src/commands/__tests__/project.commands.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { describe, it, expect } from "vitest";

describe("project.commands", () => {
it("should return a list of commands", () => {
expect(true).toBe(true);
});
});
7 changes: 5 additions & 2 deletions src/generate/utils/command-utils.ts
Original file line number Diff line number Diff line change
@@ -222,8 +222,11 @@ export const splitTarget = async ({
const isCamelCase = camelCaseRegex.test(name);
const isKebabCase = kebabCaseRegex.test(name);
if (isCamelCase || isKebabCase) {
const [wordName, ...path] = name ? name.split(isCamelCase ? /(?=[A-Z])/ : kebabCaseRegex)
.map((word) => word.toLowerCase()) : [];
const [wordName, ...path] = name
? name
.split(isCamelCase ? /(?=[A-Z])/ : kebabCaseRegex)
.map((word) => word.toLowerCase())
: [];

return {
path: `${wordName}/${pathEdgeCase(path)}${pathEdgeCase(
2 changes: 1 addition & 1 deletion src/generate/utils/opinionated-cmd.ts
Original file line number Diff line number Diff line change
@@ -53,7 +53,7 @@ export async function opinionatedProcess(
method,
f.file,
);

const u = await validateAndPrepareFile({
schematic: "usecase",
target,
8 changes: 4 additions & 4 deletions src/providers/prisma/prisma.provider.ts
Original file line number Diff line number Diff line change
@@ -98,10 +98,10 @@ const prismaProvider = async (
)
? "npm"
: fs.existsSync("yarn.lock")
? "yarn"
: fs.existsSync("pnpm-lock.yaml")
? "pnpm"
: null;
? "yarn"
: fs.existsSync("pnpm-lock.yaml")
? "pnpm"
: null;

if (packageManager) {
// Install prisma in the project
6 changes: 3 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -6,16 +6,16 @@
"esModuleInterop": true,
"moduleResolution": "node",
"resolveJsonModule": false,
"target": "ES2017",
"lib": ["ES2017"],
"target": "ES2021",
"lib": ["ES2021"],
"outDir": "bin",
"sourceMap": false,
"strictNullChecks": false,
"strict": true,
"skipLibCheck": true,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"types": ["node", "vitest/globals"]
"types": ["node", "reflect-metadata", "vitest/globals"]
},
"include": ["./src/**/*.ts"],
"exclude": ["node_modules", "test/**/*.spec.ts", "./bin/**/*"]