Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zeroing-pack
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
劳工
zeroing-pack
Commits
4034ca64
Commit
4034ca64
authored
Dec 23, 2019
by
rockyl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复自定义模块的问题
parent
9587a0d8
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
7 additions
and
279 deletions
+7
-279
index.es.js
dist/index.es.js
+1
-92
index.es.js.map
dist/index.es.js.map
+1
-1
index.js
dist/index.js
+1
-92
index.js.map
dist/index.js.map
+1
-1
index.umd.js
dist/index.umd.js
+1
-92
index.umd.js.map
dist/index.umd.js.map
+1
-1
index.js
src/index.js
+1
-0
No files found.
dist/index.es.js
View file @
4034ca64
...
@@ -70,6 +70,7 @@ async function packData(data, {debug, packedAssets, getProcesses, getScripts, ge
...
@@ -70,6 +70,7 @@ async function packData(data, {debug, packedAssets, getProcesses, getScripts, ge
newData
.
assets
=
packedAssets
||
data
.
assets
;
newData
.
assets
=
packedAssets
||
data
.
assets
;
newData
.
dataMapping
=
data
.
dataMapping
;
newData
.
dataMapping
=
data
.
dataMapping
;
newData
.
processes
=
data
.
processes
;
newData
.
processes
=
data
.
processes
;
newData
.
customs
=
data
.
customs
;
delete
newData
.
options
.
tpl
;
delete
newData
.
options
.
tpl
;
deleteUnusedData
(
newData
.
processes
);
deleteUnusedData
(
newData
.
processes
);
...
@@ -86,98 +87,6 @@ async function packData(data, {debug, packedAssets, getProcesses, getScripts, ge
...
@@ -86,98 +87,6 @@ async function packData(data, {debug, packedAssets, getProcesses, getScripts, ge
getProcesses
,
getScripts
,
getCustoms
,
getProcesses
,
getScripts
,
getCustoms
,
});
});
/*/!*=====START process =====*!/
console.log(TAG, 'start process');
let processIDs = [];
findDepPidsBat(processIDs, newData.processes);
let builtinProcesses = newData.builtinProcesses = [];
let bProcessIDs = processIDs;
while (true) {
let newPids = await addBuiltinProcesses(builtinProcesses, bProcessIDs, getProcesses);
bProcessIDs = [];
for (let id of newPids) {
if (!processIDs.includes(id)) {
bProcessIDs.push(id);
processIDs.push(id);
}
}
if (bProcessIDs.length === 0) {
break;
}
}
for (let process of newData.processes) {
processManager.deal(process);
}
console.log(TAG, 'processManager.generateCurrent()');
processManager.generateCurrent();
await processManager.compile(); //自定义过程先编译
for (let process of builtinProcesses) {
processManager.deal(process);
}
let processScriptContent = processManager.generate();
//console.log(processScriptContent);
if (!debug) {
processScriptContent = uglify(processScriptContent);
}
/!*=====END process =====*!/
/!*=====START script =====*!/
console.log(TAG, 'start script');
let scriptIDs = [];
for (let view of newData.views) {
traverseNode(view, (node) => {
if (node.scripts && node.scripts.length > 0) {
for (let {script} of node.scripts) {
if (!scriptIDs.includes(script)) {
scriptIDs.push(script);
}
}
}
});
}
//console.log('scriptIDs:', scriptIDs);
//let scriptsContainer = newData.scripts = {};
//let scriptsCode = '';
if (scriptIDs.length > 0) {
const scripts = await getScripts(scriptIDs);
for (let scriptData of scripts) {
let script = JSON.parse(scriptData);
//scriptsContainer[id] = code;
scriptManager.deal(script);
}
//console.log('scripts:', scriptsContainer);
}
let scriptsContent = scriptManager.generate();
//console.log(scriptsContent);
if (!debug) {
scriptsContent = uglify(scriptsContent);
}
/!*=====END script =====*!/
/!*=====START custom =====*!/
console.log(TAG, 'start custom');
//newData.customs = [];
if (data.customs && data.customs.length > 0) {
/!*newData.customs = *!/
(await getCustoms(data.customs)).map(item => {
customManager.deal(JSON.parse(item));
//return JSON.parse(item);
})
}
let customScriptContent = customManager.generate();
//console.log(customScriptContent);
if (!debug) {
customScriptContent = uglify(customScriptContent);
}
/!*=====END custom =====*!/*/
return
{
return
{
data
:
JSON
.
stringify
(
newData
),
data
:
JSON
.
stringify
(
newData
),
processScriptContent
,
processScriptContent
,
...
...
dist/index.es.js.map
View file @
4034ca64
This diff is collapsed.
Click to expand it.
dist/index.js
View file @
4034ca64
...
@@ -76,6 +76,7 @@ async function packData(data, {debug, packedAssets, getProcesses, getScripts, ge
...
@@ -76,6 +76,7 @@ async function packData(data, {debug, packedAssets, getProcesses, getScripts, ge
newData
.
assets
=
packedAssets
||
data
.
assets
;
newData
.
assets
=
packedAssets
||
data
.
assets
;
newData
.
dataMapping
=
data
.
dataMapping
;
newData
.
dataMapping
=
data
.
dataMapping
;
newData
.
processes
=
data
.
processes
;
newData
.
processes
=
data
.
processes
;
newData
.
customs
=
data
.
customs
;
delete
newData
.
options
.
tpl
;
delete
newData
.
options
.
tpl
;
deleteUnusedData
(
newData
.
processes
);
deleteUnusedData
(
newData
.
processes
);
...
@@ -92,98 +93,6 @@ async function packData(data, {debug, packedAssets, getProcesses, getScripts, ge
...
@@ -92,98 +93,6 @@ async function packData(data, {debug, packedAssets, getProcesses, getScripts, ge
getProcesses
,
getScripts
,
getCustoms
,
getProcesses
,
getScripts
,
getCustoms
,
});
});
/*/!*=====START process =====*!/
console.log(TAG, 'start process');
let processIDs = [];
findDepPidsBat(processIDs, newData.processes);
let builtinProcesses = newData.builtinProcesses = [];
let bProcessIDs = processIDs;
while (true) {
let newPids = await addBuiltinProcesses(builtinProcesses, bProcessIDs, getProcesses);
bProcessIDs = [];
for (let id of newPids) {
if (!processIDs.includes(id)) {
bProcessIDs.push(id);
processIDs.push(id);
}
}
if (bProcessIDs.length === 0) {
break;
}
}
for (let process of newData.processes) {
processManager.deal(process);
}
console.log(TAG, 'processManager.generateCurrent()');
processManager.generateCurrent();
await processManager.compile(); //自定义过程先编译
for (let process of builtinProcesses) {
processManager.deal(process);
}
let processScriptContent = processManager.generate();
//console.log(processScriptContent);
if (!debug) {
processScriptContent = uglify(processScriptContent);
}
/!*=====END process =====*!/
/!*=====START script =====*!/
console.log(TAG, 'start script');
let scriptIDs = [];
for (let view of newData.views) {
traverseNode(view, (node) => {
if (node.scripts && node.scripts.length > 0) {
for (let {script} of node.scripts) {
if (!scriptIDs.includes(script)) {
scriptIDs.push(script);
}
}
}
});
}
//console.log('scriptIDs:', scriptIDs);
//let scriptsContainer = newData.scripts = {};
//let scriptsCode = '';
if (scriptIDs.length > 0) {
const scripts = await getScripts(scriptIDs);
for (let scriptData of scripts) {
let script = JSON.parse(scriptData);
//scriptsContainer[id] = code;
scriptManager.deal(script);
}
//console.log('scripts:', scriptsContainer);
}
let scriptsContent = scriptManager.generate();
//console.log(scriptsContent);
if (!debug) {
scriptsContent = uglify(scriptsContent);
}
/!*=====END script =====*!/
/!*=====START custom =====*!/
console.log(TAG, 'start custom');
//newData.customs = [];
if (data.customs && data.customs.length > 0) {
/!*newData.customs = *!/
(await getCustoms(data.customs)).map(item => {
customManager.deal(JSON.parse(item));
//return JSON.parse(item);
})
}
let customScriptContent = customManager.generate();
//console.log(customScriptContent);
if (!debug) {
customScriptContent = uglify(customScriptContent);
}
/!*=====END custom =====*!/*/
return
{
return
{
data
:
JSON
.
stringify
(
newData
),
data
:
JSON
.
stringify
(
newData
),
processScriptContent
,
processScriptContent
,
...
...
dist/index.js.map
View file @
4034ca64
This diff is collapsed.
Click to expand it.
dist/index.umd.js
View file @
4034ca64
...
@@ -75,6 +75,7 @@
...
@@ -75,6 +75,7 @@
newData
.
assets
=
packedAssets
||
data
.
assets
;
newData
.
assets
=
packedAssets
||
data
.
assets
;
newData
.
dataMapping
=
data
.
dataMapping
;
newData
.
dataMapping
=
data
.
dataMapping
;
newData
.
processes
=
data
.
processes
;
newData
.
processes
=
data
.
processes
;
newData
.
customs
=
data
.
customs
;
delete
newData
.
options
.
tpl
;
delete
newData
.
options
.
tpl
;
deleteUnusedData
(
newData
.
processes
);
deleteUnusedData
(
newData
.
processes
);
...
@@ -91,98 +92,6 @@
...
@@ -91,98 +92,6 @@
getProcesses
,
getScripts
,
getCustoms
,
getProcesses
,
getScripts
,
getCustoms
,
});
});
/*/!*=====START process =====*!/
console.log(TAG, 'start process');
let processIDs = [];
findDepPidsBat(processIDs, newData.processes);
let builtinProcesses = newData.builtinProcesses = [];
let bProcessIDs = processIDs;
while (true) {
let newPids = await addBuiltinProcesses(builtinProcesses, bProcessIDs, getProcesses);
bProcessIDs = [];
for (let id of newPids) {
if (!processIDs.includes(id)) {
bProcessIDs.push(id);
processIDs.push(id);
}
}
if (bProcessIDs.length === 0) {
break;
}
}
for (let process of newData.processes) {
processManager.deal(process);
}
console.log(TAG, 'processManager.generateCurrent()');
processManager.generateCurrent();
await processManager.compile(); //自定义过程先编译
for (let process of builtinProcesses) {
processManager.deal(process);
}
let processScriptContent = processManager.generate();
//console.log(processScriptContent);
if (!debug) {
processScriptContent = uglify(processScriptContent);
}
/!*=====END process =====*!/
/!*=====START script =====*!/
console.log(TAG, 'start script');
let scriptIDs = [];
for (let view of newData.views) {
traverseNode(view, (node) => {
if (node.scripts && node.scripts.length > 0) {
for (let {script} of node.scripts) {
if (!scriptIDs.includes(script)) {
scriptIDs.push(script);
}
}
}
});
}
//console.log('scriptIDs:', scriptIDs);
//let scriptsContainer = newData.scripts = {};
//let scriptsCode = '';
if (scriptIDs.length > 0) {
const scripts = await getScripts(scriptIDs);
for (let scriptData of scripts) {
let script = JSON.parse(scriptData);
//scriptsContainer[id] = code;
scriptManager.deal(script);
}
//console.log('scripts:', scriptsContainer);
}
let scriptsContent = scriptManager.generate();
//console.log(scriptsContent);
if (!debug) {
scriptsContent = uglify(scriptsContent);
}
/!*=====END script =====*!/
/!*=====START custom =====*!/
console.log(TAG, 'start custom');
//newData.customs = [];
if (data.customs && data.customs.length > 0) {
/!*newData.customs = *!/
(await getCustoms(data.customs)).map(item => {
customManager.deal(JSON.parse(item));
//return JSON.parse(item);
})
}
let customScriptContent = customManager.generate();
//console.log(customScriptContent);
if (!debug) {
customScriptContent = uglify(customScriptContent);
}
/!*=====END custom =====*!/*/
return
{
return
{
data
:
JSON
.
stringify
(
newData
),
data
:
JSON
.
stringify
(
newData
),
processScriptContent
,
processScriptContent
,
...
...
dist/index.umd.js.map
View file @
4034ca64
This diff is collapsed.
Click to expand it.
src/index.js
View file @
4034ca64
...
@@ -38,6 +38,7 @@ async function packData(data, {debug, packedAssets, getProcesses, getScripts, ge
...
@@ -38,6 +38,7 @@ async function packData(data, {debug, packedAssets, getProcesses, getScripts, ge
newData
.
assets
=
packedAssets
||
data
.
assets
;
newData
.
assets
=
packedAssets
||
data
.
assets
;
newData
.
dataMapping
=
data
.
dataMapping
;
newData
.
dataMapping
=
data
.
dataMapping
;
newData
.
processes
=
data
.
processes
;
newData
.
processes
=
data
.
processes
;
newData
.
customs
=
data
.
customs
;
delete
newData
.
options
.
tpl
;
delete
newData
.
options
.
tpl
;
deleteUnusedData
(
newData
.
processes
);
deleteUnusedData
(
newData
.
processes
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment