doric cli

This commit is contained in:
pengfei.zhou 2019-08-03 02:03:56 +08:00
parent 740848e604
commit 99b900f2b6
8 changed files with 2253 additions and 5 deletions

2
doric-cli/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
node_modules/
build/

20
doric-cli/index.js Executable file
View File

@ -0,0 +1,20 @@
#!/usr/bin/env node
var program = require('commander');
var program = require('commander');
program
.command('create <name>')
.option('-n, --native', 'Native')
.action(function (name, cmd) {
console.log('create ' + name + (cmd.native ? ' native' : 'js'))
})
program
.command('dev')
.action(function () {
require('./scripts/watcher')
})
program.parse(process.argv)
console.log(process.cwd())

272
doric-cli/package-lock.json generated Normal file
View File

@ -0,0 +1,272 @@
{
"name": "doric-cli",
"version": "1.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"@types/estree": {
"version": "0.0.39",
"resolved": "https://registry.npm.taobao.org/@types/estree/download/@types/estree-0.0.39.tgz",
"integrity": "sha1-4Xfmme4bjCLSMXTKqnQiZEOJUJ8="
},
"@types/node": {
"version": "12.6.9",
"resolved": "https://registry.npm.taobao.org/@types/node/download/@types/node-12.6.9.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Fnode%2Fdownload%2F%40types%2Fnode-12.6.9.tgz",
"integrity": "sha1-/+7iOv3BmrFul5M457U2/eu7rq8="
},
"acorn": {
"version": "6.2.1",
"resolved": "https://registry.npm.taobao.org/acorn/download/acorn-6.2.1.tgz",
"integrity": "sha1-PthCLW3sCeYSHMeoQ8qGozCoa1E="
},
"anymatch": {
"version": "3.0.3",
"resolved": "https://registry.npm.taobao.org/anymatch/download/anymatch-3.0.3.tgz",
"integrity": "sha1-L7Yk/g6EvMqwCv7j0ABu0xDyLwk=",
"requires": {
"normalize-path": "^3.0.0",
"picomatch": "^2.0.4"
}
},
"balanced-match": {
"version": "1.0.0",
"resolved": "http://registry.npm.taobao.org/balanced-match/download/balanced-match-1.0.0.tgz",
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c="
},
"binary-extensions": {
"version": "2.0.0",
"resolved": "https://registry.npm.taobao.org/binary-extensions/download/binary-extensions-2.0.0.tgz",
"integrity": "sha1-I8DfFPaogHf1+YbA0WfsA8PVU3w="
},
"brace-expansion": {
"version": "1.1.11",
"resolved": "http://registry.npm.taobao.org/brace-expansion/download/brace-expansion-1.1.11.tgz",
"integrity": "sha1-PH/L9SnYcibz0vUrlm/1Jx60Qd0=",
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
}
},
"braces": {
"version": "3.0.2",
"resolved": "https://registry.npm.taobao.org/braces/download/braces-3.0.2.tgz",
"integrity": "sha1-NFThpGLujVmeI23zNs2epPiv4Qc=",
"requires": {
"fill-range": "^7.0.1"
}
},
"child_process": {
"version": "1.0.2",
"resolved": "https://registry.npm.taobao.org/child_process/download/child_process-1.0.2.tgz",
"integrity": "sha1-sffn/HPSXn/R1FWtyU4UODAYK1o="
},
"chokidar": {
"version": "3.0.2",
"resolved": "https://registry.npm.taobao.org/chokidar/download/chokidar-3.0.2.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fchokidar%2Fdownload%2Fchokidar-3.0.2.tgz",
"integrity": "sha1-DRzW0E6y3wMnRGGIzRNzajNn1oE=",
"requires": {
"anymatch": "^3.0.1",
"braces": "^3.0.2",
"fsevents": "^2.0.6",
"glob-parent": "^5.0.0",
"is-binary-path": "^2.1.0",
"is-glob": "^4.0.1",
"normalize-path": "^3.0.0",
"readdirp": "^3.1.1"
}
},
"commander": {
"version": "2.20.0",
"resolved": "https://registry.npm.taobao.org/commander/download/commander-2.20.0.tgz?cache=0&sync_timestamp=1564195111889&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcommander%2Fdownload%2Fcommander-2.20.0.tgz",
"integrity": "sha1-1YuytcHuj4ew00ACfp6U4iLFpCI="
},
"concat-map": {
"version": "0.0.1",
"resolved": "http://registry.npm.taobao.org/concat-map/download/concat-map-0.0.1.tgz",
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
},
"fill-range": {
"version": "7.0.1",
"resolved": "https://registry.npm.taobao.org/fill-range/download/fill-range-7.0.1.tgz",
"integrity": "sha1-GRmmp8df44ssfHflGYU12prN2kA=",
"requires": {
"to-regex-range": "^5.0.1"
}
},
"fs.realpath": {
"version": "1.0.0",
"resolved": "http://registry.npm.taobao.org/fs.realpath/download/fs.realpath-1.0.0.tgz",
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8="
},
"fsevents": {
"version": "2.0.7",
"resolved": "https://registry.npm.taobao.org/fsevents/download/fsevents-2.0.7.tgz",
"integrity": "sha1-OCybRDxsusTFcYfN2iOqO/HM/Co=",
"optional": true
},
"glob": {
"version": "7.1.4",
"resolved": "https://registry.npm.taobao.org/glob/download/glob-7.1.4.tgz",
"integrity": "sha1-qmCKL2xXetNX4a5aXCbZqNGWklU=",
"requires": {
"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"
}
},
"glob-parent": {
"version": "5.0.0",
"resolved": "https://registry.npm.taobao.org/glob-parent/download/glob-parent-5.0.0.tgz",
"integrity": "sha1-HcmfDzmwBtPpLCwoQGg4Lwwg6VQ=",
"requires": {
"is-glob": "^4.0.1"
}
},
"inflight": {
"version": "1.0.6",
"resolved": "http://registry.npm.taobao.org/inflight/download/inflight-1.0.6.tgz",
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
"requires": {
"once": "^1.3.0",
"wrappy": "1"
}
},
"inherits": {
"version": "2.0.4",
"resolved": "https://registry.npm.taobao.org/inherits/download/inherits-2.0.4.tgz?cache=0&sync_timestamp=1560975547815&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Finherits%2Fdownload%2Finherits-2.0.4.tgz",
"integrity": "sha1-D6LGT5MpF8NDOg3tVTY6rjdBa3w="
},
"interpret": {
"version": "1.2.0",
"resolved": "https://registry.npm.taobao.org/interpret/download/interpret-1.2.0.tgz",
"integrity": "sha1-1QYaYiS+WOgIOYX1AU2EQ1lXYpY="
},
"is-binary-path": {
"version": "2.1.0",
"resolved": "https://registry.npm.taobao.org/is-binary-path/download/is-binary-path-2.1.0.tgz",
"integrity": "sha1-6h9/O4DwZCNug0cPhsCcJU+0Wwk=",
"requires": {
"binary-extensions": "^2.0.0"
}
},
"is-extglob": {
"version": "2.1.1",
"resolved": "http://registry.npm.taobao.org/is-extglob/download/is-extglob-2.1.1.tgz",
"integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI="
},
"is-glob": {
"version": "4.0.1",
"resolved": "https://registry.npm.taobao.org/is-glob/download/is-glob-4.0.1.tgz",
"integrity": "sha1-dWfb6fL14kZ7x3q4PEopSCQHpdw=",
"requires": {
"is-extglob": "^2.1.1"
}
},
"is-number": {
"version": "7.0.0",
"resolved": "http://registry.npm.taobao.org/is-number/download/is-number-7.0.0.tgz",
"integrity": "sha1-dTU0W4lnNNX4DE0GxQlVUnoU8Ss="
},
"minimatch": {
"version": "3.0.4",
"resolved": "http://registry.npm.taobao.org/minimatch/download/minimatch-3.0.4.tgz",
"integrity": "sha1-UWbihkV/AzBgZL5Ul+jbsMPTIIM=",
"requires": {
"brace-expansion": "^1.1.7"
}
},
"normalize-path": {
"version": "3.0.0",
"resolved": "http://registry.npm.taobao.org/normalize-path/download/normalize-path-3.0.0.tgz",
"integrity": "sha1-Dc1p/yOhybEf0JeDFmRKA4ghamU="
},
"once": {
"version": "1.4.0",
"resolved": "http://registry.npm.taobao.org/once/download/once-1.4.0.tgz",
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
"requires": {
"wrappy": "1"
}
},
"path-is-absolute": {
"version": "1.0.1",
"resolved": "http://registry.npm.taobao.org/path-is-absolute/download/path-is-absolute-1.0.1.tgz",
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18="
},
"path-parse": {
"version": "1.0.6",
"resolved": "http://registry.npm.taobao.org/path-parse/download/path-parse-1.0.6.tgz",
"integrity": "sha1-1i27VnlAXXLEc37FhgDp3c8G0kw="
},
"picomatch": {
"version": "2.0.7",
"resolved": "https://registry.npm.taobao.org/picomatch/download/picomatch-2.0.7.tgz",
"integrity": "sha1-UUFp2MfNC9vuzIomCeNKcWPeafY="
},
"readdirp": {
"version": "3.1.1",
"resolved": "https://registry.npm.taobao.org/readdirp/download/readdirp-3.1.1.tgz",
"integrity": "sha1-sVgSOsNDyLDzHWVoAmnMD8ECXbE=",
"requires": {
"picomatch": "^2.0.4"
}
},
"rechoir": {
"version": "0.6.2",
"resolved": "https://registry.npm.taobao.org/rechoir/download/rechoir-0.6.2.tgz",
"integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=",
"requires": {
"resolve": "^1.1.6"
}
},
"resolve": {
"version": "1.12.0",
"resolved": "https://registry.npm.taobao.org/resolve/download/resolve-1.12.0.tgz?cache=0&sync_timestamp=1564641434608&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fresolve%2Fdownload%2Fresolve-1.12.0.tgz",
"integrity": "sha1-P8ZEo1yEpIVUYJ/ybsUrZvpXffY=",
"requires": {
"path-parse": "^1.0.6"
}
},
"rollup": {
"version": "1.18.0",
"resolved": "https://registry.npm.taobao.org/rollup/download/rollup-1.18.0.tgz?cache=0&sync_timestamp=1564658049147&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Frollup%2Fdownload%2Frollup-1.18.0.tgz",
"integrity": "sha1-mOo2RyUj7XEuIMDplv0FGIL3h+Y=",
"requires": {
"@types/estree": "0.0.39",
"@types/node": "^12.6.3",
"acorn": "^6.2.0"
}
},
"shelljs": {
"version": "0.8.3",
"resolved": "https://registry.npm.taobao.org/shelljs/download/shelljs-0.8.3.tgz",
"integrity": "sha1-p/MxlSDr8J7oEnWyNorbKGZZsJc=",
"requires": {
"glob": "^7.0.0",
"interpret": "^1.0.0",
"rechoir": "^0.6.2"
}
},
"to-regex-range": {
"version": "5.0.1",
"resolved": "https://registry.npm.taobao.org/to-regex-range/download/to-regex-range-5.0.1.tgz",
"integrity": "sha1-FkjESq58jZiKMmAY7XL1tN0DkuQ=",
"requires": {
"is-number": "^7.0.0"
}
},
"typescript": {
"version": "3.5.3",
"resolved": "https://registry.npm.taobao.org/typescript/download/typescript-3.5.3.tgz",
"integrity": "sha1-yDD2V/k/HqhGgZ6SkJL1/lmD6Xc="
},
"wrappy": {
"version": "1.0.2",
"resolved": "http://registry.npm.taobao.org/wrappy/download/wrappy-1.0.2.tgz",
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
}
}
}

