Skip to content

Commit a69f685

Browse files
committed
Move browser build scripts into scripts directory and update their paths and version bump logging
- move `apps/browser/create-zip-archives.ts` and `apps/browser/create-zip-archives.ts` to scripts └── apps └── browser ├── .eslintrc.json ├── .gitignore ├── README.md ├── package.json ├── scripts │ ├── bump.js │ ├── create-firefox-build.ts │ └── create-zip-archives.ts ├── src │ ├── background │ │ ├── clear-chat-init-data.ts │ │ ├── config.ts │ │ ├── keep-alive.ts │ │ ├── main.ts │ │ ├── message-handler.ts │ │ └── websocket.ts │ ├── content-scripts │ │ └── send-prompt-content-script │ │ ├── chatbots │ │ │ ├── ai-studio.ts │ │ │ ├── arena.ts │ │ │ ├── chatgpt.ts │ │ │ ├── claude.ts │ │ │ ├── copilot.ts │ │ │ ├── deepseek.ts │ │ │ ├── doubao.ts │ │ │ ├── gemini.ts │ │ │ ├── github-copilot.ts │ │ │ ├── grok.ts │ │ │ ├── hugging-chat.ts │ │ │ ├── index.ts │ │ │ ├── kimi.ts │ │ │ ├── meta.ts │ │ │ ├── mistral.ts │ │ │ ├── open-webui.ts │ │ │ ├── openrouter.ts │ │ │ ├── qwen.ts │ │ │ ├── together.ts │ │ │ ├── yuanbao.ts │ │ │ └── z-ai.ts │ │ ├── constants │ │ │ ├── apply-response-icon.ts │ │ │ └── dictionary.ts │ │ ├── send-prompt-content-script.ts │ │ ├── types │ │ │ └── chatbot.ts │ │ └── utils │ │ ├── add-apply-response-button.ts │ │ ├── apply-response-styles.ts │ │ ├── logger.ts │ │ ├── report-initialization-error.ts │ │ ├── session-state.ts │ │ └── show-response-ready-notification.ts │ ├── fonts │ │ └── Bangers-Regular.ttf │ ├── icons │ │ ├── icon-128.png │ │ ├── icon-16.png │ │ ├── icon-32.png │ │ └── icon-48.png │ ├── manifest.json │ ├── types │ │ └── messages.ts │ ├── utils │ │ └── is-message.ts │ └── views │ └── popup │ ├── App.tsx │ ├── Popup.module.scss │ ├── Popup.tsx │ ├── index.css │ ├── index.html │ ├── use-browser-profile-name.ts │ └── use-firefox-containers.ts ├── tsconfig.json └── webpack.config.ts
1 parent f75392c commit a69f685

5 files changed

Lines changed: 18 additions & 12 deletions

File tree

