@apps-in-toss/plugins 0.0.0-dev.1752114017143 → 0.0.0-dev.1752115036458

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 CHANGED
@@ -26562,12 +26562,11 @@ init_cjs_shims();
26562
26562
  var import_fs2 = __toESM(require("fs"), 1);
26563
26563
  var import_path3 = __toESM(require("path"), 1);
26564
26564
 
26565
- // ../../.yarn/cache/@react-native-bedrock-utils-npm-0.0.25-695b359c64-87cc7b90a3.zip/node_modules/@react-native-bedrock/utils/dist/index.js
26565
+ // ../../.yarn/cache/@granite-js-utils-npm-0.1.2-cb1031ea38-87c00032d4.zip/node_modules/@granite-js/utils/dist/index.js
26566
26566
  init_cjs_shims();
26567
26567
  var import_fs = __toESM(require("fs"), 1);
26568
26568
  var import_path = __toESM(require("path"), 1);
26569
26569
  var import_yauzl = __toESM(require_yauzl(), 1);
26570
- var import_os = __toESM(require("os"), 1);
26571
26570
  function getPackageRoot() {
26572
26571
  let cwd = process.cwd();
26573
26572
  const root = import_path.default.parse(cwd).root;
@@ -26612,13 +26611,6 @@ function readZipContent(zipPath, fileName) {
26612
26611
  });
26613
26612
  });
26614
26613
  }
26615
- var win32Impl = {
26616
- normalizePath: (path22) => path22.replace(/\\/g, "/")
26617
- };
26618
- var posixImpl = {
26619
- normalizePath: (path22) => path22
26620
- };
26621
- var { normalizePath } = import_os.default.type() === "Windows_NT" ? win32Impl : posixImpl;
26622
26614
 
26623
26615
  // src/appsInToss.ts
26624
26616
  var import_picocolors = __toESM(require_picocolors(), 1);
@@ -27030,6 +27022,9 @@ function extractPackagePath(path8, packageName) {
27030
27022
  }
27031
27023
  throw new Error(`Failed to extract path: ${packageName}`);
27032
27024
  }
