Skip to content

Commit 9e4e7cc

Browse files
committed
Fix: Bug fixes for help, and init using dev-dependency. Added extra cors header removing the need for PNA notification
1 parent 93339f3 commit 9e4e7cc

File tree

7 files changed

+5314
-4848
lines changed

7 files changed

+5314
-4848
lines changed

esbuild.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { build } from 'esbuild';
22

33
const result = await build({
4-
entryPoints: ['src/commands/**/index.ts', 'src/commands/*.ts', 'src/index.ts'],
4+
entryPoints: ['src/commands/**/index.ts', 'src/commands/*.ts', 'src/index.ts', 'src/help.ts'],
55
bundle: true,
66
minify: true,
77
splitting: true,

package-lock.json

Lines changed: 5299 additions & 4835 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
"dependencies": {
77
"@codifycli/ink-form": "0.0.12",
88
"@homebridge/node-pty-prebuilt-multiarch": "^0.12.0-beta.5",
9-
"@hono/node-server": "^1.17.1",
10-
"@hono/node-ws": "^1.2.0",
119
"@inkjs/ui": "^2",
1210
"@mischnic/json-sourcemap": "^0.1.1",
1311
"@oclif/core": "^4.0.8",
@@ -23,7 +21,6 @@
2321
"detect-indent": "^7.0.1",
2422
"diff": "^7.0.0",
2523
"express": "^5.1.0",
26-
"hono": "^4.8.9",
2724
"ink": "^5.1.0",
2825
"ink-big-text": "^2.0.0",
2926
"ink-gradient": "^3.0.0",
@@ -41,17 +38,14 @@
4138
"open": "^10.1.2",
4239
"parse-json": "^8.1.0",
4340
"react": "^18.3.1",
44-
"semver": "^7.5.4",
45-
"socket.io": "^4.8.1",
46-
"supports-color": "^9.4.0",
4741
"uuid": "^10.0.0",
4842
"ws": "^8.18.3"
4943
},
5044
"description": "Codify allows users to configure settings, install new packages, and automate their systems using code instead of the GUI. Check out https://dashboard.codifycli.com for an online editor.",
5145
"devDependencies": {
52-
"@memlab/core": "^1.1.39",
5346
"@oclif/prettier-config": "^0.2.1",
5447
"@types/chalk": "^2.2.0",
48+
"@types/cors": "^2.8.19",
5549
"@types/debug": "^4.1.12",
5650
"@types/diff": "^7.0.1",
5751
"@types/express": "^5.0.3",
@@ -61,21 +55,18 @@
6155
"@types/mocha": "^10.0.10",
6256
"@types/node": "^20",
6357
"@types/react": "^18.3.1",
64-
"@types/semver": "^7.5.4",
6558
"@types/strip-ansi": "^5.2.1",
6659
"@types/uuid": "^10.0.0",
6760
"@types/ws": "^8.18.1",
6861
"@typescript-eslint/eslint-plugin": "^8.16.0",
6962
"codify-plugin-lib": "^1.0.151",
7063
"esbuild": "^0.24.0",
71-
"esbuild-plugin-copy": "^2.1.1",
7264
"eslint": "^8.51.0",
7365
"eslint-config-oclif": "^5",
7466
"eslint-config-oclif-typescript": "^3.1.13",
7567
"eslint-config-prettier": "^9.0.0",
7668
"ink-testing-library": "^4.0.0",
7769
"memfs": "^4.14.0",
78-
"mocha": "^10",
7970
"oclif": "^4.15.29",
8071
"react-devtools-core": "4.28.5",
8172
"shx": "^0.3.3",

src/connect/http-server.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ export async function createHttpServer(
1919
): Promise<Server> {
2020
const app = express();
2121

22+
app.use((req, res, next) => {
23+
res.set('Access-Control-Allow-Private-Network', 'true');
24+
next();
25+
});
2226
app.use(cors({ origin: config.corsAllowedOrigins }))
2327
app.use(json())
2428
app.use(createAuthHandler(connectionSecret))

src/orchestrators/init.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
import chalk from 'chalk';
2-
import { tildify } from 'codify-plugin-lib';
32
import path from 'node:path';
43

54
import { PluginInitOrchestrator } from '../common/initialize-plugins.js';
65
import { ResourceConfig } from '../entities/resource-config.js';
76
import { ProcessName, SubProcessName, ctx } from '../events/context.js';
87
import { Reporter } from '../ui/reporters/reporter.js';
98
import { FileUtils } from '../utils/file.js';
10-
import { resolvePathWithVariables, untildify } from '../utils/index.js';
9+
import { resolvePathWithVariables, tildify, untildify } from '../utils/index.js';
1110

1211
export interface InitArgs {
1312
path?: string;

src/orchestrators/login.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ export class LoginOrchestrator {
5959

6060
const app = express();
6161

62+
app.use((req, res, next) => {
63+
res.set('Access-Control-Allow-Private-Network', 'true');
64+
next();
65+
});
6266
app.use(cors({ origin: config.corsAllowedOrigins }))
6367
app.use(json());
6468

src/utils/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,7 @@ export function untildify(pathWithTilde: string) {
7171
const homeDirectory = os.homedir();
7272
return homeDirectory ? pathWithTilde.replace(/^~(?=$|\/|\\)/, homeDirectory) : pathWithTilde;
7373
}
74+
75+
export function tildify(pathWithTilde: string) {
76+
return os.homedir() ? pathWithTilde.replace(os.homedir(), '~') : pathWithTilde;
77+
}

0 commit comments

Comments
 (0)