@apps-in-toss/framework 0.0.0-dev.1741599426292 → 0.0.0-dev.1741675190621
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/LICENSE +674 -202
- package/README.md +4 -5
- package/{bin.js → bin/ait.js} +0 -1
- package/dist/index.cjs +38 -10
- package/dist/index.d.cts +59 -12
- package/dist/index.d.ts +59 -12
- package/dist/index.js +29 -2
- package/dist/jest/index.cjs +24 -0
- package/dist/jest/index.d.cts +1 -0
- package/dist/jest/index.d.ts +1 -0
- package/dist/jest/index.js +4 -0
- package/dist/plugins/index.cjs +26 -61
- package/dist/plugins/index.d.cts +3 -1
- package/dist/plugins/index.d.ts +3 -1
- package/dist/plugins/index.js +25 -61
- package/jest.d.ts +1 -0
- package/package.json +18 -11
package/dist/plugins/index.d.cts
CHANGED
|
@@ -47,6 +47,7 @@ interface AppsInTossPluginOptions {
|
|
|
47
47
|
permissions: AppManifest['permissions'];
|
|
48
48
|
oauth: AppManifest['oauth'];
|
|
49
49
|
}
|
|
50
|
+
declare function appsInTossAppJson(options: AppsInTossPluginOptions): Promise<BedrockPluginCore>;
|
|
50
51
|
declare function appsInToss(options: AppsInTossPluginOptions): (BedrockPluginCore | Promise<BedrockPluginCore>)[];
|
|
51
52
|
|
|
52
53
|
interface CompileHbcOptions {
|
|
@@ -70,6 +71,7 @@ interface CreateArtifactOptions {
|
|
|
70
71
|
path: string;
|
|
71
72
|
platform: 'ios' | 'android';
|
|
72
73
|
}[];
|
|
74
|
+
reactNativeVersion: `${string}_${string}_${string}`;
|
|
73
75
|
appJsonPath: string;
|
|
74
76
|
outfile: string;
|
|
75
77
|
deploymentId: string;
|
|
@@ -80,4 +82,4 @@ interface CreateArtifactOptions {
|
|
|
80
82
|
}
|
|
81
83
|
declare function createArtifact(options: CreateArtifactOptions, deps: CreateCompressedBytecodeDependencies): Promise<string>;
|
|
82
84
|
|
|
83
|
-
export { type AppManifest, type AppsInTossPluginOptions, type BuildResult, type CreateArtifactOptions, type OAuthScope, type Permission, appsInToss, createArtifact };
|
|
85
|
+
export { type AppManifest, type AppsInTossPluginOptions, type BuildResult, type CreateArtifactOptions, type OAuthScope, type Permission, appsInToss, appsInTossAppJson, createArtifact };
|
package/dist/plugins/index.d.ts
CHANGED
|
@@ -47,6 +47,7 @@ interface AppsInTossPluginOptions {
|
|
|
47
47
|
permissions: AppManifest['permissions'];
|
|
48
48
|
oauth: AppManifest['oauth'];
|
|
49
49
|
}
|
|
50
|
+
declare function appsInTossAppJson(options: AppsInTossPluginOptions): Promise<BedrockPluginCore>;
|
|
50
51
|
declare function appsInToss(options: AppsInTossPluginOptions): (BedrockPluginCore | Promise<BedrockPluginCore>)[];
|
|
51
52
|
|
|
52
53
|
interface CompileHbcOptions {
|
|
@@ -70,6 +71,7 @@ interface CreateArtifactOptions {
|
|
|
70
71
|
path: string;
|
|
71
72
|
platform: 'ios' | 'android';
|
|
72
73
|
}[];
|
|
74
|
+
reactNativeVersion: `${string}_${string}_${string}`;
|
|
73
75
|
appJsonPath: string;
|
|
74
76
|
outfile: string;
|
|
75
77
|
deploymentId: string;
|
|
@@ -80,4 +82,4 @@ interface CreateArtifactOptions {
|
|
|
80
82
|
}
|
|
81
83
|
declare function createArtifact(options: CreateArtifactOptions, deps: CreateCompressedBytecodeDependencies): Promise<string>;
|
|
82
84
|
|
|
83
|
-
export { type AppManifest, type AppsInTossPluginOptions, type BuildResult, type CreateArtifactOptions, type OAuthScope, type Permission, appsInToss, createArtifact };
|
|
85
|
+
export { type AppManifest, type AppsInTossPluginOptions, type BuildResult, type CreateArtifactOptions, type OAuthScope, type Permission, appsInToss, appsInTossAppJson, createArtifact };
|
package/dist/plugins/index.js
CHANGED
|
@@ -14238,7 +14238,7 @@ var require_isPlainObject = __commonJS({
|
|
|
14238
14238
|
var funcToString = funcProto.toString;
|
|
14239
14239
|
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
14240
14240
|
var objectCtorString = funcToString.call(Object);
|
|
14241
|
-
function
|
|
14241
|
+
function isPlainObject2(value) {
|
|
14242
14242
|
if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
|
|
14243
14243
|
return false;
|
|
14244
14244
|
}
|
|
@@ -14249,7 +14249,7 @@ var require_isPlainObject = __commonJS({
|
|
|
14249
14249
|
var Ctor = hasOwnProperty.call(proto, "constructor") && proto.constructor;
|
|
14250
14250
|
return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;
|
|
14251
14251
|
}
|
|
14252
|
-
module.exports =
|
|
14252
|
+
module.exports = isPlainObject2;
|
|
14253
14253
|
}
|
|
14254
14254
|
});
|
|
14255
14255
|
|
|
@@ -20885,7 +20885,7 @@ var require_file = __commonJS({
|
|
|
20885
20885
|
var flatten = require_flatten();
|
|
20886
20886
|
var difference = require_difference();
|
|
20887
20887
|
var union = require_union();
|
|
20888
|
-
var
|
|
20888
|
+
var isPlainObject2 = require_isPlainObject();
|
|
20889
20889
|
var glob = require_commonjs5();
|
|
20890
20890
|
var file = module.exports = {};
|
|
20891
20891
|
var pathSeparatorRe = /[\/\\]/g;
|
|
@@ -20910,7 +20910,7 @@ var require_file = __commonJS({
|
|
|
20910
20910
|
return fs6.existsSync(filepath);
|
|
20911
20911
|
};
|
|
20912
20912
|
file.expand = function(...args) {
|
|
20913
|
-
var options =
|
|
20913
|
+
var options = isPlainObject2(args[0]) ? args.shift() : {};
|
|
20914
20914
|
var patterns = Array.isArray(args[0]) ? args[0] : args;
|
|
20915
20915
|
if (patterns.length === 0) {
|
|
20916
20916
|
return [];
|
|
@@ -25650,6 +25650,7 @@ import path12 from "path";
|
|
|
25650
25650
|
|
|
25651
25651
|
// src/plugins/constants.ts
|
|
25652
25652
|
init_esm_shims();
|
|
25653
|
+
var REACT_NATIVE_VERSION = "0_72_6";
|
|
25653
25654
|
var APP_MANIFEST_NAME = "app.json";
|
|
25654
25655
|
|
|
25655
25656
|
// src/plugins/utils/compileHbc.ts
|
|
@@ -32708,50 +32709,6 @@ init_esm_shims();
|
|
|
32708
32709
|
import * as fs4 from "fs/promises";
|
|
32709
32710
|
import * as path10 from "path";
|
|
32710
32711
|
|
|
32711
|
-
// ../../.yarn/cache/es-toolkit-npm-1.33.0-f181eedbc7-4c8dea3167.zip/node_modules/es-toolkit/dist/index.mjs
|
|
32712
|
-
init_esm_shims();
|
|
32713
|
-
|
|
32714
|
-
// ../../.yarn/cache/es-toolkit-npm-1.33.0-f181eedbc7-4c8dea3167.zip/node_modules/es-toolkit/dist/predicate/isPlainObject.mjs
|
|
32715
|
-
init_esm_shims();
|
|
32716
|
-
function isPlainObject2(value) {
|
|
32717
|
-
if (!value || typeof value !== "object") {
|
|
32718
|
-
return false;
|
|
32719
|
-
}
|
|
32720
|
-
const proto = Object.getPrototypeOf(value);
|
|
32721
|
-
const hasObjectPrototype = proto === null || proto === Object.prototype || Object.getPrototypeOf(proto) === null;
|
|
32722
|
-
if (!hasObjectPrototype) {
|
|
32723
|
-
return false;
|
|
32724
|
-
}
|
|
32725
|
-
return Object.prototype.toString.call(value) === "[object Object]";
|
|
32726
|
-
}
|
|
32727
|
-
|
|
32728
|
-
// ../../.yarn/cache/es-toolkit-npm-1.33.0-f181eedbc7-4c8dea3167.zip/node_modules/es-toolkit/dist/object/merge.mjs
|
|
32729
|
-
init_esm_shims();
|
|
32730
|
-
function merge(target, source) {
|
|
32731
|
-
const sourceKeys = Object.keys(source);
|
|
32732
|
-
for (let i2 = 0; i2 < sourceKeys.length; i2++) {
|
|
32733
|
-
const key = sourceKeys[i2];
|
|
32734
|
-
const sourceValue = source[key];
|
|
32735
|
-
const targetValue = target[key];
|
|
32736
|
-
if (Array.isArray(sourceValue)) {
|
|
32737
|
-
if (Array.isArray(targetValue)) {
|
|
32738
|
-
target[key] = merge(targetValue, sourceValue);
|
|
32739
|
-
} else {
|
|
32740
|
-
target[key] = merge([], sourceValue);
|
|
32741
|
-
}
|
|
32742
|
-
} else if (isPlainObject2(sourceValue)) {
|
|
32743
|
-
if (isPlainObject2(targetValue)) {
|
|
32744
|
-
target[key] = merge(targetValue, sourceValue);
|
|
32745
|
-
} else {
|
|
32746
|
-
target[key] = merge({}, sourceValue);
|
|
32747
|
-
}
|
|
32748
|
-
} else if (targetValue === void 0 || sourceValue !== void 0) {
|
|
32749
|
-
target[key] = sourceValue;
|
|
32750
|
-
}
|
|
32751
|
-
}
|
|
32752
|
-
return target;
|
|
32753
|
-
}
|
|
32754
|
-
|
|
32755
32712
|
// src/plugins/utils/getPackageRoot.ts
|
|
32756
32713
|
init_esm_shims();
|
|
32757
32714
|
import fs3 from "fs";
|
|
@@ -32775,26 +32732,29 @@ async function resolveAppManifestPath() {
|
|
|
32775
32732
|
await fs4.access(appManifestPath, fs4.constants.F_OK);
|
|
32776
32733
|
return appManifestPath;
|
|
32777
32734
|
}
|
|
32735
|
+
async function readAppJson(appJsonPath) {
|
|
32736
|
+
const appJson = await fs4.readFile(appJsonPath, "utf8");
|
|
32737
|
+
return JSON.parse(appJson);
|
|
32738
|
+
}
|
|
32739
|
+
async function writeAppJson(appJsonPath, content) {
|
|
32740
|
+
await fs4.writeFile(appJsonPath, JSON.stringify(content));
|
|
32741
|
+
}
|
|
32778
32742
|
async function updateAppJsonMetadata(metadata) {
|
|
32779
32743
|
const appJsonPath = await resolveAppManifestPath();
|
|
32780
|
-
const appJson = await
|
|
32781
|
-
await
|
|
32782
|
-
|
|
32783
|
-
|
|
32784
|
-
|
|
32785
|
-
_metadata: metadata
|
|
32786
|
-
})
|
|
32787
|
-
)
|
|
32788
|
-
);
|
|
32744
|
+
const appJson = await readAppJson(appJsonPath);
|
|
32745
|
+
await writeAppJson(appJsonPath, {
|
|
32746
|
+
...appJson,
|
|
32747
|
+
_metadata: metadata
|
|
32748
|
+
});
|
|
32789
32749
|
}
|
|
32790
32750
|
|
|
32791
32751
|
// src/plugins/utils/createArtifact.ts
|
|
32792
32752
|
async function createArtifact(options, deps) {
|
|
32793
|
-
const { inputJsFiles, outfile, appJsonPath } = options;
|
|
32753
|
+
const { inputJsFiles, outfile, appJsonPath, reactNativeVersion } = options;
|
|
32794
32754
|
const bundleFiles = await Promise.all(
|
|
32795
32755
|
inputJsFiles.map(async (result) => {
|
|
32796
32756
|
const { compressed } = await createCompressedBytecode(result.path, path11.dirname(outfile), deps);
|
|
32797
|
-
return { path: compressed, name: `bundle.${result.platform}.hbc.gz` };
|
|
32757
|
+
return { path: compressed, name: `bundle.${result.platform}.${reactNativeVersion}.hbc.gz` };
|
|
32798
32758
|
})
|
|
32799
32759
|
);
|
|
32800
32760
|
await updateAppJsonMetadata({
|
|
@@ -33213,6 +33173,7 @@ function appsInTossCreateArtifact(deploymentId) {
|
|
|
33213
33173
|
handler: async ({ buildResults, appName, cwd }) => {
|
|
33214
33174
|
const artifactOutfile = await createArtifact(
|
|
33215
33175
|
{
|
|
33176
|
+
reactNativeVersion: REACT_NATIVE_VERSION,
|
|
33216
33177
|
deploymentId,
|
|
33217
33178
|
inputJsFiles: buildResults.map((buildResult) => ({
|
|
33218
33179
|
path: buildResult.outfile,
|
|
@@ -33269,11 +33230,13 @@ function appsInTossDevServer(options) {
|
|
|
33269
33230
|
config: {
|
|
33270
33231
|
mpack: {
|
|
33271
33232
|
devServer: {
|
|
33272
|
-
enableRouterGen: false,
|
|
33273
33233
|
middlewares: [
|
|
33274
33234
|
createServerPermissionsMiddleware(options.permissions),
|
|
33275
33235
|
createServerOAuthMiddleware(options.oauth)
|
|
33276
|
-
]
|
|
33236
|
+
],
|
|
33237
|
+
routegen: {
|
|
33238
|
+
enabled: false
|
|
33239
|
+
}
|
|
33277
33240
|
}
|
|
33278
33241
|
}
|
|
33279
33242
|
}
|
|
@@ -33331,6 +33294,7 @@ function appsInToss(options) {
|
|
|
33331
33294
|
init_esm_shims();
|
|
33332
33295
|
export {
|
|
33333
33296
|
appsInToss,
|
|
33297
|
+
appsInTossAppJson,
|
|
33334
33298
|
createArtifact
|
|
33335
33299
|
};
|
|
33336
33300
|
/*! Bundled license information:
|
package/jest.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './dist/jest';
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apps-in-toss/framework",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.0-dev.
|
|
5
|
-
"description": "
|
|
4
|
+
"version": "0.0.0-dev.1741675190621",
|
|
5
|
+
"description": "The framework for Apps In Toss",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"prepack": "yarn build",
|
|
8
8
|
"typecheck": "tsc --noEmit",
|
|
@@ -27,36 +27,41 @@
|
|
|
27
27
|
"types": "./src/bridges.ts",
|
|
28
28
|
"default": "./src/bridges.ts"
|
|
29
29
|
},
|
|
30
|
+
"./jest": {
|
|
31
|
+
"types": "./dist/jest/index.d.ts",
|
|
32
|
+
"import": "./dist/jest/index.js",
|
|
33
|
+
"require": "./dist/jest/index.cjs"
|
|
34
|
+
},
|
|
30
35
|
"./package.json": "./package.json"
|
|
31
36
|
},
|
|
32
37
|
"files": [
|
|
33
38
|
"dist/**/*",
|
|
34
39
|
"src/bridges.ts",
|
|
35
40
|
"hermesc/**/*",
|
|
36
|
-
"plugins.d.ts"
|
|
41
|
+
"plugins.d.ts",
|
|
42
|
+
"jest.d.ts"
|
|
37
43
|
],
|
|
38
44
|
"bin": {
|
|
39
|
-
"ait": "./bin.js"
|
|
45
|
+
"ait": "./bin/ait.js"
|
|
40
46
|
},
|
|
41
47
|
"dependencies": {
|
|
42
|
-
"@apps-in-toss/cli": "
|
|
48
|
+
"@apps-in-toss/cli": "0.0.0-dev.1741675190621"
|
|
43
49
|
},
|
|
44
50
|
"devDependencies": {
|
|
45
|
-
"@react-native-bedrock/mpack-next": "0.0.0-dev.
|
|
46
|
-
"@react-native-bedrock/native": "0.0.0-dev.
|
|
51
|
+
"@react-native-bedrock/mpack-next": "0.0.0-dev.1741675002593",
|
|
52
|
+
"@react-native-bedrock/native": "0.0.0-dev.1741675002593",
|
|
53
|
+
"@toss-design-system/react-native": "^0",
|
|
47
54
|
"@types/archiver": "^6.0.3",
|
|
48
55
|
"@types/connect": "^3",
|
|
49
56
|
"@types/react": "18.3.3",
|
|
50
57
|
"archiver": "^7.0.1",
|
|
51
58
|
"connect": "^3.7.0",
|
|
52
|
-
"es-toolkit": "^1.33.0",
|
|
53
59
|
"eslint": "^9.7.0",
|
|
54
60
|
"execa": "^9.5.2",
|
|
55
|
-
"find-up": "^7.0.0",
|
|
56
61
|
"picocolors": "^1.1.1",
|
|
57
62
|
"react": "18.2.0",
|
|
58
63
|
"react-native": "0.72.6",
|
|
59
|
-
"react-native-bedrock": "0.0.0-dev.
|
|
64
|
+
"react-native-bedrock": "0.0.0-dev.1741675002593",
|
|
60
65
|
"tsup": "^8.3.5",
|
|
61
66
|
"typescript": "4.9.5",
|
|
62
67
|
"uuidv7": "^1.0.2",
|
|
@@ -64,6 +69,8 @@
|
|
|
64
69
|
},
|
|
65
70
|
"peerDependencies": {
|
|
66
71
|
"@react-native-bedrock/native": "*",
|
|
72
|
+
"@toss-design-system/react-native": "*",
|
|
73
|
+
"@types/react": "*",
|
|
67
74
|
"react": "*",
|
|
68
75
|
"react-native": "*",
|
|
69
76
|
"react-native-bedrock": "*"
|
|
@@ -71,5 +78,5 @@
|
|
|
71
78
|
"publishConfig": {
|
|
72
79
|
"access": "public"
|
|
73
80
|
},
|
|
74
|
-
"gitHead": "
|
|
81
|
+
"gitHead": "6187ae5debf7ce5f46d4c6274fac9b26df728392"
|
|
75
82
|
}
|