@todesktop/cli 1.15.2 → 1.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/types.d.ts CHANGED
@@ -26,6 +26,23 @@ export type AppProtocolSchemeProperty = string | [string, ...string[]];
26
26
  * This is the path to your Electron application directory. Omit this unless your project setup is complicated. This is the directory that the CLI uploads.
27
27
  */
28
28
  export type AppPathProperty = string;
29
+ /**
30
+ * Compile selected source files to .jsc using Bytenode during the build. Provide glob patterns relative to your appPath.
31
+ */
32
+ export type BytenodeConfigProperty = {
33
+ [k: string]: unknown;
34
+ } & {
35
+ /**
36
+ * Enable Bytenode compilation.
37
+ */
38
+ enabled?: boolean;
39
+ /**
40
+ * Glob patterns relative to appPath for files to compile to Bytenode.
41
+ *
42
+ * @minItems 1
43
+ */
44
+ files?: [string, ...string[]];
45
+ };
29
46
  /**
30
47
  * Whether to package your application's source code within an asar archive. You should only turn this off if you have a good reason to.
31
48
  */
@@ -188,6 +205,16 @@ export interface Schema {
188
205
  appFiles?: AppFilesProperty;
189
206
  appProtocolScheme?: AppProtocolSchemeProperty;
190
207
  appPath?: AppPathProperty;
208
+ /**
209
+ * Useful when your application is a monorepo (e.g. pnpm workspaces). You can configure whether the CLI bundles workspace packages alongside the app upload. When enabled, workspace dependencies referenced via `workspace:` or local `file:` specifiers are bundled with your application upload and dependency ranges are rewritten to `file:` paths so they install deterministically on the build servers.
210
+ */
211
+ bundleWorkspacePackages?: {
212
+ /**
213
+ * Enable automatic bundling of workspace packages for this project.
214
+ */
215
+ enabled?: boolean;
216
+ };
217
+ bytenode?: BytenodeConfigProperty;
191
218
  asar?: AsarProperty;
192
219
  asarUnpack?: AsarUnpackProperty;
193
220
  buildVersion?: BuildVersionProperty;
@@ -475,6 +502,7 @@ export interface PlatformOverridableProperties {
475
502
  appFiles?: AppFilesProperty;
476
503
  appProtocolScheme?: AppProtocolSchemeProperty;
477
504
  appPath?: AppPathProperty;
505
+ bytenode?: BytenodeConfigProperty;
478
506
  asar?: AsarProperty;
479
507
  asarUnpack?: AsarUnpackProperty;
480
508
  buildVersion?: BuildVersionProperty;
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "access": "public"
5
5
  },
6
6
  "name": "@todesktop/cli",
7
- "version": "1.15.2",
7
+ "version": "1.18.0",
8
8
  "license": "MIT",
9
9
  "author": "Dave Jeffery <dave@todesktop.com> (http://www.todesktop.com/)",
10
10
  "homepage": "https://todesktop.com/cli",
@@ -19,23 +19,23 @@
19
19
  "node": ">=16"
20
20
  },
