@apps-in-toss/web-framework 0.0.0-dev.1741675190621 → 0.0.0-dev.1741859884482

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/cli/index.js CHANGED
@@ -54635,6 +54635,7 @@ import { callbackify as callbackify3 } from "node:util";
54635
54635
  import { Duplex as Duplex3 } from "node:stream";
54636
54636
  import { callbackify as callbackify4 } from "node:util";
54637
54637
  import path11 from "path";
54638
+ import { readZipContent } from "@apps-in-toss/cli";
54638
54639
  import * as fs2 from "fs";
54639
54640
  import * as path7 from "path";
54640
54641
  import * as path8 from "path";
@@ -79903,6 +79904,39 @@ var require_archiver = __commonJS2({
79903
79904
  module.exports = vending;
79904
79905
  }
79905
79906
  });
79907
+ var require_isFormatUuid = __commonJS2({
79908
+ "../../.yarn/unplugged/typia-virtual-7c91ede42e/node_modules/typia/lib/internal/_isFormatUuid.js"(exports) {
79909
+ "use strict";
79910
+ init_esm_shims2();
79911
+ Object.defineProperty(exports, "__esModule", { value: true });
79912
+ exports._isFormatUuid = void 0;
79913
+ var _isFormatUuid2 = (str) => PATTERN.test(str);
79914
+ exports._isFormatUuid = _isFormatUuid2;
79915
+ var PATTERN = /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;
79916
+ }
79917
+ });
79918
+ var require_validateReport = __commonJS2({
79919
+ "../../.yarn/unplugged/typia-virtual-7c91ede42e/node_modules/typia/lib/internal/_validateReport.js"(exports) {
79920
+ "use strict";
79921
+ init_esm_shims2();
79922
+ Object.defineProperty(exports, "__esModule", { value: true });
79923
+ exports._validateReport = void 0;
79924
+ var _validateReport2 = (array) => {
79925
+ const reportable = (path132) => {
79926
+ if (array.length === 0)
79927
+ return true;
79928
+ const last = array[array.length - 1].path;
79929
+ return path132.length > last.length || last.substring(0, path132.length) !== path132;
79930
+ };
79931
+ return (exceptable, error) => {
79932
+ if (exceptable && reportable(error.path))
79933
+ array.push(error);
79934
+ return false;
79935
+ };
79936
+ };
79937
+ exports._validateReport = _validateReport2;
79938
+ }
79939
+ });
79906
79940
  init_esm_shims2();
79907
79941
  init_esm_shims2();
79908
79942
  var import_picocolors2 = __toESM2(require_picocolors2(), 1);
@@ -86478,6 +86512,206 @@ async function updateAppJsonMetadata(metadata) {
86478
86512
  _metadata: metadata
86479
86513
  });
86480
86514
  }