27025
+ function normalizePath(path8) {
27026
+ return path8.replace(/\\/g, "/");
27027
+ }
27033
27028
  async function getPackageVersion(packagePath) {
27034
27029
  const packageJson = JSON.parse(await fs2.readFile(path2.join(packagePath, "package.json"), "utf-8"));
27035
27030
  return packageJson.version;
@@ -27066,7 +27061,7 @@ var fs4 = __toESM(require("fs/promises"), 1);
27066
27061
  var path4 = __toESM(require("path"), 1);
27067
27062
  async function resolveAppManifestPath() {
27068
27063
  const cwd = getPackageRoot();
27069
- const appManifestPath = path4.join(cwd, ".bedrock", APP_MANIFEST_NAME);
27064
+ const appManifestPath = path4.join(cwd, ".granite", APP_MANIFEST_NAME);
27070
27065
  await fs4.access(appManifestPath, fs4.constants.F_OK);
27071
27066
  return appManifestPath;
27072
27067
  }
@@ -27092,7 +27087,7 @@ async function validateZip(zipPath) {
27092
27087
  const appJson = JSON.parse(appJsonString);
27093
27088
  const validated = validateAppManifest(appJson);
27094
27089
  if (!validated.success) {
27095
- throw new Error("bedrock.config.ts \uAC12\uC774 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.");
27090
+ throw new Error("granite.config.ts \uAC12\uC774 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.");
27096
27091
  }
27097
27092
  }
27098
27093
  async function createArtifact(options2) {
@@ -27506,13 +27501,13 @@ var import_node_fs = __toESM(require("fs"), 1);
27506
27501
  var import_node_path = __toESM(require("path"), 1);
27507
27502
  function setupRuntimeSetupScript(config) {
27508
27503
  const packageRoot = getPackageRoot();
27509
- const bedrockPath = import_node_path.default.join(packageRoot, ".bedrock");
27504
+ const granitePath = import_node_path.default.join(packageRoot, ".granite");
27510
27505
  try {
27511
- import_node_fs.default.accessSync(bedrockPath);
27506
+ import_node_fs.default.accessSync(granitePath);
27512
27507
  } catch {
27513
- import_node_fs.default.mkdirSync(bedrockPath, { recursive: true });
27508
+ import_node_fs.default.mkdirSync(granitePath, { recursive: true });
27514
27509
  }
27515
- const envFilePath = import_node_path.default.join(bedrockPath, ".apps-in-toss.env.js");
27510
+ const envFilePath = import_node_path.default.join(granitePath, ".apps-in-toss.env.js");
27516
27511
  const script = `
27517
27512
  (function (global) {
27518
27513
  global.__appsInToss = ${JSON.stringify({
@@ -27540,6 +27535,47 @@ function setupRuntimeSetupScript(config) {
27540
27535
  function log2(...args) {
27541
27536
  console.log(import_picocolors.default.bold(import_picocolors.default.cyan("[AppsInToss]")), ...args);
27542
27537
  }
27538
+ function bedrockCompat() {
27539
+ const replaceNativeModule = (code, targetModuleName, moduleName) => {
27540
+ return code.replace(
27541
+ /TurboModuleRegistry\.getEnforcing<[^>]+>\(\s*['"]([^'"]+)['"]\s*\)/g,
27542
+ (origin, matchedModuleName) => {
27543
+ return matchedModuleName === targetModuleName ? `TurboModuleRegistry.get('${targetModuleName}') || TurboModuleRegistry.getEnforcing('${moduleName}')` : origin;
27544
+ }
27545
+ );
27546
+ };
27547
+ return {
27548
+ name: "ensure-toss-native-module",
27549
+ config: {
27550
+ esbuild: {
27551
+ banner: {
27552
+ js: `
27553
+ (function (global) {
27554
+ global.__granite_require__ = global.__bedrock_require__;
27555
+ })(
27556
+ typeof globalThis !== 'undefined'
27557
+ ? globalThis
27558
+ : typeof global !== 'undefined'
27559
+ ? global
27560
+ : typeof window !== 'undefined'
27561
+ ? window
27562
+ : this
27563
+ );
27564
+ `
27565
+ }
27566
+ }
27567
+ },
27568
+ transformSync(id, code) {
27569
+ if (id.includes("GraniteModule")) {
27570
+ return replaceNativeModule(code, "GraniteModule", "BedrockModule");
27571
+ }
27572
+ if (id.includes("GraniteCoreModule")) {
27573
+ return replaceNativeModule(code, "GraniteCoreModule", "BedrockCoreModule");
27574
+ }
27575
+ return code;
27576
+ }
27577
+ };
27578
+ }
27543
27579
  function appsInTossCreateArtifact(deploymentId) {
27544
27580
  const packageRoot = getPackageRoot();
27545
27581
  return {
@@ -27564,7 +27600,7 @@ function appsInTossCreateArtifact(deploymentId) {
27564
27600
  }
27565
27601
  ]).flat(),
27566
27602
  outfile: import_path3.default.join(cwd, `${appName}.ait`),
27567
- appJsonPath: import_path3.default.join(packageRoot, ".bedrock", APP_MANIFEST_NAME)
27603
+ appJsonPath: import_path3.default.join(packageRoot, ".granite", APP_MANIFEST_NAME)
27568
27604
  });
27569
27605
  if (!artifactOutfile) {
27570
27606
  throw new Error("\uC544\uD2F0\uD329\uD2B8 \uC0DD\uC131\uC5D0 \uC2E4\uD328\uD588\uC5B4\uC694.");
@@ -27614,7 +27650,7 @@ function appsInTossDevServer(options2) {
27614
27650
  async function appsInTossAppJson(options2) {
27615
27651
  const packageRoot = getPackageRoot();
27616
27652
  const handleAppJson = async (appName) => {
27617
- const appJsonPath = import_path3.default.join(packageRoot, ".bedrock", APP_MANIFEST_NAME);
27653
+ const appJsonPath = import_path3.default.join(packageRoot, ".granite", APP_MANIFEST_NAME);
27618
27654
  const appJsonObject = {
27619
27655
  appName,
27620
27656
  permissions: options2.permissions
@@ -27693,6 +27729,7 @@ function appsInToss(options2) {
27693
27729
  deploymentId
27694
27730
  });
27695
27731
  return [
27732
+ bedrockCompat(),
27696
27733
  appsInTossAppJson(result.data),
27697
27734
  appsInTossDevServer(result.data),
27698
27735
  appsInTossCreateArtifact(deploymentId),
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { BedrockPluginCore } from '@react-native-bedrock/plugin-core';
1
+ import { GranitePluginCore } from '@granite-js/plugin-core';
2
2
  import typia, { tags } from 'typia';
3
3
 
4
4
  type PermissionReadWrite = 'read' | 'write';
@@ -49,13 +49,13 @@ interface AppsInTossPluginOptions {
49
49
  type BridgeTheme = 'basic' | 'inverted';
50
50
  declare const validateAppInTossPluginOptions: (input: unknown) => typia.IValidation<AppsInTossPluginOptions>;
51
51
 
52
- declare function appsInTossEsbuildConfig(envScript: string): BedrockPluginCore;
53
- declare function appsInTossMetroConfig(envScriptPath: string): BedrockPluginCore;
54
- declare function appsInTossAppJson(options: Pick<AppsInTossPluginOptions, 'permissions'>): Promise<BedrockPluginCore>;
55
- declare function appsInTossPostNotice(): BedrockPluginCore;
56
- declare function appsInToss(options: AppsInTossPluginOptions): (BedrockPluginCore | Promise<BedrockPluginCore>)[];
52
+ declare function appsInTossEsbuildConfig(envScript: string): GranitePluginCore;
53
+ declare function appsInTossMetroConfig(envScriptPath: string): GranitePluginCore;
54
+ declare function appsInTossAppJson(options: Pick<AppsInTossPluginOptions, 'permissions'>): Promise<GranitePluginCore>;
55
+ declare function appsInTossPostNotice(): GranitePluginCore;
56
+ declare function appsInToss(options: AppsInTossPluginOptions): (GranitePluginCore | Promise<GranitePluginCore>)[];
57
57
 
58
- declare function analytics(): BedrockPluginCore;
58
+ declare function analytics(): GranitePluginCore;
59
59
 
60
60
  interface AppsInTossBuildMetadata {
61
61
  runtimeVersion: string;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { BedrockPluginCore } from '@react-native-bedrock/plugin-core';
1
+ import { GranitePluginCore } from '@granite-js/plugin-core';
2
2
  import typia, { tags } from 'typia';
3
3
 
4
4
  type PermissionReadWrite = 'read' | 'write';
@@ -49,13 +49,13 @@ interface AppsInTossPluginOptions {
49
49
  type BridgeTheme = 'basic' | 'inverted';
50
50
  declare const validateAppInTossPluginOptions: (input: unknown) => typia.IValidation<AppsInTossPluginOptions>;
51
51
 
52
- declare function appsInTossEsbuildConfig(envScript: string): BedrockPluginCore;
53
- declare function appsInTossMetroConfig(envScriptPath: string): BedrockPluginCore;
54
- declare function appsInTossAppJson(options: Pick<AppsInTossPluginOptions, 'permissions'>): Promise<BedrockPluginCore>;
55
- declare function appsInTossPostNotice(): BedrockPluginCore;
56
- declare function appsInToss(options: AppsInTossPluginOptions): (BedrockPluginCore | Promise<BedrockPluginCore>)[];
52
+ declare function appsInTossEsbuildConfig(envScript: string): GranitePluginCore;
53
+ declare function appsInTossMetroConfig(envScriptPath: string): GranitePluginCore;
54
+ declare function appsInTossAppJson(options: Pick<AppsInTossPluginOptions, 'permissions'>): Promise<GranitePluginCore>;
55
+ declare function appsInTossPostNotice(): GranitePluginCore;
56
+ declare function appsInToss(options: AppsInTossPluginOptions): (GranitePluginCore | Promise<GranitePluginCore>)[];
57
57
 
58
- declare function analytics(): BedrockPluginCore;
58
+ declare function analytics(): GranitePluginCore;
59
59
 
60
60
  interface AppsInTossBuildMetadata {
61
61
  runtimeVersion: string;
package/dist/index.js CHANGED
@@ -26552,12 +26552,11 @@ init_esm_shims();
26552
26552
  import fs6 from "fs";
26553
26553
  import path7 from "path";
26554
26554
 
26555
- // ../../.yarn/cache/@react-native-bedrock-utils-npm-0.0.25-695b359c64-87cc7b90a3.zip/node_modules/@react-native-bedrock/utils/dist/index.js
26555
+ // ../../.yarn/cache/@granite-js-utils-npm-0.1.2-cb1031ea38-87c00032d4.zip/node_modules/@granite-js/utils/dist/index.js
26556
26556
  init_esm_shims();
26557
26557
  var import_yauzl = __toESM(require_yauzl(), 1);
26558
26558
  import fs from "fs";
26559
26559
  import path from "path";
26560
- import os from "os";
26561
26560
  function getPackageRoot() {
26562
26561
  let cwd = process.cwd();
26563
26562
  const root = path.parse(cwd).root;
@@ -26602,13 +26601,6 @@ function readZipContent(zipPath, fileName) {
26602
26601
  });
26603
26602
  });
26604
26603
  }
26605
- var win32Impl = {
26606
- normalizePath: (path22) => path22.replace(/\\/g, "/")
26607
- };
26608
- var posixImpl = {
26609
- normalizePath: (path22) => path22
26610
- };
26611
- var { normalizePath } = os.type() === "Windows_NT" ? win32Impl : posixImpl;
26612
26604
 
26613
26605
  // src/appsInToss.ts
26614
26606
  var import_picocolors = __toESM(require_picocolors(), 1);
@@ -27020,6 +27012,9 @@ function extractPackagePath(path8, packageName) {
27020
27012
  }
27021
27013
  throw new Error(`Failed to extract path: ${packageName}`);
27022
27014
  }
27015
+ function normalizePath(path8) {
27016
+ return path8.replace(/\\/g, "/");
27017
+ }
27023
27018
  async function getPackageVersion(packagePath) {
27024
27019
  const packageJson = JSON.parse(await fs2.readFile(path2.join(packagePath, "package.json"), "utf-8"));
27025
27020
  return packageJson.version;
@@ -27056,7 +27051,7 @@ import * as fs4 from "fs/promises";
27056
27051
  import * as path4 from "path";
27057
27052
  async function resolveAppManifestPath() {
27058
27053
  const cwd = getPackageRoot();
27059
- const appManifestPath = path4.join(cwd, ".bedrock", APP_MANIFEST_NAME);
27054
+ const appManifestPath = path4.join(cwd, ".granite", APP_MANIFEST_NAME);
27060
27055
  await fs4.access(appManifestPath, fs4.constants.F_OK);
27061
27056
  return appManifestPath;
27062
27057
  }
@@ -27082,7 +27077,7 @@ async function validateZip(zipPath) {
27082
27077
  const appJson = JSON.parse(appJsonString);
27083
27078
  const validated = validateAppManifest(appJson);
27084
27079
  if (!validated.success) {
27085
- throw new Error("bedrock.config.ts \uAC12\uC774 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.");
27080
+ throw new Error("granite.config.ts \uAC12\uC774 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.");
27086
27081
  }
27087
27082
  }
27088
27083
  async function createArtifact(options2) {
@@ -27496,13 +27491,13 @@ import fs5 from "node:fs";
27496
27491
  import path6 from "node:path";
27497
27492
  function setupRuntimeSetupScript(config) {
27498
27493
  const packageRoot = getPackageRoot();
27499
- const bedrockPath = path6.join(packageRoot, ".bedrock");
27494
+ const granitePath = path6.join(packageRoot, ".granite");
27500
27495
  try {
27501
- fs5.accessSync(bedrockPath);
27496
+ fs5.accessSync(granitePath);
27502
27497
  } catch {
27503
- fs5.mkdirSync(bedrockPath, { recursive: true });
27498
+ fs5.mkdirSync(granitePath, { recursive: true });
27504
27499
  }
27505
- const envFilePath = path6.join(bedrockPath, ".apps-in-toss.env.js");
27500
+ const envFilePath = path6.join(granitePath, ".apps-in-toss.env.js");
27506
27501
  const script = `
27507
27502
  (function (global) {
27508
27503
  global.__appsInToss = ${JSON.stringify({
@@ -27530,6 +27525,47 @@ function setupRuntimeSetupScript(config) {
27530
27525
  function log2(...args) {
27531
27526
  console.log(import_picocolors.default.bold(import_picocolors.default.cyan("[AppsInToss]")), ...args);
27532
27527
  }
27528
+ function bedrockCompat() {
27529
+ const replaceNativeModule = (code, targetModuleName, moduleName) => {
27530
+ return code.replace(
27531
+ /TurboModuleRegistry\.getEnforcing<[^>]+>\(\s*['"]([^'"]+)['"]\s*\)/g,
27532
+ (origin, matchedModuleName) => {
27533
+ return matchedModuleName === targetModuleName ? `TurboModuleRegistry.get('${targetModuleName}') || TurboModuleRegistry.getEnforcing('${moduleName}')` : origin;
27534
+ }
27535
+ );
27536
+ };
27537
+ return {
27538
+ name: "ensure-toss-native-module",
27539
+ config: {
27540
+ esbuild: {
27541
+ banner: {
27542
+ js: `
27543
+ (function (global) {
27544
+ global.__granite_require__ = global.__bedrock_require__;
27545
+ })(
27546
+ typeof globalThis !== 'undefined'
27547
+ ? globalThis
27548
+ : typeof global !== 'undefined'
27549
+ ? global
27550
+ : typeof window !== 'undefined'
27551
+ ? window
27552
+ : this
27553
+ );
27554
+ `
27555
+ }
27556
+ }
27557
+ },
27558
+ transformSync(id, code) {
27559
+ if (id.includes("GraniteModule")) {
27560
+ return replaceNativeModule(code, "GraniteModule", "BedrockModule");
27561
+ }
27562
+ if (id.includes("GraniteCoreModule")) {
27563
+ return replaceNativeModule(code, "GraniteCoreModule", "BedrockCoreModule");
27564
+ }
27565
+ return code;
27566
+ }
27567
+ };
27568
+ }
27533
27569
  function appsInTossCreateArtifact(deploymentId) {
27534
27570
  const packageRoot = getPackageRoot();
27535
27571
  return {
@@ -27554,7 +27590,7 @@ function appsInTossCreateArtifact(deploymentId) {
27554
27590
  }
27555
27591
  ]).flat(),
27556
27592
  outfile: path7.join(cwd, `${appName}.ait`),
27557
- appJsonPath: path7.join(packageRoot, ".bedrock", APP_MANIFEST_NAME)
27593
+ appJsonPath: path7.join(packageRoot, ".granite", APP_MANIFEST_NAME)
27558
27594
  });
27559
27595
  if (!artifactOutfile) {
27560
27596
  throw new Error("\uC544\uD2F0\uD329\uD2B8 \uC0DD\uC131\uC5D0 \uC2E4\uD328\uD588\uC5B4\uC694.");
@@ -27604,7 +27640,7 @@ function appsInTossDevServer(options2) {
27604
27640
  async function appsInTossAppJson(options2) {
27605
27641
  const packageRoot = getPackageRoot();
27606
27642
  const handleAppJson = async (appName) => {
27607
- const appJsonPath = path7.join(packageRoot, ".bedrock", APP_MANIFEST_NAME);
27643
+ const appJsonPath = path7.join(packageRoot, ".granite", APP_MANIFEST_NAME);
27608
27644
  const appJsonObject = {
27609
27645
  appName,
27610
27646
  permissions: options2.permissions
@@ -27683,6 +27719,7 @@ function appsInToss(options2) {
27683
27719
  deploymentId
27684
27720
  });
27685
27721
  return [
27722
+ bedrockCompat(),
27686
27723
  appsInTossAppJson(result.data),
27687
27724
  appsInTossDevServer(result.data),
27688
27725
  appsInTossCreateArtifact(deploymentId),
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.0-dev.1752114017143",
4
+ "version": "0.0.0-dev.1752115036458",
5
5
  "description": "The plugins for Apps In Toss",
6
6
  "scripts": {
7
7
  "prepack": "yarn build",
@@ -23,8 +23,8 @@
23
23
  "dist/**/*"
24
24
  ],
25
25
  "devDependencies": {
26
- "@react-native-bedrock/plugin-core": "0.0.25",
27
- "@react-native-bedrock/utils": "0.0.25",
26
+ "@granite-js/plugin-core": "0.1.2",
27
+ "@granite-js/utils": "0.1.2",
28
28
  "@ryoppippi/unplugin-typia": "^2.1.3",
29
29
  "@types/archiver": "^6.0.3",
30
30
  "@types/connect": "^3",
@@ -32,7 +32,6 @@
32
32
  "connect": "^3.7.0",
33
33
  "execa": "^9.5.2",
34
34
  "picocolors": "^1.1.1",
35
- "react-native-bedrock": "0.0.25",
36
35
  "tsup": "^8.4.0",
37
36
  "typescript": "5.8.3",
38
37
  "typia": "^8.0.4",
@@ -44,5 +43,5 @@
44
43
  "publishConfig": {
45
44
  "access": "public"
46
45
  },
47
- "gitHead": "d4d3441684f79edb0dd69330007f32b737ee01dc"
46
+ "gitHead": "73735f83556eb2727f160e998234101bd17e55f0"
48
47
  }