Repository navigation
feat: Add TypeScript CLI, templates, and CI - #1
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR migrates create-vextro from a legacy JS CLI + extension-structure/ folder into a TypeScript-based CLI/generator that scaffolds browser-extension projects for Chrome/Edge and Firefox, along with formatting/linting/testing and CI workflows.
Changes:
- Introduces a TypeScript CLI (Commander) with prompts, validation, logging, and an extension generator.
- Adds shared + browser-specific templates under
src/templates/and removes the oldextension-structure/contents. - Adds build/test tooling (tsup, vitest, eslint/prettier), docs, changelog, and GitHub Actions CI/release workflows.
Reviewed changes
Copilot reviewed 52 out of 59 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| vitest.config.ts | Adds Vitest configuration for unit tests. |
| tsup.config.ts | Adds tsup build configuration for compiling the CLI to dist/. |
| tsconfig.json | Adds strict TS compiler configuration for the CLI source. |
| tests/unit/validator.test.ts | Adds unit tests for project-name and Node-version validation. |
| tests/unit/cli.test.ts | Adds unit tests for CLI structure/options. |
| src/utils/validator.ts | Adds validation helpers (project name, directory existence, Node version). |
| src/utils/logger.ts | Adds logging/spinner helpers (chalk + ora) and verbose mode. |
| src/utils/index.ts | Re-exports utilities for cleaner imports. |
| src/utils/file.ts | Adds filesystem helpers and template directory resolution. |
| src/types/index.ts | Adds shared types for CLI options and generator config. |
| src/templates/shared/src/utils/storage.ts | Adds typed chrome.storage.sync helper wrappers for generated projects. |
| src/templates/shared/src/styles.css | Adds Tailwind CSS entrypoint for generated projects. |
| src/templates/shared/src/popup/popup.html | Adds popup HTML entry for generated projects. |
| src/templates/shared/src/popup/index.tsx | Formats popup React entrypoint. |
| src/templates/shared/src/popup/App.tsx | Adds popup UI demo (storage-backed counter + options link). |
| src/templates/shared/src/options/options.html | Adds options HTML entry for generated projects. |
| src/templates/shared/src/options/index.tsx | Formats options React entrypoint. |
| src/templates/shared/src/options/App.tsx | Adds options UI demo (storage-backed greeting editor). |
| src/templates/shared/public/icons/icon48.png | Adds shared template icon asset. |
| src/templates/shared/public/icons/icon16.png | Adds shared template icon asset. |
| src/templates/shared/public/icons/icon128.png | Adds shared template icon asset. |
| src/templates/shared/public/icon.png | Adds shared template icon asset. |
| src/templates/firefox/vite.config.ts | Adds Firefox Vite template config (vite-plugin-web-extension). |
| src/templates/firefox/src/manifest.json | Adds Firefox MV3 manifest template. |
| src/templates/firefox/src/content/content.ts | Adds Firefox content-script template. |
| src/templates/firefox/src/background/background.ts | Adds Firefox background template. |
| src/templates/chrome/vite.config.ts | Updates Chrome Vite template config formatting and inputs. |
| src/templates/chrome/src/manifest.ts | Adds typed Chrome MV3 manifest template (CRXJS). |
| src/templates/chrome/src/content/content.ts | Adds Chrome content-script template. |
| src/templates/chrome/src/background/background.ts | Adds Chrome background service worker template. |
| src/prompts/index.ts | Adds interactive prompts for project name and browser selection. |
| src/index.ts | Adds CLI entrypoint that creates/parses the program. |
| src/generators/extension.ts | Adds generator logic to scaffold Vite project, copy templates, patch configs, and install deps. |
| src/constants.ts | Adds shared constants (branding, defaults, browser metadata, deps, file removal list). |
| src/commands/create.ts | Adds create command implementation (flags, prompts, force/cleanup flow). |
| src/cli.ts | Adds Commander program wiring, default command, and --verbose hook. |
| package.json | Updates package metadata for TS build output, scripts, engines, deps, and publish files. |
| extension-structure/src/utils/apiClient.ts | Removes legacy placeholder demo file. |
| extension-structure/src/styles.css | Removes legacy Tailwind entrypoint in old structure. |
| extension-structure/src/popup/popup.html | Removes legacy popup HTML in old structure. |
| extension-structure/src/popup/App.tsx | Removes legacy popup React app in old structure. |
| extension-structure/src/options/options.html | Removes legacy options HTML in old structure. |
| extension-structure/src/options/App.tsx | Removes legacy options React app in old structure. |
| extension-structure/src/manifest.ts | Removes legacy manifest template in old structure. |
| extension-structure/src/content/content.ts | Removes legacy content-script template in old structure. |
| extension-structure/src/background/background.ts | Removes legacy background template in old structure. |
| eslint.config.js | Adds ESLint configuration using typescript-eslint. |
| docs/CONTRIBUTING.md | Adds contribution guide and repo structure overview. |
| bin/cli.js | Removes legacy JS CLI entrypoint. |
| README.md | Updates README for new CLI usage and multi-browser support. |
| CHANGELOG.md | Adds changelog entry describing the migration and new features. |
| .prettierrc | Adds Prettier configuration. |
| .prettierignore | Adds Prettier ignore rules. |
| .npmignore | Updates npm ignore rules to publish compiled output + templates only. |
| .github/workflows/release.yml | Adds workflow to publish package on tags. |
| .github/workflows/ci.yml | Adds CI workflow (typecheck, lint, format check, build, test). |
| .github/PULL_REQUEST_TEMPLATE.md | Adds PR template. |
| .changeset/config.json | Adds Changesets configuration for version management. |
Comments suppressed due to low confidence (1)
src/templates/chrome/vite.config.ts:16
vite.config.tsuses__dirnamebut does not define it. Since the generated Vite project is ESM by default,__dirnamewill be undefined and Vite config loading will fail. Compute the directory fromimport.meta.urlor refactor to avoid needing__dirnamewhen resolving inputs.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 52 out of 59 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 Description
🔗 Related Issue
Fixes
Remove test-firefox template and update configs
Format code and templates for consistency
🏷️ Type of Change
🧪 How Has This Been Tested?