86515
+ init_esm_shims2();
86516
+ var __typia_transform__isFormatUuid = __toESM2(require_isFormatUuid(), 1);
86517
+ var __typia_transform__validateReport = __toESM2(require_validateReport(), 1);
86518
+ var validateAppManifest = /* @__PURE__ */ (() => {
86519
+ const _io0 = (input) => "string" === typeof input.appName && (Array.isArray(input.permissions) && input.permissions.every((elem) => "object" === typeof elem && null !== elem && _iu0(elem))) && ("object" === typeof input.oauth && null !== input.oauth && _io6(input.oauth)) && ("object" === typeof input._metadata && null !== input._metadata && _io7(input._metadata));
86520
+ const _io1 = (input) => "clipboard" === input.name && ("read" === input.access || "write" === input.access);
86521
+ const _io2 = (input) => "geolocation" === input.name && "access" === input.access;
86522
+ const _io3 = (input) => "contacts" === input.name && ("read" === input.access || "write" === input.access);
86523
+ const _io4 = (input) => "photos" === input.name && ("read" === input.access || "write" === input.access);
86524
+ const _io5 = (input) => "camera" === input.name && "access" === input.access;
86525
+ const _io6 = (input) => Array.isArray(input.scopes) && input.scopes.every((elem) => "user_name" === elem || "user_phone" === elem || "user_birthday" === elem || "user_ci" === elem || "user_gender" === elem || "user_nationality" === elem || "user_email" === elem);
86526
+ const _io7 = (input) => Array.isArray(input.bundleFiles) && input.bundleFiles.every((elem) => "string" === typeof elem) && ("string" === typeof input.deploymentId && __typia_transform__isFormatUuid._isFormatUuid(input.deploymentId));
86527
+ const _iu0 = (input) => (() => {
86528
+ if ("camera" === input.name)
86529
+ return _io5(input);
86530
+ else if ("photos" === input.name)
86531
+ return _io4(input);
86532
+ else if ("contacts" === input.name)
86533
+ return _io3(input);
86534
+ else if ("geolocation" === input.name)
86535
+ return _io2(input);
86536
+ else if ("clipboard" === input.name)
86537
+ return _io1(input);
86538
+ else
86539
+ return false;
86540
+ })();
86541
+ const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.appName || _report(_exceptionable, {
86542
+ path: _path + ".appName",
86543
+ expected: "string",
86544
+ value: input.appName
86545
+ }), (Array.isArray(input.permissions) || _report(_exceptionable, {
86546
+ path: _path + ".permissions",
86547
+ expected: "Array<Permission>",
86548
+ value: input.permissions
86549
+ })) && input.permissions.map((elem, _index4) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
86550
+ path: _path + ".permissions[" + _index4 + "]",
86551
+ expected: "(CameraPermission | ClipboardPermission | ContactsPermission | GeolocationPermission | PhotosPermission)",
86552
+ value: elem
86553
+ })) && _vu0(elem, _path + ".permissions[" + _index4 + "]", _exceptionable) || _report(_exceptionable, {
86554
+ path: _path + ".permissions[" + _index4 + "]",
86555
+ expected: "(CameraPermission | ClipboardPermission | ContactsPermission | GeolocationPermission | PhotosPermission)",
86556
+ value: elem
86557
+ })).every((flag) => flag) || _report(_exceptionable, {
86558
+ path: _path + ".permissions",
86559
+ expected: "Array<Permission>",
86560
+ value: input.permissions
86561
+ }), ("object" === typeof input.oauth && null !== input.oauth || _report(_exceptionable, {
86562
+ path: _path + ".oauth",
86563
+ expected: "__type",
86564
+ value: input.oauth
86565
+ })) && _vo6(input.oauth, _path + ".oauth", _exceptionable) || _report(_exceptionable, {
86566
+ path: _path + ".oauth",
86567
+ expected: "__type",
86568
+ value: input.oauth
86569
+ }), ("object" === typeof input._metadata && null !== input._metadata || _report(_exceptionable, {
86570
+ path: _path + "._metadata",
86571
+ expected: "__type.o1",
86572
+ value: input._metadata
86573
+ })) && _vo7(input._metadata, _path + "._metadata", _exceptionable) || _report(_exceptionable, {
86574
+ path: _path + "._metadata",
86575
+ expected: "__type.o1",
86576
+ value: input._metadata
86577
+ })].every((flag) => flag);
86578
+ const _vo1 = (input, _path, _exceptionable = true) => ["clipboard" === input.name || _report(_exceptionable, {
86579
+ path: _path + ".name",
86580
+ expected: '"clipboard"',
86581
+ value: input.name
86582
+ }), "read" === input.access || "write" === input.access || _report(_exceptionable, {
86583
+ path: _path + ".access",
86584
+ expected: '("read" | "write")',
86585
+ value: input.access
86586
+ })].every((flag) => flag);
86587
+ const _vo2 = (input, _path, _exceptionable = true) => ["geolocation" === input.name || _report(_exceptionable, {
86588
+ path: _path + ".name",
86589
+ expected: '"geolocation"',
86590
+ value: input.name
86591
+ }), "access" === input.access || _report(_exceptionable, {
86592
+ path: _path + ".access",
86593
+ expected: '"access"',
86594
+ value: input.access
86595
+ })].every((flag) => flag);
86596
+ const _vo3 = (input, _path, _exceptionable = true) => ["contacts" === input.name || _report(_exceptionable, {
86597
+ path: _path + ".name",
86598
+ expected: '"contacts"',
86599
+ value: input.name
86600
+ }), "read" === input.access || "write" === input.access || _report(_exceptionable, {
86601
+ path: _path + ".access",
86602
+ expected: '("read" | "write")',
86603
+ value: input.access
86604
+ })].every((flag) => flag);
86605
+ const _vo4 = (input, _path, _exceptionable = true) => ["photos" === input.name || _report(_exceptionable, {
86606
+ path: _path + ".name",
86607
+ expected: '"photos"',
86608
+ value: input.name
86609
+ }), "read" === input.access || "write" === input.access || _report(_exceptionable, {
86610
+ path: _path + ".access",
86611
+ expected: '("read" | "write")',
86612
+ value: input.access
86613
+ })].every((flag) => flag);
86614
+ const _vo5 = (input, _path, _exceptionable = true) => ["camera" === input.name || _report(_exceptionable, {
86615
+ path: _path + ".name",
86616
+ expected: '"camera"',
86617
+ value: input.name
86618
+ }), "access" === input.access || _report(_exceptionable, {
86619
+ path: _path + ".access",
86620
+ expected: '"access"',
86621
+ value: input.access
86622
+ })].every((flag) => flag);
86623
+ const _vo6 = (input, _path, _exceptionable = true) => [(Array.isArray(input.scopes) || _report(_exceptionable, {
86624
+ path: _path + ".scopes",
86625
+ expected: "Array<OAuthScope>",
86626
+ value: input.scopes
86627
+ })) && input.scopes.map((elem, _index5) => "user_name" === elem || "user_phone" === elem || "user_birthday" === elem || "user_ci" === elem || "user_gender" === elem || "user_nationality" === elem || "user_email" === elem || _report(_exceptionable, {
86628
+ path: _path + ".scopes[" + _index5 + "]",
86629
+ expected: '("user_birthday" | "user_ci" | "user_email" | "user_gender" | "user_name" | "user_nationality" | "user_phone")',
86630
+ value: elem
86631
+ })).every((flag) => flag) || _report(_exceptionable, {
86632
+ path: _path + ".scopes",
86633
+ expected: "Array<OAuthScope>",
86634
+ value: input.scopes
86635
+ })].every((flag) => flag);
86636
+ const _vo7 = (input, _path, _exceptionable = true) => [(Array.isArray(input.bundleFiles) || _report(_exceptionable, {
86637
+ path: _path + ".bundleFiles",
86638
+ expected: "Array<string>",
86639
+ value: input.bundleFiles
86640
+ })) && input.bundleFiles.map((elem, _index6) => "string" === typeof elem || _report(_exceptionable, {
86641
+ path: _path + ".bundleFiles[" + _index6 + "]",
86642
+ expected: "string",
86643
+ value: elem
86644
+ })).every((flag) => flag) || _report(_exceptionable, {
86645
+ path: _path + ".bundleFiles",
86646
+ expected: "Array<string>",
86647
+ value: input.bundleFiles
86648
+ }), "string" === typeof input.deploymentId && (__typia_transform__isFormatUuid._isFormatUuid(input.deploymentId) || _report(_exceptionable, {
86649
+ path: _path + ".deploymentId",
86650
+ expected: 'string & Format<"uuid">',
86651
+ value: input.deploymentId
86652
+ })) || _report(_exceptionable, {
86653
+ path: _path + ".deploymentId",
86654
+ expected: '(string & Format<"uuid">)',
86655
+ value: input.deploymentId
86656
+ })].every((flag) => flag);
86657
+ const _vu0 = (input, _path, _exceptionable = true) => (() => {
86658
+ if ("camera" === input.name)
86659
+ return _vo5(input, _path, _exceptionable);
86660
+ else if ("photos" === input.name)
86661
+ return _vo4(input, _path, _exceptionable);
86662
+ else if ("contacts" === input.name)
86663
+ return _vo3(input, _path, _exceptionable);
86664
+ else if ("geolocation" === input.name)
86665
+ return _vo2(input, _path, _exceptionable);
86666
+ else if ("clipboard" === input.name)
86667
+ return _vo1(input, _path, _exceptionable);
86668
+ else
86669
+ return _report(_exceptionable, {
86670
+ path: _path,
86671
+ expected: "(CameraPermission | PhotosPermission | ContactsPermission | GeolocationPermission | ClipboardPermission)",
86672
+ value: input
86673
+ });
86674
+ })();
86675
+ const __is = (input) => "object" === typeof input && null !== input && _io0(input);
86676
+ let errors;
86677
+ let _report;
86678
+ return (input) => {
86679
+ if (false === __is(input)) {
86680
+ errors = [];
86681
+ _report = __typia_transform__validateReport._validateReport(errors);
86682
+ ((input2, _path, _exceptionable = true) => ("object" === typeof input2 && null !== input2 || _report(true, {
86683
+ path: _path + "",
86684
+ expected: "AppManifest",
86685
+ value: input2
86686
+ })) && _vo0(input2, _path + "", true) || _report(true, {
86687
+ path: _path + "",
86688
+ expected: "AppManifest",
86689
+ value: input2
86690
+ }))(input, "$input", true);
86691
+ const success = 0 === errors.length;
86692
+ return success ? {
86693
+ success,
86694
+ data: input
86695
+ } : {
86696
+ success,
86697
+ errors,
86698
+ data: input
86699
+ };
86700
+ }
86701
+ return {
86702
+ success: true,
86703
+ data: input
86704
+ };
86705
+ };
86706
+ })();
86707
+ async function validateZip(zipPath) {
86708
+ const appJsonString = await readZipContent(zipPath, "app.json");
86709
+ const appJson = JSON.parse(appJsonString);
86710
+ const validated = validateAppManifest(appJson);
86711
+ if (!validated.success) {
86712
+ throw new Error("bedrock.config.ts \uAC12\uC774 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.");
86713
+ }
86714
+ }
86481
86715
  async function createArtifact(options, deps) {
86482
86716
  const { inputJsFiles, outfile, appJsonPath, reactNativeVersion } = options;
86483
86717
  const bundleFiles = await Promise.all(
@@ -86494,6 +86728,7 @@ async function createArtifact(options, deps) {
86494
86728
  files: [{ path: appJsonPath, name: "app.json" }, ...bundleFiles, ...options.additionalFilesToZip ?? []],
86495
86729
  outfile
86496
86730
  });
86731
+ await validateZip(outfile);
86497
86732
  return outfile;
86498
86733
  }
