Skip to content

Commit

Permalink
fix: updated nx and removed exposed cloud token -> nx login for remot…
Browse files Browse the repository at this point in the history
…e caching (#100)

* chore: updated nx and removed exposed cloud token -> nx login for remote caching

* fix: ci

* fix: rspack version mismatch
  • Loading branch information
yann510 authored Oct 28, 2024
1 parent 37f35dd commit f47d5d0
Show file tree
Hide file tree
Showing 23 changed files with 7,042 additions and 3,140 deletions.
10 changes: 8 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,18 @@
{
"files": ["*.ts", "*.tsx"],
"extends": ["plugin:@nx/typescript"],
"rules": {}
"rules": {
"@typescript-eslint/no-extra-semi": "error",
"no-extra-semi": "off"
}
},
{
"files": ["*.js", "*.jsx"],
"extends": ["plugin:@nx/javascript"],
"rules": {}
"rules": {
"@typescript-eslint/no-extra-semi": "error",
"no-extra-semi": "off"
}
},
{
"files": ["*.spec.ts", "*.spec.tsx", "*.spec.js", "*.spec.jsx"],
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/publish-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ jobs:
with:
fetch-depth: 0

- name: Setup node.js 18
uses: actions/setup-node@v3
- name: Setup node.js 22
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 22

- name: Cache dependencies
id: cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
./node_modules
Expand Down
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v22.5.1
6 changes: 5 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Add files here to ignore them from prettier formatting
/dist
/coverage
/coverage
/.nx/cache
/.nx/workspace-data
CHANGELOG.md
**/data-chunk*
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,10 @@ const results = search(data, ['arrayObjects[arrayObjectProperty]'], 'arrayObject

Customize your search experience using the following options:

| Option parameter | Value | Description |
| ---------------- | ----- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `withScore` | `true` | When set to `true`, the search function will return an array of objects, each containing the matched element and its corresponding score. The score represents how closely the element matches the search text, with a higher score indicating a closer match. Even if the search doesn't match, it will return a score of 0. |
| `withScore` | `false` | When set to `false` or not provided, the function will return an array of matched elements without their scores. |
| Option parameter | Value | Description |
| ---------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `withScore` | `true` | When set to `true`, the search function will return an array of objects, each containing the matched element and its corresponding score. The score represents how closely the element matches the search text, with a higher score indicating a closer match. Even if the search doesn't match, it will return a score of 0. |
| `withScore` | `false` | When set to `false` or not provided, the function will return an array of matched elements without their scores. |

### Example Usage

Expand All @@ -164,7 +164,7 @@ With `withScore` option:
```javascript
const data = [{ name: 'John' }, { name: 'Jane' }, { name: 'Doe' }]
const result = search(data, ['name'], 'John', { withScore: true })
console.log(result)
console.log(result)
// [
// { element: { name: 'John' }, score: 1 },
// { element: { name: 'Jane' }, score: 0 },
Expand Down
19 changes: 4 additions & 15 deletions benchmark/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"$schema": "../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "benchmark/src",
"projectType": "application",
"tags": [],
"targets": {
"build": {
"executor": "@nx/esbuild:esbuild",
Expand Down Expand Up @@ -52,26 +53,14 @@
}
},
"lint": {
"executor": "@nx/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["benchmark/**/*.ts"]
}
"executor": "@nx/eslint:lint"
},
"test": {
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"options": {
"jestConfig": "benchmark/jest.config.ts",
"passWithNoTests": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
"jestConfig": "benchmark/jest.config.ts"
}
}
},
"tags": []
}
}
2 changes: 1 addition & 1 deletion benchmark/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export interface BenchmarkResult {
}

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

async function main() {
const packageVersions: string[] = JSON.parse(execSync('npm view ss-search versions --json').toString())
Expand Down
60 changes: 43 additions & 17 deletions nx.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,35 @@
{
"$schema": "./node_modules/nx/schemas/nx-schema.json",
"tasksRunnerOptions": {
"default": {
"runner": "nx-cloud",
"options": {
"cacheableOperations": ["build", "lint", "test", "e2e"],
"accessToken": "OGQ0YTdhYTktYzk5OS00ZGMxLThhNzAtYTMxMzBlNzllMWM5fHJlYWQtd3JpdGU="
}
}
"workspaceLayout": {
"projectNameAndRootFormat": "as-provided"
},
"workspaceLayout": { "projectNameAndRootFormat": "as-provided" },
"targetDefaults": {
"build": { "dependsOn": ["^build"], "inputs": ["production", "^production"] },
"lint": {
"inputs": ["default", "{workspaceRoot}/.eslintrc.json", "{workspaceRoot}/.eslintignore", "{workspaceRoot}/eslint.config.js"]
"build": {
"dependsOn": ["^build"],
"inputs": ["production", "^production"],
"cache": true
},
"@nx/jest:jest": {
"inputs": ["default", "^production", "{workspaceRoot}/jest.preset.js"],
"cache": true,
"options": {
"passWithNoTests": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
}
},
"@nx/vite:test": {
"inputs": ["default", "^production", "{workspaceRoot}/jest.preset.js"],
"cache": true
},
"test": { "inputs": ["default", "^production", "{workspaceRoot}/jest.preset.js"] }
"@nx/eslint:lint": {
"inputs": ["default", "{workspaceRoot}/.eslintrc.json", "{workspaceRoot}/.eslintignore", "{workspaceRoot}/eslint.config.js"],
"cache": true
}
},
"namedInputs": {
"default": ["{projectRoot}/**/*", "sharedGlobals"],
Expand All @@ -33,9 +47,21 @@
},
"generators": {
"@nx/react": {
"application": { "style": "css", "linter": "eslint", "bundler": "rspack", "babel": true },
"component": { "style": "css" },
"library": { "style": "css", "linter": "eslint" }
"application": {
"babel": true,
"style": "css",
"linter": "eslint",
"bundler": "rspack"
},
"component": {
"style": "css"
},
"library": {
"style": "css",
"linter": "eslint"
}
}
}
},
"useInferencePlugins": false,
"nxCloudId": "670f1d8b22b1a18844d39587"
}
Loading

0 comments on commit f47d5d0

Please sign in to comment.