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
44 changes: 44 additions & 0 deletions apps/find-orphans/.env.seed.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Configuration for scripts/seed-test-data.mjs. Copy to .env.seed and fill in
# the target space. The access token is read from .env if it is not set here.
# Use a dedicated TEST space: cleanup deletes by the seedTestData tag and
# removes the seedOrphanTest content type.

# CMA token with write access to the space below. Falls back to the
# CONTENTFUL_ACCESS_TOKEN in .env when omitted.
# CONTENTFUL_ACCESS_TOKEN=

CONTENTFUL_SPACE_ID=
CONTENTFUL_ENVIRONMENT_ID=master

# --- What to create (all optional; defaults shown) ------------------------
# Every item is tagged `seedTestData` so cleanup can remove it exactly.

# Drafts with no title: found by the "untitled" scan criterion.
SEED_UNTITLED_DRAFTS=200

# Drafts with a title and no inbound links: found by "unreferenced" only.
SEED_TITLED_DRAFTS=100

# Titled drafts that published container entries link to: these must be
# EXCLUDED by the unreferenced scan, which is what proves the link check.
SEED_REFERENCED_DRAFTS=25

# Published filler entries, excluded from every scan. Raise this to test
# whether total space size affects scan behavior: it adds no API calls (the
# draft filter is server-side) but grows the corpus the links_to_entry
# reference searches run over, and it counts toward the plan record limit.
SEED_PUBLISHED_ENTRIES=0

# Untitled, fileless draft assets with no inbound links: found by both
# criteria when asset scanning is enabled.
SEED_DRAFT_ASSETS=50

# Untitled draft assets that containers link to: excluded by "unreferenced".
SEED_REFERENCED_ASSETS=10

# Fraction of untitled/titled drafts that get a second save, so the scan's
# "never edited" filter has both version-1 and edited items to distinguish.
SEED_EDITED_FRACTION=0.25

# Concurrent CMA requests, capped at 7 (the per-space rate limit per second).
SEED_CONCURRENCY=5
3 changes: 3 additions & 0 deletions apps/find-orphans/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Seed-script config holds a CMA token and a test space id; keep it local.
# (.env is already ignored by the repo-root .gitignore.)
.env.seed
302 changes: 302 additions & 0 deletions apps/find-orphans/AGENTS.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions apps/find-orphans/CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@AGENTS.md
241 changes: 241 additions & 0 deletions apps/find-orphans/README.md

Large diffs are not rendered by default.

59 changes: 59 additions & 0 deletions apps/find-orphans/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import js from '@eslint/js';
import globals from 'globals';
import tseslint from 'typescript-eslint';
import pluginReact from 'eslint-plugin-react';
import pluginReactHooks from 'eslint-plugin-react-hooks';
import unusedImports from 'eslint-plugin-unused-imports';
import { defineConfig, globalIgnores } from 'eslint/config';

// Modeled on apps/auto-prefix (the repo's ESLint 9 flat-config reference),
// plus react-hooks: this app is orchestrated almost entirely through
// useCallback/useMemo, so exhaustive-deps is the lint rule most likely to
// catch a real bug here.
export default defineConfig([
globalIgnores(['**/build/']),
{
settings: {
react: {
version: 'detect',
},
},
},
{
files: ['**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
plugins: { js },
extends: ['js/recommended'],
languageOptions: { globals: globals.browser },
},
{
// The seed/upload scripts run under Node, not the browser.
files: ['scripts/**/*.mjs'],
languageOptions: { globals: globals.node },
},
tseslint.configs.recommended,
pluginReact.configs.flat.recommended,
pluginReactHooks.configs.flat['recommended-latest'],
{
plugins: {
'unused-imports': unusedImports,
},
rules: {
// The automatic JSX runtime makes React imports unnecessary.
'react/jsx-uses-react': 'off',
'react/react-in-jsx-scope': 'off',
// unused-imports subsumes the base rule and can auto-fix removals.
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'unused-imports/no-unused-imports': 'error',
'unused-imports/no-unused-vars': [
'warn',
{
vars: 'all',
varsIgnorePattern: '^_',
args: 'after-used',
argsIgnorePattern: '^_',
},
],
},
},
]);
12 changes: 12 additions & 0 deletions apps/find-orphans/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<script type="module" src="/src/index.tsx"></script>
</body>
</html>
Loading
Loading