Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zeroing-code-divider
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-code-divider
Commits
0cb1266f
Commit
0cb1266f
authored
Feb 16, 2020
by
rockyl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
库版本锁
parent
1b6d4100
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
51 additions
and
27 deletions
+51
-27
index.es.js
dist/index.es.js
+12
-6
index.es.js.map
dist/index.es.js.map
+1
-1
index.js
dist/index.js
+12
-6
index.js.map
dist/index.js.map
+1
-1
index.umd.js
dist/index.umd.js
+12
-6
index.umd.js.map
dist/index.umd.js.map
+1
-1
main.js
src/main.js
+12
-6
No files found.
dist/index.es.js
View file @
0cb1266f
...
...
@@ -188,11 +188,13 @@ ${scripts}
* Created by rockyl on 2019-12-20.
*/
async
function
divideCode
(
data
,
{
debug
,
compile
,
uglify
,
getP
rocesses
,
getScripts
,
getCustom
s
})
{
async
function
divideCode
(
data
,
{
debug
,
compile
,
uglify
,
getP
ackage
s
})
{
const
processManager
=
new
ProcessManager
();
const
scriptManager
=
new
ScriptManager
();
const
customManager
=
new
CustomManager
();
const
dependencies
=
data
.
dependencies
;
/*=====START process =====*/
//console.log(TAG, 'start process');
let
processIDs
=
[];
...
...
@@ -201,7 +203,7 @@ async function divideCode(data, {debug, compile, uglify, getProcesses, getScript
let
bProcessIDs
=
processIDs
;
while
(
true
)
{
let
newPids
=
await
addBuiltinProcesses
(
builtinProcesses
,
bProcessIDs
,
getP
rocess
es
);
let
newPids
=
await
addBuiltinProcesses
(
builtinProcesses
,
bProcessIDs
,
getP
ackages
,
dependenci
es
);
bProcessIDs
=
[];
for
(
let
id
of
newPids
)
{
if
(
!
processIDs
.
includes
(
id
))
{
...
...
@@ -255,7 +257,7 @@ async function divideCode(data, {debug, compile, uglify, getProcesses, getScript
//let scriptsContainer = data.scripts = {};
//let scriptsCode = '';
if
(
scriptIDs
.
length
>
0
)
{
const
scripts
=
await
get
Script
s
(
scriptIDs
);
const
scripts
=
await
get
Package
s
(
scriptIDs
);
for
(
let
scriptData
of
scripts
)
{
let
script
=
typeof
scriptData
===
'string'
?
JSON
.
parse
(
scriptData
)
:
scriptData
;
//scriptsContainer[id] = code;
...
...
@@ -276,7 +278,7 @@ async function divideCode(data, {debug, compile, uglify, getProcesses, getScript
//data.customs = [];
const
customs
=
data
.
customs
;
if
(
customs
&&
customs
.
length
>
0
)
{
let
customMetas
=
await
get
Custom
s
(
customs
.
map
(
item
=>
item
.
id
));
let
customMetas
=
await
get
Package
s
(
customs
.
map
(
item
=>
item
.
id
));
data
.
customs
=
customMetas
.
map
(
item
=>
{
const
custom
=
typeof
item
===
'string'
?
JSON
.
parse
(
item
)
:
item
;
customManager
.
deal
(
custom
);
...
...
@@ -337,10 +339,14 @@ function findDepPidsBat(list, processes) {
}
}
async
function
addBuiltinProcesses
(
list
,
ids
,
getP
rocess
es
)
{
async
function
addBuiltinProcesses
(
list
,
ids
,
getP
ackages
,
dependenci
es
)
{
let
newPids
=
[];
let
schema
=
{};
if
(
ids
.
length
>
0
)
{
let
processes
=
await
getProcesses
(
ids
);
for
(
let
id
of
ids
){
schema
[
id
]
=
dependencies
[
id
];
}
let
processes
=
await
getPackages
(
schema
);
for
(
let
processData
of
processes
)
{
let
process
=
typeof
processData
===
'string'
?
JSON
.
parse
(
processData
)
:
processData
;
list
.
push
(
process
);
...
...
dist/index.es.js.map
View file @
0cb1266f
This diff is collapsed.
Click to expand it.
dist/index.js
View file @
0cb1266f
...
...
@@ -194,11 +194,13 @@ ${scripts}
* Created by rockyl on 2019-12-20.
*/
async
function
divideCode
(
data
,
{
debug
,
compile
,
uglify
,
getP
rocesses
,
getScripts
,
getCustom
s
})
{
async
function
divideCode
(
data
,
{
debug
,
compile
,
uglify
,
getP
ackage
s
})
{
const
processManager
=
new
ProcessManager
();
const
scriptManager
=
new
ScriptManager
();
const
customManager
=
new
CustomManager
();
const
dependencies
=
data
.
dependencies
;
/*=====START process =====*/
//console.log(TAG, 'start process');
let
processIDs
=
[];
...
...
@@ -207,7 +209,7 @@ async function divideCode(data, {debug, compile, uglify, getProcesses, getScript
let
bProcessIDs
=
processIDs
;
while
(
true
)
{
let
newPids
=
await
addBuiltinProcesses
(
builtinProcesses
,
bProcessIDs
,
getP
rocess
es
);
let
newPids
=
await
addBuiltinProcesses
(
builtinProcesses
,
bProcessIDs
,
getP
ackages
,
dependenci
es
);
bProcessIDs
=
[];
for
(
let
id
of
newPids
)
{
if
(
!
processIDs
.
includes
(
id
))
{
...
...
@@ -261,7 +263,7 @@ async function divideCode(data, {debug, compile, uglify, getProcesses, getScript
//let scriptsContainer = data.scripts = {};
//let scriptsCode = '';
if
(
scriptIDs
.
length
>
0
)
{
const
scripts
=
await
get
Script
s
(
scriptIDs
);
const
scripts
=
await
get
Package
s
(
scriptIDs
);
for
(
let
scriptData
of
scripts
)
{
let
script
=
typeof
scriptData
===
'string'
?
JSON
.
parse
(
scriptData
)
:
scriptData
;
//scriptsContainer[id] = code;
...
...
@@ -282,7 +284,7 @@ async function divideCode(data, {debug, compile, uglify, getProcesses, getScript
//data.customs = [];
const
customs
=
data
.
customs
;
if
(
customs
&&
customs
.
length
>
0
)
{
let
customMetas
=
await
get
Custom
s
(
customs
.
map
(
item
=>
item
.
id
));
let
customMetas
=
await
get
Package
s
(
customs
.
map
(
item
=>
item
.
id
));
data
.
customs
=
customMetas
.
map
(
item
=>
{
const
custom
=
typeof
item
===
'string'
?
JSON
.
parse
(
item
)
:
item
;
customManager
.
deal
(
custom
);
...
...
@@ -343,10 +345,14 @@ function findDepPidsBat(list, processes) {
}
}
async
function
addBuiltinProcesses
(
list
,
ids
,
getP
rocess
es
)
{
async
function
addBuiltinProcesses
(
list
,
ids
,
getP
ackages
,
dependenci
es
)
{
let
newPids
=
[];
let
schema
=
{};
if
(
ids
.
length
>
0
)
{
let
processes
=
await
getProcesses
(
ids
);
for
(
let
id
of
ids
){
schema
[
id
]
=
dependencies
[
id
];
}
let
processes
=
await
getPackages
(
schema
);
for
(
let
processData
of
processes
)
{
let
process
=
typeof
processData
===
'string'
?
JSON
.
parse
(
processData
)
:
processData
;
list
.
push
(
process
);
...
...
dist/index.js.map
View file @
0cb1266f
This diff is collapsed.
Click to expand it.
dist/index.umd.js
View file @
0cb1266f
...
...
@@ -193,11 +193,13 @@ ${scripts}
* Created by rockyl on 2019-12-20.
*/
async
function
divideCode
(
data
,
{
debug
,
compile
,
uglify
,
getP
rocesses
,
getScripts
,
getCustom
s
})
{
async
function
divideCode
(
data
,
{
debug
,
compile
,
uglify
,
getP
ackage
s
})
{
const
processManager
=
new
ProcessManager
();
const
scriptManager
=
new
ScriptManager
();
const
customManager
=
new
CustomManager
();
const
dependencies
=
data
.
dependencies
;
/*=====START process =====*/
//console.log(TAG, 'start process');
let
processIDs
=
[];
...
...
@@ -206,7 +208,7 @@ ${scripts}
let
bProcessIDs
=
processIDs
;
while
(
true
)
{
let
newPids
=
await
addBuiltinProcesses
(
builtinProcesses
,
bProcessIDs
,
getP
rocess
es
);
let
newPids
=
await
addBuiltinProcesses
(
builtinProcesses
,
bProcessIDs
,
getP
ackages
,
dependenci
es
);
bProcessIDs
=
[];
for
(
let
id
of
newPids
)
{
if
(
!
processIDs
.
includes
(
id
))
{
...
...
@@ -260,7 +262,7 @@ ${scripts}
//let scriptsContainer = data.scripts = {};
//let scriptsCode = '';
if
(
scriptIDs
.
length
>
0
)
{
const
scripts
=
await
get
Script
s
(
scriptIDs
);
const
scripts
=
await
get
Package
s
(
scriptIDs
);
for
(
let
scriptData
of
scripts
)
{
let
script
=
typeof
scriptData
===
'string'
?
JSON
.
parse
(
scriptData
)
:
scriptData
;
//scriptsContainer[id] = code;
...
...
@@ -281,7 +283,7 @@ ${scripts}
//data.customs = [];
const
customs
=
data
.
customs
;
if
(
customs
&&
customs
.
length
>
0
)
{
let
customMetas
=
await
get
Custom
s
(
customs
.
map
(
item
=>
item
.
id
));
let
customMetas
=
await
get
Package
s
(
customs
.
map
(
item
=>
item
.
id
));
data
.
customs
=
customMetas
.
map
(
item
=>
{
const
custom
=
typeof
item
===
'string'
?
JSON
.
parse
(
item
)
:
item
;
customManager
.
deal
(
custom
);
...
...
@@ -342,10 +344,14 @@ ${scripts}
}
}
async
function
addBuiltinProcesses
(
list
,
ids
,
getP
rocess
es
)
{
async
function
addBuiltinProcesses
(
list
,
ids
,
getP
ackages
,
dependenci
es
)
{
let
newPids
=
[];
let
schema
=
{};
if
(
ids
.
length
>
0
)
{
let
processes
=
await
getProcesses
(
ids
);
for
(
let
id
of
ids
){
schema
[
id
]
=
dependencies
[
id
];
}
let
processes
=
await
getPackages
(
schema
);
for
(
let
processData
of
processes
)
{
let
process
=
typeof
processData
===
'string'
?
JSON
.
parse
(
processData
)
:
processData
;
list
.
push
(
process
);
...
...
dist/index.umd.js.map
View file @
0cb1266f
This diff is collapsed.
Click to expand it.
src/main.js
View file @
0cb1266f
...
...
@@ -9,11 +9,13 @@ import {compute} from "props-compute";
const
TAG
=
'zeroing-code-divider'
;
export
async
function
divideCode
(
data
,
{
debug
,
compile
,
uglify
,
getP
rocesses
,
getScripts
,
getCustom
s
})
{
export
async
function
divideCode
(
data
,
{
debug
,
compile
,
uglify
,
getP
ackage
s
})
{
const
processManager
=
new
ProcessManager
();
const
scriptManager
=
new
ScriptManager
();
const
customManager
=
new
CustomManager
();
const
dependencies
=
data
.
dependencies
;
/*=====START process =====*/
//console.log(TAG, 'start process');
let
processIDs
=
[];
...
...
@@ -22,7 +24,7 @@ export async function divideCode(data, {debug, compile, uglify, getProcesses, ge
let
bProcessIDs
=
processIDs
;
while
(
true
)
{
let
newPids
=
await
addBuiltinProcesses
(
builtinProcesses
,
bProcessIDs
,
getP
rocess
es
);
let
newPids
=
await
addBuiltinProcesses
(
builtinProcesses
,
bProcessIDs
,
getP
ackages
,
dependenci
es
);
bProcessIDs
=
[];
for
(
let
id
of
newPids
)
{
if
(
!
processIDs
.
includes
(
id
))
{
...
...
@@ -76,7 +78,7 @@ export async function divideCode(data, {debug, compile, uglify, getProcesses, ge
//let scriptsContainer = data.scripts = {};
//let scriptsCode = '';
if
(
scriptIDs
.
length
>
0
)
{
const
scripts
=
await
get
Script
s
(
scriptIDs
);
const
scripts
=
await
get
Package
s
(
scriptIDs
);
for
(
let
scriptData
of
scripts
)
{
let
script
=
typeof
scriptData
===
'string'
?
JSON
.
parse
(
scriptData
)
:
scriptData
;
//scriptsContainer[id] = code;
...
...
@@ -97,7 +99,7 @@ export async function divideCode(data, {debug, compile, uglify, getProcesses, ge
//data.customs = [];
const
customs
=
data
.
customs
;
if
(
customs
&&
customs
.
length
>
0
)
{
let
customMetas
=
await
get
Custom
s
(
customs
.
map
(
item
=>
item
.
id
));
let
customMetas
=
await
get
Package
s
(
customs
.
map
(
item
=>
item
.
id
));
data
.
customs
=
customMetas
.
map
(
item
=>
{
const
custom
=
typeof
item
===
'string'
?
JSON
.
parse
(
item
)
:
item
;
customManager
.
deal
(
custom
);
...
...
@@ -158,10 +160,14 @@ function findDepPidsBat(list, processes) {
}
}
async
function
addBuiltinProcesses
(
list
,
ids
,
getP
rocess
es
)
{
async
function
addBuiltinProcesses
(
list
,
ids
,
getP
ackages
,
dependenci
es
)
{
let
newPids
=
[];
let
schema
=
{};
if
(
ids
.
length
>
0
)
{
let
processes
=
await
getProcesses
(
ids
);
for
(
let
id
of
ids
){
schema
[
id
]
=
dependencies
[
id
];
}
let
processes
=
await
getPackages
(
schema
);
for
(
let
processData
of
processes
)
{
let
process
=
typeof
processData
===
'string'
?
JSON
.
parse
(
processData
)
:
processData
;
list
.
push
(
process
);
...
...
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