Skip to content

Commit

Permalink
feat: Add Mac specific dmg options
Browse files Browse the repository at this point in the history
  • Loading branch information
toxophilist committed Nov 13, 2024
1 parent 3ebd377 commit 6b58db0
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 25 deletions.
16 changes: 8 additions & 8 deletions ocd/packages/codegen-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
"compile": "tsc -p tsconfig.json && tsc -p tsconfig-cjs.json",
"build": "npm run compile && npm run pack",

"generate-ocd-svg-css-desktop": "node lib/esm/ocd-build-svg-css.js -d ../desktop/src/data -i ../desktop/src/css",
"generate-ocd-svg-css-desktop": "node lib/esm/ocd-build-svg-css.js -d ../react/src/data -i ../react/src/css",

"generate-ocd-build-date-desktop": "node lib/esm/ocd-set-build-date.js -d ../desktop/src/data -p ../desktop/package.json",
"generate-ocd-build-date-desktop": "node lib/esm/ocd-set-build-date.js -d ../react/src/data -p ../desktop/package.json",
"generate-ocd-build-date-export": "node lib/esm/ocd-set-build-date.js -d ../export/src/data -p ../desktop/package.json",
"generate-ocd-build-date": "npm run generate-ocd-build-date-desktop && npm run generate-ocd-build-date-export",

Expand All @@ -52,24 +52,24 @@

"generate-oci-markdown": "node lib/esm/ocd-codegen.js generate oci-markdown-js -s ./schema/oci-schema.json -d ../export/src/markdown/provider/oci",
"generate-oci-model": "node lib/esm/ocd-codegen.js generate oci-model-js -s ./schema/oci-schema.json -d ../model/src/provider/oci",
"generate-oci-properties": "node lib/esm/ocd-codegen.js generate oci-properties-js -s ./schema/oci-schema.json -d ../desktop/src/components/properties/provider/oci",
"generate-oci-tabular": "node lib/esm/ocd-codegen.js generate oci-tabular-js -s ./schema/oci-schema.json -d ../desktop/src/components/tabular/provider/oci",
"generate-oci-properties": "node lib/esm/ocd-codegen.js generate oci-properties-js -s ./schema/oci-schema.json -d ../react/src/components/properties/provider/oci",
"generate-oci-tabular": "node lib/esm/ocd-codegen.js generate oci-tabular-js -s ./schema/oci-schema.json -d ../react/src/components/tabular/provider/oci",
"generate-oci-terraform": "node lib/esm/ocd-codegen.js generate oci-terraform-js -s ./schema/oci-schema.json -d ../export/src/terraform/provider/oci",
"generate-oci-validator": "node lib/esm/ocd-codegen.js generate oci-validator-js -s ./schema/oci-schema.json -d ../model/src/validator/provider/oci",
"generate-oci": "npm run generate-oci-model && npm run generate-oci-markdown && npm run generate-oci-properties && npm run generate-oci-terraform && npm run generate-oci-tabular && npm run generate-oci-validator",

"generate-azurerm-markdown": "node lib/esm/ocd-codegen.js generate azurerm-markdown-js -f -s ./schema/azurerm-schema.json -d ../export/src/markdown/provider/azure",
"generate-azurerm-model": "node lib/esm/ocd-codegen.js generate azurerm-model-js -f -s ./schema/azurerm-schema.json -d ../model/src/provider/azure",
"generate-azurerm-properties": "node lib/esm/ocd-codegen.js generate azurerm-properties-js -f -s ./schema/azurerm-schema.json -d ../desktop/src/components/properties/provider/azure",
"generate-azurerm-tabular": "node lib/esm/ocd-codegen.js generate azurerm-tabular-js -f -s ./schema/azurerm-schema.json -d ../desktop/src/components/tabular/provider/azure",
"generate-azurerm-properties": "node lib/esm/ocd-codegen.js generate azurerm-properties-js -f -s ./schema/azurerm-schema.json -d ../react/src/components/properties/provider/azure",
"generate-azurerm-tabular": "node lib/esm/ocd-codegen.js generate azurerm-tabular-js -f -s ./schema/azurerm-schema.json -d ../react/src/components/tabular/provider/azure",
"generate-azurerm-terraform": "node lib/esm/ocd-codegen.js generate azurerm-terraform-js -f -s ./schema/azurerm-schema.json -d ../export/src/terraform/provider/azure",
"generate-azurerm-validator": "node lib/esm/ocd-codegen.js generate azurerm-validator-js -f -s ./schema/azurerm-schema.json -d ../model/src/validator/provider/azure",
"generate-azurerm": "npm run generate-azurerm-model && npm run generate-azurerm-markdown && npm run generate-azurerm-properties && npm run generate-azurerm-terraform && npm run generate-azurerm-tabular && npm run generate-azurerm-validator",

