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
9c04420d
Commit
9c04420d
authored
Dec 20, 2019
by
rockyl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
分离代码分离器
parent
c936d152
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
92 deletions
+0
-92
index.js
src/index.js
+0
-92
No files found.
src/index.js
View file @
9c04420d
...
@@ -54,98 +54,6 @@ async function packData(data, {debug, packedAssets, getProcesses, getScripts, ge
...
@@ -54,98 +54,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
,
...
...
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