21
21
  "scripts": {
22
- "dev": "cp-cli dev.env .env && npm run build:dev && npm link",
23
- "dev:prod": "cp-cli prod.env .env && npm run build && npm link",
24
- "dev:local:prod": "cp-cli prod-local.env .env && npm run build && npm link && cp-cli prod-local.env .env",
25
- "build": "npm run types:generate && esbuild src/index.ts --packages=external --bundle --sourcemap --platform=node --outfile=dist/cli.js && cp-cli prod.env .env",
26
- "build:dev": "npm run types:generate && esbuild src/index.ts --packages=external --bundle --sourcemap --platform=node --outfile=dist/cli.js && cp-cli dev.env .env",
22
+ "build": "scripts/esbuild.js",
23
+ "dev": "scripts/esbuild.js --link --watch --stage dev",
24
+ "dev:local:prod": "scripts/esbuild.js --link --watch --stage prod-local",
25
+ "dev:prod": "scripts/esbuild.js --link --watch",
26
+ "docs:generate": "node scripts/generate-readme.js",
27
+ "format": "prettier --write .",
27
28
  "lint": "npm run lint:types && npm run lint:styles",
29
+ "lint--fix": "eslint src test --fix",
28
30
  "lint:styles": "eslint src test .eslintrc.js && prettier --check .",
29
- "format": "prettier --write .",
30
31
  "lint:types": "tsc && tsc-strict",
31
- "lint--fix": "eslint src test --fix",
32
- "docs:generate": "node scripts/generate-readme.js",
33
32
  "types:generate": "node scripts/generate-types.js",
34
- "release": "npm run docs:generate && npm run build && npx np --tag=latest",
33
+ "release": "npm run docs:generate && npm run build && pnpx np --tag=latest",
35
34
  "release-beta": "npm run docs:generate && npm run build && npx np --any-branch --no-tests --tag=beta",
36
35
  "test": "ava",
36
+ "test:e2e": "node test/output-snapshots/output.test.js",
37
37
  "test--watch": "npm test -- --watch",
38
- "postinstall": "node scripts/postinstall.js"
38
+ "typecheck": "tsc --noEmit"
39
39
  },
40
40
  "files": [
41
41
  "scripts/postinstall.js",
@@ -72,6 +72,7 @@
72
72
  "ink-text-input": "^4.0.1",
73
73
  "is-ci": "^3.0.1",
74
74
  "is-installed-globally": "^0.3.2",
75
+ "js-yaml": "^4.1.0",
75
76
  "latest-version": "^5.1.0",
76
77
  "lodash.merge": "^4.6.2",
77
78
  "lodash.throttle": "^4.1.1",
@@ -89,6 +90,7 @@
89
90
  "xdg-basedir": "^4.0.0"
90
91
  },
91
92
  "devDependencies": {
93
+ "@todesktop/dev-config": "workspace:*",
92
94
  "@todesktop/shared": "^7.189.6",
93
95
  "@types/bunyan": "^1.8.6",
94
96
  "@types/is-ci": "^3.0.4",
@@ -98,7 +100,7 @@
98
100
  "@typescript-eslint/parser": "^5.46.1",
99
101
  "ava": "^4.3.1",
100
102
  "cp-cli": "^2.0.0",
101
- "esbuild": "^0.16.5",
103
+ "esbuild": "^0.25.10",
102
104
  "esbuild-register": "^3.4.1",
103
105
  "eslint": "^8.29.0",
104
106
  "eslint-config-prettier": "^8.5.0",
@@ -120,7 +122,7 @@
120
122
  "prettier": "^2.8.1",
121
123
  "proxyquire": "^2.1.3",
122
124
  "sinon": "^9.0.3",
123
- "typescript": "^4.9.4",
125
+ "typescript": "catalog:",
124
126
  "typescript-strict-plugin": "^2.2.1"
125
127
  },
126
128
  "ava": {
@@ -154,18 +156,6 @@
154
156
  "pre-commit": "lint-staged"
155
157
  }
156
158
  },
