@apps-in-toss/plugins 0.0.0-dev.1752049503789 → 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 +42 -0
- package/dist/index.js +42 -0
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -27535,6 +27535,47 @@ function setupRuntimeSetupScript(config) {
|
|
|
27535
27535
|
function log2(...args) {
|
|
27536
27536
|
console.log(import_picocolors.default.bold(import_picocolors.default.cyan("[AppsInToss]")), ...args);
|
|
27537
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
|
+
}
|
|
27538
27579
|
function appsInTossCreateArtifact(deploymentId) {
|
|
27539
27580
|
const packageRoot = getPackageRoot();
|
|
27540
27581
|
return {
|
|
@@ -27688,6 +27729,7 @@ function appsInToss(options2) {
|
|
|
27688
27729
|
deploymentId
|
|
27689
27730
|
});
|
|
27690
27731
|
return [
|
|
27732
|
+
bedrockCompat(),
|
|
27691
27733
|
appsInTossAppJson(result.data),
|
|
27692
27734
|
appsInTossDevServer(result.data),
|
|
27693
27735
|
appsInTossCreateArtifact(deploymentId),
|
package/dist/index.js
CHANGED
|
@@ -27525,6 +27525,47 @@ function setupRuntimeSetupScript(config) {
|
|
|
27525
27525
|
function log2(...args) {
|
|
27526
27526
|
console.log(import_picocolors.default.bold(import_picocolors.default.cyan("[AppsInToss]")), ...args);
|
|
27527
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
|
+
}
|
|
27528
27569
|
function appsInTossCreateArtifact(deploymentId) {
|
|
27529
27570
|
const packageRoot = getPackageRoot();
|
|
27530
27571
|
return {
|
|
@@ -27678,6 +27719,7 @@ function appsInToss(options2) {
|
|
|
27678
27719
|
deploymentId
|
|
27679
27720
|
});
|
|
27680
27721
|
return [
|
|
27722
|
+
bedrockCompat(),
|
|
27681
27723
|
appsInTossAppJson(result.data),
|
|
27682
27724
|
appsInTossDevServer(result.data),
|
|
27683
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.
|
|
4
|
+
"version": "0.0.0-dev.1752115036458",
|
|
5
5
|
"description": "The plugins for Apps In Toss",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"prepack": "yarn build",
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"publishConfig": {
|
|
44
44
|
"access": "public"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "73735f83556eb2727f160e998234101bd17e55f0"
|
|
47
47
|
}
|