@apps-in-toss/plugins 0.0.28 → 0.0.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/index.cjs +372 -169
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +370 -169
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1495,6 +1495,43 @@ var require_picocolors = __commonJS({
|
|
|
1495
1495
|
}
|
|
1496
1496
|
});
|
|
1497
1497
|
|
|
1498
|
+
// ../../.yarn/__virtual__/typia-virtual-93fdc6e779/0/cache/typia-npm-8.0.4-b2444b63f3-1028a8a121.zip/node_modules/typia/lib/internal/_isFormatUuid.js
|
|
1499
|
+
var require_isFormatUuid = __commonJS({
|
|
1500
|
+
"../../.yarn/__virtual__/typia-virtual-93fdc6e779/0/cache/typia-npm-8.0.4-b2444b63f3-1028a8a121.zip/node_modules/typia/lib/internal/_isFormatUuid.js"(exports2) {
|
|
1501
|
+
"use strict";
|
|
1502
|
+
init_cjs_shims();
|
|
1503
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
1504
|
+
exports2._isFormatUuid = void 0;
|
|
1505
|
+
var _isFormatUuid2 = (str) => PATTERN.test(str);
|
|
1506
|
+
exports2._isFormatUuid = _isFormatUuid2;
|
|
1507
|
+
var PATTERN = /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;
|
|
1508
|
+
}
|
|
1509
|
+
});
|
|
1510
|
+
|
|
1511
|
+
// ../../.yarn/__virtual__/typia-virtual-93fdc6e779/0/cache/typia-npm-8.0.4-b2444b63f3-1028a8a121.zip/node_modules/typia/lib/internal/_validateReport.js
|
|
1512
|
+
var require_validateReport = __commonJS({
|
|
1513
|
+
"../../.yarn/__virtual__/typia-virtual-93fdc6e779/0/cache/typia-npm-8.0.4-b2444b63f3-1028a8a121.zip/node_modules/typia/lib/internal/_validateReport.js"(exports2) {
|
|
1514
|
+
"use strict";
|
|
1515
|
+
init_cjs_shims();
|
|
1516
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
1517
|
+
exports2._validateReport = void 0;
|
|
1518
|
+
var _validateReport2 = (array) => {
|
|
1519
|
+
const reportable = (path8) => {
|
|
1520
|
+
if (array.length === 0)
|
|
1521
|
+
return true;
|
|
1522
|
+
const last = array[array.length - 1].path;
|
|
1523
|
+
return path8.length > last.length || last.substring(0, path8.length) !== path8;
|
|
1524
|
+
};
|
|
1525
|
+
return (exceptable, error) => {
|
|
1526
|
+
if (exceptable && reportable(error.path))
|
|
1527
|
+
array.push(error);
|
|
1528
|
+
return false;
|
|
1529
|
+
};
|
|
1530
|
+
};
|
|
1531
|
+
exports2._validateReport = _validateReport2;
|
|
1532
|
+
}
|
|
1533
|
+
});
|
|
1534
|
+
|
|
1498
1535
|
// ../../.yarn/cache/minimatch-npm-5.1.6-33ea6af31a-3defdfd230.zip/node_modules/minimatch/lib/path.js
|
|
1499
1536
|
var require_path = __commonJS({
|
|
1500
1537
|
"../../.yarn/cache/minimatch-npm-5.1.6-33ea6af31a-3defdfd230.zip/node_modules/minimatch/lib/path.js"(exports2, module2) {
|
|
@@ -26501,43 +26538,6 @@ var require_archiver = __commonJS({
|
|
|
26501
26538
|
}
|
|
26502
26539
|
});
|
|
26503
26540
|
|
|
26504
|
-
// ../../.yarn/__virtual__/typia-virtual-93fdc6e779/0/cache/typia-npm-8.0.4-b2444b63f3-1028a8a121.zip/node_modules/typia/lib/internal/_isFormatUuid.js
|
|
26505
|
-
var require_isFormatUuid = __commonJS({
|
|
26506
|
-
"../../.yarn/__virtual__/typia-virtual-93fdc6e779/0/cache/typia-npm-8.0.4-b2444b63f3-1028a8a121.zip/node_modules/typia/lib/internal/_isFormatUuid.js"(exports2) {
|
|
26507
|
-
"use strict";
|
|
26508
|
-
init_cjs_shims();
|
|
26509
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
26510
|
-
exports2._isFormatUuid = void 0;
|
|
26511
|
-
var _isFormatUuid2 = (str) => PATTERN.test(str);
|
|
26512
|
-
exports2._isFormatUuid = _isFormatUuid2;
|
|
26513
|
-
var PATTERN = /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;
|
|
26514
|
-
}
|
|
26515
|
-
});
|
|
26516
|
-
|
|
26517
|
-
// ../../.yarn/__virtual__/typia-virtual-93fdc6e779/0/cache/typia-npm-8.0.4-b2444b63f3-1028a8a121.zip/node_modules/typia/lib/internal/_validateReport.js
|
|
26518
|
-
var require_validateReport = __commonJS({
|
|
26519
|
-
"../../.yarn/__virtual__/typia-virtual-93fdc6e779/0/cache/typia-npm-8.0.4-b2444b63f3-1028a8a121.zip/node_modules/typia/lib/internal/_validateReport.js"(exports2) {
|
|
26520
|
-
"use strict";
|
|
26521
|
-
init_cjs_shims();
|
|
26522
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
26523
|
-
exports2._validateReport = void 0;
|
|
26524
|
-
var _validateReport2 = (array) => {
|
|
26525
|
-
const reportable = (path8) => {
|
|
26526
|
-
if (array.length === 0)
|
|
26527
|
-
return true;
|
|
26528
|
-
const last = array[array.length - 1].path;
|
|
26529
|
-
return path8.length > last.length || last.substring(0, path8.length) !== path8;
|
|
26530
|
-
};
|
|
26531
|
-
return (exceptable, error) => {
|
|
26532
|
-
if (exceptable && reportable(error.path))
|
|
26533
|
-
array.push(error);
|
|
26534
|
-
return false;
|
|
26535
|
-
};
|
|
26536
|
-
};
|
|
26537
|
-
exports2._validateReport = _validateReport2;
|
|
26538
|
-
}
|
|
26539
|
-
});
|
|
26540
|
-
|
|
26541
26541
|
// src/index.ts
|
|
26542
26542
|
var index_exports = {};
|
|
26543
26543
|
__export(index_exports, {
|
|
@@ -26546,9 +26546,11 @@ __export(index_exports, {
|
|
|
26546
26546
|
appsInTossAppJson: () => appsInTossAppJson,
|
|
26547
26547
|
appsInTossEsbuildConfig: () => appsInTossEsbuildConfig,
|
|
26548
26548
|
appsInTossMetroConfig: () => appsInTossMetroConfig,
|
|
26549
|
+
appsInTossPostNotice: () => appsInTossPostNotice,
|
|
26549
26550
|
collectDependencyVersions: () => collectDependencyVersions,
|
|
26550
26551
|
createArtifact: () => createArtifact,
|
|
26551
26552
|
setupRuntimeSetupScript: () => setupRuntimeSetupScript,
|
|
26553
|
+
validateAppInTossPluginOptions: () => validateAppInTossPluginOptions,
|
|
26552
26554
|
validateAppManifest: () => validateAppManifest,
|
|
26553
26555
|
validateZip: () => validateZip
|
|
26554
26556
|
});
|
|
@@ -26626,133 +26628,6 @@ init_cjs_shims();
|
|
|
26626
26628
|
var REACT_NATIVE_VERSION = "0.72.6";
|
|
26627
26629
|
var APP_MANIFEST_NAME = "app.json";
|
|
26628
26630
|
|
|
26629
|
-
// src/utils/collectDependencyVersions.ts
|
|
26630
|
-
init_cjs_shims();
|
|
26631
|
-
var fs2 = __toESM(require("fs/promises"), 1);
|
|
26632
|
-
var path2 = __toESM(require("path"), 1);
|
|
26633
|
-
var esbuild = __toESM(require("esbuild"), 1);
|
|
26634
|
-
async function collectDependencyVersions(rootDir) {
|
|
26635
|
-
const packageJsonPath = path2.join(rootDir, "package.json");
|
|
26636
|
-
const packageJson = JSON.parse(await fs2.readFile(packageJsonPath, "utf8"));
|
|
26637
|
-
const [dependencies, devDependencies] = await Promise.all([
|
|
26638
|
-
resolvePackageVersions(rootDir, Object.keys(packageJson.dependencies)),
|
|
26639
|
-
resolvePackageVersions(rootDir, Object.keys(packageJson.devDependencies))
|
|
26640
|
-
]);
|
|
26641
|
-
return { dependencies, devDependencies };
|
|
26642
|
-
}
|
|
26643
|
-
async function resolvePackageVersions(rootDir, packageNames) {
|
|
26644
|
-
const results = {};
|
|
26645
|
-
await esbuild.build({
|
|
26646
|
-
stdin: { contents: createVirtualEntry(packageNames) },
|
|
26647
|
-
bundle: true,
|
|
26648
|
-
write: false,
|
|
26649
|
-
logLevel: "silent",
|
|
26650
|
-
plugins: [
|
|
26651
|
-
{
|
|
26652
|
-
name: "collect-package-version",
|
|
26653
|
-
setup(build2) {
|
|
26654
|
-
const RESOLVING = Symbol();
|
|
26655
|
-
build2.onResolve({ filter: /.*/ }, async (args) => {
|
|
26656
|
-
if (args.pluginData === RESOLVING) {
|
|
26657
|
-
return null;
|
|
26658
|
-
}
|
|
26659
|
-
const resolveOptions = {
|
|
26660
|
-
importer: args.importer,
|
|
26661
|
-
kind: args.kind,
|
|
26662
|
-
resolveDir: rootDir,
|
|
26663
|
-
pluginData: RESOLVING
|
|
26664
|
-
};
|
|
26665
|
-
let result = await build2.resolve(path2.join(args.path, "package.json"), resolveOptions);
|
|
26666
|
-
if (result.errors.length) {
|
|
26667
|
-
result = await build2.resolve(args.path, resolveOptions);
|
|
26668
|
-
}
|
|
26669
|
-
if (result.errors.length) {
|
|
26670
|
-
return result;
|
|
26671
|
-
}
|
|
26672
|
-
const packageName = args.path;
|
|
26673
|
-
const packagePath = extractPackagePath(result.path, packageName);
|
|
26674
|
-
if (packagePath) {
|
|
26675
|
-
results[packageName] = await getPackageVersion(packagePath);
|
|
26676
|
-
}
|
|
26677
|
-
return result;
|
|
26678
|
-
});
|
|
26679
|
-
build2.onLoad({ filter: /.*/ }, () => ({ contents: "// empty source" }));
|
|
26680
|
-
}
|
|
26681
|
-
}
|
|
26682
|
-
]
|
|
26683
|
-
});
|
|
26684
|
-
return results;
|
|
26685
|
-
}
|
|
26686
|
-
function createVirtualEntry(packageNames) {
|
|
26687
|
-
return packageNames.map((packageName) => `import '${packageName}';`).join("\n");
|
|
26688
|
-
}
|
|
26689
|
-
function extractPackagePath(path8, packageName) {
|
|
26690
|
-
const normalizedPath = normalizePath(path8);
|
|
26691
|
-
if (normalizedPath.endsWith("/package.json")) {
|
|
26692
|
-
return normalizedPath.replace(/\/package\.json$/, "");
|
|
26693
|
-
}
|
|
26694
|
-
const match = normalizedPath.match(new RegExp(`(.*?node_modules/${packageName})/.*$`));
|
|
26695
|
-
if (match) {
|
|
26696
|
-
return match[1];
|
|
26697
|
-
}
|
|
26698
|
-
throw new Error(`Failed to extract path: ${packageName}`);
|
|
26699
|
-
}
|
|
26700
|
-
async function getPackageVersion(packagePath) {
|
|
26701
|
-
const packageJson = JSON.parse(await fs2.readFile(path2.join(packagePath, "package.json"), "utf-8"));
|
|
26702
|
-
return packageJson.version;
|
|
26703
|
-
}
|
|
26704
|
-
|
|
26705
|
-
// src/utils/createArtifact.ts
|
|
26706
|
-
init_cjs_shims();
|
|
26707
|
-
var import_path2 = __toESM(require("path"), 1);
|
|
26708
|
-
|
|
26709
|
-
// src/utils/compressToZip.ts
|
|
26710
|
-
init_cjs_shims();
|
|
26711
|
-
var fs3 = __toESM(require("fs"), 1);
|
|
26712
|
-
var path3 = __toESM(require("path"), 1);
|
|
26713
|
-
var import_archiver = __toESM(require_archiver(), 1);
|
|
26714
|
-
async function compressToZip(config) {
|
|
26715
|
-
const { files, outfile } = config;
|
|
26716
|
-
return new Promise((resolve, reject2) => {
|
|
26717
|
-
const outputStream = fs3.createWriteStream(outfile);
|
|
26718
|
-
const archive = (0, import_archiver.default)("zip", { zlib: { level: 9 } });
|
|
26719
|
-
outputStream.on("close", () => resolve(outfile));
|
|
26720
|
-
outputStream.on("error", (error) => reject2(error));
|
|
26721
|
-
archive.on("error", (error) => reject2(error)).pipe(outputStream);
|
|
26722
|
-
files.forEach(({ path: filePath, name }) => {
|
|
26723
|
-
const fileName = name ?? path3.basename(filePath);
|
|
26724
|
-
archive.append(fs3.createReadStream(filePath), { name: fileName });
|
|
26725
|
-
});
|
|
26726
|
-
archive.finalize();
|
|
26727
|
-
});
|
|
26728
|
-
}
|
|
26729
|
-
|
|
26730
|
-
// src/utils/updateAppJsonMetadata.ts
|
|
26731
|
-
init_cjs_shims();
|
|
26732
|
-
var fs4 = __toESM(require("fs/promises"), 1);
|
|
26733
|
-
var path4 = __toESM(require("path"), 1);
|
|
26734
|
-
async function resolveAppManifestPath() {
|
|
26735
|
-
const cwd = getPackageRoot();
|
|
26736
|
-
const appManifestPath = path4.join(cwd, ".bedrock", APP_MANIFEST_NAME);
|
|
26737
|
-
await fs4.access(appManifestPath, fs4.constants.F_OK);
|
|
26738
|
-
return appManifestPath;
|
|
26739
|
-
}
|
|
26740
|
-
async function readAppJson(appJsonPath) {
|
|
26741
|
-
const appJson = await fs4.readFile(appJsonPath, "utf8");
|
|
26742
|
-
return JSON.parse(appJson);
|
|
26743
|
-
}
|
|
26744
|
-
async function writeAppJson(appJsonPath, content) {
|
|
26745
|
-
await fs4.writeFile(appJsonPath, JSON.stringify(content));
|
|
26746
|
-
}
|
|
26747
|
-
async function updateAppJsonMetadata(metadata) {
|
|
26748
|
-
const appJsonPath = await resolveAppManifestPath();
|
|
26749
|
-
const appJson = await readAppJson(appJsonPath);
|
|
26750
|
-
await writeAppJson(appJsonPath, {
|
|
26751
|
-
...appJson,
|
|
26752
|
-
_metadata: metadata
|
|
26753
|
-
});
|
|
26754
|
-
}
|
|
26755
|
-
|
|
26756
26631
|
// src/types.ts
|
|
26757
26632
|
init_cjs_shims();
|
|
26758
26633
|
var __typia_transform__isFormatUuid = __toESM(require_isFormatUuid(), 1);
|
|
@@ -26924,6 +26799,292 @@ var validateAppManifest = /* @__PURE__ */ (() => {
|
|
|
26924
26799
|
};
|
|
26925
26800
|
};
|
|
26926
26801
|
})();
|
|
26802
|
+
var validateAppInTossPluginOptions = /* @__PURE__ */ (() => {
|
|
26803
|
+
const _io0 = (input) => "object" === typeof input.brand && null !== input.brand && _io1(input.brand) && (Array.isArray(input.permissions) && input.permissions.every((elem) => "object" === typeof elem && null !== elem && _iu0(elem)));
|
|
26804
|
+
const _io1 = (input) => "string" === typeof input.displayName && "string" === typeof input.primaryColor && "string" === typeof input.icon && ("basic" === input.bridgeColorMode || "inverted" === input.bridgeColorMode);
|
|
26805
|
+
const _io2 = (input) => "clipboard" === input.name && ("read" === input.access || "write" === input.access);
|
|
26806
|
+
const _io3 = (input) => "geolocation" === input.name && "access" === input.access;
|
|
26807
|
+
const _io4 = (input) => "contacts" === input.name && ("read" === input.access || "write" === input.access);
|
|
26808
|
+
const _io5 = (input) => "photos" === input.name && ("read" === input.access || "write" === input.access);
|
|
26809
|
+
const _io6 = (input) => "camera" === input.name && "access" === input.access;
|
|
26810
|
+
const _iu0 = (input) => (() => {
|
|
26811
|
+
if ("camera" === input.name)
|
|
26812
|
+
return _io6(input);
|
|
26813
|
+
else if ("photos" === input.name)
|
|
26814
|
+
return _io5(input);
|
|
26815
|
+
else if ("contacts" === input.name)
|
|
26816
|
+
return _io4(input);
|
|
26817
|
+
else if ("geolocation" === input.name)
|
|
26818
|
+
return _io3(input);
|
|
26819
|
+
else if ("clipboard" === input.name)
|
|
26820
|
+
return _io2(input);
|
|
26821
|
+
else
|
|
26822
|
+
return false;
|
|
26823
|
+
})();
|
|
26824
|
+
const _vo0 = (input, _path, _exceptionable = true) => [("object" === typeof input.brand && null !== input.brand || _report(_exceptionable, {
|
|
26825
|
+
path: _path + ".brand",
|
|
26826
|
+
expected: "__type",
|
|
26827
|
+
value: input.brand
|
|
26828
|
+
})) && _vo1(input.brand, _path + ".brand", _exceptionable) || _report(_exceptionable, {
|
|
26829
|
+
path: _path + ".brand",
|
|
26830
|
+
expected: "__type",
|
|
26831
|
+
value: input.brand
|
|
26832
|
+
}), (Array.isArray(input.permissions) || _report(_exceptionable, {
|
|
26833
|
+
path: _path + ".permissions",
|
|
26834
|
+
expected: "Array<Permission>",
|
|
26835
|
+
value: input.permissions
|
|
26836
|
+
})) && input.permissions.map((elem, _index2) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
26837
|
+
path: _path + ".permissions[" + _index2 + "]",
|
|
26838
|
+
expected: "(CameraPermission | ClipboardPermission | ContactsPermission | GeolocationPermission | PhotosPermission)",
|
|
26839
|
+
value: elem
|
|
26840
|
+
})) && _vu0(elem, _path + ".permissions[" + _index2 + "]", _exceptionable) || _report(_exceptionable, {
|
|
26841
|
+
path: _path + ".permissions[" + _index2 + "]",
|
|
26842
|
+
expected: "(CameraPermission | ClipboardPermission | ContactsPermission | GeolocationPermission | PhotosPermission)",
|
|
26843
|
+
value: elem
|
|
26844
|
+
})).every((flag) => flag) || _report(_exceptionable, {
|
|
26845
|
+
path: _path + ".permissions",
|
|
26846
|
+
expected: "Array<Permission>",
|
|
26847
|
+
value: input.permissions
|
|
26848
|
+
})].every((flag) => flag);
|
|
26849
|
+
const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.displayName || _report(_exceptionable, {
|
|
26850
|
+
path: _path + ".displayName",
|
|
26851
|
+
expected: "string",
|
|
26852
|
+
value: input.displayName
|
|
26853
|
+
}), "string" === typeof input.primaryColor || _report(_exceptionable, {
|
|
26854
|
+
path: _path + ".primaryColor",
|
|
26855
|
+
expected: "string",
|
|
26856
|
+
value: input.primaryColor
|
|
26857
|
+
}), "string" === typeof input.icon || _report(_exceptionable, {
|
|
26858
|
+
path: _path + ".icon",
|
|
26859
|
+
expected: "string",
|
|
26860
|
+
value: input.icon
|
|
26861
|
+
}), "basic" === input.bridgeColorMode || "inverted" === input.bridgeColorMode || _report(_exceptionable, {
|
|
26862
|
+
path: _path + ".bridgeColorMode",
|
|
26863
|
+
expected: '("basic" | "inverted")',
|
|
26864
|
+
value: input.bridgeColorMode
|
|
26865
|
+
})].every((flag) => flag);
|
|
26866
|
+
const _vo2 = (input, _path, _exceptionable = true) => ["clipboard" === input.name || _report(_exceptionable, {
|
|
26867
|
+
path: _path + ".name",
|
|
26868
|
+
expected: '"clipboard"',
|
|
26869
|
+
value: input.name
|
|
26870
|
+
}), "read" === input.access || "write" === input.access || _report(_exceptionable, {
|
|
26871
|
+
path: _path + ".access",
|
|
26872
|
+
expected: '("read" | "write")',
|
|
26873
|
+
value: input.access
|
|
26874
|
+
})].every((flag) => flag);
|
|
26875
|
+
const _vo3 = (input, _path, _exceptionable = true) => ["geolocation" === input.name || _report(_exceptionable, {
|
|
26876
|
+
path: _path + ".name",
|
|
26877
|
+
expected: '"geolocation"',
|
|
26878
|
+
value: input.name
|
|
26879
|
+
}), "access" === input.access || _report(_exceptionable, {
|
|
26880
|
+
path: _path + ".access",
|
|
26881
|
+
expected: '"access"',
|
|
26882
|
+
value: input.access
|
|
26883
|
+
})].every((flag) => flag);
|
|
26884
|
+
const _vo4 = (input, _path, _exceptionable = true) => ["contacts" === input.name || _report(_exceptionable, {
|
|
26885
|
+
path: _path + ".name",
|
|
26886
|
+
expected: '"contacts"',
|
|
26887
|
+
value: input.name
|
|
26888
|
+
}), "read" === input.access || "write" === input.access || _report(_exceptionable, {
|
|
26889
|
+
path: _path + ".access",
|
|
26890
|
+
expected: '("read" | "write")',
|
|
26891
|
+
value: input.access
|
|
26892
|
+
})].every((flag) => flag);
|
|
26893
|
+
const _vo5 = (input, _path, _exceptionable = true) => ["photos" === input.name || _report(_exceptionable, {
|
|
26894
|
+
path: _path + ".name",
|
|
26895
|
+
expected: '"photos"',
|
|
26896
|
+
value: input.name
|
|
26897
|
+
}), "read" === input.access || "write" === input.access || _report(_exceptionable, {
|
|
26898
|
+
path: _path + ".access",
|
|
26899
|
+
expected: '("read" | "write")',
|
|
26900
|
+
value: input.access
|
|
26901
|
+
})].every((flag) => flag);
|
|
26902
|
+
const _vo6 = (input, _path, _exceptionable = true) => ["camera" === input.name || _report(_exceptionable, {
|
|
26903
|
+
path: _path + ".name",
|
|
26904
|
+
expected: '"camera"',
|
|
26905
|
+
value: input.name
|
|
26906
|
+
}), "access" === input.access || _report(_exceptionable, {
|
|
26907
|
+
path: _path + ".access",
|
|
26908
|
+
expected: '"access"',
|
|
26909
|
+
value: input.access
|
|
26910
|
+
})].every((flag) => flag);
|
|
26911
|
+
const _vu0 = (input, _path, _exceptionable = true) => (() => {
|
|
26912
|
+
if ("camera" === input.name)
|
|
26913
|
+
return _vo6(input, _path, _exceptionable);
|
|
26914
|
+
else if ("photos" === input.name)
|
|
26915
|
+
return _vo5(input, _path, _exceptionable);
|
|
26916
|
+
else if ("contacts" === input.name)
|
|
26917
|
+
return _vo4(input, _path, _exceptionable);
|
|
26918
|
+
else if ("geolocation" === input.name)
|
|
26919
|
+
return _vo3(input, _path, _exceptionable);
|
|
26920
|
+
else if ("clipboard" === input.name)
|
|
26921
|
+
return _vo2(input, _path, _exceptionable);
|
|
26922
|
+
else
|
|
26923
|
+
return _report(_exceptionable, {
|
|
26924
|
+
path: _path,
|
|
26925
|
+
expected: "(CameraPermission | PhotosPermission | ContactsPermission | GeolocationPermission | ClipboardPermission)",
|
|
26926
|
+
value: input
|
|
26927
|
+
});
|
|
26928
|
+
})();
|
|
26929
|
+
const __is = (input) => "object" === typeof input && null !== input && _io0(input);
|
|
26930
|
+
let errors;
|
|
26931
|
+
let _report;
|
|
26932
|
+
return (input) => {
|
|
26933
|
+
if (false === __is(input)) {
|
|
26934
|
+
errors = [];
|
|
26935
|
+
_report = __typia_transform__validateReport._validateReport(errors);
|
|
26936
|
+
((input2, _path, _exceptionable = true) => ("object" === typeof input2 && null !== input2 || _report(true, {
|
|
26937
|
+
path: _path + "",
|
|
26938
|
+
expected: "AppsInTossPluginOptions",
|
|
26939
|
+
value: input2
|
|
26940
|
+
})) && _vo0(input2, _path + "", true) || _report(true, {
|
|
26941
|
+
path: _path + "",
|
|
26942
|
+
expected: "AppsInTossPluginOptions",
|
|
26943
|
+
value: input2
|
|
26944
|
+
}))(input, "$input", true);
|
|
26945
|
+
const success = 0 === errors.length;
|
|
26946
|
+
return success ? {
|
|
26947
|
+
success,
|
|
26948
|
+
data: input
|
|
26949
|
+
} : {
|
|
26950
|
+
success,
|
|
26951
|
+
errors,
|
|
26952
|
+
data: input
|
|
26953
|
+
};
|
|
26954
|
+
}
|
|
26955
|
+
return {
|
|
26956
|
+
success: true,
|
|
26957
|
+
data: input
|
|
26958
|
+
};
|
|
26959
|
+
};
|
|
26960
|
+
})();
|
|
26961
|
+
|
|
26962
|
+
// src/utils/collectDependencyVersions.ts
|
|
26963
|
+
init_cjs_shims();
|
|
26964
|
+
var fs2 = __toESM(require("fs/promises"), 1);
|
|
26965
|
+
var path2 = __toESM(require("path"), 1);
|
|
26966
|
+
var esbuild = __toESM(require("esbuild"), 1);
|
|
26967
|
+
async function collectDependencyVersions(rootDir) {
|
|
26968
|
+
const packageJsonPath = path2.join(rootDir, "package.json");
|
|
26969
|
+
const packageJson = JSON.parse(await fs2.readFile(packageJsonPath, "utf8"));
|
|
26970
|
+
const [dependencies, devDependencies] = await Promise.all([
|
|
26971
|
+
resolvePackageVersions(rootDir, Object.keys(packageJson.dependencies)),
|
|
26972
|
+
resolvePackageVersions(rootDir, Object.keys(packageJson.devDependencies))
|
|
26973
|
+
]);
|
|
26974
|
+
return { dependencies, devDependencies };
|
|
26975
|
+
}
|
|
26976
|
+
async function resolvePackageVersions(rootDir, packageNames) {
|
|
26977
|
+
const results = {};
|
|
26978
|
+
await esbuild.build({
|
|
26979
|
+
stdin: { contents: createVirtualEntry(packageNames) },
|
|
26980
|
+
bundle: true,
|
|
26981
|
+
write: false,
|
|
26982
|
+
logLevel: "silent",
|
|
26983
|
+
plugins: [
|
|
26984
|
+
{
|
|
26985
|
+
name: "collect-package-version",
|
|
26986
|
+
setup(build2) {
|
|
26987
|
+
const RESOLVING = Symbol();
|
|
26988
|
+
build2.onResolve({ filter: /.*/ }, async (args) => {
|
|
26989
|
+
if (args.pluginData === RESOLVING) {
|
|
26990
|
+
return null;
|
|
26991
|
+
}
|
|
26992
|
+
const resolveOptions = {
|
|
26993
|
+
importer: args.importer,
|
|
26994
|
+
kind: args.kind,
|
|
26995
|
+
resolveDir: rootDir,
|
|
26996
|
+
pluginData: RESOLVING
|
|
26997
|
+
};
|
|
26998
|
+
let result = await build2.resolve(path2.join(args.path, "package.json"), resolveOptions);
|
|
26999
|
+
if (result.errors.length) {
|
|
27000
|
+
result = await build2.resolve(args.path, resolveOptions);
|
|
27001
|
+
}
|
|
27002
|
+
if (result.errors.length) {
|
|
27003
|
+
return result;
|
|
27004
|
+
}
|
|
27005
|
+
const packageName = args.path;
|
|
27006
|
+
const packagePath = extractPackagePath(result.path, packageName);
|
|
27007
|
+
if (packagePath) {
|
|
27008
|
+
results[packageName] = await getPackageVersion(packagePath);
|
|
27009
|
+
}
|
|
27010
|
+
return result;
|
|
27011
|
+
});
|
|
27012
|
+
build2.onLoad({ filter: /.*/ }, () => ({ contents: "// empty source" }));
|
|
27013
|
+
}
|
|
27014
|
+
}
|
|
27015
|
+
]
|
|
27016
|
+
});
|
|
27017
|
+
return results;
|
|
27018
|
+
}
|
|
27019
|
+
function createVirtualEntry(packageNames) {
|
|
27020
|
+
return packageNames.map((packageName) => `import '${packageName}';`).join("\n");
|
|
27021
|
+
}
|
|
27022
|
+
function extractPackagePath(path8, packageName) {
|
|
27023
|
+
const normalizedPath = normalizePath(path8);
|
|
27024
|
+
if (normalizedPath.endsWith("/package.json")) {
|
|
27025
|
+
return normalizedPath.replace(/\/package\.json$/, "");
|
|
27026
|
+
}
|
|
27027
|
+
const match = normalizedPath.match(new RegExp(`(.*?node_modules/${packageName})/.*$`));
|
|
27028
|
+
if (match) {
|
|
27029
|
+
return match[1];
|
|
27030
|
+
}
|
|
27031
|
+
throw new Error(`Failed to extract path: ${packageName}`);
|
|
27032
|
+
}
|
|
27033
|
+
async function getPackageVersion(packagePath) {
|
|
27034
|
+
const packageJson = JSON.parse(await fs2.readFile(path2.join(packagePath, "package.json"), "utf-8"));
|
|
27035
|
+
return packageJson.version;
|
|
27036
|
+
}
|
|
27037
|
+
|
|
27038
|
+
// src/utils/createArtifact.ts
|
|
27039
|
+
init_cjs_shims();
|
|
27040
|
+
var import_path2 = __toESM(require("path"), 1);
|
|
27041
|
+
|
|
27042
|
+
// src/utils/compressToZip.ts
|
|
27043
|
+
init_cjs_shims();
|
|
27044
|
+
var fs3 = __toESM(require("fs"), 1);
|
|
27045
|
+
var path3 = __toESM(require("path"), 1);
|
|
27046
|
+
var import_archiver = __toESM(require_archiver(), 1);
|
|
27047
|
+
async function compressToZip(config) {
|
|
27048
|
+
const { files, outfile } = config;
|
|
27049
|
+
return new Promise((resolve, reject2) => {
|
|
27050
|
+
const outputStream = fs3.createWriteStream(outfile);
|
|
27051
|
+
const archive = (0, import_archiver.default)("zip", { zlib: { level: 9 } });
|
|
27052
|
+
outputStream.on("close", () => resolve(outfile));
|
|
27053
|
+
outputStream.on("error", (error) => reject2(error));
|
|
27054
|
+
archive.on("error", (error) => reject2(error)).pipe(outputStream);
|
|
27055
|
+
files.forEach(({ path: filePath, name }) => {
|
|
27056
|
+
const fileName = name ?? path3.basename(filePath);
|
|
27057
|
+
archive.append(fs3.createReadStream(filePath), { name: fileName });
|
|
27058
|
+
});
|
|
27059
|
+
archive.finalize();
|
|
27060
|
+
});
|
|
27061
|
+
}
|
|
27062
|
+
|
|
27063
|
+
// src/utils/updateAppJsonMetadata.ts
|
|
27064
|
+
init_cjs_shims();
|
|
27065
|
+
var fs4 = __toESM(require("fs/promises"), 1);
|
|
27066
|
+
var path4 = __toESM(require("path"), 1);
|
|
27067
|
+
async function resolveAppManifestPath() {
|
|
27068
|
+
const cwd = getPackageRoot();
|
|
27069
|
+
const appManifestPath = path4.join(cwd, ".bedrock", APP_MANIFEST_NAME);
|
|
27070
|
+
await fs4.access(appManifestPath, fs4.constants.F_OK);
|
|
27071
|
+
return appManifestPath;
|
|
27072
|
+
}
|
|
27073
|
+
async function readAppJson(appJsonPath) {
|
|
27074
|
+
const appJson = await fs4.readFile(appJsonPath, "utf8");
|
|
27075
|
+
return JSON.parse(appJson);
|
|
27076
|
+
}
|
|
27077
|
+
async function writeAppJson(appJsonPath, content) {
|
|
27078
|
+
await fs4.writeFile(appJsonPath, JSON.stringify(content));
|
|
27079
|
+
}
|
|
27080
|
+
async function updateAppJsonMetadata(metadata) {
|
|
27081
|
+
const appJsonPath = await resolveAppManifestPath();
|
|
27082
|
+
const appJson = await readAppJson(appJsonPath);
|
|
27083
|
+
await writeAppJson(appJsonPath, {
|
|
27084
|
+
...appJson,
|
|
27085
|
+
_metadata: metadata
|
|
27086
|
+
});
|
|
27087
|
+
}
|
|
26927
27088
|
|
|
26928
27089
|
// src/utils/createArtifact.ts
|
|
26929
27090
|
async function validateZip(zipPath) {
|
|
@@ -27376,6 +27537,9 @@ function setupRuntimeSetupScript(config) {
|
|
|
27376
27537
|
}
|
|
27377
27538
|
|
|
27378
27539
|
// src/appsInToss.ts
|
|
27540
|
+
function log2(...args) {
|
|
27541
|
+
console.log(import_picocolors.default.bold(import_picocolors.default.cyan("[AppsInToss]")), ...args);
|
|
27542
|
+
}
|
|
27379
27543
|
function appsInTossCreateArtifact(deploymentId) {
|
|
27380
27544
|
const packageRoot = getPackageRoot();
|
|
27381
27545
|
return {
|
|
@@ -27383,6 +27547,7 @@ function appsInTossCreateArtifact(deploymentId) {
|
|
|
27383
27547
|
build: {
|
|
27384
27548
|
order: "post",
|
|
27385
27549
|
handler: async ({ buildResults, appName, cwd }) => {
|
|
27550
|
+
log2("\uC571 \uBE4C\uB4DC \uC911...");
|
|
27386
27551
|
const { dependencies, devDependencies } = await collectDependencyVersions(cwd);
|
|
27387
27552
|
const artifactOutfile = await createArtifact({
|
|
27388
27553
|
reactNativeVersion: REACT_NATIVE_VERSION,
|
|
@@ -27405,7 +27570,7 @@ function appsInTossCreateArtifact(deploymentId) {
|
|
|
27405
27570
|
throw new Error("\uC544\uD2F0\uD329\uD2B8 \uC0DD\uC131\uC5D0 \uC2E4\uD328\uD588\uC5B4\uC694.");
|
|
27406
27571
|
}
|
|
27407
27572
|
const filename = import_path3.default.basename(artifactOutfile);
|
|
27408
|
-
|
|
27573
|
+
log2(`\u2705 ${import_picocolors.default.green(`${filename}`)} \uBE4C\uB4DC \uC644\uB8CC`);
|
|
27409
27574
|
}
|
|
27410
27575
|
}
|
|
27411
27576
|
};
|
|
@@ -27482,18 +27647,54 @@ async function appsInTossAppJson(options2) {
|
|
|
27482
27647
|
}
|
|
27483
27648
|
};
|
|
27484
27649
|
}
|
|
27650
|
+
function appsInTossPostNotice() {
|
|
27651
|
+
const phase = "post";
|
|
27652
|
+
return {
|
|
27653
|
+
name: "apps-in-toss:post-notice",
|
|
27654
|
+
dev: {
|
|
27655
|
+
order: phase,
|
|
27656
|
+
handler() {
|
|
27657
|
+
}
|
|
27658
|
+
},
|
|
27659
|
+
build: {
|
|
27660
|
+
order: phase,
|
|
27661
|
+
async handler({ appName }) {
|
|
27662
|
+
if (this.meta.sentry) {
|
|
27663
|
+
const command = [
|
|
27664
|
+
"ait sentry upload-sourcemap",
|
|
27665
|
+
`--app-name ${appName}`,
|
|
27666
|
+
"--api-key <API_KEY>",
|
|
27667
|
+
"--deployment-id <DEPLOYMENT_ID>"
|
|
27668
|
+
].join(" \\\n");
|
|
27669
|
+
log2(
|
|
27670
|
+
`Sentry \uAD6C\uC131\uC774 \uAC10\uC9C0\uB410\uC5B4\uC694. \uC815\uD655\uD55C \uC624\uB958 \uCD94\uC801\uC744 \uC704\uD574\uC11C\uB294 \uBC30\uD3EC\uAC00 \uB05D\uB09C \uB4A4 \uB2E4\uC74C \uBA85\uB839\uC5B4\uB85C \uC18C\uC2A4\uB9F5\uC744 \uC5C5\uB85C\uB4DC\uD574 \uC8FC\uC138\uC694.
|
|
27671
|
+
|
|
27672
|
+
${command}
|
|
27673
|
+
`
|
|
27674
|
+
);
|
|
27675
|
+
}
|
|
27676
|
+
}
|
|
27677
|
+
}
|
|
27678
|
+
};
|
|
27679
|
+
}
|
|
27485
27680
|
function appsInToss(options2) {
|
|
27681
|
+
const result = validateAppInTossPluginOptions(options2);
|
|
27682
|
+
if (!result.success) {
|
|
27683
|
+
console.error("[Apps In Toss Plugin] \uD50C\uB7EC\uADF8\uC778 \uC635\uC158\uC774 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. bedrock.config.ts \uAD6C\uC131\uC744 \uD655\uC778\uD574\uC8FC\uC138\uC694.");
|
|
27684
|
+
process.exit(1);
|
|
27685
|
+
}
|
|
27486
27686
|
const deploymentId = generateDeploymentId();
|
|
27487
27687
|
const { contents, path: envFilePath } = setupRuntimeSetupScript({
|
|
27488
|
-
brand:
|
|
27688
|
+
brand: result.data.brand,
|
|
27489
27689
|
deploymentId
|
|
27490
27690
|
});
|
|
27491
27691
|
return [
|
|
27492
|
-
appsInTossAppJson(
|
|
27493
|
-
appsInTossDevServer(
|
|
27692
|
+
appsInTossAppJson(result.data),
|
|
27693
|
+
appsInTossDevServer(result.data),
|
|
27494
27694
|
appsInTossCreateArtifact(deploymentId),
|
|
27495
27695
|
appsInTossEsbuildConfig(contents),
|
|
27496
|
-
appsInTossMetroConfig(envFilePath)
|
|
27696
|
+
appsInTossMetroConfig(envFilePath),
|
|
27697
|
+
appsInTossPostNotice()
|
|
27497
27698
|
];
|
|
27498
27699
|
}
|
|
27499
27700
|
|
|
@@ -27560,9 +27761,11 @@ function analytics() {
|
|
|
27560
27761
|
appsInTossAppJson,
|
|
27561
27762
|
appsInTossEsbuildConfig,
|
|
27562
27763
|
appsInTossMetroConfig,
|
|
27764
|
+
appsInTossPostNotice,
|
|
27563
27765
|
collectDependencyVersions,
|
|
27564
27766
|
createArtifact,
|
|
27565
27767
|
setupRuntimeSetupScript,
|
|
27768
|
+
validateAppInTossPluginOptions,
|
|
27566
27769
|
validateAppManifest,
|
|
27567
27770
|
validateZip
|
|
27568
27771
|
});
|
package/dist/index.d.cts
CHANGED
|
@@ -47,10 +47,12 @@ interface AppsInTossPluginOptions {
|
|
|
47
47
|
* - `inverted`: 반전 테마 (검은 배경)
|
|
48
48
|
*/
|
|
49
49
|
type BridgeTheme = 'basic' | 'inverted';
|
|
50
|
+
declare const validateAppInTossPluginOptions: (input: unknown) => typia.IValidation<AppsInTossPluginOptions>;
|
|
50
51
|
|
|
51
52
|
declare function appsInTossEsbuildConfig(envScript: string): BedrockPluginCore;
|
|
52
53
|
declare function appsInTossMetroConfig(envScriptPath: string): BedrockPluginCore;
|
|
53
54
|
declare function appsInTossAppJson(options: Pick<AppsInTossPluginOptions, 'permissions'>): Promise<BedrockPluginCore>;
|
|
55
|
+
declare function appsInTossPostNotice(): BedrockPluginCore;
|
|
54
56
|
declare function appsInToss(options: AppsInTossPluginOptions): (BedrockPluginCore | Promise<BedrockPluginCore>)[];
|
|
55
57
|
|
|
56
58
|
declare function analytics(): BedrockPluginCore;
|
|
@@ -99,4 +101,4 @@ declare function collectDependencyVersions(rootDir: string): Promise<{
|
|
|
99
101
|
devDependencies: Record<string, string>;
|
|
100
102
|
}>;
|
|
101
103
|
|
|
102
|
-
export { type AppManifest, type AppsInTossPluginOptions, type BridgeTheme, type BuildResult, type CreateArtifactOptions, type Permission, analytics, appsInToss, appsInTossAppJson, appsInTossEsbuildConfig, appsInTossMetroConfig, collectDependencyVersions, createArtifact, setupRuntimeSetupScript, validateAppManifest, validateZip };
|
|
104
|
+
export { type AppManifest, type AppsInTossPluginOptions, type BridgeTheme, type BuildResult, type CreateArtifactOptions, type Permission, analytics, appsInToss, appsInTossAppJson, appsInTossEsbuildConfig, appsInTossMetroConfig, appsInTossPostNotice, collectDependencyVersions, createArtifact, setupRuntimeSetupScript, validateAppInTossPluginOptions, validateAppManifest, validateZip };
|
package/dist/index.d.ts
CHANGED
|
@@ -47,10 +47,12 @@ interface AppsInTossPluginOptions {
|
|
|
47
47
|
* - `inverted`: 반전 테마 (검은 배경)
|
|
48
48
|
*/
|
|
49
49
|
type BridgeTheme = 'basic' | 'inverted';
|
|
50
|
+
declare const validateAppInTossPluginOptions: (input: unknown) => typia.IValidation<AppsInTossPluginOptions>;
|
|
50
51
|
|
|
51
52
|
declare function appsInTossEsbuildConfig(envScript: string): BedrockPluginCore;
|
|
52
53
|
declare function appsInTossMetroConfig(envScriptPath: string): BedrockPluginCore;
|
|
53
54
|
declare function appsInTossAppJson(options: Pick<AppsInTossPluginOptions, 'permissions'>): Promise<BedrockPluginCore>;
|
|
55
|
+
declare function appsInTossPostNotice(): BedrockPluginCore;
|
|
54
56
|
declare function appsInToss(options: AppsInTossPluginOptions): (BedrockPluginCore | Promise<BedrockPluginCore>)[];
|
|
55
57
|
|
|
56
58
|
declare function analytics(): BedrockPluginCore;
|
|
@@ -99,4 +101,4 @@ declare function collectDependencyVersions(rootDir: string): Promise<{
|
|
|
99
101
|
devDependencies: Record<string, string>;
|
|
100
102
|
}>;
|
|
101
103
|
|
|
102
|
-
export { type AppManifest, type AppsInTossPluginOptions, type BridgeTheme, type BuildResult, type CreateArtifactOptions, type Permission, analytics, appsInToss, appsInTossAppJson, appsInTossEsbuildConfig, appsInTossMetroConfig, collectDependencyVersions, createArtifact, setupRuntimeSetupScript, validateAppManifest, validateZip };
|
|
104
|
+
export { type AppManifest, type AppsInTossPluginOptions, type BridgeTheme, type BuildResult, type CreateArtifactOptions, type Permission, analytics, appsInToss, appsInTossAppJson, appsInTossEsbuildConfig, appsInTossMetroConfig, appsInTossPostNotice, collectDependencyVersions, createArtifact, setupRuntimeSetupScript, validateAppInTossPluginOptions, validateAppManifest, validateZip };
|
package/dist/index.js
CHANGED
|
@@ -1501,6 +1501,43 @@ var require_picocolors = __commonJS({
|
|
|
1501
1501
|
}
|
|
1502
1502
|
});
|
|
1503
1503
|
|
|
1504
|
+
// ../../.yarn/__virtual__/typia-virtual-93fdc6e779/0/cache/typia-npm-8.0.4-b2444b63f3-1028a8a121.zip/node_modules/typia/lib/internal/_isFormatUuid.js
|
|
1505
|
+
var require_isFormatUuid = __commonJS({
|
|
1506
|
+
"../../.yarn/__virtual__/typia-virtual-93fdc6e779/0/cache/typia-npm-8.0.4-b2444b63f3-1028a8a121.zip/node_modules/typia/lib/internal/_isFormatUuid.js"(exports) {
|
|
1507
|
+
"use strict";
|
|
1508
|
+
init_esm_shims();
|
|
1509
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1510
|
+
exports._isFormatUuid = void 0;
|
|
1511
|
+
var _isFormatUuid2 = (str) => PATTERN.test(str);
|
|
1512
|
+
exports._isFormatUuid = _isFormatUuid2;
|
|
1513
|
+
var PATTERN = /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;
|
|
1514
|
+
}
|
|
1515
|
+
});
|
|
1516
|
+
|
|
1517
|
+
// ../../.yarn/__virtual__/typia-virtual-93fdc6e779/0/cache/typia-npm-8.0.4-b2444b63f3-1028a8a121.zip/node_modules/typia/lib/internal/_validateReport.js
|
|
1518
|
+
var require_validateReport = __commonJS({
|
|
1519
|
+
"../../.yarn/__virtual__/typia-virtual-93fdc6e779/0/cache/typia-npm-8.0.4-b2444b63f3-1028a8a121.zip/node_modules/typia/lib/internal/_validateReport.js"(exports) {
|
|
1520
|
+
"use strict";
|
|
1521
|
+
init_esm_shims();
|
|
1522
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1523
|
+
exports._validateReport = void 0;
|
|
1524
|
+
var _validateReport2 = (array) => {
|
|
1525
|
+
const reportable = (path8) => {
|
|
1526
|
+
if (array.length === 0)
|
|
1527
|
+
return true;
|
|
1528
|
+
const last = array[array.length - 1].path;
|
|
1529
|
+
return path8.length > last.length || last.substring(0, path8.length) !== path8;
|
|
1530
|
+
};
|
|
1531
|
+
return (exceptable, error) => {
|
|
1532
|
+
if (exceptable && reportable(error.path))
|
|
1533
|
+
array.push(error);
|
|
1534
|
+
return false;
|
|
1535
|
+
};
|
|
1536
|
+
};
|
|
1537
|
+
exports._validateReport = _validateReport2;
|
|
1538
|
+
}
|
|
1539
|
+
});
|
|
1540
|
+
|
|
1504
1541
|
// ../../.yarn/cache/minimatch-npm-5.1.6-33ea6af31a-3defdfd230.zip/node_modules/minimatch/lib/path.js
|
|
1505
1542
|
var require_path = __commonJS({
|
|
1506
1543
|
"../../.yarn/cache/minimatch-npm-5.1.6-33ea6af31a-3defdfd230.zip/node_modules/minimatch/lib/path.js"(exports, module) {
|
|
@@ -26507,43 +26544,6 @@ var require_archiver = __commonJS({
|
|
|
26507
26544
|
}
|
|
26508
26545
|
});
|
|
26509
26546
|
|
|
26510
|
-
// ../../.yarn/__virtual__/typia-virtual-93fdc6e779/0/cache/typia-npm-8.0.4-b2444b63f3-1028a8a121.zip/node_modules/typia/lib/internal/_isFormatUuid.js
|
|
26511
|
-
var require_isFormatUuid = __commonJS({
|
|
26512
|
-
"../../.yarn/__virtual__/typia-virtual-93fdc6e779/0/cache/typia-npm-8.0.4-b2444b63f3-1028a8a121.zip/node_modules/typia/lib/internal/_isFormatUuid.js"(exports) {
|
|
26513
|
-
"use strict";
|
|
26514
|
-
init_esm_shims();
|
|
26515
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26516
|
-
exports._isFormatUuid = void 0;
|
|
26517
|
-
var _isFormatUuid2 = (str) => PATTERN.test(str);
|
|
26518
|
-
exports._isFormatUuid = _isFormatUuid2;
|
|
26519
|
-
var PATTERN = /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;
|
|
26520
|
-
}
|
|
26521
|
-
});
|
|
26522
|
-
|
|
26523
|
-
// ../../.yarn/__virtual__/typia-virtual-93fdc6e779/0/cache/typia-npm-8.0.4-b2444b63f3-1028a8a121.zip/node_modules/typia/lib/internal/_validateReport.js
|
|
26524
|
-
var require_validateReport = __commonJS({
|
|
26525
|
-
"../../.yarn/__virtual__/typia-virtual-93fdc6e779/0/cache/typia-npm-8.0.4-b2444b63f3-1028a8a121.zip/node_modules/typia/lib/internal/_validateReport.js"(exports) {
|
|
26526
|
-
"use strict";
|
|
26527
|
-
init_esm_shims();
|
|
26528
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26529
|
-
exports._validateReport = void 0;
|
|
26530
|
-
var _validateReport2 = (array) => {
|
|
26531
|
-
const reportable = (path8) => {
|
|
26532
|
-
if (array.length === 0)
|
|
26533
|
-
return true;
|
|
26534
|
-
const last = array[array.length - 1].path;
|
|
26535
|
-
return path8.length > last.length || last.substring(0, path8.length) !== path8;
|
|
26536
|
-
};
|
|
26537
|
-
return (exceptable, error) => {
|
|
26538
|
-
if (exceptable && reportable(error.path))
|
|
26539
|
-
array.push(error);
|
|
26540
|
-
return false;
|
|
26541
|
-
};
|
|
26542
|
-
};
|
|
26543
|
-
exports._validateReport = _validateReport2;
|
|
26544
|
-
}
|
|
26545
|
-
});
|
|
26546
|
-
|
|
26547
26547
|
// src/index.ts
|
|
26548
26548
|
init_esm_shims();
|
|
26549
26549
|
|
|
@@ -26618,133 +26618,6 @@ init_esm_shims();
|
|
|
26618
26618
|
var REACT_NATIVE_VERSION = "0.72.6";
|
|
26619
26619
|
var APP_MANIFEST_NAME = "app.json";
|
|
26620
26620
|
|
|
26621
|
-
// src/utils/collectDependencyVersions.ts
|
|
26622
|
-
init_esm_shims();
|
|
26623
|
-
import * as fs2 from "fs/promises";
|
|
26624
|
-
import * as path2 from "path";
|
|
26625
|
-
import * as esbuild from "esbuild";
|
|
26626
|
-
async function collectDependencyVersions(rootDir) {
|
|
26627
|
-
const packageJsonPath = path2.join(rootDir, "package.json");
|
|
26628
|
-
const packageJson = JSON.parse(await fs2.readFile(packageJsonPath, "utf8"));
|
|
26629
|
-
const [dependencies, devDependencies] = await Promise.all([
|
|
26630
|
-
resolvePackageVersions(rootDir, Object.keys(packageJson.dependencies)),
|
|
26631
|
-
resolvePackageVersions(rootDir, Object.keys(packageJson.devDependencies))
|
|
26632
|
-
]);
|
|
26633
|
-
return { dependencies, devDependencies };
|
|
26634
|
-
}
|
|
26635
|
-
async function resolvePackageVersions(rootDir, packageNames) {
|
|
26636
|
-
const results = {};
|
|
26637
|
-
await esbuild.build({
|
|
26638
|
-
stdin: { contents: createVirtualEntry(packageNames) },
|
|
26639
|
-
bundle: true,
|
|
26640
|
-
write: false,
|
|
26641
|
-
logLevel: "silent",
|
|
26642
|
-
plugins: [
|
|
26643
|
-
{
|
|
26644
|
-
name: "collect-package-version",
|
|
26645
|
-
setup(build2) {
|
|
26646
|
-
const RESOLVING = Symbol();
|
|
26647
|
-
build2.onResolve({ filter: /.*/ }, async (args) => {
|
|
26648
|
-
if (args.pluginData === RESOLVING) {
|
|
26649
|
-
return null;
|
|
26650
|
-
}
|
|
26651
|
-
const resolveOptions = {
|
|
26652
|
-
importer: args.importer,
|
|
26653
|
-
kind: args.kind,
|
|
26654
|
-
resolveDir: rootDir,
|
|
26655
|
-
pluginData: RESOLVING
|
|
26656
|
-
};
|
|
26657
|
-
let result = await build2.resolve(path2.join(args.path, "package.json"), resolveOptions);
|
|
26658
|
-
if (result.errors.length) {
|
|
26659
|
-
result = await build2.resolve(args.path, resolveOptions);
|
|
26660
|
-
}
|
|
26661
|
-
if (result.errors.length) {
|
|
26662
|
-
return result;
|
|
26663
|
-
}
|
|
26664
|
-
const packageName = args.path;
|
|
26665
|
-
const packagePath = extractPackagePath(result.path, packageName);
|
|
26666
|
-
if (packagePath) {
|
|
26667
|
-
results[packageName] = await getPackageVersion(packagePath);
|
|
26668
|
-
}
|
|
26669
|
-
return result;
|
|
26670
|
-
});
|
|
26671
|
-
build2.onLoad({ filter: /.*/ }, () => ({ contents: "// empty source" }));
|
|
26672
|
-
}
|
|
26673
|
-
}
|
|
26674
|
-
]
|
|
26675
|
-
});
|
|
26676
|
-
return results;
|
|
26677
|
-
}
|
|
26678
|
-
function createVirtualEntry(packageNames) {
|
|
26679
|
-
return packageNames.map((packageName) => `import '${packageName}';`).join("\n");
|
|
26680
|
-
}
|
|
26681
|
-
function extractPackagePath(path8, packageName) {
|
|
26682
|
-
const normalizedPath = normalizePath(path8);
|
|
26683
|
-
if (normalizedPath.endsWith("/package.json")) {
|
|
26684
|
-
return normalizedPath.replace(/\/package\.json$/, "");
|
|
26685
|
-
}
|
|
26686
|
-
const match = normalizedPath.match(new RegExp(`(.*?node_modules/${packageName})/.*$`));
|
|
26687
|
-
if (match) {
|
|
26688
|
-
return match[1];
|
|
26689
|
-
}
|
|
26690
|
-
throw new Error(`Failed to extract path: ${packageName}`);
|
|
26691
|
-
}
|
|
26692
|
-
async function getPackageVersion(packagePath) {
|
|
26693
|
-
const packageJson = JSON.parse(await fs2.readFile(path2.join(packagePath, "package.json"), "utf-8"));
|
|
26694
|
-
return packageJson.version;
|
|
26695
|
-
}
|
|
26696
|
-
|
|
26697
|
-
// src/utils/createArtifact.ts
|
|
26698
|
-
init_esm_shims();
|
|
26699
|
-
import path5 from "path";
|
|
26700
|
-
|
|
26701
|
-
// src/utils/compressToZip.ts
|
|
26702
|
-
init_esm_shims();
|
|
26703
|
-
var import_archiver = __toESM(require_archiver(), 1);
|
|
26704
|
-
import * as fs3 from "fs";
|
|
26705
|
-
import * as path3 from "path";
|
|
26706
|
-
async function compressToZip(config) {
|
|
26707
|
-
const { files, outfile } = config;
|
|
26708
|
-
return new Promise((resolve, reject2) => {
|
|
26709
|
-
const outputStream = fs3.createWriteStream(outfile);
|
|
26710
|
-
const archive = (0, import_archiver.default)("zip", { zlib: { level: 9 } });
|
|
26711
|
-
outputStream.on("close", () => resolve(outfile));
|
|
26712
|
-
outputStream.on("error", (error) => reject2(error));
|
|
26713
|
-
archive.on("error", (error) => reject2(error)).pipe(outputStream);
|
|
26714
|
-
files.forEach(({ path: filePath, name }) => {
|
|
26715
|
-
const fileName = name ?? path3.basename(filePath);
|
|
26716
|
-
archive.append(fs3.createReadStream(filePath), { name: fileName });
|
|
26717
|
-
});
|
|
26718
|
-
archive.finalize();
|
|
26719
|
-
});
|
|
26720
|
-
}
|
|
26721
|
-
|
|
26722
|
-
// src/utils/updateAppJsonMetadata.ts
|
|
26723
|
-
init_esm_shims();
|
|
26724
|
-
import * as fs4 from "fs/promises";
|
|
26725
|
-
import * as path4 from "path";
|
|
26726
|
-
async function resolveAppManifestPath() {
|
|
26727
|
-
const cwd = getPackageRoot();
|
|
26728
|
-
const appManifestPath = path4.join(cwd, ".bedrock", APP_MANIFEST_NAME);
|
|
26729
|
-
await fs4.access(appManifestPath, fs4.constants.F_OK);
|
|
26730
|
-
return appManifestPath;
|
|
26731
|
-
}
|
|
26732
|
-
async function readAppJson(appJsonPath) {
|
|
26733
|
-
const appJson = await fs4.readFile(appJsonPath, "utf8");
|
|
26734
|
-
return JSON.parse(appJson);
|
|
26735
|
-
}
|
|
26736
|
-
async function writeAppJson(appJsonPath, content) {
|
|
26737
|
-
await fs4.writeFile(appJsonPath, JSON.stringify(content));
|
|
26738
|
-
}
|
|
26739
|
-
async function updateAppJsonMetadata(metadata) {
|
|
26740
|
-
const appJsonPath = await resolveAppManifestPath();
|
|
26741
|
-
const appJson = await readAppJson(appJsonPath);
|
|
26742
|
-
await writeAppJson(appJsonPath, {
|
|
26743
|
-
...appJson,
|
|
26744
|
-
_metadata: metadata
|
|
26745
|
-
});
|
|
26746
|
-
}
|
|
26747
|
-
|
|
26748
26621
|
// src/types.ts
|
|
26749
26622
|
init_esm_shims();
|
|
26750
26623
|
var __typia_transform__isFormatUuid = __toESM(require_isFormatUuid(), 1);
|
|
@@ -26916,6 +26789,292 @@ var validateAppManifest = /* @__PURE__ */ (() => {
|
|
|
26916
26789
|
};
|
|
26917
26790
|
};
|
|
26918
26791
|
})();
|
|
26792
|
+
var validateAppInTossPluginOptions = /* @__PURE__ */ (() => {
|
|
26793
|
+
const _io0 = (input) => "object" === typeof input.brand && null !== input.brand && _io1(input.brand) && (Array.isArray(input.permissions) && input.permissions.every((elem) => "object" === typeof elem && null !== elem && _iu0(elem)));
|
|
26794
|
+
const _io1 = (input) => "string" === typeof input.displayName && "string" === typeof input.primaryColor && "string" === typeof input.icon && ("basic" === input.bridgeColorMode || "inverted" === input.bridgeColorMode);
|
|
26795
|
+
const _io2 = (input) => "clipboard" === input.name && ("read" === input.access || "write" === input.access);
|
|
26796
|
+
const _io3 = (input) => "geolocation" === input.name && "access" === input.access;
|
|
26797
|
+
const _io4 = (input) => "contacts" === input.name && ("read" === input.access || "write" === input.access);
|
|
26798
|
+
const _io5 = (input) => "photos" === input.name && ("read" === input.access || "write" === input.access);
|
|
26799
|
+
const _io6 = (input) => "camera" === input.name && "access" === input.access;
|
|
26800
|
+
const _iu0 = (input) => (() => {
|
|
26801
|
+
if ("camera" === input.name)
|
|
26802
|
+
return _io6(input);
|
|
26803
|
+
else if ("photos" === input.name)
|
|
26804
|
+
return _io5(input);
|
|
26805
|
+
else if ("contacts" === input.name)
|
|
26806
|
+
return _io4(input);
|
|
26807
|
+
else if ("geolocation" === input.name)
|
|
26808
|
+
return _io3(input);
|
|
26809
|
+
else if ("clipboard" === input.name)
|
|
26810
|
+
return _io2(input);
|
|
26811
|
+
else
|
|
26812
|
+
return false;
|
|
26813
|
+
})();
|
|
26814
|
+
const _vo0 = (input, _path, _exceptionable = true) => [("object" === typeof input.brand && null !== input.brand || _report(_exceptionable, {
|
|
26815
|
+
path: _path + ".brand",
|
|
26816
|
+
expected: "__type",
|
|
26817
|
+
value: input.brand
|
|
26818
|
+
})) && _vo1(input.brand, _path + ".brand", _exceptionable) || _report(_exceptionable, {
|
|
26819
|
+
path: _path + ".brand",
|
|
26820
|
+
expected: "__type",
|
|
26821
|
+
value: input.brand
|
|
26822
|
+
}), (Array.isArray(input.permissions) || _report(_exceptionable, {
|
|
26823
|
+
path: _path + ".permissions",
|
|
26824
|
+
expected: "Array<Permission>",
|
|
26825
|
+
value: input.permissions
|
|
26826
|
+
})) && input.permissions.map((elem, _index2) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
26827
|
+
path: _path + ".permissions[" + _index2 + "]",
|
|
26828
|
+
expected: "(CameraPermission | ClipboardPermission | ContactsPermission | GeolocationPermission | PhotosPermission)",
|
|
26829
|
+
value: elem
|
|
26830
|
+
})) && _vu0(elem, _path + ".permissions[" + _index2 + "]", _exceptionable) || _report(_exceptionable, {
|
|
26831
|
+
path: _path + ".permissions[" + _index2 + "]",
|
|
26832
|
+
expected: "(CameraPermission | ClipboardPermission | ContactsPermission | GeolocationPermission | PhotosPermission)",
|
|
26833
|
+
value: elem
|
|
26834
|
+
})).every((flag) => flag) || _report(_exceptionable, {
|
|
26835
|
+
path: _path + ".permissions",
|
|
26836
|
+
expected: "Array<Permission>",
|
|
26837
|
+
value: input.permissions
|
|
26838
|
+
})].every((flag) => flag);
|
|
26839
|
+
const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.displayName || _report(_exceptionable, {
|
|
26840
|
+
path: _path + ".displayName",
|
|
26841
|
+
expected: "string",
|
|
26842
|
+
value: input.displayName
|
|
26843
|
+
}), "string" === typeof input.primaryColor || _report(_exceptionable, {
|
|
26844
|
+
path: _path + ".primaryColor",
|
|
26845
|
+
expected: "string",
|
|
26846
|
+
value: input.primaryColor
|
|
26847
|
+
}), "string" === typeof input.icon || _report(_exceptionable, {
|
|
26848
|
+
path: _path + ".icon",
|
|
26849
|
+
expected: "string",
|
|
26850
|
+
value: input.icon
|
|
26851
|
+
}), "basic" === input.bridgeColorMode || "inverted" === input.bridgeColorMode || _report(_exceptionable, {
|
|
26852
|
+
path: _path + ".bridgeColorMode",
|
|
26853
|
+
expected: '("basic" | "inverted")',
|
|
26854
|
+
value: input.bridgeColorMode
|
|
26855
|
+
})].every((flag) => flag);
|
|
26856
|
+
const _vo2 = (input, _path, _exceptionable = true) => ["clipboard" === input.name || _report(_exceptionable, {
|
|
26857
|
+
path: _path + ".name",
|
|
26858
|
+
expected: '"clipboard"',
|
|
26859
|
+
value: input.name
|
|
26860
|
+
}), "read" === input.access || "write" === input.access || _report(_exceptionable, {
|
|
26861
|
+
path: _path + ".access",
|
|
26862
|
+
expected: '("read" | "write")',
|
|
26863
|
+
value: input.access
|
|
26864
|
+
})].every((flag) => flag);
|
|
26865
|
+
const _vo3 = (input, _path, _exceptionable = true) => ["geolocation" === input.name || _report(_exceptionable, {
|
|
26866
|
+
path: _path + ".name",
|
|
26867
|
+
expected: '"geolocation"',
|
|
26868
|
+
value: input.name
|
|
26869
|
+
}), "access" === input.access || _report(_exceptionable, {
|
|
26870
|
+
path: _path + ".access",
|
|
26871
|
+
expected: '"access"',
|
|
26872
|
+
value: input.access
|
|
26873
|
+
})].every((flag) => flag);
|
|
26874
|
+
const _vo4 = (input, _path, _exceptionable = true) => ["contacts" === input.name || _report(_exceptionable, {
|
|
26875
|
+
path: _path + ".name",
|
|
26876
|
+
expected: '"contacts"',
|
|
26877
|
+
value: input.name
|
|
26878
|
+
}), "read" === input.access || "write" === input.access || _report(_exceptionable, {
|
|
26879
|
+
path: _path + ".access",
|
|
26880
|
+
expected: '("read" | "write")',
|
|
26881
|
+
value: input.access
|
|
26882
|
+
})].every((flag) => flag);
|
|
26883
|
+
const _vo5 = (input, _path, _exceptionable = true) => ["photos" === input.name || _report(_exceptionable, {
|
|
26884
|
+
path: _path + ".name",
|
|
26885
|
+
expected: '"photos"',
|
|
26886
|
+
value: input.name
|
|
26887
|
+
}), "read" === input.access || "write" === input.access || _report(_exceptionable, {
|
|
26888
|
+
path: _path + ".access",
|
|
26889
|
+
expected: '("read" | "write")',
|
|
26890
|
+
value: input.access
|
|
26891
|
+
})].every((flag) => flag);
|
|
26892
|
+
const _vo6 = (input, _path, _exceptionable = true) => ["camera" === input.name || _report(_exceptionable, {
|
|
26893
|
+
path: _path + ".name",
|
|
26894
|
+
expected: '"camera"',
|
|
26895
|
+
value: input.name
|
|
26896
|
+
}), "access" === input.access || _report(_exceptionable, {
|
|
26897
|
+
path: _path + ".access",
|
|
26898
|
+
expected: '"access"',
|
|
26899
|
+
value: input.access
|
|
26900
|
+
})].every((flag) => flag);
|
|
26901
|
+
const _vu0 = (input, _path, _exceptionable = true) => (() => {
|
|
26902
|
+
if ("camera" === input.name)
|
|
26903
|
+
return _vo6(input, _path, _exceptionable);
|
|
26904
|
+
else if ("photos" === input.name)
|
|
26905
|
+
return _vo5(input, _path, _exceptionable);
|
|
26906
|
+
else if ("contacts" === input.name)
|
|
26907
|
+
return _vo4(input, _path, _exceptionable);
|
|
26908
|
+
else if ("geolocation" === input.name)
|
|
26909
|
+
return _vo3(input, _path, _exceptionable);
|
|
26910
|
+
else if ("clipboard" === input.name)
|
|
26911
|
+
return _vo2(input, _path, _exceptionable);
|
|
26912
|
+
else
|
|
26913
|
+
return _report(_exceptionable, {
|
|
26914
|
+
path: _path,
|
|
26915
|
+
expected: "(CameraPermission | PhotosPermission | ContactsPermission | GeolocationPermission | ClipboardPermission)",
|
|
26916
|
+
value: input
|
|
26917
|
+
});
|
|
26918
|
+
})();
|
|
26919
|
+
const __is = (input) => "object" === typeof input && null !== input && _io0(input);
|
|
26920
|
+
let errors;
|
|
26921
|
+
let _report;
|
|
26922
|
+
return (input) => {
|
|
26923
|
+
if (false === __is(input)) {
|
|
26924
|
+
errors = [];
|
|
26925
|
+
_report = __typia_transform__validateReport._validateReport(errors);
|
|
26926
|
+
((input2, _path, _exceptionable = true) => ("object" === typeof input2 && null !== input2 || _report(true, {
|
|
26927
|
+
path: _path + "",
|
|
26928
|
+
expected: "AppsInTossPluginOptions",
|
|
26929
|
+
value: input2
|
|
26930
|
+
})) && _vo0(input2, _path + "", true) || _report(true, {
|
|
26931
|
+
path: _path + "",
|
|
26932
|
+
expected: "AppsInTossPluginOptions",
|
|
26933
|
+
value: input2
|
|
26934
|
+
}))(input, "$input", true);
|
|
26935
|
+
const success = 0 === errors.length;
|
|
26936
|
+
return success ? {
|
|
26937
|
+
success,
|
|
26938
|
+
data: input
|
|
26939
|
+
} : {
|
|
26940
|
+
success,
|
|
26941
|
+
errors,
|
|
26942
|
+
data: input
|
|
26943
|
+
};
|
|
26944
|
+
}
|
|
26945
|
+
return {
|
|
26946
|
+
success: true,
|
|
26947
|
+
data: input
|
|
26948
|
+
};
|
|
26949
|
+
};
|
|
26950
|
+
})();
|
|
26951
|
+
|
|
26952
|
+
// src/utils/collectDependencyVersions.ts
|
|
26953
|
+
init_esm_shims();
|
|
26954
|
+
import * as fs2 from "fs/promises";
|
|
26955
|
+
import * as path2 from "path";
|
|
26956
|
+
import * as esbuild from "esbuild";
|
|
26957
|
+
async function collectDependencyVersions(rootDir) {
|
|
26958
|
+
const packageJsonPath = path2.join(rootDir, "package.json");
|
|
26959
|
+
const packageJson = JSON.parse(await fs2.readFile(packageJsonPath, "utf8"));
|
|
26960
|
+
const [dependencies, devDependencies] = await Promise.all([
|
|
26961
|
+
resolvePackageVersions(rootDir, Object.keys(packageJson.dependencies)),
|
|
26962
|
+
resolvePackageVersions(rootDir, Object.keys(packageJson.devDependencies))
|
|
26963
|
+
]);
|
|
26964
|
+
return { dependencies, devDependencies };
|
|
26965
|
+
}
|
|
26966
|
+
async function resolvePackageVersions(rootDir, packageNames) {
|
|
26967
|
+
const results = {};
|
|
26968
|
+
await esbuild.build({
|
|
26969
|
+
stdin: { contents: createVirtualEntry(packageNames) },
|
|
26970
|
+
bundle: true,
|
|
26971
|
+
write: false,
|
|
26972
|
+
logLevel: "silent",
|
|
26973
|
+
plugins: [
|
|
26974
|
+
{
|
|
26975
|
+
name: "collect-package-version",
|
|
26976
|
+
setup(build2) {
|
|
26977
|
+
const RESOLVING = Symbol();
|
|
26978
|
+
build2.onResolve({ filter: /.*/ }, async (args) => {
|
|
26979
|
+
if (args.pluginData === RESOLVING) {
|
|
26980
|
+
return null;
|
|
26981
|
+
}
|
|
26982
|
+
const resolveOptions = {
|
|
26983
|
+
importer: args.importer,
|
|
26984
|
+
kind: args.kind,
|
|
26985
|
+
resolveDir: rootDir,
|
|
26986
|
+
pluginData: RESOLVING
|
|
26987
|
+
};
|
|
26988
|
+
let result = await build2.resolve(path2.join(args.path, "package.json"), resolveOptions);
|
|
26989
|
+
if (result.errors.length) {
|
|
26990
|
+
result = await build2.resolve(args.path, resolveOptions);
|
|
26991
|
+
}
|
|
26992
|
+
if (result.errors.length) {
|
|
26993
|
+
return result;
|
|
26994
|
+
}
|
|
26995
|
+
const packageName = args.path;
|
|
26996
|
+
const packagePath = extractPackagePath(result.path, packageName);
|
|
26997
|
+
if (packagePath) {
|
|
26998
|
+
results[packageName] = await getPackageVersion(packagePath);
|
|
26999
|
+
}
|
|
27000
|
+
return result;
|
|
27001
|
+
});
|
|
27002
|
+
build2.onLoad({ filter: /.*/ }, () => ({ contents: "// empty source" }));
|
|
27003
|
+
}
|
|
27004
|
+
}
|
|
27005
|
+
]
|
|
27006
|
+
});
|
|
27007
|
+
return results;
|
|
27008
|
+
}
|
|
27009
|
+
function createVirtualEntry(packageNames) {
|
|
27010
|
+
return packageNames.map((packageName) => `import '${packageName}';`).join("\n");
|
|
27011
|
+
}
|
|
27012
|
+
function extractPackagePath(path8, packageName) {
|
|
27013
|
+
const normalizedPath = normalizePath(path8);
|
|
27014
|
+
if (normalizedPath.endsWith("/package.json")) {
|
|
27015
|
+
return normalizedPath.replace(/\/package\.json$/, "");
|
|
27016
|
+
}
|
|
27017
|
+
const match = normalizedPath.match(new RegExp(`(.*?node_modules/${packageName})/.*$`));
|
|
27018
|
+
if (match) {
|
|
27019
|
+
return match[1];
|
|
27020
|
+
}
|
|
27021
|
+
throw new Error(`Failed to extract path: ${packageName}`);
|
|
27022
|
+
}
|
|
27023
|
+
async function getPackageVersion(packagePath) {
|
|
27024
|
+
const packageJson = JSON.parse(await fs2.readFile(path2.join(packagePath, "package.json"), "utf-8"));
|
|
27025
|
+
return packageJson.version;
|
|
27026
|
+
}
|
|
27027
|
+
|
|
27028
|
+
// src/utils/createArtifact.ts
|
|
27029
|
+
init_esm_shims();
|
|
27030
|
+
import path5 from "path";
|
|
27031
|
+
|
|
27032
|
+
// src/utils/compressToZip.ts
|
|
27033
|
+
init_esm_shims();
|
|
27034
|
+
var import_archiver = __toESM(require_archiver(), 1);
|
|
27035
|
+
import * as fs3 from "fs";
|
|
27036
|
+
import * as path3 from "path";
|
|
27037
|
+
async function compressToZip(config) {
|
|
27038
|
+
const { files, outfile } = config;
|
|
27039
|
+
return new Promise((resolve, reject2) => {
|
|
27040
|
+
const outputStream = fs3.createWriteStream(outfile);
|
|
27041
|
+
const archive = (0, import_archiver.default)("zip", { zlib: { level: 9 } });
|
|
27042
|
+
outputStream.on("close", () => resolve(outfile));
|
|
27043
|
+
outputStream.on("error", (error) => reject2(error));
|
|
27044
|
+
archive.on("error", (error) => reject2(error)).pipe(outputStream);
|
|
27045
|
+
files.forEach(({ path: filePath, name }) => {
|
|
27046
|
+
const fileName = name ?? path3.basename(filePath);
|
|
27047
|
+
archive.append(fs3.createReadStream(filePath), { name: fileName });
|
|
27048
|
+
});
|
|
27049
|
+
archive.finalize();
|
|
27050
|
+
});
|
|
27051
|
+
}
|
|
27052
|
+
|
|
27053
|
+
// src/utils/updateAppJsonMetadata.ts
|
|
27054
|
+
init_esm_shims();
|
|
27055
|
+
import * as fs4 from "fs/promises";
|
|
27056
|
+
import * as path4 from "path";
|
|
27057
|
+
async function resolveAppManifestPath() {
|
|
27058
|
+
const cwd = getPackageRoot();
|
|
27059
|
+
const appManifestPath = path4.join(cwd, ".bedrock", APP_MANIFEST_NAME);
|
|
27060
|
+
await fs4.access(appManifestPath, fs4.constants.F_OK);
|
|
27061
|
+
return appManifestPath;
|
|
27062
|
+
}
|
|
27063
|
+
async function readAppJson(appJsonPath) {
|
|
27064
|
+
const appJson = await fs4.readFile(appJsonPath, "utf8");
|
|
27065
|
+
return JSON.parse(appJson);
|
|
27066
|
+
}
|
|
27067
|
+
async function writeAppJson(appJsonPath, content) {
|
|
27068
|
+
await fs4.writeFile(appJsonPath, JSON.stringify(content));
|
|
27069
|
+
}
|
|
27070
|
+
async function updateAppJsonMetadata(metadata) {
|
|
27071
|
+
const appJsonPath = await resolveAppManifestPath();
|
|
27072
|
+
const appJson = await readAppJson(appJsonPath);
|
|
27073
|
+
await writeAppJson(appJsonPath, {
|
|
27074
|
+
...appJson,
|
|
27075
|
+
_metadata: metadata
|
|
27076
|
+
});
|
|
27077
|
+
}
|
|
26919
27078
|
|
|
26920
27079
|
// src/utils/createArtifact.ts
|
|
26921
27080
|
async function validateZip(zipPath) {
|
|
@@ -27368,6 +27527,9 @@ function setupRuntimeSetupScript(config) {
|
|
|
27368
27527
|
}
|
|
27369
27528
|
|
|
27370
27529
|
// src/appsInToss.ts
|
|
27530
|
+
function log2(...args) {
|
|
27531
|
+
console.log(import_picocolors.default.bold(import_picocolors.default.cyan("[AppsInToss]")), ...args);
|
|
27532
|
+
}
|
|
27371
27533
|
function appsInTossCreateArtifact(deploymentId) {
|
|
27372
27534
|
const packageRoot = getPackageRoot();
|
|
27373
27535
|
return {
|
|
@@ -27375,6 +27537,7 @@ function appsInTossCreateArtifact(deploymentId) {
|
|
|
27375
27537
|
build: {
|
|
27376
27538
|
order: "post",
|
|
27377
27539
|
handler: async ({ buildResults, appName, cwd }) => {
|
|
27540
|
+
log2("\uC571 \uBE4C\uB4DC \uC911...");
|
|
27378
27541
|
const { dependencies, devDependencies } = await collectDependencyVersions(cwd);
|
|
27379
27542
|
const artifactOutfile = await createArtifact({
|
|
27380
27543
|
reactNativeVersion: REACT_NATIVE_VERSION,
|
|
@@ -27397,7 +27560,7 @@ function appsInTossCreateArtifact(deploymentId) {
|
|
|
27397
27560
|
throw new Error("\uC544\uD2F0\uD329\uD2B8 \uC0DD\uC131\uC5D0 \uC2E4\uD328\uD588\uC5B4\uC694.");
|
|
27398
27561
|
}
|
|
27399
27562
|
const filename = path7.basename(artifactOutfile);
|
|
27400
|
-
|
|
27563
|
+
log2(`\u2705 ${import_picocolors.default.green(`${filename}`)} \uBE4C\uB4DC \uC644\uB8CC`);
|
|
27401
27564
|
}
|
|
27402
27565
|
}
|
|
27403
27566
|
};
|
|
@@ -27474,18 +27637,54 @@ async function appsInTossAppJson(options2) {
|
|
|
27474
27637
|
}
|
|
27475
27638
|
};
|
|
27476
27639
|
}
|
|
27640
|
+
function appsInTossPostNotice() {
|
|
27641
|
+
const phase = "post";
|
|
27642
|
+
return {
|
|
27643
|
+
name: "apps-in-toss:post-notice",
|
|
27644
|
+
dev: {
|
|
27645
|
+
order: phase,
|
|
27646
|
+
handler() {
|
|
27647
|
+
}
|
|
27648
|
+
},
|
|
27649
|
+
build: {
|
|
27650
|
+
order: phase,
|
|
27651
|
+
async handler({ appName }) {
|
|
27652
|
+
if (this.meta.sentry) {
|
|
27653
|
+
const command = [
|
|
27654
|
+
"ait sentry upload-sourcemap",
|
|
27655
|
+
`--app-name ${appName}`,
|
|
27656
|
+
"--api-key <API_KEY>",
|
|
27657
|
+
"--deployment-id <DEPLOYMENT_ID>"
|
|
27658
|
+
].join(" \\\n");
|
|
27659
|
+
log2(
|
|
27660
|
+
`Sentry \uAD6C\uC131\uC774 \uAC10\uC9C0\uB410\uC5B4\uC694. \uC815\uD655\uD55C \uC624\uB958 \uCD94\uC801\uC744 \uC704\uD574\uC11C\uB294 \uBC30\uD3EC\uAC00 \uB05D\uB09C \uB4A4 \uB2E4\uC74C \uBA85\uB839\uC5B4\uB85C \uC18C\uC2A4\uB9F5\uC744 \uC5C5\uB85C\uB4DC\uD574 \uC8FC\uC138\uC694.
|
|
27661
|
+
|
|
27662
|
+
${command}
|
|
27663
|
+
`
|
|
27664
|
+
);
|
|
27665
|
+
}
|
|
27666
|
+
}
|
|
27667
|
+
}
|
|
27668
|
+
};
|
|
27669
|
+
}
|
|
27477
27670
|
function appsInToss(options2) {
|
|
27671
|
+
const result = validateAppInTossPluginOptions(options2);
|
|
27672
|
+
if (!result.success) {
|
|
27673
|
+
console.error("[Apps In Toss Plugin] \uD50C\uB7EC\uADF8\uC778 \uC635\uC158\uC774 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. bedrock.config.ts \uAD6C\uC131\uC744 \uD655\uC778\uD574\uC8FC\uC138\uC694.");
|
|
27674
|
+
process.exit(1);
|
|
27675
|
+
}
|
|
27478
27676
|
const deploymentId = generateDeploymentId();
|
|
27479
27677
|
const { contents, path: envFilePath } = setupRuntimeSetupScript({
|
|
27480
|
-
brand:
|
|
27678
|
+
brand: result.data.brand,
|
|
27481
27679
|
deploymentId
|
|
27482
27680
|
});
|
|
27483
27681
|
return [
|
|
27484
|
-
appsInTossAppJson(
|
|
27485
|
-
appsInTossDevServer(
|
|
27682
|
+
appsInTossAppJson(result.data),
|
|
27683
|
+
appsInTossDevServer(result.data),
|
|
27486
27684
|
appsInTossCreateArtifact(deploymentId),
|
|
27487
27685
|
appsInTossEsbuildConfig(contents),
|
|
27488
|
-
appsInTossMetroConfig(envFilePath)
|
|
27686
|
+
appsInTossMetroConfig(envFilePath),
|
|
27687
|
+
appsInTossPostNotice()
|
|
27489
27688
|
];
|
|
27490
27689
|
}
|
|
27491
27690
|
|
|
@@ -27551,9 +27750,11 @@ export {
|
|
|
27551
27750
|
appsInTossAppJson,
|
|
27552
27751
|
appsInTossEsbuildConfig,
|
|
27553
27752
|
appsInTossMetroConfig,
|
|
27753
|
+
appsInTossPostNotice,
|
|
27554
27754
|
collectDependencyVersions,
|
|
27555
27755
|
createArtifact,
|
|
27556
27756
|
setupRuntimeSetupScript,
|
|
27757
|
+
validateAppInTossPluginOptions,
|
|
27557
27758
|
validateAppManifest,
|
|
27558
27759
|
validateZip
|
|
27559
27760
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apps-in-toss/plugins",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.30",
|
|
5
5
|
"description": "The plugins for Apps In Toss",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"prepack": "yarn build",
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"publishConfig": {
|
|
45
45
|
"access": "public"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "7390d4ed0f09dec042523a302bc1aa0d21474512"
|
|
48
48
|
}
|