Skip to content

Commit

Permalink
feat: add sumi icon
Browse files Browse the repository at this point in the history
  • Loading branch information
yantze committed Jan 17, 2022
1 parent 3d82e1d commit 6752733
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
Binary file added build/icon/sumi.ico
Binary file not shown.
Binary file added build/icon/sumi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 13 additions & 5 deletions build/pack.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ const rootPackage = require('../package.json');

const DEFAULT_TARGET_PLATFORM = 'darwin';

// 使用双 package.json 结构,自动处理 node_modules
// disable code sign
process.env.CSC_IDENTITY_AUTO_DISCOVERY = false;

// use double package.json structure, auto handle node_modules
fs.copyFileSync(path.join(__dirname, '../build/package.json'), path.join(__dirname, '../app/package.json'));

const targetPlatforms = (process.env.TARGET_PLATFORMS || DEFAULT_TARGET_PLATFORM).split(',').map((str) => str.trim());
Expand All @@ -26,8 +29,8 @@ electronBuilder.build({
publish: null,
targets: targets.size ? targets : undefined,
config: {
productName: 'OpenSumi-Desktop',
npmArgs: ['--registry=https://registry.npm.taobao.org'],
productName: 'OpenSumi',
npmArgs: ['--registry=https://registry.npmmirror.com'],
electronVersion: rootPackage.devDependencies.electron, // 根据前置 package.json 判断版本号即可
extraResources: [
{
Expand All @@ -40,12 +43,17 @@ electronBuilder.build({
output: path.join(__dirname, '../out/'),
},
asar: true,
asarUnpack: 'node_modules/vscode-ripgrep',
asarUnpack: [
'node_modules/@opensumi/vscode-ripgrep',
],
mac: {
icon: 'build/icon/sumi.png',
artifactName: '${productName}-Desktop-${version}.${ext}',
target: 'dmg',
},
win: {
artifactName: '${productName}-${version}.${ext}',
artifactName: '${productName}-Desktop-${version}.${ext}',
icon: 'build/icon/sumi.ico',
target: [{
target: 'nsis',
arch: ['x64'],
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ide-electron",
"version": "1.0.1",
"version": "1.0.3",
"description": "OpenSumi IDE Electron 示例项目",
"main": "./app/main/index.js",
"scripts": {
Expand All @@ -26,7 +26,7 @@
"watch": "run-p watch:*",
"build": "rimraf -rf ./app && rimraf -rf ./out && run-p build:*",
"build-prod": "rimraf -rf ./app && rimraf -rf ./out && run-p build-prod:*",
"pack": "npm run build-prod && CSC_IDENTITY_AUTO_DISCOVERY=false node build/pack.js",
"pack": "npm run build-prod && node build/pack.js",
"rebuild-native": "node ./scripts/rebuild-native.js --target=electron",
"download-extension": "node scripts/download.js"
},
Expand Down Expand Up @@ -128,4 +128,4 @@
"webpack": "^4.46.0",
"webpack-cli": "^4.9.1"
}
}
}

0 comments on commit 6752733

Please sign in to comment.