Skip to content

Commit 94deacc

Browse files
committed
feat: Added codesigning for the new binaries from node-pty. Bumped library versions
1 parent b8286a1 commit 94deacc

7 files changed

Lines changed: 20 additions & 25 deletions

File tree

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ $ npm install -g codify
1818
$ codify COMMAND
1919
running command...
2020
$ codify (--version)
21-
codify/0.4.0 darwin-arm64 node-v20.15.0
21+
codify/0.5.0 darwin-arm64 node-v20.15.1
2222
$ codify --help [COMMAND]
2323
USAGE
2424
$ codify COMMAND
@@ -62,7 +62,7 @@ EXAMPLES
6262
$ codify apply --path ~
6363
```
6464

65-
_See code: [src/commands/apply/index.ts](https://github.com/kevinwang5658/codify/blob/v0.4.0/src/commands/apply/index.ts)_
65+
_See code: [src/commands/apply/index.ts](https://github.com/kevinwang5658/codify/blob/v0.5.0/src/commands/apply/index.ts)_
6666

6767
## `codify destroy`
6868

@@ -88,7 +88,7 @@ EXAMPLES
8888
$ codify destroy homebrew nvm
8989
```
9090

91-
_See code: [src/commands/destroy.ts](https://github.com/kevinwang5658/codify/blob/v0.4.0/src/commands/destroy.ts)_
91+
_See code: [src/commands/destroy.ts](https://github.com/kevinwang5658/codify/blob/v0.5.0/src/commands/destroy.ts)_
9292

9393
## `codify help [COMMAND]`
9494

@@ -135,7 +135,7 @@ EXAMPLES
135135
$ codify import homebrew nvm
136136
```
137137

138-
_See code: [src/commands/import.ts](https://github.com/kevinwang5658/codify/blob/v0.4.0/src/commands/import.ts)_
138+
_See code: [src/commands/import.ts](https://github.com/kevinwang5658/codify/blob/v0.5.0/src/commands/import.ts)_
139139

140140
## `codify plan`
141141

@@ -163,7 +163,7 @@ EXAMPLES
163163
$ codify plan
164164
```
165165

166-
_See code: [src/commands/plan/index.ts](https://github.com/kevinwang5658/codify/blob/v0.4.0/src/commands/plan/index.ts)_
166+
_See code: [src/commands/plan/index.ts](https://github.com/kevinwang5658/codify/blob/v0.5.0/src/commands/plan/index.ts)_
167167

168168
## `codify update [CHANNEL]`
169169

package.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"ajv": "^8.12.0",
1313
"ajv-formats": "^3.0.1",
1414
"chalk": "^5.3.0",
15-
"codify-schemas": "^1.0.56",
15+
"codify-schemas": "^1.0.60",
1616
"debug": "^4.3.4",
1717
"ink": "^5",
1818
"ink-form": "^2.0.1",
@@ -38,7 +38,7 @@
3838
"@types/semver": "^7.5.4",
3939
"@types/strip-ansi": "^5.2.1",
4040
"@typescript-eslint/eslint-plugin": "^8.16.0",
41-
"codify-plugin-lib": "^1.0.107",
41+
"codify-plugin-lib": "^1.0.129",
4242
"esbuild": "^0.24.0",
4343
"esbuild-plugin-copy": "^2.1.1",
4444
"eslint": "^8.51.0",
@@ -85,7 +85,8 @@
8585
"topics": {},
8686
"macos": {
8787
"identifier": "com.codify.cli",
88-
"sign": "\"Developer ID Installer: Qingran Wang (PCG246DPVT)\""
88+
"sign": "\"Developer ID Installer: Qingran Wang (PCG246DPVT)\"",
89+
"application-certificate": "Developer ID Application: Qingran Wang (PCG246DPVT)"
8990
},
9091
"update": {
9192
"s3": {
@@ -100,6 +101,7 @@
100101
"build:release": "npm run pkg && ./scripts/notarize.sh",
101102
"lint": "tsc && eslint . --ext .ts",
102103
"postpack": "shx rm -f oclif.manifest.json",
104+
"pretarball": "../../../scripts/codesign.sh",
103105
"pkg": "tsx ./scripts/pkg.ts",
104106
"notorize": "./scripts/notarize.sh",
105107
"upload": "./scripts/upload.sh",
@@ -110,7 +112,7 @@
110112
"start:dev": "./bin/dev.js",
111113
"start:vm": "npm run build && npm run pack:macos && npm run start:vm"
112114
},
113-
"version": "0.4.0",
115+
"version": "0.5.0",
114116
"bugs": "https://github.com/kevinwang5658/codify/issues",
115117
"keywords": [
116118
"oclif"

scripts/codesign.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
3+
APPLE_DEVELOPER_APPLICATION_PROFILE=$(cat package.json | jq -r '.oclif.macos."application-certificate"')
4+
5+
codesign --verbose=4 --timestamp --strict --options runtime -s "$APPLE_DEVELOPER_APPLICATION_PROFILE" node_modules/@homebridge/node-pty-prebuilt-multiarch/build/Release/spawn-helper --force
6+
codesign --verbose=4 --timestamp --strict --options runtime -s "$APPLE_DEVELOPER_APPLICATION_PROFILE" node_modules/@homebridge/node-pty-prebuilt-multiarch/build/Release/pty.node --force

scripts/pkg.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ execSync('tsx esbuild.ts', { shell: 'zsh' })
2727
console.log(chalk.magenta('Install production dependencies'))
2828
execSync('npm install --production', { cwd: './.build', shell: 'zsh' })
2929

30-
3130
console.log(chalk.magenta('Running oclif pkg macos'))
3231
execSync('oclif pack macos -r .', { cwd: './.build', shell: 'zsh' })
3332

src/entities/plan.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ export class ResourcePlan {
3939
operation: ResourceOperation;
4040
resourceName?: string;
4141
resourceType: string;
42+
isStateful: boolean;
4243
parameters: Array<{
4344
name: string;
4445
newValue: null | unknown;
@@ -49,6 +50,7 @@ export class ResourcePlan {
4950
constructor(json: PlanResponseData) {
5051
this.raw = json;
5152
this.planId = json.planId;
53+
this.isStateful = json.isStateful
5254
this.operation = json.operation;
5355
this.resourceName = json.resourceName;
5456
this.resourceType = json.resourceType;

src/plugins/plugin-manager.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ export class PluginManager {
118118
}
119119

120120
await this.plugins.get(pluginName)!.apply(resourcePlan);
121-
await this.validateApply(pluginName, planRequest);
122121

123122
ctx.subprocessFinished(SubProcessName.APPLYING_RESOURCE, resourcePlan.id);
124123
}
@@ -170,16 +169,4 @@ export class PluginManager {
170169

171170
return resourceMap;
172171
}
173-
174-
private async validateApply(pluginName: string, planInput: PlanRequest): Promise<void> {
175-
const validationPlan = await this.plugins.get(pluginName)!.plan(planInput);
176-
if (validationPlan.operation !== ResourceOperation.NOOP) {
177-
throw new Error(`Plugin: '${pluginName}'. Resource: '${planInput.type}'. Additional changes are needed to match the desired plan.
178-
179-
Validation returned: "${validationPlan.operation}" instead of "${ResourceOperation.NOOP}". These changes are remaining.
180-
${prettyFormatResourcePlan(validationPlan)}
181-
`)
182-
}
183-
}
184-
185172
}

test/orchestrator/mocks/plugin.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ export class MockPlugin {
1010
name = 'default';
1111
version = '0.0.0'
1212
path = '/'
13-
14-
plugin: Plugin;
13+
plugin!: Plugin;
1514

1615
async initialize(secureMode: boolean): Promise<InitializeResponseData> {
1716
this.plugin = Plugin.create(

0 commit comments

Comments
 (0)