Commit acfe82e4 authored by rockyl's avatar rockyl

init

parent aa1c079e
......@@ -11,10 +11,11 @@ const program = require('commander');
const {generateDeclareMap} = require('../src/index');
program
.version('1.0.1')
.version('1.0.2')
.description('scilla declare generator')
.option('-i, --input [string]', 'input file')
.option('-o, --output [string]', 'output file')
.option('-p, --pathofcomponents [string]', 'path of components')
.option('-v, --verbose [boolean]', 'verbose mode', false)
.parse(process.argv);
......@@ -22,9 +23,9 @@ if(!program.input || program.output){
process.exit(1);
}
const systemComponentsPath = path.join(os.homedir(), '.scilla', 'components');
const systemComponentsSrcPath = path.join(systemComponentsPath, 'src');
const tsconfig = fs.readJsonSync(path.join(systemComponentsPath, 'tsconfig.json'));
const componentsPath = program.pathofcomponents || path.join(os.homedir(), '.scilla', 'components');
const componentsSrcPath = path.join(componentsPath, 'src');
const tsconfig = fs.readJsonSync(path.join(componentsPath, 'tsconfig.json'));
const inputFile = program.input;
const inputFileFolder = path.dirname(inputFile);
......@@ -38,7 +39,7 @@ function declareFilter(source) {
const result = generateDeclareMap(
tsconfig,
program.input,
systemComponentsSrcPath,
componentsSrcPath,
projectPath,
null,
declareFilter
......
{
"properties": {
"PuzzleItemPrefab": {
"type": "resource"
},
"disrupt": {
"type": "(Anonymous function)"
},
"onCoverOther": {
"type": "(Anonymous function)"
},
"cancelCoverOther": {
"type": "(Anonymous function)"
},
"onItemMove": {
"type": "(Anonymous function)"
},
"missionComplete": {
"type": "(Anonymous function)"
},
"onAlertClose": {
"type": "(Anonymous function)"
}
},
"methods": {
"getPuzzleItem": {
"item": {
"type": "any"
}
},
"start": {
"img": {
"type": "any"
},
"segmentation": {
"type": "any"
},
"_items": {
"type": "Array"
},
"frames": {
"type": "frames"
},
"perSize": {
"type": "number"
},
"offset": {
"type": "number"
},
"sheet": {
"type": "\"node_modules/scilla/src/core/Sheet\".Sheet",
"defaultValue": [
"img",
"frames"
]
}
},
"judgement": {
"complete": {
"type": "boolean",
"defaultValue": true
}
}
},
"bases": [
"\"node_modules/scilla-components/src/base/ScillaComponent\".ScillaComponent",
"\"node_modules/scilla/src/core/Component\".Component",
"\"node_modules/scilla/src/core/HashObject\".HashObject"
]
}
\ No newline at end of file
{
"name": "scilla-declare-generator",
"version": "1.0.1",
"version": "1.0.2",
"main": "src/index.js",
"bin": "bin/cli.js",
"license": "MIT",
......
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