Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
7780380
Updated STAN
jasongalvin Aug 29, 2025
06c2075
feat: convert to React 18 component template
jasongalvin Aug 29, 2025
fede91a
fix: clean lint and TS for React component template
jasongalvin Aug 29, 2025
8a6424f
chore: switch to TS ESLint flat config; fix lint/TS friction
jasongalvin Aug 29, 2025
1144b8f
Fix vitest typescript error
jasongalvin Aug 29, 2025
24e0dbe
docs: rewrite README for React component template
jasongalvin Aug 29, 2025
c8dee9f
Update docs
jasongalvin Aug 30, 2025
af01fc1
Node 20 compatibility fix and update Rollup config
jasongalvin Aug 30, 2025
a631efa
Revert the Rollup configuration file back to TS
jasongalvin Aug 31, 2025
6f8d5b5
Update docs
jasongalvin Aug 31, 2025
f6677cb
tests: add entry tests; edge cases; tweak cov
jasongalvin Aug 31, 2025
f9f1dfb
Fix failing test
jasongalvin Aug 31, 2025
bfb97b4
Update github urls in package.json
jasongalvin Aug 31, 2025
ce46b97
Update package-lock.json
jasongalvin Aug 31, 2025
6376dfc
docs: add “How to use this template” section
jasongalvin Aug 31, 2025
ce300b0
Improved cross-platform config
karmaniverous Aug 31, 2025
366bf65
fix: set tsconfigRootDir to fix Windows lint
karmaniverous Aug 31, 2025
08afae7
chore: lint playground and drop hook proposal
karmaniverous Aug 31, 2025
a7d5cba
lintfix
karmaniverous Aug 31, 2025
10ad821
chore: dedupe ESLint config; share Prettier/sort
karmaniverous Aug 31, 2025
abd3826
Added license & updated README
karmaniverous Aug 31, 2025
c4e02f4
lintfix
karmaniverous Aug 31, 2025
6142d7e
docs(readme): add STAN + “In The Box” section
karmaniverous Aug 31, 2025
956bf53
updated docs
karmaniverous Aug 31, 2025
bd31c56
Update README.md
karmaniverous Aug 31, 2025
ab11e12
Update README.md
karmaniverous Aug 31, 2025
8c3e405
updated docs
karmaniverous Aug 31, 2025
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
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
end_of_line = lf
charset = utf-8
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 2
6 changes: 6 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Normalize text files to LF in the repo regardless of platform
* text=auto eol=lf

# Optional: allow CRLF where required on Windows scripts
*.bat text eol=crlf
*.cmd text eol=crlf
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ coverage/
dist/
esm/
node_modules/
context/
.stan/output/
.stan/diff/
.stan/dist/
Expand Down
Empty file modified .lefthook/pre-commit/branch-naming-policy
100644 → 100755
Empty file.
Empty file modified .lefthook/prepare-commit-msg/add-issue
100644 → 100755
Empty file.
4 changes: 3 additions & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"endOfLine": "crlf",
"embeddedLanguageFormatting": "auto",
"endOfLine": "lf",
"proseWrap": "never",
"singleQuote": true
}
2 changes: 1 addition & 1 deletion .stan/system/.docs.meta.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "0.4.0"
"version": "0.5.6"
}
49 changes: 49 additions & 0 deletions .stan/system/stan.project.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# stan.project.md — Project-specific requirements

When updated: 2025-08-29T00:00:00Z

Repository goal

- Provide a ready-to-use template for building and publishing React 18 component libraries using TypeScript.

Baseline decisions

- React
- Target React 18.
- Use the modern “react-jsx” runtime.
- Build outputs
- ESM-only. No CJS or IIFE bundles.
- ship types (.d.ts).
- Dependencies
- react and react-dom are peerDependencies (>=18).
- Also present as devDependencies for local development and playground.
- Mark package as "sideEffects": false (no global CSS side-effects).
- Linting
- TS-only rules; no react-specific eslint plugins for now.
- Playground IS included in lint/Prettier scope (treat as first-class source). Exclude only generated output: dist/, docs/, coverage/, .rollup.cache/, .stan/, context/, diagrams/out/.
- Flat config in eslint.config.ts (TypeScript), executed via `node --loader tsx` in npm scripts.
- Windows: set ESLint languageOptions.parserOptions.tsconfigRootDir to path.resolve() to avoid a known typescript-eslint path bug affecting tsconfigRootDir resolution on Windows.
- Limit lint to non-generated code; exclude dist/, docs/, coverage/, .rollup.cache/, .stan/, context/, and diagrams/out/.
- Line endings (cross-platform): enforce LF-only in the repo via .gitattributes, .editorconfig, and Prettier (endOfLine: "lf"). If CRLF noise appears locally, normalize once: • git add --renormalize . • npm run lint:fix Editors with Prettier on save should keep files normalized.
- Tests linted with Vitest recommended rules (non type-checked).
- Testing
- Vitest with happy-dom environment (project default).
- @testing-library/react and @testing-library/jest-dom for component tests.
- jest-dom is registered via vitest.setup.ts.
- Dev preview
- Vite playground under /playground for interactive browser viewing.
- Playground is excluded from npm package (files: ["dist"]) and from typecheck.
- Source layout
- Components under src/components.
- Public entry at src/index.ts re-exports components.
- Removed legacy pieces
- CLI example and related build logic removed.
- No IIFE browser bundle.
- Docs
- Keep TypeDoc for API docs; entry remains src/index.ts.

