Skip to content

Commit

Permalink
Merge pull request #450 from ieedan/fixes-branch
Browse files Browse the repository at this point in the history
fix: test suffixes
  • Loading branch information
ieedan authored Feb 21, 2025
2 parents 26152c6 + 12713ad commit 158c22e
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 24 deletions.
5 changes: 5 additions & 0 deletions .changeset/gold-trains-act.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"jsrepo": patch
---

fix: Add more test suffixes.
18 changes: 3 additions & 15 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,7 @@
"bugs": {
"url": "https://github.com/ieedan/jsrepo/issues"
},
"keywords": [
"repo",
"cli",
"svelte",
"vue",
"typescript",
"javascript",
"shadcn",
"registry"
],
"keywords": ["repo", "cli", "svelte", "vue", "typescript", "javascript", "shadcn", "registry"],
"type": "module",
"exports": {
".": {
Expand All @@ -34,10 +25,7 @@
},
"bin": "./dist/index.js",
"main": "./dist/index.js",
"files": [
"./schemas/**/*",
"dist/**/*"
],
"files": ["./schemas/**/*", "dist/**/*"],
"scripts": {
"start": "tsup --silent && node ./dist/index.js",
"build": "tsup",
Expand Down Expand Up @@ -78,7 +66,7 @@
"node-fetch": "^3.3.2",
"octokit": "^4.1.2",
"ollama": "^0.5.13",
"openai": "^4.85.2",
"openai": "^4.85.3",
"package-manager-detector": "^0.2.9",
"parse5": "^7.2.1",
"pathe": "^2.0.3",
Expand Down
15 changes: 14 additions & 1 deletion packages/cli/src/utils/build/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,20 @@ import type { RegistryConfig } from '../config';
import { languages } from '../language-support';
import { isDependedOn } from './check';

const TEST_SUFFIXES = ['.test.ts', '_test.ts', '.test.js', '_test.js'] as const;
const TEST_SUFFIXES = [
'.test.ts',
'_test.ts',
'.test.js',
'_test.js',
'.spec.ts',
'_spec.ts',
'.spec.js',
'_spec.js',
'.stories.jsx',
'_stories.jsx',
'.stories.tsx',
'_stories.tsx',
] as const;

export const isTestFile = (file: string): boolean =>
TEST_SUFFIXES.find((suffix) => file.endsWith(suffix)) !== undefined;
Expand Down
41 changes: 34 additions & 7 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sites/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"eslint-plugin-svelte": "^2.46.1",
"globals": "^16.0.0",
"isomorphic-dompurify": "^2.22.0",
"jsrepo": "^1.38.0",
"jsrepo": "^1.39.1",
"lucide-svelte": "^0.475.0",
"markdown-it": "^14.1.0",
"markdown-it-table": "^4.1.1",
Expand Down

0 comments on commit 158c22e

Please sign in to comment.