Skip to content

Commit

Permalink
Merge pull request #395 from nyaggah/develop
Browse files Browse the repository at this point in the history
feat(project-gen): bump project-gen packages to latest; code clean up
  • Loading branch information
JoeyDoey authored Mar 25, 2024
2 parents d828ff9 + 752c6cf commit 39c6c98
Show file tree
Hide file tree
Showing 10 changed files with 947 additions and 519 deletions.
6 changes: 6 additions & 0 deletions .changeset/five-jobs-retire.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@bedframe/core": patch
"@bedframe/cli": patch
---

bump project-gen packages to latest
10 changes: 5 additions & 5 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,26 +36,26 @@
},
"dependencies": {
"@bedframe/core": "workspace:*",
"commander": "^11.1.0",
"commander": "^12.0.0",
"execa": "^8.0.1",
"kolorist": "^1.8.0",
"listr": "^0.14.3",
"nanospinner": "^1.1.0",
"node-fetch": "^3.3.2",
"pkg-install": "^1.0.0",
"prompts": "^2.4.2",
"vite": "^4.5.2"
"vite": "^5.2.6"
},
"devDependencies": {
"@commander-js/extra-typings": "^11.1.0",
"@commander-js/extra-typings": "^12.0.1",
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-typescript": "^11.1.6",
"@types/chrome": "^0.0.263",
"@types/listr": "^0.14.9",
"@types/node": "^20.11.30",
"@types/prompts": "^2.4.9",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/eslint-plugin": "^7.3.1",
"concurrently": "^8.2.2",
"eslint-config-bedframe": "workspace:^",
"eslint-config-turbo": "^1.13.0",
Expand All @@ -66,7 +66,7 @@
"rollup-plugin-string": "^3.0.0",
"ts-node": "^10.9.2",
"tsconfig-paths": "^4.2.0",
"tsx": "^3.14.0",
"tsx": "^4.7.1",
"typescript": "^5.4.3"
},
"lint-staged": {
Expand Down
55 changes: 18 additions & 37 deletions packages/cli/src/commands/make.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,62 +12,43 @@ makeCommand
// B R O W S E R
.option(
'-b, --browsers <browsers>',
`specify comma-separated list browsers (${dim('chrome, edge, firefox')})`,
`comma-separated list browsers (${dim('chrome, edge, firefox, etc')})`,
)

// E X T E N S I O N
.option(
'-v, --version <version>',
`specify project version (${dim('0.0.1')})`,
)
.option('-d, --description <description>', 'specify project description')
.option('-v, --version <version>', `project version (${dim('0.0.1')})`)
.option('-d, --description <description>', 'project description')
.option(
'-a, --author <author>',
`specify project author (${dim('name, email, url')})`,
)
.option('--license <license>', `specify project license (${dim('MIT')})`)
.option('-p, --private', `specify visibility of project (${dim('true')})`)
.option('-t, --type <type>', `specify extension type (${dim('popup')})`)
.option(
'--position <position>',
`specify overlay extension position (${dim('center')})`,
)
.option(
'--override <override>',
`specify page to override (${dim('newtab')})`,
`project author (${dim('name, email, url')})`,
)
.option('--license <license>', `project license (${dim('MIT')})`)
.option('-r, --private', `visibility of project (${dim('true')})`)
.option('-t, --type <type>', `extension type (${dim('popup')})`)
.option('--override <override>', `page to override (${dim('newtab')})`)
.option(
'--options <options>',
`specify whether to and how render options (${dim('embedded')})`,
`whether to and how render options (${dim('embedded')})`,
)

// D E V E L O P M E N T
.option(
'-p, --packageManager <packageManager>',
`Specify package manager to use (${dim('pnpm')})`,
)
.option(
'-f, --framework <framework>',
`specify framework to use (${dim('react')})`,
)
.option(
'-l, --language <language>',
`specify language to use (${dim('typescript')})`,
)
.option(
'-s, --style <style>',
`specify CSS framework to use (${dim('tailwind')})`,
`package manager to use (${dim('pnpm')})`,
)
.option('-f, --framework <framework>', `framework to use (${dim('react')})`)
.option('-l, --language <language>', `language to use (${dim('typescript')})`)
.option('-s, --style <style>', `css framework to use (${dim('tailwind')})`)
.option('-o, --lintFormat', `add linting with formatting (${dim('true')})`)
.option(
'-t, --tests',
'-e, --tests',
`add tests (vitest + testing library) (${dim('true')})`,
)
.option('-g, --git', `initialize git for source control (${dim('true')})`)
.option('-h, --gitHooks', `add git hooks (${dim('true')})`)
.option('-c, --commitLint', `add commit linting (${dim('true')})`)
.option('-x, --changesets', `add changesets (${dim('true')})`)
.option('-i, --installDeps', `add & install dependencies (${dim('true')})`)
.option('-h, --gitHooks', `use git hooks (${dim('true')})`)
.option('-c, --commitLint', `use commit linting (${dim('true')})`)
.option('-x, --changesets', `use changesets (${dim('true')})`)
.option('-i, --installDeps', `install dependencies (${dim('true')})`)
.option(
'-y, --yes',
`make your BED w/ preconfigured defaults (${dim('false')})`,
Expand Down
9 changes: 5 additions & 4 deletions packages/cli/src/commands/publish.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Command } from 'commander'
import {
dim,
lightCyan,
lightGreen,
lightMagenta,
Expand Down Expand Up @@ -253,10 +254,10 @@ async function uploadToEdge(config: EdgeUploadConfig, source: string) {
export const publishCommand = new Command('publish')
.command('publish')
.description(
`publish new or update existing extension(s)
├ • C W S: Chrome Web Store
├ • A M O: Mozilla/Firefox Add-ons
└ • M E A: MS Edge Add-ons`,
`publish new or update existing extension(s)
- chrome: Chrome Web Store (C W S)
- firefox: Mozilla/Firefox Add-ons (A M O)
- edge: MS Edge Add-ons (M E A)`,
)
.option(
'-b, --browsers <browsers...>',
Expand Down
4 changes: 1 addition & 3 deletions packages/cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { Command } from 'commander'
import { readFileSync } from 'node:fs'
import {
buildCommand,
codeModCommand,
devCommand,
makeCommand,
publishCommand,
Expand All @@ -22,7 +21,7 @@ program
.version(`${pkg.name}@${pkg.version}`)
.enablePositionalOptions()
.passThroughOptions()
.addHelpText('beforeAll', promptsIntro())
.addHelpText('beforeAll', promptsIntro(pkg.name, pkg.version))

program
.addCommand(makeCommand)
Expand All @@ -31,7 +30,6 @@ program

.addCommand(devCommand)
.addCommand(buildCommand)
.addCommand(codeModCommand)
.addCommand(zipCommand)

export async function run() {
Expand Down
5 changes: 4 additions & 1 deletion packages/cli/src/lib/make/prompts/prompts-intro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,16 @@ import {
* @export
* @return {*} {string}
*/
export function promptsIntro(): string {
export function promptsIntro(name?: string, version?: string): string {
return `
${bold(dim('>_'))}
${lightMagenta('B R O W S E R')}
${lightGreen('E X T E N S I O N')}
${lightCyan('D E V E L O P M E N T')}
${lightYellow('F R A M E W O R K')}
${name && version ? `${name} v${version}` : ''}
`
}
2 changes: 1 addition & 1 deletion packages/cli/src/lib/make/utils/write-manifests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export function manifestForBrowser(
const firefoxManifest = `import { type Manifest, createManifest } from '@bedframe/core'
import { baseManifest } from './base.manifest'
const { ${optionsUIorPage}${
const { ${optionsPage !== 'none' ? optionsUIorPage : ''}${
extensionType === 'sidepanel' ? ', side_panel' : ''
}, ...rest } = baseManifest
Expand Down
80 changes: 39 additions & 41 deletions packages/cli/src/lib/make/utils/write-package-json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,48 +78,46 @@ export function writePackageJson(response: prompts.Answers<string>): void {
},
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-frame-component": "^5.2.6",${
"react-dom": "^18.2.0",${
isStyle.tailwind
? `\n"@radix-ui/react-dropdown-menu": "^2.0.5",
? `\n"@radix-ui/react-dropdown-menu": "^2.0.6",
"@radix-ui/react-icons": "^1.3.0",
"@radix-ui/react-menubar": "^1.0.3",
"@radix-ui/react-navigation-menu": "^1.1.3",
"@radix-ui/react-menubar": "^1.0.4",
"@radix-ui/react-navigation-menu": "^1.1.4",
"@radix-ui/react-slot": "^1.0.2",
"@radix-ui/react-tabs": "^1.0.4",
"class-variance-authority": "^0.7.0",
"clsx": "^2.0.0",
"lucide-react": "^0.271.0",
"react-icons": "^4.10.1",
"tailwind-merge": "^1.14.0",
"clsx": "^2.1.0",
"lucide-react": "^0.363.0",
"react-icons": "^5.0.1",
"tailwind-merge": "^2.2.2",
"tailwindcss-animate": "^1.0.7"`
: ''
}
},
"devDependencies": {
"@bedframe/cli": "^0.0.76",
"@bedframe/core": "^0.0.40",${
"@bedframe/cli": "^0.0.77",
"@bedframe/core": "^0.0.41",${
changesets
? `\n"@changesets/cli": "^2.26.2",
"@commitlint/cli": "^17.7.1",
"@commitlint/config-conventional": "^17.7.0",`
? `\n"@changesets/cli": "^2.27.1",
"@commitlint/cli": "^19.2.1",
"@commitlint/config-conventional": "^19.1.0",`
: ''
}${
hasTests
? `\n"@testing-library/jest-dom": "^6.1.2",
"@testing-library/react": "^14.0.0",
"@testing-library/user-event": "^14.4.3",
"@types/jest": "^29.5.4",
"happy-dom": "^12.9.1",
"vitest": "^0.34.3",
"@vitest/coverage-istanbul": "^0.34.3",`
? `\n"@testing-library/jest-dom": "^6.4.2",
"@testing-library/react": "^14.2.2",
"@testing-library/user-event": "^14.5.2",
"@types/jest": "^29.5.12",
"happy-dom": "^14.3.6",
"vitest": "^1.4.0",
"@vitest/coverage-istanbul": "^1.4.0",`
: ''
}
"@types/node": "^20.8.7",
"@types/chrome": "^0.0.248",
"@types/react": "^18.2.21",
"@types/react-dom": "^18.2.7",
"@types/react-frame-component": "^4.1.3",
"@types/node": "^20.11.30",
"@types/chrome": "^0.0.263",
"@types/react": "^18.2.69",
"@types/react-dom": "^18.2.22",
"@vitejs/plugin-react": "^4.0.4",
"concurrently": "^8.2.1",${
commitLint
Expand All @@ -128,27 +126,27 @@ export function writePackageJson(response: prompts.Answers<string>): void {
: ''
}${
lintFormat
? `\n"@typescript-eslint/eslint-plugin": "^6.5.0",
"eslint": "^8.48.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-n": "^16.0.2",
? `\n"@typescript-eslint/eslint-plugin": "^7.3.1",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-n": "^16.6.2",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react": "^7.34.1",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.3",
"lint-staged": "^14.0.1",
"eslint-plugin-react-refresh": "^0.4.6",
"lint-staged": "^15.2.2",
"prettier": "^3.0.3",`
: ''
}${gitHooks ? `\n"husky": "^8.0.3",` : ''}${
}${gitHooks ? `\n"husky": "^9.0.11",` : ''}${
isStyle.tailwind
? `\n"autoprefixer": "^10.4.15",
"postcss": "^8.4.31",
"tailwindcss": "^3.3.3",`
? `\n"autoprefixer": "^10.4.19",
"postcss": "^8.4.38",
"tailwindcss": "^3.4.1",`
: ''
}${language.toLowerCase() === 'typescript' ? `\n"typescript": "^5.2.2",` : ''}
"unplugin-fonts": "^1.0.3",
"vite": "^4.5.0"
}${language.toLowerCase() === 'typescript' ? `\n"typescript": "^5.4.3",` : ''}
"unplugin-fonts": "^1.1.1",
"vite": "^5.2.6"
}${lintFormat ? ',' : ''}${
lintFormat
? `"eslintConfig": {
Expand Down
4 changes: 2 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"devDependencies": {
"@types/chrome": "^0.0.263",
"@types/node": "^20.11.30",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/eslint-plugin": "^7.3.1",
"@vitejs/plugin-react": "^4.2.1",
"eslint-config-bedframe": "workspace:^",
"eslint-config-turbo": "^1.13.0",
Expand All @@ -47,7 +47,7 @@
"tslib": "^2.6.2",
"typescript": "^5.4.3",
"unplugin-fonts": "^1.1.1",
"vite": "^4.5.2",
"vite": "^5.2.6",
"vite-plugin-babel-macros": "^1.0.6"
},
"peerDependencies": {
Expand Down
Loading

0 comments on commit 39c6c98

Please sign in to comment.