Commit ef570dc1 authored by rockyl's avatar rockyl

init

parents
Pipeline #176192 failed with stages
in 0 seconds
# Created by .ignore support plugin (hsz.mobi)
### Node template
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
*.lcov
# nyc test coverage
.nyc_output
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# TypeScript v1 declaration files
typings/
# TypeScript cache
*.tsbuildinfo
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
.env.test
# parcel-bundler cache (https://parceljs.org/)
.cache
# next.js build output
.next
# nuxt.js build output
.nuxt
# vuepress build output
.vuepress/dist
# Serverless directories
.serverless/
# FuseBox cache
.fusebox/
# DynamoDB Local files
.dynamodb/
{
"name": "关闭弹窗",
"desc": "关闭弹窗",
"props": {
"closeAll": {
"alias": "是否关闭全部弹窗",
"type": "boolean",
"default": false
}
},
"output": [
"complete"
],
"id": "close-dialog",
"script": "if (props.closeAll) {\n engine.gameStage.popupContainer.pop();\n}\nelse {\n engine.gameStage.popupContainer.popAll();\n}\n",
"group": "base",
"type": "builtin"
}
{
"name": "比较",
"props": {
"left": {
"alias": "左值",
"type": "any",
"default": ""
},
"right": {
"alias": "右值",
"type": "any",
"default": ""
},
"strict": {
"alias": "严格模式",
"type": "any",
"default": ""
},
"operator": {
"alias": "操作符",
"type": "enum",
"enum": [
"==",
">",
">=",
"<",
"<=",
"!="
],
"default": "=="
}
},
"output": [
"equal",
"unequal"
],
"id": "compare",
"script": "setTimeout(function () {\n next('complete');\n}, args ? args.duration : (props.duration || 0));\n",
"group": "base",
"type": "builtin"
}
{
"name": "入口",
"props": {},
"output": [
"success"
],
"id": "entry",
"script": "next('success');\n",
"group": "base",
"type": "builtin"
}
{
"name": "日志",
"props": {
"content": {
"alias": "内容",
"type": "string",
"default": ""
}
},
"output": [
"success"
],
"id": "log",
"script": "var leftValue = typeof props.left === 'object' ? args[props.left.path] : props.left;\nvar rightValue = typeof props.right === 'object' ? args[props.right.path] : props.right;\nvar func = new Function('return ' + leftValue + args.operator + rightValue);\nvar result = func();\nnext(result ? 'equal' : 'unequal');\n",
"group": "base",
"type": "builtin"
}
{
"name": "弹出弹窗",
"desc": "根据视图名弹出弹窗",
"props": {
"target": {
"alias": "目标视图名",
"type": "string"
},
"center": {
"alias": "是否居中展示",
"type": "boolean",
"default": true
}
},
"output": [
"complete"
],
"id": "show-dialog",
"script": "if (!props.viewName) {\n console.log('没有设置视图名');\n next('exception', '没有设置视图名');\n}\nelse {\n var gameStage = engine.gameStage;\n var viewConfig = gameStage.getViewConfigByName(props.viewName);\n if (viewConfig) {\n var view = engine.instantiate(viewConfig);\n gameStage.popupContainer.push(view, { center: props.center || true });\n }\n else {\n console.error('view config not exists');\n }\n}\n",
"group": "base",
"type": "builtin"
}
{
"name": "等待",
"props": {
"duration": {
"alias": "时间(毫秒)",
"type": "number",
"default": 1000
}
},
"output": [
"complete"
],
"id": "wait",
"script": "setTimeout(function () {\n next('complete');\n}, args ? args.duration : (props.duration || 0));\n",
"group": "base",
"type": "builtin"
}
{
"name": "兑吧接口转换",
"desc": "将http请求返回成兑吧接口的解析",
"props": {},
"output": [
"success",
"failed"
],
"id": "duiba-api-transform",
"script": "if (args.success) {\n next('success', args.data);\n}\nelse {\n next('failed');\n}\n",
"group": "duiba",
"type": "builtin"
}
{
"name": "跳转到中奖记录",
"props": {},
"output": [
"success"
],
"id": "goto-record",
"script": "location.href = '/record';\nnext('success');\n",
"group": "duiba",
"type": "builtin"
}
{
"name": "HttpRequest",
"props": {
"url": {
"type": "string",
"alias": "地址"
},
"method": {
"type": "enum",
"enum": [
"get",
"post"
],
"alias": "方法",
"default": "get"
}
},
"output": [
"success",
"failed",
"exception"
],
"desc": "http请求",
"id": "http-request",
"script": "if (!props.url) {\n console.log('url is empty');\n next('exception', '\\'url is empty\\'');\n}\nelse {\n engine.globalLoader.httpRequest(function (s, payload) {\n if (s) {\n next('success', payload);\n }\n else {\n next('failed', payload);\n }\n }, props.url, props.method || 'get', 'json');\n}\n",
"group": "net",
"type": "builtin"
}
This diff is collapsed.
{
"name": "process-lib",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"scripts": {
"build": "node scripts/compiler"
},
"devDependencies": {
"fs-extra": "^8.1.0",
"typescript": "^3.7.2"
},
"dependencies": {
"glob": "^7.1.6"
}
}
/**
* Created by rockyl on 2019-11-17.
*/
const {prepare, compile} = require('./tscompiler');
const fs = require('fs-extra');
const path = require('path');
const glob = require('glob');
const tsconfig = fs.readJsonSync('tsconfig.json');
prepare(tsconfig, process.cwd());
function compileProcess(sourcePath, output, isBuiltin) {
const arr = sourcePath.split('/');
const group = arr[0];
const id = arr[1];
const meta = fs.readJsonSync(path.join('src/' + sourcePath, 'meta.json'));
const {code} = compile('src/' + sourcePath);
meta.id = id;
meta.script = code;
meta.group = group;
if(isBuiltin){
meta.type = 'builtin'
}
const outputPath = path.join(output, sourcePath + '.json');
fs.ensureDir(path.dirname(outputPath));
fs.writeJsonSync(outputPath, meta, {spaces: ' '});
}
const [_, __, sourcePath, outputPath = 'dist', builtin] = process.argv;
const isBuiltin = builtin ? builtin === 'builtin' : true;
if (sourcePath) {
compileProcess(sourcePath, outputPath, isBuiltin);
} else {
const files = glob.sync('*/*', {cwd: process.cwd() + '/src'});
for (let file of files) {
compileProcess(file, outputPath, isBuiltin);
}
}
console.log('complete!');
/**
* Created by rockyl on 2019-03-28.
*/
const ts = require("typescript");
const fs = require('fs-extra');
const path = require('path');
let _options, _projectPath;
exports.prepare = function (tsconfig, projectPath) {
const config = ts.parseJsonConfigFileContent(tsconfig, ts.sys, projectPath);
_options = config.options;
_projectPath = projectPath;
};
exports.compile = function (file) {
if (!_options) {
throw Error('no options input')
}
let filePath = path.resolve(_projectPath, file + (file.endsWith('.ts') ? '' : '.ts'));
if (!fs.existsSync(filePath)) {
filePath = path.resolve(_projectPath, file + '/index.ts');
if (!fs.existsSync(filePath)) {
throw new Error('source code file not exists');
}
}
let source = fs.readFileSync(filePath, 'utf-8');
let result = ts.transpileModule(source, {compilerOptions: _options});
return {
code: result.outputText,
filePath,
relativeFilePath: './' + path.relative(_projectPath, filePath),
};
};
/**
* Created by rockyl on 2019-11-16.
*/
if(props.closeAll){
engine.gameStage.popupContainer.pop();
}else{
engine.gameStage.popupContainer.popAll();
}
{
"name": "关闭弹窗",
"desc": "关闭弹窗",
"props": {
"closeAll": {
"alias": "是否关闭全部弹窗",
"type": "boolean",
"default": false
}
},
"output": [
"complete"
]
}
\ No newline at end of file
/**
* Created by rockyl on 2019-11-16.
*/
setTimeout(function(){
next('complete')
}, args ? args.duration : (props.duration || 0));
{
"name": "比较",
"props": {
"left": {"alias": "左值","type": "any", "default": ""},
"right": {"alias": "右值","type": "any", "default": ""},
"strict": {"alias": "严格模式","type": "any", "default": ""},
"operator": {"alias": "操作符","type": "enum",
"enum": ["==",">",">=","<","<=","!="],
"default": "=="}
},
"output": [
"equal", "unequal"
]
}
\ No newline at end of file
/**
* Created by rockyl on 2019-11-16.
*/
next('success');
{
"name": "入口",
"props": {},
"output": [
"success"
]
}
\ No newline at end of file
/**
* Created by rockyl on 2019-11-16.
*/
let leftValue = typeof props.left === 'object' ? args[props.left.path] : props.left;
let rightValue = typeof props.right === 'object' ? args[props.right.path] : props.right;
let func = new Function('return ' + leftValue + args.operator + rightValue);
let result = func();
next(result ? 'equal' : 'unequal');
{
"name": "日志",
"props": {
"content": {
"alias": "内容",
"type": "string",
"default": ""
}
},
"output": [
"success"
]
}
\ No newline at end of file
/**
* Created by rockyl on 2019-11-16.
*/
if (!props.viewName) {
console.log('没有设置视图名');
next('exception', '没有设置视图名');
}else{
let gameStage = engine.gameStage;
let viewConfig = gameStage.getViewConfigByName(props.viewName);
if (viewConfig) {
let view = engine.instantiate(viewConfig);
gameStage.popupContainer.push(view, {center: props.center || true});
} else {
console.error('view config not exists');
}
}
{
"name": "弹出弹窗",
"desc": "根据视图名弹出弹窗",
"props": {
"target": {
"alias": "目标视图名",
"type": "string"
},
"center": {
"alias": "是否居中展示",
"type": "boolean",
"default": true
}
},
"output": [
"complete"
]
}
\ No newline at end of file
/**
* Created by rockyl on 2019-11-16.
*/
if (!props.viewName) {
console.log('没有设置视图名');
next('exception', '没有设置视图名');
}else{
let gameStage = engine.gameStage;
let viewConfig = gameStage.getViewConfigByName(props.viewName);
if (viewConfig) {
let view = engine.instantiate(viewConfig);
gameStage.sceneContainer.push(view);
} else {
console.error('view config not exists');
}
}
{
"name": "展示场景",
"desc": "根据视图名展示场景",
"props": {
"target": {
"alias": "目标视图名",
"type": "string"
}
},
"output": [
"complete"
]
}
\ No newline at end of file
/**
* Created by rockyl on 2019-11-16.
*/
setTimeout(function(){
next('complete')
}, args ? args.duration : (props.duration || 0));
{
"name": "等待",
"props": {
"duration": {
"alias": "时间(毫秒)",
"type": "number",
"default": 1000
}
},
"output": [
"complete"
]
}
\ No newline at end of file
/**
* Created by rockyl on 2019-11-16.
*/
if(args.success){
next('success', args.data);
}else{
next('failed')
}
\ No newline at end of file
{
"name": "兑吧接口转换",
"desc": "将http请求返回成兑吧接口的解析",
"props": {},
"output": [
"success",
"failed"
]
}
\ No newline at end of file
/**
* Created by rockyl on 2019-11-16.
*/
location.href='/record';
next('success');
{
"name": "跳转到中奖记录",
"props": {
},
"output": [
"success"
]
}
\ No newline at end of file
/**
* Created by rockyl on 2019-11-16.
*/
if(!props.url){
console.log('url is empty');
next('exception', '\'url is empty\'');
}else{
engine.globalLoader.httpRequest((s, payload) => {
if(s){
next('success', payload);
}else{
next('failed', payload);
}
}, props.url, props.method || 'get', 'json');
}
{
"name": "HttpRequest",
"props": {
"url": {"type": "string", "alias": "地址"},
"method": {"type": "enum", "enum": ["get", "post"], "alias": "方法", "default": "get"}
},
"output": ["success", "failed", "exception"],
"desc": "http请求"
}
\ No newline at end of file
{
"compilerOptions": {
"target": "es5",
"noImplicitAny": false,
"removeComments": true,
"noEmitOnError": true,
"declarationDir": "types",
"declaration": true,
"experimentalDecorators": true,
"outDir": "dist",
"lib": [
"es5",
"dom",
"es2015.promise"
]
},
"include": [
"libs",
"src"
],
"exclude": [
"node_modules"
]
}
\ No newline at end of file
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
balanced-match@^1.0.0:
version "1.0.0"
resolved "https://registry.npm.taobao.org/balanced-match/download/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767"
integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c=
brace-expansion@^1.1.7:
version "1.1.11"
resolved "https://registry.npm.taobao.org/brace-expansion/download/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd"
integrity sha1-PH/L9SnYcibz0vUrlm/1Jx60Qd0=
dependencies:
balanced-match "^1.0.0"
concat-map "0.0.1"
concat-map@0.0.1:
version "0.0.1"
resolved "https://registry.npm.taobao.org/concat-map/download/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=
fs-extra@^8.1.0:
version "8.1.0"
resolved "https://registry.npm.taobao.org/fs-extra/download/fs-extra-8.1.0.tgz#49d43c45a88cd9677668cb7be1b46efdb8d2e1c0"
integrity sha1-SdQ8RaiM2Wd2aMt74bRu/bjS4cA=
dependencies:
graceful-fs "^4.2.0"
jsonfile "^4.0.0"
universalify "^0.1.0"
fs.realpath@^1.0.0:
version "1.0.0"
resolved "https://registry.npm.taobao.org/fs.realpath/download/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8=
glob@^7.1.6:
version "7.1.6"
resolved "https://registry.npm.taobao.org/glob/download/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6"
integrity sha1-FB8zuBp8JJLhJVlDB0gMRmeSeKY=
dependencies:
fs.realpath "^1.0.0"
inflight "^1.0.4"
inherits "2"
minimatch "^3.0.4"
once "^1.3.0"
path-is-absolute "^1.0.0"
graceful-fs@^4.1.6, graceful-fs@^4.2.0:
version "4.2.3"
resolved "https://registry.npm.taobao.org/graceful-fs/download/graceful-fs-4.2.3.tgz#4a12ff1b60376ef09862c2093edd908328be8423"
integrity sha1-ShL/G2A3bvCYYsIJPt2Qgyi+hCM=
inflight@^1.0.4:
version "1.0.6"
resolved "https://registry.npm.taobao.org/inflight/download/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=
dependencies:
once "^1.3.0"
wrappy "1"
inherits@2:
version "2.0.4"
resolved "https://registry.npm.taobao.org/inherits/download/inherits-2.0.4.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Finherits%2Fdownload%2Finherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c"
integrity sha1-D6LGT5MpF8NDOg3tVTY6rjdBa3w=
jsonfile@^4.0.0:
version "4.0.0"
resolved "https://registry.npm.taobao.org/jsonfile/download/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb"
integrity sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=
optionalDependencies:
graceful-fs "^4.1.6"
minimatch@^3.0.4:
version "3.0.4"
resolved "https://registry.npm.taobao.org/minimatch/download/minimatch-3.0.4.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fminimatch%2Fdownload%2Fminimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
integrity sha1-UWbihkV/AzBgZL5Ul+jbsMPTIIM=
dependencies:
brace-expansion "^1.1.7"
once@^1.3.0:
version "1.4.0"
resolved "https://registry.npm.taobao.org/once/download/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E=
dependencies:
wrappy "1"
path-is-absolute@^1.0.0:
version "1.0.1"
resolved "https://registry.npm.taobao.org/path-is-absolute/download/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18=
typescript@^3.7.2:
version "3.7.2"
resolved "https://registry.npm.taobao.org/typescript/download/typescript-3.7.2.tgz#27e489b95fa5909445e9fef5ee48d81697ad18fb"
integrity sha1-J+SJuV+lkJRF6f717kjYFpetGPs=
universalify@^0.1.0:
version "0.1.2"
resolved "https://registry.npm.taobao.org/universalify/download/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66"
integrity sha1-tkb2m+OULavOzJ1mOcgNwQXvqmY=
wrappy@1:
version "1.0.2"
resolved "https://registry.npm.taobao.org/wrappy/download/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment