miaoda-expo-devkit 0.1.1-beta.91 → 0.1.1-beta.93
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/lint.js +13 -2
- package/dist/stubs/entry-inject.js +2 -0
- package/dist/stubs/preview-control.js +60 -0
- package/package.json +1 -1
package/dist/cli/lint.js
CHANGED
|
@@ -17266,9 +17266,19 @@ async function validateAppJsonSchema() {
|
|
|
17266
17266
|
const exp = appJson?.expo ?? appJson;
|
|
17267
17267
|
const schema = { type: "object", properties: app_config_schema_v55_default };
|
|
17268
17268
|
const validator = new import_schemer.default(schema, { rootDir: projectRoot });
|
|
17269
|
+
let ok = true;
|
|
17270
|
+
if (!exp?.scheme && !exp?.ios?.scheme) {
|
|
17271
|
+
console.error(
|
|
17272
|
+
`
|
|
17273
|
+
[app.json required fields missing]
|
|
17274
|
+
${appJsonPath}: 'expo.scheme' is required
|
|
17275
|
+
type: string | string[] (each item must match /^[a-z][a-z0-9+.-]*$/)
|
|
17276
|
+
example: "miaoda" or ["miaoda", "com.baidu.miaoda"]`
|
|
17277
|
+
);
|
|
17278
|
+
ok = false;
|
|
17279
|
+
}
|
|
17269
17280
|
try {
|
|
17270
17281
|
await validator.validateSchemaAsync(exp);
|
|
17271
|
-
return true;
|
|
17272
17282
|
} catch (e) {
|
|
17273
17283
|
if (e instanceof import_schemer.SchemerError) {
|
|
17274
17284
|
console.error("\n[app.json schema errors]");
|
|
@@ -17277,8 +17287,9 @@ async function validateAppJsonSchema() {
|
|
|
17277
17287
|
console.error(` ${appJsonPath}: ${field} \u2014 ${err.message} (got: ${JSON.stringify(err.data)})`);
|
|
17278
17288
|
}
|
|
17279
17289
|
}
|
|
17280
|
-
|
|
17290
|
+
ok = false;
|
|
17281
17291
|
}
|
|
17292
|
+
return ok;
|
|
17282
17293
|
}
|
|
17283
17294
|
async function main() {
|
|
17284
17295
|
run("oxlint", "oxlint", ["--config", oxlintConfig, ...lintTargets]);
|
|
@@ -4,10 +4,12 @@ var import_lgui_control = require("./lgui-control");
|
|
|
4
4
|
var import_css_control = require("./css-control");
|
|
5
5
|
var import_router_control = require("./router-control");
|
|
6
6
|
var import_screenshot_control = require("./screenshot-control");
|
|
7
|
+
var import_preview_control = require("./preview-control");
|
|
7
8
|
globalThis.__DEVKIT_INJECTED__ = true;
|
|
8
9
|
(0, import_hmr_control.setupHMRMessageControl)();
|
|
9
10
|
(0, import_lgui_control.setupLGUIMessageControl)();
|
|
10
11
|
(0, import_css_control.setupCSSInjectionControl)();
|
|
11
12
|
(0, import_router_control.setupRouterControl)();
|
|
12
13
|
(0, import_screenshot_control.setupScreenshotControl)();
|
|
14
|
+
(0, import_preview_control.setupPreviewControl)();
|
|
13
15
|
//# sourceMappingURL=entry-inject.js.map
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var preview_control_exports = {};
|
|
20
|
+
__export(preview_control_exports, {
|
|
21
|
+
setupPreviewControl: () => setupPreviewControl
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(preview_control_exports);
|
|
24
|
+
function getParentOrigin() {
|
|
25
|
+
try {
|
|
26
|
+
const w = globalThis.window;
|
|
27
|
+
if (!w) return "*";
|
|
28
|
+
return new URLSearchParams(w.location.search).get("parentOrigin") || "*";
|
|
29
|
+
} catch {
|
|
30
|
+
return "*";
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
function postPreviewSuccess() {
|
|
34
|
+
const w = globalThis.window;
|
|
35
|
+
if (!w || w.editorPreviewSuccessPosted) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
w.editorPreviewSuccessPosted = true;
|
|
39
|
+
w.parent.postMessage(
|
|
40
|
+
{
|
|
41
|
+
type: "editor-preview-success"
|
|
42
|
+
},
|
|
43
|
+
getParentOrigin()
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
function setupPreviewControl() {
|
|
47
|
+
if (typeof document === "undefined" || typeof window === "undefined") {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
if (document.readyState === "complete") {
|
|
51
|
+
postPreviewSuccess();
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
window.addEventListener("load", postPreviewSuccess, { once: true });
|
|
55
|
+
}
|
|
56
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
57
|
+
0 && (module.exports = {
|
|
58
|
+
setupPreviewControl
|
|
59
|
+
});
|
|
60
|
+
//# sourceMappingURL=preview-control.js.map
|