提交 68e3ff90 编写于 作者: fxy060608's avatar fxy060608

move apis.js

上级 c3d71c95
const fs = require('fs') const fs = require('fs')
const path = require('path') const path = require('path')
const apis = require('../src/core/helpers/apis') const apis = require('../lib/apis')
const AUTO_LOADS = [ const AUTO_LOADS = [
'upx2px', 'upx2px',
...@@ -49,11 +49,8 @@ const DEPS = { ...@@ -49,11 +49,8 @@ const DEPS = {
['/core/view/bridge/subscribe/api/request-component-info.js', 'requestComponentInfo'] ['/core/view/bridge/subscribe/api/request-component-info.js', 'requestComponentInfo']
], ],
'createIntersectionObserver': [ 'createIntersectionObserver': [
[ ['/core/view/bridge/subscribe/api/request-component-observer.js', 'requestComponentObserver'],
'/core/view/bridge/subscribe/api/request-component-observer.js', ['/core/view/bridge/subscribe/api/request-component-observer.js', 'destroyComponentObserver']
'requestComponentObserver',
'destroyComponentObserver'
]
] ]
} }
...@@ -113,6 +110,9 @@ function parseApiManifestDeps (manifest, protocol) { ...@@ -113,6 +110,9 @@ function parseApiManifestDeps (manifest, protocol) {
module.exports = { module.exports = {
generateApiManifest (manifest, protocol) { generateApiManifest (manifest, protocol) {
if (!Object.keys(manifest).length) {
throw new Error('api manifest.json 生成失败')
}
parseApiManifestDeps(manifest, protocol) parseApiManifestDeps(manifest, protocol)
const manifestJson = Object.create(null) const manifestJson = Object.create(null)
......
...@@ -13,7 +13,7 @@ const protocolPath = resolve('../../src/core/helpers/protocol') ...@@ -13,7 +13,7 @@ const protocolPath = resolve('../../src/core/helpers/protocol')
const coreApiPath = resolve('../../src/core/service/api') const coreApiPath = resolve('../../src/core/service/api')
const platformApiPath = resolve('../../src/platforms/' + process.env.UNI_PLATFORM + '/service/api') const platformApiPath = resolve('../../src/platforms/' + process.env.UNI_PLATFORM + '/service/api')
const apis = require('../../src/core/helpers/apis') const apis = require('../apis')
process.UNI_SERVICE_API_MANIFEST = Object.create(null) process.UNI_SERVICE_API_MANIFEST = Object.create(null)
process.UNI_SERVICE_API_PROTOCOL = Object.create(null) process.UNI_SERVICE_API_PROTOCOL = Object.create(null)
......
...@@ -645,7 +645,10 @@ ...@@ -645,7 +645,10 @@
[ [
[ [
"/core/view/bridge/subscribe/api/request-component-observer.js", "/core/view/bridge/subscribe/api/request-component-observer.js",
"requestComponentObserver", "requestComponentObserver"
],
[
"/core/view/bridge/subscribe/api/request-component-observer.js",
"destroyComponentObserver" "destroyComponentObserver"
] ]
] ]
......
import apis from 'uni-helpers/apis' import apis from '../../../lib/apis'
import { import {
wrapper, wrapper,
wrapperUnimplemented wrapperUnimplemented
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册