Skip to content

feat: Add TypeScript CLI, templates, and CI - #1

Merged
lasalasa merged 11 commits into
mainfrom
feature/add-typescript-cli
Mar 27, 2026
Merged

lasalasa merged 11 commits into
mainfrom
feature/add-typescript-cli

Conversation

@lasalasa

@lasalasa lasalasa commented Mar 27, 2026 •

Copy link
Copy Markdown
Member

📝 Description

🔗 Related Issue

Fixes

Remove test-firefox template and update configs
Format code and templates for consistency

🏷️ Type of Change

  • ✨ Migrate the project to a TypeScript-based CLI and scaffold system.
  • ✨ Add multi-browser templates and browser selection

🧪 How Has This Been Tested?

  • Unit Tests
  • Manual Verification - Tested with Chrome, Microsoft edge and Firfox.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 old extension-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.ts uses __dirname but does not define it. Since the generated Vite project is ESM by default, __dirname will be undefined and Vite config loading will fail. Compute the directory from import.meta.url or refactor to avoid needing __dirname when resolving inputs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/CONTRIBUTING.md Outdated
Comment thread package.json Outdated
Comment thread eslint.config.js Outdated
Comment thread src/generators/extension.ts
Comment thread src/generators/extension.ts
Comment thread src/templates/firefox/src/manifest.json
Comment thread vitest.config.ts
Comment thread src/templates/firefox/vite.config.ts
Comment thread README.md Outdated
lasalasa and others added 5 commits March 27, 2026 13:53
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment thread src/commands/create.ts
Comment thread src/cli.ts Outdated
Comment thread src/utils/logger.ts
Comment thread src/templates/firefox/src/manifest.json
@lasalasa
lasalasa merged commit f645558 into main Mar 27, 2026
2 checks passed
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.

2 participants