"generate-google-markdown": "node lib/esm/ocd-codegen.js generate google-markdown-js -f -s ./schema/google-schema.json -d ../export/src/markdown/provider/google",
"generate-google-model": "node lib/esm/ocd-codegen.js generate google-model-js -f -s ./schema/google-schema.json -d ../model/src/provider/google",
"generate-google-properties": "node lib/esm/ocd-codegen.js generate google-properties-js -f -s ./schema/google-schema.json -d ../desktop/src/components/properties/provider/google",
"generate-google-tabular": "node lib/esm/ocd-codegen.js generate google-tabular-js -f -s ./schema/google-schema.json -d ../desktop/src/components/tabular/provider/google",
"generate-google-properties": "node lib/esm/ocd-codegen.js generate google-properties-js -f -s ./schema/google-schema.json -d ../react/src/components/properties/provider/google",
"generate-google-tabular": "node lib/esm/ocd-codegen.js generate google-tabular-js -f -s ./schema/google-schema.json -d ../react/src/components/tabular/provider/google",
"generate-google-terraform": "node lib/esm/ocd-codegen.js generate google-terraform-js -f -s ./schema/google-schema.json -d ../export/src/terraform/provider/google",
"generate-google-validator": "node lib/esm/ocd-codegen.js generate google-validator-js -f -s ./schema/google-schema.json -d ../model/src/validator/provider/google",
"generate-google": "npm run generate-google-model && npm run generate-google-markdown && npm run generate-google-properties && npm run generate-google-terraform && npm run generate-google-tabular && npm run generate-google-validator",
Expand Down
38 changes: 22 additions & 16 deletions ocd/packages/desktop/forge.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@ import { MakerDMG } from '@electron-forge/maker-dmg'
import { VitePlugin } from '@electron-forge/plugin-vite';
import { FusesPlugin } from '@electron-forge/plugin-fuses';
import { FuseV1Options, FuseVersion } from '@electron/fuses';
import os from 'os'

const archPos = process.argv.findIndex(arg => arg.startsWith('--arch'))
const arch = archPos > 0 ? process.argv[archPos+1] : os.arch()
console.info('Args:', process.argv, archPos, arch)
const config: ForgeConfig = {
outDir: '../../dist/${os}',
outDir: '../../dist',
packagerConfig: {
asar: true,
// executableName: 'ocd',
Expand All @@ -24,30 +28,32 @@ const config: ForgeConfig = {
new MakerDMG({
appPath: 'ocd',
background: './public/assets/background.png',
icon: './public/assets/icon.icns',
title: 'OKIT - Open Cloud Designer',
format: 'ULFO',
overwrite: true,
additionalDMGOptions: {
window: {
size: {
width: 585,
height: 450
height: 355
}
},
},
// contents: [
// {
// x: 500,
// y: 200,
// type: 'link',
// path: '/Applications'
// },
// {
// x: 100,
// y: 200,
// type: 'file',
// path: './out/ocd-darwin-arm64/ocd.app'
// }
// ]
contents: [
{
x: 400,
y: 200,
type: 'link',
path: '/Applications'
},
{
x: 150,
y: 200,
type: 'file',
path: `${process.cwd()}/../../dist/ocd-darwin-${arch}/ocd.app`
}
]
}, ['darwin']),
new MakerRpm({}),
new MakerDeb({})
Expand Down
3 changes: 2 additions & 1 deletion ocd/packages/desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"package": "NODE_OPTIONS=--max-old-space-size=8192 electron-forge package",
"make": "NODE_OPTIONS=--max-old-space-size=8192 DEBUG=electron-installer-dmg* electron-forge make ",
"make-macos-universal": "NODE_OPTIONS=--max-old-space-size=8192 DEBUG=electron-installer-dmg* electron-forge make --arch='universal'",
"make-macos-arm64-x64": "NODE_OPTIONS=--max-old-space-size=8192 DEBUG=electron-installer-dmg* electron-forge make --arch='arm64,x64'",
"make-macos-arm64": "NODE_OPTIONS=--max-old-space-size=8192 DEBUG=electron-installer-dmg* electron-forge make --arch='arm64'",
"make-macos-x64": "NODE_OPTIONS=--max-old-space-size=8192 DEBUG=electron-installer-dmg* electron-forge make --arch='x64'",
"publish": "electron-forge publish",
"lint": "eslint --ext .ts,.tsx ."
},
Expand Down

0 comments on commit 6b58db0

Please sign in to comment.