Skip to content

Commit

Permalink
chore: fix benchmark (#99)
Browse files Browse the repository at this point in the history
  • Loading branch information
yann510 authored Oct 28, 2024
1 parent 3b6b2de commit 6b4cab8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/publish-package.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
name: ss-search CI
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}

on:
pull_request:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ npm-debug.log
yarn-error.log
testem.log
/typings
*.env

# System Files
.DS_Store
Expand Down
6 changes: 6 additions & 0 deletions benchmark/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export interface BenchmarkResult {
}

const benchmarkResultPath = `${__dirname}/../../../../web-app/src/assets/benchmarkResults.json`
const ignoredVersions = ["1.9.1"]

async function main() {
const packageVersions: string[] = JSON.parse(execSync('npm view ss-search versions --json').toString())
Expand All @@ -28,6 +29,11 @@ async function main() {
)

for (const version of missingVersionsToBenchmark) {
if (ignoredVersions.includes(version)) {
console.info(`Ignoring version ${version}`)
continue
}

console.log(`Benchmarking version ${version}`)
execSync(`npm i --prefix ${__dirname} ss-search@${version}`)

Expand Down
7 changes: 5 additions & 2 deletions ss-search/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
"dependencies": {
"lodash": "4.17.21"
},
"type": "module",
"main": "./index.cjs",
"module": "./index.js"
"module": "./index.esm.js",
"exports": {
"require": "./index.cjs.js",
"import": "./index.esm.js"
}
}

0 comments on commit 6b4cab8

Please sign in to comment.