Skip to content

Commit

Permalink
Merge pull request #2 from zakstucke/dev
Browse files Browse the repository at this point in the history
dev
  • Loading branch information
zakstucke authored Nov 29, 2023
2 parents e6faee8 + 81f9d81 commit cc5cafc
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ jobs:
uses: actions/setup-node@v2
with:
node-version: "20"
cache: npm
cache-dependency-path: "js/package-lock.json"

- name: Install dependencies
run: |
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ jobs:
uses: actions/setup-node@v2
with:
node-version: "20"
cache: npm
cache-dependency-path: "js/package-lock.json"

- name: Install dependencies
run: |
Expand Down
2 changes: 2 additions & 0 deletions dev_scripts/docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ js_sub_build () {
# Find all the index files and pass them to typedoc:
index_paths=$(find ./js/bitbazaar \( -name "index.ts" -o -name "index.js" -o -name "index.cjs" -o -name "index.tsx" -o -name "index.jsx" \) -exec printf "%s " {} +)

# Typedoc needs the target package's deps to be installed:
npm install --prefix ./js install
npx --yes [email protected] --out ./docs/js_ref --readme none --tsconfig ./js/tsconfig.json $index_paths
}

Expand Down
8 changes: 5 additions & 3 deletions js/bitbazaar/vite/createConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { VitePWA } from "vite-plugin-pwa";
import { defineConfig, UserConfig } from "vitest/config";

import preact from "@preact/preset-vite";
import { genPath } from "@root/utils/genPath";

import { genPath } from "../utils/genPath";
import fs from "fs/promises";

import { genBackendProxies, ProxyConf } from "./genProxy";
Expand All @@ -17,10 +17,12 @@ const baseNonFrontendGlobs: string[] = [
"**/.venv/**",
"**/node_modules/**",
"**/dist/**",
"**/lib/**",
"**/cypress/**",
"**/coverage/**",
"**/htmlcov/**",
"**/.{idea,git,cache,output,temp,mypy_cache,pytype}/**",
"**/.eslintrc.*/**",
"**/*.etch.*",
"**/.{idea,git,cache,output,temp,mypy_cache,pytype,pytest,pyright}/**",
"**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*",
];

Expand Down
2 changes: 1 addition & 1 deletion js/bitbazaar/vite/genProxy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ProxyOptions, UserConfig } from "vite";

import { genPath } from "../utils/genPath";
import { genPath } from "@root/utils/genPath";

export interface ProxyConf {
// Where matches should be sent to:
Expand Down
2 changes: 1 addition & 1 deletion js/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
"isolatedModules": true,
"moduleDetection": "force",
"forceConsistentCasingInFileNames": true,
"composite": true,
"allowSyntheticDefaultImports": true,
"resolveJsonModule": true
},
"exclude": ["bitbazaar/*.spec.(js|jsx|ts|tsx)", "bitbazaar/*.test.(js|jsx|ts|tsx)"],
"include": ["bitbazaar/**/*", "tests/**/*", "lib/index.d.ts"]
}
10 changes: 7 additions & 3 deletions js/vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,18 @@ import { defineConfig } from "vitest/config";

import tsconfig from "./tsconfig.json";

const nonFrontendGlobs: string[] = [
// Default globs to exclude from test and coverage, important dist/lib is in here to prevent trying to run on compiled output:
const excludeGlobs: string[] = [
"**/.git/**",
"**/venv/**",
"**/.venv/**",
"**/node_modules/**",
"**/dist/**",
"**/lib/**",
"**/cypress/**",
"**/coverage/**",
"**/.eslintrc.*/**",
"**/*.etch.*",
"**/.{idea,git,cache,output,temp,mypy_cache,pytype,pytest,pyright}/**",
"**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*",
];
Expand All @@ -32,9 +36,9 @@ export default defineConfig({
functions: 100,
branches: 100,
statements: 100,
exclude: excludeGlobs,
},
testTimeout: 15000,
// Not sure if this does anything, but maybe makes loading faster:
exclude: nonFrontendGlobs,
exclude: excludeGlobs,
},
});

0 comments on commit cc5cafc

Please sign in to comment.