Skip to content

Commit

Permalink
feat: merge pull request #105 from nyaggah/develop
Browse files Browse the repository at this point in the history
feat: project gen updates; bump deps etc
  • Loading branch information
JoeyDoey authored Jul 15, 2023
2 parents 3d1c2ac + 558f631 commit 43941d4
Show file tree
Hide file tree
Showing 10 changed files with 196 additions and 304 deletions.
6 changes: 6 additions & 0 deletions .changeset/chilly-spoons-wash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@bedframe/core': patch
'@bedframe/cli': patch
---

project gen updates; bump deps etc
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"@changesets/cli": "^2.26.1",
"@commitlint/cli": "^17.4.4",
"@commitlint/config-conventional": "^17.6.3",
"@types/chrome": "^0.0.237",
"@types/chrome": "^0.0.241",
"@types/fs-extra": "^11.0.1",
"@types/node": "^16.18.36",
"@types/prompts": "^2.4.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"@rollup/plugin-json": "^6.0.0",
"@rollup/plugin-node-resolve": "^15.0.2",
"@rollup/plugin-typescript": "^11.1.0",
"@types/chrome": "^0.0.237",
"@types/chrome": "^0.0.241",
"@types/fs-extra": "^11.0.1",
"@types/listr": "^0.14.4",
"@types/node": "^16.18.36",
Expand Down
3 changes: 1 addition & 2 deletions packages/cli/public/stubs/tsconfig/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@
"noFallthroughCasesInSwitch": true,

/* Path aliases */
"baseUrl": ".",
"paths": {
"@/*": ["src/*"]
"@/*": ["./src/*"]
}
},
"include": ["src"],
Expand Down
10 changes: 6 additions & 4 deletions packages/cli/src/lib/write-bedframe-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,15 @@ import { getCustomFonts, getManifest, BuildConfig } from '@bedframe/core'
import { manifests } from './src/manifests'
export function createBedframeConfig({ command, mode }: BuildConfig): UserConfig {
const root = resolve(__dirname, './src')
const root = __dirname
const src = resolve(root, './src')
const outDir = resolve(root, 'dist', mode)
return {
root,
resolve: {
alias: {
'@': resolve(__dirname, './src'),
'@': src,
},
},
plugins: [
Expand All @@ -74,11 +76,11 @@ export function createBedframeConfig({ command, mode }: BuildConfig): UserConfig
rollupOptions: {
input: {${
extensionType === 'sidepanel'
? `welcome: resolve(root, 'sidepanels', 'welcome', 'index.html'),\nmain: resolve(root, 'sidepanels', 'main', 'index.html'),\n`
? `welcome: resolve(src, 'sidepanels', 'welcome', 'index.html'),\n`
: ''
}${
extensionType === 'devtools'
? `devtools: resolve(root, 'pages', 'devtools', 'sidepanel.html'),\n`
? `devtools: resolve(src, 'pages', 'devtools', 'sidepanel.html'),\n`
: ''
}${overridePage !== 'none' ? getOverridePage(overridePage) : ''}
},
Expand Down
20 changes: 10 additions & 10 deletions packages/cli/src/lib/write-manifests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ import {
import pkg from '../../package.json'
export const icons = createManifestIcons({
16: 'assets/icons/icon-16x16.png',
32: 'assets/icons/icon-32x32.png',
48: 'assets/icons/icon-48x48.png',
128: 'assets/icons/icon-128x128.png',
16: 'src/assets/icons/icon-16x16.png',
32: 'src/assets/icons/icon-32x32.png',
48: 'src/assets/icons/icon-48x48.png',
128: 'src/assets/icons/icon-128x128.png',
})
export const action: ManifestAction = {
Expand Down Expand Up @@ -86,11 +86,11 @@ export const contentScripts: ManifestContentScripts = [
export const webAccessibleResources: ManifestWebAccessibleResources = [
{
resources: [
'assets/icons/*.png',
'assets/fonts/inter/Inter-Bold.ttf',
'assets/fonts/inter/Inter-ExtraBold.ttf',
'assets/fonts/inter/Inter-Regular.ttf',
'assets/fonts/inter/Inter-SemiBold.ttf',
'src/assets/icons/*.png',
'src/assets/fonts/inter/Inter-Bold.ttf',
'src/assets/fonts/inter/Inter-ExtraBold.ttf',
'src/assets/fonts/inter/Inter-Regular.ttf',
'src/assets/fonts/inter/Inter-SemiBold.ttf',
],
matches: ['<all_urls>'],
},
Expand Down Expand Up @@ -165,7 +165,7 @@ export function manifestForBrowser(
const { name: extensionType } = type

const optionsUI = `options_ui: {
page: 'pages/options/index.html',
page: 'src/pages/options/index.html',
open_in_tab: false,
}`

Expand Down
8 changes: 2 additions & 6 deletions packages/cli/src/lib/write-package-json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,9 @@ export function createDependenciesFrom(response: prompts.Answers<string>): {
},
{
devDependencies: [
{ name: '@bedframe/core', version: '^0.0.17' },
{ name: '@bedframe/core', version: '^0.0.18' },
{ name: '@crxjs/vite-plugin', version: '^1.0.14' },
{ name: '@types/chrome', version: '^0.0.237' },
{ name: '@types/chrome', version: '^0.0.241' },
{ name: '@types/react', version: '^18.2.9' },
{ name: '@types/react-dom', version: '^18.2.4' },
{ name: '@types/react-frame-component', version: '^4.1.3' },
Expand All @@ -288,10 +288,6 @@ export function createDependenciesFrom(response: prompts.Answers<string>): {
{ name: 'eslint-plugin-react', version: '^7.32.2' },
{ name: 'eslint-plugin-react-hooks', version: '^4.6.0' },
{ name: 'eslint-plugin-react-refresh', version: '^0.4.1' },
// {
// name: 'eslint-config-standard-with-typescript',
// version: '^34.0.0',
// },
{ name: 'prettier', version: '^2.8.8' },
].sort((a, b) => a.name.localeCompare(b.name)),
},
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/lib/write-service-worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ const eventListeners = (isSidePanel: boolean) =>
onInstalled(isSidePanel) + onConnect + onStartup + onSuspend

const sidePanels = `
const welcomePanel = 'sidepanels/welcome/index.html'
const mainPanel = 'sidepanels/main/index.html'
const welcomePanel = 'src/sidepanels/welcome/index.html'
const mainPanel = 'src/sidepanels/main/index.html'
/**
* Fires when the active tab in a window changes.
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"@crxjs/vite-plugin": "^1.0.14"
},
"devDependencies": {
"@types/chrome": "^0.0.237",
"@types/chrome": "^0.0.241",
"@types/node": "^16.18.36",
"@typescript-eslint/eslint-plugin": "^5.59.8",
"@vitejs/plugin-react": "^4.0.1",
Expand Down
Loading

0 comments on commit 43941d4

Please sign in to comment.