@deploid/core 2.0.1 → 2.0.2
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/artifacts.d.ts +12 -0
- package/dist/artifacts.d.ts.map +1 -0
- package/dist/artifacts.js +37 -0
- package/dist/artifacts.js.map +1 -0
- package/dist/devices.d.ts +6 -0
- package/dist/devices.d.ts.map +1 -0
- package/dist/devices.js +20 -0
- package/dist/devices.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/artifacts.ts +52 -0
- package/src/devices.ts +27 -0
- package/src/index.ts +2 -1
- package/tsconfig.tsbuildinfo +0 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { DeploidConfig } from './types.js';
|
|
2
|
+
export type ArtifactKind = 'android-debug-apk' | 'android-release-apk' | 'android-release-aab' | 'assets' | 'desktop';
|
|
3
|
+
export interface ArtifactRecord {
|
|
4
|
+
kind: ArtifactKind;
|
|
5
|
+
label: string;
|
|
6
|
+
path: string;
|
|
7
|
+
exists: boolean;
|
|
8
|
+
isDirectory: boolean;
|
|
9
|
+
sizeBytes: number;
|
|
10
|
+
}
|
|
11
|
+
export declare function inspectArtifacts(cwd: string, config?: Pick<DeploidConfig, 'assets'>): ArtifactRecord[];
|
|
12
|
+
//# sourceMappingURL=artifacts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifacts.d.ts","sourceRoot":"","sources":["../src/artifacts.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,MAAM,MAAM,YAAY,GAAG,mBAAmB,GAAG,qBAAqB,GAAG,qBAAqB,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEtH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,YAAY,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,OAAO,CAAC;IAChB,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,IAAI,CAAC,aAAa,EAAE,QAAQ,CAAC,GAAG,cAAc,EAAE,CAStG"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
export function inspectArtifacts(cwd, config) {
|
|
4
|
+
const assetsOutput = config?.assets?.output || 'assets-gen';
|
|
5
|
+
return [
|
|
6
|
+
makeArtifactRecord('android-debug-apk', 'Debug APK', path.join(cwd, 'android', 'app', 'build', 'outputs', 'apk', 'debug', 'app-debug.apk')),
|
|
7
|
+
makeArtifactRecord('android-release-apk', 'Release APK', path.join(cwd, 'android', 'app', 'build', 'outputs', 'apk', 'release', 'app-release.apk')),
|
|
8
|
+
makeArtifactRecord('android-release-aab', 'Release AAB', path.join(cwd, 'android', 'app', 'build', 'outputs', 'bundle', 'release', 'app-release.aab')),
|
|
9
|
+
makeArtifactRecord('assets', 'Generated assets', path.join(cwd, assetsOutput)),
|
|
10
|
+
makeArtifactRecord('desktop', 'Desktop output', path.join(cwd, 'dist-electron'))
|
|
11
|
+
];
|
|
12
|
+
}
|
|
13
|
+
function makeArtifactRecord(kind, label, targetPath) {
|
|
14
|
+
const exists = fs.existsSync(targetPath);
|
|
15
|
+
const stats = exists ? fs.statSync(targetPath) : null;
|
|
16
|
+
return {
|
|
17
|
+
kind,
|
|
18
|
+
label,
|
|
19
|
+
path: targetPath,
|
|
20
|
+
exists,
|
|
21
|
+
isDirectory: Boolean(stats?.isDirectory()),
|
|
22
|
+
sizeBytes: stats ? measureSize(targetPath, stats.isDirectory()) : 0
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
function measureSize(targetPath, isDirectory) {
|
|
26
|
+
if (!isDirectory) {
|
|
27
|
+
return fs.statSync(targetPath).size;
|
|
28
|
+
}
|
|
29
|
+
let total = 0;
|
|
30
|
+
for (const entry of fs.readdirSync(targetPath)) {
|
|
31
|
+
const childPath = path.join(targetPath, entry);
|
|
32
|
+
const childStats = fs.statSync(childPath);
|
|
33
|
+
total += childStats.isDirectory() ? measureSize(childPath, true) : childStats.size;
|
|
34
|
+
}
|
|
35
|
+
return total;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=artifacts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifacts.js","sourceRoot":"","sources":["../src/artifacts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAc7B,MAAM,UAAU,gBAAgB,CAAC,GAAW,EAAE,MAAsC;IAClF,MAAM,YAAY,GAAG,MAAM,EAAE,MAAM,EAAE,MAAM,IAAI,YAAY,CAAC;IAC5D,OAAO;QACL,kBAAkB,CAAC,mBAAmB,EAAE,WAAW,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,eAAe,CAAC,CAAC;QAC3I,kBAAkB,CAAC,qBAAqB,EAAE,aAAa,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,iBAAiB,CAAC,CAAC;QACnJ,kBAAkB,CAAC,qBAAqB,EAAE,aAAa,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,iBAAiB,CAAC,CAAC;QACtJ,kBAAkB,CAAC,QAAQ,EAAE,kBAAkB,EAAE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UAAU,CAAC,IAAI,CAAC;IACrF,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"devices.d.ts","sourceRoot":"","sources":["../src/devices.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,kBAAkB,IAAI,mBAAmB,EAAE,CAmB1D"}
|
package/dist/devices.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { spawnSync } from 'node:child_process';
|
|
2
|
+
export function listAndroidDevices() {
|
|
3
|
+
const result = spawnSync('adb', ['devices'], {
|
|
4
|
+
encoding: 'utf8',
|
|
5
|
+
stdio: ['ignore', 'pipe', 'pipe']
|
|
6
|
+
});
|
|
7
|
+
if (result.status !== 0) {
|
|
8
|
+
const reason = (result.stderr || '').trim() || 'adb devices failed';
|
|
9
|
+
throw new Error(reason);
|
|
10
|
+
}
|
|
11
|
+
return (result.stdout || '')
|
|
12
|
+
.split('\n')
|
|
13
|
+
.map((line) => line.trim())
|
|
14
|
+
.filter((line) => line && !line.startsWith('List of devices'))
|
|
15
|
+
.map((line) => {
|
|
16
|
+
const [id, state = 'unknown'] = line.split('\t');
|
|
17
|
+
return { id, state };
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=devices.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"devices.js","sourceRoot":"","sources":["../src/devices.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAO/C,MAAM,UAAU,kBAAkB;IAChC,MAAM,MAAM,GAAG,SAAS,CAAC,KAAK,EAAE,CAAC,SAAS,CAAC,EAAE;QAC3C,QAAQ,EAAE,MAAM;QAChB,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC;KAClC,CAAC,CAAC;IAEH,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxB,MAAM,MAAM,GAAG,CAAC,MAAM,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,IAAI,oBAAoB,CAAC;QACpE,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC;IAC1B,CAAC;IAED,OAAO,CAAC,MAAM,CAAC,MAAM,IAAI,EAAE,CAAC;SACzB,KAAK,CAAC,IAAI,CAAC;SACX,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;SAC1B,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC;SAC7D,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACZ,MAAM,CAAC,EAAE,EAAE,KAAK,GAAG,SAAS,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACjD,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC;IACvB,CAAC,CAAC,CAAC;AACP,CAAC"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC"}
|
package/package.json
CHANGED
package/src/artifacts.ts
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import type { DeploidConfig } from './types.js';
|
|
4
|
+
|
|
5
|
+
export type ArtifactKind = 'android-debug-apk' | 'android-release-apk' | 'android-release-aab' | 'assets' | 'desktop';
|
|
6
|
+
|
|
7
|
+
export interface ArtifactRecord {
|
|
8
|
+
kind: ArtifactKind;
|
|
9
|
+
label: string;
|
|
10
|
+
path: string;
|
|
11
|
+
exists: boolean;
|
|
12
|
+
isDirectory: boolean;
|
|
13
|
+
sizeBytes: number;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function inspectArtifacts(cwd: string, config?: Pick<DeploidConfig, 'assets'>): ArtifactRecord[] {
|
|
17
|
+
const assetsOutput = config?.assets?.output || 'assets-gen';
|
|
18
|
+
return [
|
|
19
|
+
makeArtifactRecord('android-debug-apk', 'Debug APK', path.join(cwd, 'android', 'app', 'build', 'outputs', 'apk', 'debug', 'app-debug.apk')),
|
|
20
|
+
makeArtifactRecord('android-release-apk', 'Release APK', path.join(cwd, 'android', 'app', 'build', 'outputs', 'apk', 'release', 'app-release.apk')),
|
|
21
|
+
makeArtifactRecord('android-release-aab', 'Release AAB', path.join(cwd, 'android', 'app', 'build', 'outputs', 'bundle', 'release', 'app-release.aab')),
|
|
22
|
+
makeArtifactRecord('assets', 'Generated assets', path.join(cwd, assetsOutput)),
|
|
23
|
+
makeArtifactRecord('desktop', 'Desktop output', path.join(cwd, 'dist-electron'))
|
|
24
|
+
];
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function makeArtifactRecord(kind: ArtifactKind, label: string, targetPath: string): ArtifactRecord {
|
|
28
|
+
const exists = fs.existsSync(targetPath);
|
|
29
|
+
const stats = exists ? fs.statSync(targetPath) : null;
|
|
30
|
+
return {
|
|
31
|
+
kind,
|
|
32
|
+
label,
|
|
33
|
+
path: targetPath,
|
|
34
|
+
exists,
|
|
35
|
+
isDirectory: Boolean(stats?.isDirectory()),
|
|
36
|
+
sizeBytes: stats ? measureSize(targetPath, stats.isDirectory()) : 0
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function measureSize(targetPath: string, isDirectory: boolean): number {
|
|
41
|
+
if (!isDirectory) {
|
|
42
|
+
return fs.statSync(targetPath).size;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
let total = 0;
|
|
46
|
+
for (const entry of fs.readdirSync(targetPath)) {
|
|
47
|
+
const childPath = path.join(targetPath, entry);
|
|
48
|
+
const childStats = fs.statSync(childPath);
|
|
49
|
+
total += childStats.isDirectory() ? measureSize(childPath, true) : childStats.size;
|
|
50
|
+
}
|
|
51
|
+
return total;
|
|
52
|
+
}
|
package/src/devices.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { spawnSync } from 'node:child_process';
|
|
2
|
+
|
|
3
|
+
export interface AndroidDeviceRecord {
|
|
4
|
+
id: string;
|
|
5
|
+
state: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export function listAndroidDevices(): AndroidDeviceRecord[] {
|
|
9
|
+
const result = spawnSync('adb', ['devices'], {
|
|
10
|
+
encoding: 'utf8',
|
|
11
|
+
stdio: ['ignore', 'pipe', 'pipe']
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
if (result.status !== 0) {
|
|
15
|
+
const reason = (result.stderr || '').trim() || 'adb devices failed';
|
|
16
|
+
throw new Error(reason);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return (result.stdout || '')
|
|
20
|
+
.split('\n')
|
|
21
|
+
.map((line) => line.trim())
|
|
22
|
+
.filter((line) => line && !line.startsWith('List of devices'))
|
|
23
|
+
.map((line) => {
|
|
24
|
+
const [id, state = 'unknown'] = line.split('\t');
|
|
25
|
+
return { id, state };
|
|
26
|
+
});
|
|
27
|
+
}
|
package/src/index.ts
CHANGED
package/tsconfig.tsbuildinfo
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"root":["./src/app-api.ts","./src/config.ts","./src/index.ts","./src/logger.ts","./src/pipeline.ts","./src/plugin-loader.ts","./src/types.ts"],"version":"5.9.3"}
|