Operational notes

- Rollup marks react and react/jsx-runtime as externals.
- Keep release and docs scripts; they may be adjusted later as needed.
- Consider adding Storybook or Ladle later if richer docs are required.
1 change: 0 additions & 1 deletion .stan/system/stan.project.template.md

This file was deleted.

37 changes: 37 additions & 0 deletions .stan/system/stan.todo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
When updated: 2025-08-31T00:28:00Z

Next up

- Run: npm install to ensure new devDependencies (react, react-dom, @types/react, @types/react-dom, vite, @vitejs/plugin-react, @testing-library/\*, tsx) are installed before running test/docs/typecheck.
- Optionally add story tooling (Storybook or Ladle) if docs scale up.
- Consider pruning unused devDependencies flagged by knip.
- Re-run: npm run lint to confirm the Windows tseslint parser fix.
- Normalize line endings to LF if you see CRLF noise: • git add --renormalize . • npm run lint:fix • commit the normalization
- Verify lint includes /playground and excludes only generated output.

Completed (recent)

- Deduped ESLint config: shared Prettier/import-sort for JS/TS; kept TS-specific rules; expanded Vitest test globs to include JS.
- Fixed ESLint parser error on Windows by setting parserOptions.tsconfigRootDir = path.resolve() in eslint.config.ts.
- Clarified lint/format policy: include /playground; exclude generated outputs; rely on editor Prettier (no new Lefthook script).
- Added tests for library entry re-exports and HelloWorld edge cases.
- Tuned Vitest coverage to exclude docs/, dist/, and playground/ by default.
- Updated README test section with entry re-export example and coverage notes.
- Updated README to reflect React component template usage and features.
- Replaced eslint.config.js with eslint.config.ts (flat config), updated npm scripts to run ESLint via node --loader tsx.
- Scoped linting to avoid type-aware parse errors; ignore playground; tests use Vitest recommended rules (non type-checked).
- Excluded tests and playground from ts typecheck; removed jest-dom types from tsconfig to prevent build/docs errors if not installed.
- Excluded .rollup.cache from Vitest to avoid stale compiled tests.
- Excluded playground from lint/typecheck to reduce false positives.
- Added vitest.setup.ts and configured jest-dom globally.
- Fixed unsafe return by typing HelloWorld return to JSX.Element.
- Sorted imports and simplified tests.
- Updated stan.config.yml to use standard build script.
- Converted template to React 18 with react-jsx runtime.
- Switched to ESM-only build; removed CJS/IIFE and CLI scaffold.
- Added Vite playground under /playground for browser preview.
- Added HelloWorld component + tests (Testing Library).
- Marked react/react-dom as peerDependencies; set sideEffects: false.
- Updated rollup config to externalize react & react/jsx-runtime.
- Kept TypeDoc; preserved Vitest + happy-dom environment.
- Updated package/repository metadata placeholders.
8 changes: 4 additions & 4 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
"recommendations": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"vitest.explorer",
"github.vscode-github-actions",
"gruntfuggly.todo-tree",
"jebbs.plantuml",
"redhat.vscode-yaml",
"gruntfuggly.todo-tree",
"github.vscode-github-actions"
"vitest.explorer"
]
}
}
8 changes: 4 additions & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@
"typescript",
"typescriptreact"
],
"files.eol": "\n",
"files.insertFinalNewline": true,
"git.autofetch": true,
"git.enableSmartCommit": true,
"javascript.preferences.importModuleSpecifierEnding": "minimal",
"javascript.updateImportsOnFileMove.enabled": "always",
"plantuml.diagramsRoot": "diagrams/src",
"plantuml.diagramsRoot": "diagrams",
"plantuml.exportFormat": "",
"plantuml.exportIncludeFolderHeirarchy": true,
"plantuml.exportOutDir": "diagrams/out",
"plantuml.exportOutDir": "assets",
"plantuml.exportSubFolder": false,
"plantuml.render": "Local",
"prettier.prettierPath": "./node_modules/prettier",
"prettier.singleQuote": true,
"todo-tree.filtering.ignoreGitSubmodules": false,
"todo-tree.filtering.includeHiddenFiles": false,
"todo-tree.general.showActivityBarBadge": true,
Expand Down
Loading