30
doric-cli/package.json Normal file
View File

@ -0,0 +1,30 @@
{
"name": "doric-cli",
"version": "1.0.0",
"description": "Doric tools",
"main": "index.js",
"bin": {
"doric": "index.js"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+ssh://git@github.com/penfeizhou/doric.git"
},
"author": "pengfei.zhou",
"license": "ISC",
"bugs": {
"url": "https://github.com/penfeizhou/doric/issues"
},
"homepage": "https://github.com/penfeizhou/doric#readme",
"dependencies": {
"child_process": "^1.0.2",
"chokidar": "^3.0.2",
"commander": "^2.20.0",
"rollup": "^1.18.0",
"shelljs": "^0.8.3",
"typescript": "^3.5.3"
}
}

View File

@ -0,0 +1,10 @@
var chokidar = require('chokidar')
require('shelljs/global')
exec('npm run dev', () => {
})
chokidar.watch(process.cwd() + "/build", {
ignored: /(^|[\/\\])\../,
}).on('all', (event, path) => {
console.log(event, path)
});

View File

@ -1,5 +1,4 @@
import { HLayout, StackConfig, ViewHolder, VMPanel, View, ViewModel, WRAP_CONTENT, Gravity, Mutable, NativeCall, Text, Color, VLayout, Panel, log, logw, loge, Group, Stack, } from "./index" import { HLayout, StackConfig, ViewHolder, VMPanel, View, ViewModel, WRAP_CONTENT, Gravity, Mutable, NativeCall, Text, Color, VLayout, Panel, log, logw, loge, Group, Stack, } from "./index"
import { RIGHT } from "./src/util/gravity";
interface CountModel { interface CountModel {

File diff suppressed because it is too large Load Diff

View File

@ -5,8 +5,8 @@
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"test": "echo \"Error: no test specified\" && exit 1", "test": "echo \"Error: no test specified\" && exit 1",
"dev": "tsc -p .&& rollup -c && node ./bundle/bundle.js", "build": "tsc -p .&& rollup -c",
"build": "tsc -p . && rollup -c ", "dev": "tsc -w -p . & rollup -c -w",
"clean": "rm -rf build && rm -rf demo && rm -rf bundle" "clean": "rm -rf build && rm -rf demo && rm -rf bundle"
}, },
"repository": { "repository": {
@ -24,6 +24,8 @@
"rollup": "^1.17.0", "rollup": "^1.17.0",
"rollup-plugin-commonjs": "^10.0.1", "rollup-plugin-commonjs": "^10.0.1",
"rollup-plugin-node-resolve": "^5.2.0", "rollup-plugin-node-resolve": "^5.2.0",
"tslib": "^1.10.0" "rollup-watch": "^4.3.1",
"tslib": "^1.10.0",
"typescript": "^3.5.3"
} }
} }