Skip to content

feat: rework igo-signal into igo-component#46

Open
mickael-coquer-igocreate wants to merge 2 commits intov6from
feat/igo-component
Open

feat: rework igo-signal into igo-component#46
mickael-coquer-igocreate wants to merge 2 commits intov6from
feat/igo-component

Conversation

@mickael-coquer-igocreate

Summary

  • Rename @igojs/signal package to @igojs/component to better reflect its purpose
  • Add ComponentLoader for automatic client-side component loading
  • Add ComponentController and ComponentHelper for server-side component rendering
  • Add ComponentSplitter in dust package for single-file component compilation
  • Update skeleton project and all references to use the new package name
  • Update documentation (README) for all packages
  • Fix bug in create.js (recursive replaceInDirectory missing replacements parameter)

Test plan

  • Run npm test to verify all existing tests pass
  • Verify ComponentHelperTest and ComponentSplitterTest pass
  • Test igo create scaffolding works correctly
  • Test SSR rendering with {@component} helper

🤖 Generated with Claude Code

@mickael-coquer-igocreate mickael-coquer-igocreate changed the title Rename @igojs/signal to @igojs/component feat: rework igo-signal into igo-component Mar 10, 2026
@mickael-coquer-igocreate mickael-coquer-igocreate force-pushed the feat/igo-component branch 2 times, most recently from 4586b2f to bf02b28 Compare March 10, 2026 14:12
@mickael-coquer-igocreate
Copy link
Author

Code review

Found 1 issue:

  1. Path traversal in templates endpoint -- The templates handler reads req.query.file directly without any validation, while the component endpoint right below it uses SAFE_NAME_RE and a .. check. A request like GET /__component/templates?file=../../../../etc/passwd would attempt to read an arbitrary .dust file on disk. The same SAFE_NAME_RE guard should be applied to templates.

const templates = async (req, res) => {
const file = req.query.file;
const source = await IgoDust.getSource(`${file}.dust`);
res.json({ file, source });
};
// Validate component name to prevent path traversal
const SAFE_NAME_RE = /^[a-zA-Z0-9_/-]+$/;
// Serve component data (script + template source) for client hydration
const component = async (req, res) => {
const name = req.query.name;
if (!name || !SAFE_NAME_RE.test(name) || name.includes('..')) {
return res.status(400).json({ error: 'Invalid component name' });
}

🤖 Generated with Claude Code

- If this code review was useful, please react with 👍. Otherwise, react with 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant