Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
24 changes: 24 additions & 0 deletions e2e/recognize-app/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import baseConfig from '../../eslint.config.mjs';

export default [
{
ignores: [
'node_modules',
'*.md',
'LICENSE',
'.swcrc',
'.babelrc',
'.env*',
'.bin',
'dist',
'.eslintignore',
'*.html',
'*.svg',
'*.css',
'public',
'*.json',
'*.d.ts',
Comment on lines +15 to +20
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: List nested asset/config files under the recognize E2E app that root-only ignore globs do not cover.
python - <<'PY'
from pathlib import Path

root = Path("e2e/recognize-app")
suffixes = (".html", ".svg", ".css", ".json", ".d.ts")

for path in root.rglob("*"):
    if path.is_file() and path.name.endswith(suffixes):
        rel = path.relative_to(root).as_posix()
        if "/" in rel:
            print(rel)
PY

Repository: ForgeRock/ping-javascript-sdk

Length of output: 102


🏁 Script executed:

cd e2e/recognize-app && head -25 eslint.config.mjs

Repository: ForgeRock/ping-javascript-sdk

Length of output: 438


🏁 Script executed:

# Check if there are other nested files beyond what was already found
find e2e/recognize-app -type f \( -name "*.html" -o -name "*.svg" -o -name "*.css" -o -name "*.json" -o -name "*.d.ts" \) | head -20

Repository: ForgeRock/ping-javascript-sdk

Length of output: 237


🌐 Web query:

ESLint flat config ignore patterns glob semantics documentation

💡 Result:

In ESLint flat config (eslint.config.js, default since v9), ignore patterns use minimatch glob syntax. They are specified in the ignores array within config objects. Global ignores (applied project-wide, skipping file traversal): Use a standalone object with only ignores or the globalIgnores helper from eslint/config. Example: import { globalIgnores } from "eslint/config"; export default [ globalIgnores(["/node_modules/", "dist/", ".git/"]), // other configs ]; Local ignores (apply only to that config object): Use ignores alongside files, rules, etc. Example: { files: ["/.js"], ignores: ["/.config.js"], rules: { /* ... / } } Glob semantics (minimatch): - recurses directories (e.g., /node_modules/ ignores all node_modules). - * matches non-/ chars. - ? single non-/ char. - dir/ matches only that dir (relative to config file location). - dir/ ignores dir + contents (no unignore inside). - dir// ignores contents but allows unignoring specific files. - !pattern negates (unignores). - Patterns ending / match dirs; others match files/dirs. - Defaults: ["/node_modules/", ".git/"]. - Resolution: Relative to eslint.config.js for globalIgnores; cwd for CLI --ignore-pattern. Unlike .eslintignore (gitignore-style), flat config uses strict minimatch (e.g., dist ignores only top-level dist, use /dist/ for recursive). Primary source: Official ESLint docs (https://eslint.org/docs/latest/use/configure/ignore).

Citations:


Make asset ignore globs recursive.

Patterns like *.html and *.css match only root-level files in ESLint's flat config (using strict minimatch). Nested files such as src/index.html and src/styles.css will not be ignored, allowing the linter to process them despite being asset files.

🛠️ Proposed fix
-      '*.html',
-      '*.svg',
-      '*.css',
+      '**/*.html',
+      '**/*.svg',
+      '**/*.css',
       'public',
-      '*.json',
-      '*.d.ts',
+      '**/*.json',
+      '**/*.d.ts',
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
'*.html',
'*.svg',
'*.css',
'public',
'*.json',
'*.d.ts',
'**/*.html',
'**/*.svg',
'**/*.css',
'public',
'**/*.json',
'**/*.d.ts',
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@e2e/recognize-app/eslint.config.mjs` around lines 15 - 20, The glob ignore
patterns in eslint.config.mjs (entries like '*.html', '*.svg', '*.css',
'*.json', '*.d.ts') are non-recursive and only match root-level files; update
each asset pattern to be recursive (e.g., change '*.html' -> '**/*.html',
'*.css' -> '**/*.css', '*.svg' -> '**/*.svg', '*.json' -> '**/*.json', '*.d.ts'
-> '**/*.d.ts') so nested assets (like src/index.html or src/styles/site.css)
are ignored by ESLint; modify the array of ignore globs in the file accordingly
to use the double-star recursive form for all asset patterns.

],
},
...baseConfig,
];
18 changes: 18 additions & 0 deletions e2e/recognize-app/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "@forgerock/recognize-app",
"version": "0.0.1",
"private": true,
"scripts": {
"build": "pnpm nx nxBuild",
"lint": "pnpm nx nxLint",
"preview": "pnpm nx nxPreview",
"serve": "pnpm nx nxServe"
},
"dependencies": {
"@forgerock/journey-client": "workspace:*",
"@forgerock/recognize": "workspace:*"
},
"nx": {
"tags": ["scope:e2e"]
}
}
14 changes: 14 additions & 0 deletions e2e/recognize-app/src/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Recognize E2E Test Index | Ping Identity JavaScript SDK</title>
</head>
<body>
<div id="app">
<h2>Recognize E2E Test Index | Ping Identity JavaScript SDK</h2>
</div>
<script type="module" src="index.ts"></script>
</body>
</html>
1 change: 1 addition & 0 deletions e2e/recognize-app/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import './styles.css';
11 changes: 11 additions & 0 deletions e2e/recognize-app/src/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
body {
font-family:
-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
margin: 0;
padding: 2rem;
}

#app {
max-width: 960px;
margin: 0 auto;
}
29 changes: 29 additions & 0 deletions e2e/recognize-app/tsconfig.app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "dist",
"types": ["node"],
"rootDir": "src",
"module": "esnext",
"moduleResolution": "bundler",
"tsBuildInfoFile": "dist/tsconfig.app.tsbuildinfo"
},
"exclude": [
"out-tsc",
"dist",
"src/**/*.spec.ts",
"src/**/*.test.ts",
"eslint.config.js",
"eslint.config.cjs",
"eslint.config.mjs"
],
"include": ["src/**/*.ts"],
"references": [
{
"path": "../../packages/recognize/tsconfig.lib.json"
},
{
"path": "../../packages/journey-client/tsconfig.lib.json"
}
]
}
10 changes: 10 additions & 0 deletions e2e/recognize-app/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "../../tsconfig.base.json",
"files": [],
"include": [],
"references": [
{
"path": "./tsconfig.app.json"
}
]
}
33 changes: 33 additions & 0 deletions e2e/recognize-app/vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { defineConfig } from 'vite';
import { dirname, resolve } from 'path';
import { fileURLToPath } from 'url';

const __dirname = dirname(fileURLToPath(import.meta.url));

export default defineConfig(() => ({
root: __dirname + '/src',
cacheDir: '../../node_modules/.vite/e2e/recognize-app',
publicDir: __dirname + '/public',
Comment on lines +8 to +10
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Point publicDir at the Vite root’s public folder.

With root set to src, Line 10 currently serves e2e/recognize-app/public, not e2e/recognize-app/src/public. If the app’s static assets are under src/public, they won’t be copied or served.

🛠️ Proposed fix
-  publicDir: __dirname + '/public',
+  publicDir: resolve(__dirname, 'src/public'),
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@e2e/recognize-app/vite.config.ts` around lines 8 - 10, The Vite config sets
root to src but publicDir points to __dirname + '/public', so static assets
under the Vite root (src/public) won't be served; update publicDir to reference
the Vite root's public folder (e.g., derive it from the configured root or point
it to src/public) so that with root = __dirname + '/src' the publicDir resolves
to the corresponding public directory; adjust the publicDir setting in
vite.config.ts accordingly (referencing the root/public relationship rather than
the project root).

server: {
port: 8443,
host: 'localhost',
},
preview: {
port: 8443,
host: 'localhost',
},
plugins: [],
build: {
outDir: __dirname + '/dist',
emptyOutDir: true,
reportCompressedSize: true,
rollupOptions: {
input: {
main: resolve(__dirname + '/src', 'index.html'),
},
output: {
entryFileNames: '[name]/main.js',
},
},
},
}));
11 changes: 11 additions & 0 deletions packages/recognize/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# recognize

