easc 0.0.4 → 0.0.5
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/bin/easc.js +4 -1
- package/index.ts +8 -12
- package/package.json +3 -2
- package/src/enums/platform.ts +5 -2
- package/src/utils/files.ts +7 -7
- package/src/utils/logger.ts +1 -2
- package/src/utils/runtime.ts +1 -1
- package/src/utils/upload.ts +4 -4
package/bin/easc.js
CHANGED
|
@@ -3,12 +3,15 @@ import { spawn } from "child_process";
|
|
|
3
3
|
import { fileURLToPath } from "url";
|
|
4
4
|
import { dirname, join } from "path";
|
|
5
5
|
import { existsSync } from "fs";
|
|
6
|
+
import { createRequire } from "module";
|
|
6
7
|
|
|
7
8
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
9
|
+
const require = createRequire(import.meta.url);
|
|
10
|
+
const tsxPath = require.resolve("tsx/esm");
|
|
8
11
|
const indexPath = join(__dirname, "..", "index.ts");
|
|
9
12
|
|
|
10
13
|
const envPath = join(process.cwd(), ".env");
|
|
11
|
-
const nodeArgs = ["--
|
|
14
|
+
const nodeArgs = ["--import", tsxPath];
|
|
12
15
|
|
|
13
16
|
if (existsSync(envPath)) {
|
|
14
17
|
nodeArgs.push("--env-file", envPath);
|
package/index.ts
CHANGED
|
@@ -2,24 +2,20 @@
|
|
|
2
2
|
import { execSync } from "child_process";
|
|
3
3
|
import fs from "fs";
|
|
4
4
|
import chalk from "chalk";
|
|
5
|
-
import { parseArguments } from "./src/utils/cli
|
|
6
|
-
import { validateConfig, getConfig } from "./src/utils/schema
|
|
7
|
-
import { resolveRuntimeVersion, getPlatforms } from "./src/utils/runtime
|
|
8
|
-
import {
|
|
9
|
-
getCommitHash,
|
|
10
|
-
getShortCommitHash,
|
|
11
|
-
isGitClean,
|
|
12
|
-
} from "./src/utils/git.ts";
|
|
5
|
+
import { parseArguments } from "./src/utils/cli";
|
|
6
|
+
import { validateConfig, getConfig } from "./src/utils/schema";
|
|
7
|
+
import { resolveRuntimeVersion, getPlatforms } from "./src/utils/runtime";
|
|
8
|
+
import { getCommitHash, getShortCommitHash, isGitClean } from "./src/utils/git";
|
|
13
9
|
import {
|
|
14
10
|
readAppJson,
|
|
15
11
|
readMetadata,
|
|
16
12
|
findBundleFile,
|
|
17
13
|
getAssetFiles,
|
|
18
14
|
checkExportDirectory,
|
|
19
|
-
} from "./src/utils/files
|
|
20
|
-
import { uploadBundle, createDryRunSummary } from "./src/utils/upload
|
|
21
|
-
import { Logger } from "./src/utils/logger
|
|
22
|
-
import
|
|
15
|
+
} from "./src/utils/files";
|
|
16
|
+
import { uploadBundle, createDryRunSummary } from "./src/utils/upload";
|
|
17
|
+
import { Logger } from "./src/utils/logger";
|
|
18
|
+
import { PlatformType } from "./src/enums/platform";
|
|
23
19
|
|
|
24
20
|
type IDeploymentResult = {
|
|
25
21
|
platform: PlatformType;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "easc",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "Expo App Services for Cloudflare - Deploy tool for Expo OTA updates to Cloudflare Workers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"chalk": "5.6.0",
|
|
17
17
|
"ora": "^9.0.0",
|
|
18
|
+
"tsx": "^4.20.6",
|
|
18
19
|
"yargs": "^18.0.0",
|
|
19
20
|
"zod": "^4.1.12"
|
|
20
21
|
},
|
|
@@ -26,7 +27,7 @@
|
|
|
26
27
|
"vitest": "^3.2.4"
|
|
27
28
|
},
|
|
28
29
|
"engines": {
|
|
29
|
-
"node": ">=
|
|
30
|
+
"node": ">=18.0.0"
|
|
30
31
|
},
|
|
31
32
|
"repository": {
|
|
32
33
|
"type": "git",
|
package/src/enums/platform.ts
CHANGED
package/src/utils/files.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import fs from "fs";
|
|
2
2
|
import path from "path";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import { IAppJson } from "./runtime";
|
|
4
|
+
import { Platform, PlatformType } from "../enums/platform";
|
|
5
5
|
|
|
6
6
|
export interface IMetadata {
|
|
7
7
|
fileMetadata?: {
|
|
8
|
-
|
|
8
|
+
[Platform.iOS]?: {
|
|
9
9
|
assets: Array<{ path: string }>;
|
|
10
10
|
};
|
|
11
|
-
|
|
11
|
+
[Platform.Android]?: {
|
|
12
12
|
assets: Array<{ path: string }>;
|
|
13
13
|
};
|
|
14
14
|
};
|
|
@@ -96,9 +96,9 @@ export function getAssetFiles(
|
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
const platformMetadata =
|
|
99
|
-
platform ===
|
|
100
|
-
? metadata.fileMetadata?.
|
|
101
|
-
: metadata.fileMetadata?.
|
|
99
|
+
platform === Platform.iOS
|
|
100
|
+
? metadata.fileMetadata?.[Platform.iOS]
|
|
101
|
+
: metadata.fileMetadata?.[Platform.Android];
|
|
102
102
|
const platformAssets = platformMetadata?.assets || [];
|
|
103
103
|
|
|
104
104
|
if (platformAssets.length === 0) {
|
package/src/utils/logger.ts
CHANGED
package/src/utils/runtime.ts
CHANGED
package/src/utils/upload.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import fs from "fs";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
2
|
+
import { IAppJson } from "./runtime";
|
|
3
|
+
import { IMetadata } from "./files";
|
|
4
|
+
import { IConfig } from "./schema";
|
|
5
|
+
import { PlatformType } from "../enums/platform";
|
|
6
6
|
|
|
7
7
|
export interface IUploadOptions {
|
|
8
8
|
config: IConfig;
|