‎apps/browser/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "gemini-coder-connector",
33
"scripts": {
4-
"build": "webpack --mode production && ts-node create-firefox-build.ts && ts-node create-zip-archives.ts",
4+
"build": "webpack --mode production && ts-node scripts/create-firefox-build.ts && ts-node scripts/create-zip-archives.ts",
55
"lint": "eslint src --ext ts,tsx",
66
"lint:fix": "eslint src --ext ts,tsx --fix",
77
"bump": "node scripts/bump.js"

‎apps/browser/scripts/bump.js‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,13 @@ const next_segment = last_segment + 1
1818
manifest.version = `${date_prefix}.${next_segment}`
1919

2020
fs.writeFileSync(manifest_path, JSON.stringify(manifest, null, 2) + '\n')
21-
console.log(`Bumped version to ${manifest.version}`)
21+
console.log(`Bump version of the browser extension to ${manifest.version}`)
2222

2323
try {
2424
execSync(`git add "${manifest_path}"`, { stdio: 'ignore' })
25-
execSync(`git commit --no-verify -m "Bump version to ${manifest.version}"`, { stdio: 'ignore' })
25+
execSync(`git commit --no-verify -m "Bump version to ${manifest.version}"`, {
26+
stdio: 'ignore'
27+
})
2628
console.log('Successfully committed the version bump.')
2729
} catch (error) {
2830
console.error('Failed to commit version bump:', error.message)

apps/browser/create-firefox-build.ts renamed to apps/browser/scripts/create-firefox-build.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as fs from 'fs'
22
import * as path from 'path'
33

4-
const manifest_path = path.join(__dirname, 'src', 'manifest.json')
4+
const manifest_path = path.join(__dirname, '..', 'src', 'manifest.json')
55
const manifest = JSON.parse(fs.readFileSync(manifest_path, 'utf8'))
66

77
const firefox_manifest: any = { ...manifest }
@@ -27,16 +27,17 @@ firefox_manifest.optional_permissions = ['cookies'] // Needed by Firefox Contain
2727

2828
delete firefox_manifest.host_permissions
2929

30-
const firefox_dist_dir = path.join(__dirname, 'dist-firefox')
30+
const firefox_dist_dir = path.join(__dirname, '..', 'dist-firefox')
3131
if (!fs.existsSync(firefox_dist_dir)) {
3232
fs.mkdirSync(firefox_dist_dir)
3333
}
3434

35-
const dist_dir = path.join(__dirname, 'dist')
35+
const dist_dir = path.join(__dirname, '..', 'dist')
3636
fs.cpSync(dist_dir, firefox_dist_dir, { recursive: true })
3737

3838
const firefox_manifest_path = path.join(
3939
__dirname,
40+
'..',
4041
'dist-firefox',
4142
'manifest.json'
4243
)

apps/browser/create-zip-archives.ts renamed to apps/browser/scripts/create-zip-archives.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as path from 'path'
33
import archiver from 'archiver'
44

55
const get_version = (): string => {
6-
const manifest_path = path.join(__dirname, 'src', 'manifest.json')
6+
const manifest_path = path.join(__dirname, '..', 'src', 'manifest.json')
77
const manifest = JSON.parse(fs.readFileSync(manifest_path, 'utf8'))
88
return manifest.version
99
}
@@ -28,14 +28,15 @@ const create_zip_from_directory = (
2828
const log = (message: string) => console.log(`[create-zip-archives] ${message}`)
2929

3030
const delete_old_zip_archives = (current_version: string) => {
31-
const files = fs.readdirSync(__dirname)
31+
const base_dir = path.join(__dirname, '..')
32+
const files = fs.readdirSync(base_dir)
3233
const zipPattern = /extension-(.+)-(chrome|firefox)\.zip$/
3334
let deletedFiles = 0
3435

3536
files.forEach((file) => {
3637
const match = file.match(zipPattern)
3738
if (match && match[1] !== current_version) {
38-
const filePath = path.join(__dirname, file)
39+
const filePath = path.join(base_dir, file)
3940
log(`Deleting old archive: ${file}`)
4041
fs.unlinkSync(filePath)
4142
deletedFiles++
@@ -48,7 +49,7 @@ const delete_old_zip_archives = (current_version: string) => {
4849
}
4950

5051
const main = async () => {
51-
const base_dir = __dirname
52+
const base_dir = path.join(__dirname, '..')
5253
const dist_dir = path.join(base_dir, 'dist')
5354
const firefox_dist_dir = path.join(base_dir, 'dist-firefox')
5455
const version = get_version()

‎apps/editor/scripts/bump.js‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,13 @@ const next_segment = last_segment + 1
1818
pkg.version = `${date_prefix}.${next_segment}`
1919

2020
fs.writeFileSync(pkg_path, JSON.stringify(pkg, null, 2) + '\n')
21-
console.log(`Bumped version to ${pkg.version}`)
21+
console.log(`Bump version of the VS Code extension to ${pkg.version}`)
2222

2323
try {
2424
execSync(`git add "${pkg_path}"`, { stdio: 'ignore' })
25-
execSync(`git commit --no-verify -m "Bump version to ${pkg.version}"`, { stdio: 'ignore' })
25+
execSync(`git commit --no-verify -m "Bump version to ${pkg.version}"`, {
26+
stdio: 'ignore'
27+
})
2628
console.log('Successfully committed the version bump.')
2729
} catch (error) {
2830
console.error('Failed to commit version bump:', error.message)

0 commit comments

Comments
 (0)