This library was generated with [Nx](https://nx.dev).

## Building

Run `nx build recognize` to build the library.

## Running unit tests

Run `nx test recognize` to execute the unit tests via [Vitest](https://vitest.dev/).
25 changes: 25 additions & 0 deletions packages/recognize/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import baseConfig from '../../eslint.config.mjs';

export default [
...baseConfig,
{
files: ['**/*.json'],
rules: {
'@nx/dependency-checks': [
'error',
{
ignoredFiles: [
'{projectRoot}/eslint.config.{js,cjs,mjs,ts,cts,mts}',
'{projectRoot}/vite.config.{js,ts,mjs,mts}',
],
},
],
},
languageOptions: {
parser: await import('jsonc-eslint-parser'),
},
},
{
ignores: ['**/out-tsc'],
},
];
45 changes: 45 additions & 0 deletions packages/recognize/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"name": "@forgerock/recognize",
"version": "0.0.1",
"private": true,
"type": "module",
"main": "./dist/src/index.js",
"module": "./dist/src/index.js",
"types": "./dist/src/index.d.ts",
"exports": {
"./package.json": "./package.json",
".": {
"types": "./dist/src/index.d.ts",
"import": "./dist/src/index.js",
"default": "./dist/src/index.js"
}
},
"dependencies": {
"tslib": "^2.3.0"
},
"devDependencies": {
"@aracna/web-components": "^1.1.16"
},
Comment on lines +17 to +22
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

manifest="$(fd -a '^package\.json$' packages/recognize | head -n 1)"
sdk_dts="$(fd -a '^index\.d\.ts$' packages/recognize/src/lib/recognize-sdk | head -n 1)"

echo "Package manifest: $manifest"
jq '{dependencies, peerDependencies, devDependencies}' "$manifest"

echo
echo "External imports used by recognize-sdk declaration:"
rg -n "from '(@[^']+|[^./][^']*)'" "$sdk_dts" -o --replace '$1' | sort -u

Repository: ForgeRock/ping-javascript-sdk

Length of output: 1419


Add missing SDK dependencies to package.json.

The copied recognize-sdk declarations import several packages (@aracna/web-components, @aracna/core, @keyless/sdk-web, lit, motion, @ua-parser-js/pro-enterprise) that are not listed in dependencies or peerDependencies. Consumers will lack these packages at runtime and during type checking. Declare them as dependencies or peer dependencies.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/recognize/package.json` around lines 17 - 22, Add the missing
runtime/type dependencies referenced by the recognize-sdk imports to
package.json: declare `@aracna/web-components`, `@aracna/core`, `@keyless/sdk-web`,
lit, motion, and `@ua-parser-js/pro-enterprise` under either "dependencies" or
"peerDependencies" (choose peerDependencies if these should be provided by
consumers, otherwise dependencies to bundle them), ensuring the package names
match the imports used by the SDK so consumers have the packages available at
runtime and for type checking.

"nx": {
"tags": ["scope:package"],
"targets": {
"build": {
"executor": "@nx/js:tsc",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "packages/recognize/dist",
"main": "packages/recognize/src/index.ts",
"tsConfig": "packages/recognize/tsconfig.lib.json",
"generatePackageJson": false,
"assets": [
{
"input": "packages/recognize/src/lib/recognize-sdk",
"glob": "**/*",
"output": "./src/lib/recognize-sdk"
}
]
}
}
}
}
}
1 change: 1 addition & 0 deletions packages/recognize/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './lib/recognize.js';
Loading
Loading