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
86d6f6e6
Commit
86d6f6e6
authored
Dec 03, 2019
by
rockyl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
过程代码增加id注释
parent
fb1e8780
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
55 additions
and
87 deletions
+55
-87
index.es.js
dist/index.es.js
+13
-21
index.es.js.map
dist/index.es.js.map
+1
-1
index.js
dist/index.js
+13
-21
index.js.map
dist/index.js.map
+1
-1
index.umd.js
dist/index.umd.js
+13
-21
index.umd.js.map
dist/index.umd.js.map
+1
-1
ProcessManager.js
src/ProcessManager.js
+10
-20
index.js
src/index.js
+3
-1
No files found.
dist/index.es.js
View file @
86d6f6e6
...
...
@@ -65,7 +65,7 @@ class ProcessManager {
}
put
(
process
)
{
const
{
id
,
script
}
=
process
;
const
{
id
,
name
,
script
}
=
process
;
if
(
script
)
{
let
hash
=
md5
(
script
);
if
(
!
this
.
pool
.
hasOwnProperty
(
hash
))
{
...
...
@@ -74,20 +74,21 @@ class ProcessManager {
ids
:
[],
};
}
this
.
pool
[
hash
].
ids
.
push
(
id
);
this
.
pool
[
hash
].
ids
.
push
(
name
||
id
);
return
hash
;
}
}
async
generateCurrent
()
{
generateCurrent
()
{
let
scripts
=
''
;
for
(
let
hash
in
this
.
pool
)
{
let
{
script
,
ids
}
=
this
.
pool
[
hash
];
let
idsComment
=
ids
.
map
(
id
=>
{
return
`/*==
${
id
}
==*/`
}).
join
(
'
\
n'
);
scripts
+=
`
${
ids
.
map
(
id
=>
{
return
`/*==
${
id
}
*==/\n`
})}
exports['
${
hash
}
'] = function(args, props, target, global, vm){
return new Promise(function(resolve, reject){
${
idsComment
}
${
script
}
function next(type, payload){resolve({type: type, payload: payload})}
...
...
@@ -95,12 +96,13 @@ ${script}
};
`
;
}
this
.
scripts
+=
scripts
;
this
.
pool
=
{};
}
//console.log('scripts', scripts);
async
compile
(){
try
{
const
{
code
,
sourcemap
}
=
await
compile
(
scripts
,
true
);
const
{
code
,
sourcemap
}
=
await
compile
(
this
.
scripts
,
true
);
this
.
scripts
=
code
;
}
catch
(
e
)
{
console
.
log
(
'编译失败'
,
e
);
...
...
@@ -108,20 +110,8 @@ ${script}
}
generate
()
{
this
.
generateCurrent
();
let
scripts
=
this
.
scripts
;
for
(
let
hash
in
this
.
pool
)
{
let
code
=
this
.
pool
[
hash
];
scripts
+=
`
exports['
${
hash
}
'] = function(args, props, target, global, vm){
return new Promise(function(resolve, reject){
${
code
}
function next(type, payload){resolve({type: type, payload: payload})}
});
};
`
;
}
return
`
(function(){
...
...
@@ -281,7 +271,9 @@ async function packData(data, {debug, getProcesses, getScripts, getCustoms}) {
}
console
.
log
(
TAG
,
'processManager.generateCurrent()'
);
await
processManager
.
generateCurrent
();
//自定义过程先编译
processManager
.
generateCurrent
();
await
processManager
.
compile
();
//自定义过程先编译
for
(
let
process
of
builtinProcesses
)
{
processManager
.
deal
(
process
);
...
...
dist/index.es.js.map
View file @
86d6f6e6
This diff is collapsed.
Click to expand it.
dist/index.js
View file @
86d6f6e6
...
...
@@ -71,7 +71,7 @@ class ProcessManager {
}
put
(
process
)
{
const
{
id
,
script
}
=
process
;
const
{
id
,
name
,
script
}
=
process
;
if
(
script
)
{
let
hash
=
md5
(
script
);
if
(
!
this
.
pool
.
hasOwnProperty
(
hash
))
{
...
...
@@ -80,20 +80,21 @@ class ProcessManager {
ids
:
[],
};
}
this
.
pool
[
hash
].
ids
.
push
(
id
);
this
.
pool
[
hash
].
ids
.
push
(
name
||
id
);
return
hash
;
}
}
async
generateCurrent
()
{
generateCurrent
()
{
let
scripts
=
''
;
for
(
let
hash
in
this
.
pool
)
{
let
{
script
,
ids
}
=
this
.
pool
[
hash
];
let
idsComment
=
ids
.
map
(
id
=>
{
return
`/*==
${
id
}
==*/`
}).
join
(
'
\
n'
);
scripts
+=
`
${
ids
.
map
(
id
=>
{
return
`/*==
${
id
}
*==/\n`
})}
exports['
${
hash
}
'] = function(args, props, target, global, vm){
return new Promise(function(resolve, reject){
${
idsComment
}
${
script
}
function next(type, payload){resolve({type: type, payload: payload})}
...
...
@@ -101,12 +102,13 @@ ${script}
};
`
;
}
this
.
scripts
+=
scripts
;
this
.
pool
=
{};
}
//console.log('scripts', scripts);
async
compile
(){
try
{
const
{
code
,
sourcemap
}
=
await
compile
(
scripts
,
true
);
const
{
code
,
sourcemap
}
=
await
compile
(
this
.
scripts
,
true
);
this
.
scripts
=
code
;
}
catch
(
e
)
{
console
.
log
(
'编译失败'
,
e
);
...
...
@@ -114,20 +116,8 @@ ${script}
}
generate
()
{
this
.
generateCurrent
();
let
scripts
=
this
.
scripts
;
for
(
let
hash
in
this
.
pool
)
{
let
code
=
this
.
pool
[
hash
];
scripts
+=
`
exports['
${
hash
}
'] = function(args, props, target, global, vm){
return new Promise(function(resolve, reject){
${
code
}
function next(type, payload){resolve({type: type, payload: payload})}
});
};
`
;
}
return
`
(function(){
...
...
@@ -287,7 +277,9 @@ async function packData(data, {debug, getProcesses, getScripts, getCustoms}) {
}
console
.
log
(
TAG
,
'processManager.generateCurrent()'
);
await
processManager
.
generateCurrent
();
//自定义过程先编译
processManager
.
generateCurrent
();
await
processManager
.
compile
();
//自定义过程先编译
for
(
let
process
of
builtinProcesses
)
{
processManager
.
deal
(
process
);
...
...
dist/index.js.map
View file @
86d6f6e6
This diff is collapsed.
Click to expand it.
dist/index.umd.js
View file @
86d6f6e6
...
...
@@ -71,7 +71,7 @@
}
put
(
process
)
{
const
{
id
,
script
}
=
process
;
const
{
id
,
name
,
script
}
=
process
;
if
(
script
)
{
let
hash
=
md5
(
script
);
if
(
!
this
.
pool
.
hasOwnProperty
(
hash
))
{
...
...
@@ -80,20 +80,21 @@
ids
:
[],
};
}
this
.
pool
[
hash
].
ids
.
push
(
id
);
this
.
pool
[
hash
].
ids
.
push
(
name
||
id
);
return
hash
;
}
}
async
generateCurrent
()
{
generateCurrent
()
{
let
scripts
=
''
;
for
(
let
hash
in
this
.
pool
)
{
let
{
script
,
ids
}
=
this
.
pool
[
hash
];
let
idsComment
=
ids
.
map
(
id
=>
{
return
`/*==
${
id
}
==*/`
}).
join
(
'
\
n'
);
scripts
+=
`
${
ids
.
map
(
id
=>
{
return
`/*==
${
id
}
*==/\n`
})}
exports['
${
hash
}
'] = function(args, props, target, global, vm){
return new Promise(function(resolve, reject){
${
idsComment
}
${
script
}
function next(type, payload){resolve({type: type, payload: payload})}
...
...
@@ -101,12 +102,13 @@ ${script}
};
`
;
}
this
.
scripts
+=
scripts
;
this
.
pool
=
{};
}
//console.log('scripts', scripts);
async
compile
(){
try
{
const
{
code
,
sourcemap
}
=
await
compile
(
scripts
,
true
);
const
{
code
,
sourcemap
}
=
await
compile
(
this
.
scripts
,
true
);
this
.
scripts
=
code
;
}
catch
(
e
)
{
console
.
log
(
'编译失败'
,
e
);
...
...
@@ -114,20 +116,8 @@ ${script}
}
generate
()
{
this
.
generateCurrent
();
let
scripts
=
this
.
scripts
;
for
(
let
hash
in
this
.
pool
)
{
let
code
=
this
.
pool
[
hash
];
scripts
+=
`
exports['
${
hash
}
'] = function(args, props, target, global, vm){
return new Promise(function(resolve, reject){
${
code
}
function next(type, payload){resolve({type: type, payload: payload})}
});
};
`
;
}
return
`
(function(){
...
...
@@ -287,7 +277,9 @@ ${scripts}
}
console
.
log
(
TAG
,
'processManager.generateCurrent()'
);
await
processManager
.
generateCurrent
();
//自定义过程先编译
processManager
.
generateCurrent
();
await
processManager
.
compile
();
//自定义过程先编译
for
(
let
process
of
builtinProcesses
)
{
processManager
.
deal
(
process
);
...
...
dist/index.umd.js.map
View file @
86d6f6e6
This diff is collapsed.
Click to expand it.
src/ProcessManager.js
View file @
86d6f6e6
...
...
@@ -32,7 +32,7 @@ export default class ProcessManager {
}
put
(
process
)
{
const
{
id
,
script
}
=
process
;
const
{
id
,
name
,
script
}
=
process
;
if
(
script
)
{
let
hash
=
md5
(
script
);
if
(
!
this
.
pool
.
hasOwnProperty
(
hash
))
{
...
...
@@ -41,20 +41,21 @@ export default class ProcessManager {
ids
:
[],
};
}
this
.
pool
[
hash
].
ids
.
push
(
id
);
this
.
pool
[
hash
].
ids
.
push
(
name
||
id
);
return
hash
;
}
}
async
generateCurrent
()
{
generateCurrent
()
{
let
scripts
=
''
;
for
(
let
hash
in
this
.
pool
)
{
let
{
script
,
ids
}
=
this
.
pool
[
hash
];
let
idsComment
=
ids
.
map
(
id
=>
{
return
`/*==
${
id
}
==*/`
}).
join
(
'
\
n'
);
scripts
+=
`
${
ids
.
map
(
id
=>
{
return
`/*==
${
id
}
*==/\n`
})}
exports['
${
hash
}
'] = function(args, props, target, global, vm){
return new Promise(function(resolve, reject){
${
idsComment
}
${
script
}
function next(type, payload){resolve({type: type, payload: payload})}
...
...
@@ -62,12 +63,13 @@ ${script}
};
`
;
}
this
.
scripts
+=
scripts
;
this
.
pool
=
{};
}
//console.log('scripts', scripts);
async
compile
(){
try
{
const
{
code
,
sourcemap
}
=
await
compile
(
scripts
,
true
);
const
{
code
,
sourcemap
}
=
await
compile
(
this
.
scripts
,
true
);
this
.
scripts
=
code
;
}
catch
(
e
)
{
console
.
log
(
'编译失败'
,
e
);
...
...
@@ -75,20 +77,8 @@ ${script}
}
generate
()
{
this
.
generateCurrent
();
let
scripts
=
this
.
scripts
;
for
(
let
hash
in
this
.
pool
)
{
let
code
=
this
.
pool
[
hash
];
scripts
+=
`
exports['
${
hash
}
'] = function(args, props, target, global, vm){
return new Promise(function(resolve, reject){
${
code
}
function next(type, payload){resolve({type: type, payload: payload})}
});
};
`
;
}
return
`
(function(){
...
...
src/index.js
View file @
86d6f6e6
...
...
@@ -72,7 +72,9 @@ async function packData(data, {debug, getProcesses, getScripts, getCustoms}) {
}
console
.
log
(
TAG
,
'processManager.generateCurrent()'
);
await
processManager
.
generateCurrent
();
//自定义过程先编译
processManager
.
generateCurrent
();
await
processManager
.
compile
();
//自定义过程先编译
for
(
let
process
of
builtinProcesses
)
{
processManager
.
deal
(
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