@tamagui/native-ci 2.0.0-rc.3 → 2.0.0-rc.30

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/runner.js DELETED
@@ -1,73 +0,0 @@
1
- import { execSync } from "node:child_process";
2
- import { appendFileSync } from "node:fs";
3
- import { createCacheKey, loadCache, saveCache } from "./cache";
4
- import { generateFingerprint } from "./fingerprint";
5
- async function runWithCache(options) {
6
- const {
7
- platform,
8
- buildCommand,
9
- outputPaths,
10
- projectRoot = process.cwd(),
11
- cachePrefix = "native-build",
12
- debug = !1
13
- } = options, log = debug ? console.log : () => {
14
- };
15
- log(`Generating ${platform} fingerprint...`);
16
- const { hash: fingerprint } = await generateFingerprint({
17
- platform,
18
- projectRoot,
19
- debug
20
- });
21
- log(`Fingerprint: ${fingerprint}`);
22
- const cacheKey = createCacheKey({ platform, fingerprint, prefix: cachePrefix });
23
- log(`Cache key: ${cacheKey}`);
24
- const cached = loadCache(cacheKey);
25
- if (cached && cached.fingerprint === fingerprint)
26
- return log("Cache hit! Skipping build."), {
27
- cacheHit: !0,
28
- fingerprint,
29
- cacheKey,
30
- outputPaths
31
- };
32
- log(`Running build: ${buildCommand}`);
33
- const execOptions = {
34
- cwd: projectRoot,
35
- stdio: debug ? "inherit" : ["pipe", "pipe", "pipe"]
36
- };
37
- try {
38
- execSync(buildCommand, execOptions);
39
- } catch (error) {
40
- const err = error;
41
- throw new Error(`Build failed: ${err.message}${err.stderr ? `
42
- ${err.stderr}` : ""}`);
43
- }
44
- return saveCache(cacheKey, {
45
- fingerprint,
46
- timestamp: (/* @__PURE__ */ new Date()).toISOString(),
47
- platform,
48
- outputPaths
49
- }), {
50
- cacheHit: !1,
51
- fingerprint,
52
- cacheKey,
53
- outputPaths
54
- };
55
- }
56
- function setGitHubOutput(name, value) {
57
- const outputFile = process.env.GITHUB_OUTPUT;
58
- outputFile ? appendFileSync(outputFile, `${name}=${value}
59
- `) : console.info(`[GitHub Output] ${name}=${value}`);
60
- }
61
- function isGitHubActions() {
62
- return !!process.env.GITHUB_ACTIONS;
63
- }
64
- function isCI() {
65
- return !!process.env.CI;
66
- }
67
- export {
68
- isCI,
69
- isGitHubActions,
70
- runWithCache,
71
- setGitHubOutput
72
- };
73
- //# sourceMappingURL=runner.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/runner.ts"],
4
- "mappings": "AAAA,SAAS,gBAAsC;AAC/C,SAAS,sBAAsB;AAC/B,SAAS,gBAAgB,WAAW,iBAAiB;AACrD,SAAS,2BAA2B;AAwBpC,eAAsB,aACpB,SAC6B;AAC7B,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA,cAAc,QAAQ,IAAI;AAAA,IAC1B,cAAc;AAAA,IACd,QAAQ;AAAA,EACV,IAAI,SAEE,MAAM,QAAQ,QAAQ,MAAM,MAAM;AAAA,EAAC;AAGzC,MAAI,cAAc,QAAQ,iBAAiB;AAC3C,QAAM,EAAE,MAAM,YAAY,IAAI,MAAM,oBAAoB;AAAA,IACtD;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACD,MAAI,gBAAgB,WAAW,EAAE;AAGjC,QAAM,WAAW,eAAe,EAAE,UAAU,aAAa,QAAQ,YAAY,CAAC;AAC9E,MAAI,cAAc,QAAQ,EAAE;AAE5B,QAAM,SAAS,UAAsD,QAAQ;AAE7E,MAAI,UAAU,OAAO,gBAAgB;AACnC,eAAI,4BAA4B,GACzB;AAAA,MACL,UAAU;AAAA,MACV;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAIF,MAAI,kBAAkB,YAAY,EAAE;AACpC,QAAM,cAA+B;AAAA,IACnC,KAAK;AAAA,IACL,OAAO,QAAQ,YAAY,CAAC,QAAQ,QAAQ,MAAM;AAAA,EACpD;AAEA,MAAI;AACF,aAAS,cAAc,WAAW;AAAA,EACpC,SAAS,OAAO;AACd,UAAM,MAAM;AACZ,UAAM,IAAI,MA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