86499
86734
  init_esm_shims2();
@@ -86538,7 +86773,6 @@ async function appsInTossAppJson(options) {
86538
86773
  }
86539
86774
  };
86540
86775
  }
86541
- init_esm_shims2();
86542
86776
 
86543
86777
  // ../../.yarn/cache/execa-npm-9.5.2-ac35c57136-94782a6282.zip/node_modules/execa/index.js
86544
86778
  init_esm_shims();
@@ -93744,7 +93978,6 @@ async function babelBuild({
93744
93978
  appName,
93745
93979
  outdir,
93746
93980
  platform: platform3,
93747
- webPort,
93748
93981
  buildNumber,
93749
93982
  deploymentId
93750
93983
  }) {
@@ -93758,7 +93991,8 @@ async function babelBuild({
93758
93991
  {
93759
93992
  json: {
93760
93993
  appName,
93761
- webPort,
93994
+ webPort: "NOOP",
93995
+ webHost: "NOOP",
93762
93996
  buildNumber,
93763
93997
  deploymentId
93764
93998
  },
@@ -93786,6 +94020,7 @@ function getBuildNumber() {
93786
94020
  async function runPrebuildToBuild(cwd, config) {
93787
94021
  const buildNumber = getBuildNumber();
93788
94022
  const deploymentId = uuidv7();
94023
+ const { outdir = "dist" } = config;
93789
94024
  const resolvedPlugins = await resolvePlugins([
93790
94025
  appsInTossWeb(deploymentId, {
93791
94026
  commands: config.web.commands,
@@ -93798,7 +94033,7 @@ async function runPrebuildToBuild(cwd, config) {
93798
94033
  cwd,
93799
94034
  entryFile: "",
93800
94035
  appName: config.appName,
93801
- outdir: config.outdir,
94036
+ outdir,
93802
94037
  buildResults: []
93803
94038
  });
93804
94039
  }
@@ -93808,9 +94043,8 @@ async function runPrebuildToBuild(cwd, config) {
93808
94043
  task: async () => {
93809
94044
  await babelBuild({
93810
94045
  appName: config.appName,
93811
- outdir: config.outdir,
94046
+ outdir,
93812
94047
  platform: platform3,
93813
- webPort: config.web.port,
93814
94048
  buildNumber,
93815
94049
  deploymentId
93816
94050
  });
@@ -93830,13 +94064,13 @@ async function runPrebuildToBuild(cwd, config) {
93830
94064
  cwd,
93831
94065
  entryFile: "",
93832
94066
  appName: config.appName,
93833
- outdir: config.outdir,
94067
+ outdir,
93834
94068
  buildResults: [
93835
94069
  {
93836
94070
  errors: [],
93837
94071
  warnings: [],
93838
94072
  tag: `${config.appName}-ios`,
93839
- outfile: path20.join(cwd, config.outdir, `${config.appName}.ios.js`),
94073
+ outfile: path20.join(cwd, outdir, `${config.appName}.ios.js`),
93840
94074
  extra: {},
93841
94075
  outputFiles: [],
93842
94076
  metafile: { inputs: {}, outputs: {} },
@@ -93847,7 +94081,7 @@ async function runPrebuildToBuild(cwd, config) {
93847
94081
  errors: [],
93848
94082
  warnings: [],
93849
94083
  tag: `${config.appName}-android`,
93850
- outfile: path20.join(cwd, config.outdir, `${config.appName}.android.js`),
94084
+ outfile: path20.join(cwd, outdir, `${config.appName}.android.js`),
93851
94085
  extra: {},
93852
94086
  outputFiles: [],
93853
94087
  metafile: { inputs: {}, outputs: {} },
@@ -95969,7 +96203,7 @@ function parsePermissions(permissions) {
95969
96203
  }
95970
96204
  var createApp = ({
95971
96205
  appName,
95972
- webPort,
96206
+ web,
95973
96207
  oauth,
95974
96208
  permissions
95975
96209
  }) => {
@@ -96001,7 +96235,8 @@ var createApp = ({
96001
96235
  {
96002
96236
  json: {
96003
96237
  appName,
96004
- webPort
96238
+ webPort: web.port,
96239
+ webHost: web.host
96005
96240
  },
96006
96241
  identifierName: "Ait"
96007
96242
  }
@@ -96051,7 +96286,10 @@ var DevCommand = class extends Command {
96051
96286
  const config = await loadConfig();
96052
96287
  const app = createApp({
96053
96288
  appName: config.appName,
96054
- webPort: config.web.port,
96289
+ web: {
96290
+ port: config.web.port,
96291
+ host: config.web.host ?? "localhost"
96292
+ },
96055
96293
  oauth: config.oauth,
96056
96294
  permissions: config.permissions
96057
96295
  });
@@ -36,6 +36,10 @@ type OAuthScope = 'user_name' | 'user_phone' | 'user_birthday' | 'user_ci' | 'us
36
36
  interface AppsInTossWebConfig {
37
37
  appName: string;
38
38
  web: {
39
+ /**
40
+ * @default 'localhost'
41
+ */
42
+ host?: string;
39
43
  port: number;
40
44
  commands: {
41
45
  dev: string;
@@ -43,10 +47,13 @@ interface AppsInTossWebConfig {
43
47
  };
44
48
  };
45
49
  permissions: Permission[];
46
- outdir: string;
47
50
  oauth: {
48
51
  scopes: OAuthScope[];
49
52
  };
53
+ /**
54
+ * @default 'dist'
55
+ */
56
+ outdir?: string;
50
57
  }
51
58
  declare const defineConfig: (config: AppsInTossWebConfig) => AppsInTossWebConfig;
52
59
 
@@ -3,6 +3,9 @@ var defineConfig = (config) => {
3
3
  if (!config.outdir) {
4
4
  config.outdir = "dist";
5
5
  }
6
+ if (!config.web.host) {
7
+ config.web.host = "localhost";
8
+ }
6
9
  return config;
7
10
  };
8
11
  export {