157
- "overrides": {
158
- "pastel": {
159
- "parcel-bundler": {
160
- "deasync": "0.1.27"
161
- }
162
- }
163
- },
164
- "resolutions": {
165
- "pastel/parcel-bundler/deasync": "0.1.24",
166
- "ink": "3.2.0",
167
- "react": "17.0.2"
168
- },
169
159
  "packageExtensions": {
170
160
  "ink-progress-bar@*": {
171
161
  "dependencies": {
@@ -26,6 +26,21 @@
26
26
  "appFiles": { "$ref": "#/definitions/appFilesProperty" },
27
27
  "appProtocolScheme": { "$ref": "#/definitions/appProtocolSchemeProperty" },
28
28
  "appPath": { "$ref": "#/definitions/appPathProperty" },
29
+ "bundleWorkspacePackages": {
30
+ "type": "object",
31
+ "additionalProperties": false,
32
+ "description": "Useful when your application is a monorepo (e.g. pnpm workspaces). You can configure whether the CLI bundles workspace packages alongside the app upload. When enabled, workspace dependencies referenced via `workspace:` or local `file:` specifiers are bundled with your application upload and dependency ranges are rewritten to `file:` paths so they install deterministically on the build servers.",
33
+ "examples": ["{\"enabled\":true}"],
34
+ "default": { "enabled": false },
35
+ "properties": {
36
+ "enabled": {
37
+ "type": "boolean",
38
+ "default": false,
39
+ "description": "Enable automatic bundling of workspace packages for this project."
40
+ }
41
+ }
42
+ },
43
+ "bytenode": { "$ref": "#/definitions/bytenodeConfigProperty" },
29
44
  "asar": { "$ref": "#/definitions/asarProperty" },
30
45
  "asarUnpack": { "$ref": "#/definitions/asarUnpackProperty" },
31
46
  "buildVersion": { "$ref": "#/definitions/buildVersionProperty" },
@@ -118,6 +133,34 @@
118
133
  "examples": ["com.microsoft.word"],
119
134
  "default": "auto-generated"
120
135
  },
136
+ "bytenodeConfigProperty": {
137
+ "type": "object",
138
+ "additionalProperties": false,
139
+ "description": "Compile selected source files to .jsc using Bytenode during the build. Provide glob patterns relative to your appPath.",
140
+ "default": { "enabled": false },
141
+ "properties": {
142
+ "enabled": {
143
+ "type": "boolean",
144
+ "default": false,
145
+ "description": "Enable Bytenode compilation."
146
+ },
147
+ "files": {
148
+ "type": "array",
149
+ "items": { "type": "string", "minLength": 1 },
150
+ "minItems": 1,
151
+ "description": "Glob patterns relative to appPath for files to compile to Bytenode."
152
+ }
153
+ },
154
+ "allOf": [
155
+ {
156
+ "if": {
157
+ "properties": { "enabled": { "const": true } },
158
+ "required": ["enabled"]
159
+ },
160
+ "then": { "required": ["files"] }
161
+ }
162
+ ]
163
+ },
121
164
  "appFilesProperty": {
122
165
  "type": "array",
123
166
  "description": "This option allows you to decide which files get uploaded to be built on the ToDesktop servers. By default, all files in your app path are included in your app, except for `node_modules` and `.git`. Dependencies are installed on our build servers as there could be platform-specific postinstall steps.",
@@ -801,7 +844,7 @@
801
844
  "description": "The path to your application's Windows desktop icon. It must be an ICO, ICNS, or PNG.",
802
845
  "examples": ["./icon.ico"],
803
846
  "file": {
804
- "extensions": ["icns", "png", "icon"],
847
+ "extensions": ["icns", "png", "ico"],
805
848
  "mustBeFile": true
806
849
  },
807
850
  "minLength": 3
@@ -866,6 +909,7 @@
866
909
  "$ref": "#/definitions/appProtocolSchemeProperty"
867
910
  },
868
911
  "appPath": { "$ref": "#/definitions/appPathProperty" },
912
+ "bytenode": { "$ref": "#/definitions/bytenodeConfigProperty" },
869
913
  "asar": { "$ref": "#/definitions/asarProperty" },
870
914
  "asarUnpack": { "$ref": "#/definitions/asarUnpackProperty" },
871
915
  "buildVersion": { "$ref": "#/definitions/buildVersionProperty" },
@@ -1,19 +0,0 @@
1
- // eslint-disable-next-line @typescript-eslint/no-var-requires
2
- const path = require("path");
3
-
4
- console.log(`
5
- Thank you for installing @todesktop/cli!
6
-
7
- To enable JSON validation and IntelliSense for your configuration files, please add the following to your VSCode/Cursor settings:
8
-
9
- {
10
- "json.schemas": [
11
- {
12
- "fileMatch": ["todesktop.json", "todesktop.*.json"],
13
- "url": "${path
14
- .resolve(__dirname, "../", "schemas", "schema.json")
15
- .substring(1)}"
16
- }
17
- ]
18
- }
19
- `);