@focusbe/cli
Advanced tools
| <!DOCTYPE html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
| <title>Focusbe</title> | ||
| <link rel="stylesheet" href="css/main.css" /> | ||
| </head> | ||
| <body> | ||
| <script src="js/bundle.js"></script> | ||
| </body> | ||
| </html> |
| { | ||
| "name": "focusbe-app", | ||
| "dependencies": { | ||
| "@babel/preset-env": "^7.22.9", | ||
| "@focusbe/cli": "^1" | ||
| }, | ||
| "scripts": { | ||
| "dev":"focusbe dev" | ||
| } | ||
| } |
+22
-15
| #!/usr/bin/env node | ||
| const commander = require("commander"); | ||
| const DevTools = require("@ztgame/devtools"); | ||
| var devTools = new DevTools(); | ||
| const Build = require("./build"); | ||
| // | ||
| const commander = require('commander'); | ||
| const fs = require('fs-extra'); | ||
| const Build = require('./build'); | ||
| var projectRoot = process.cwd(); | ||
| var build = new Build(projectRoot); | ||
| commander | ||
| .version("1.0.0", "-v, --version") | ||
| .command("init") | ||
| .action(() => { | ||
| devTools.init(); | ||
| }); | ||
| commander.command("dev").action(() => { | ||
| build.start(); | ||
| .version('1.0.0', '-v, --version') | ||
| .command('init') | ||
| .action(() => { | ||
| //初始化项目 | ||
| // 将模板文件拷贝到项目中 | ||
| // 监测是否有package.json文件 | ||
| if (fs.existsSync(projectRoot + '/package.json')||fs.existsSync(projectRoot + '/index.html')) { | ||
| console.warn('请在空项目中初始化'); | ||
| return; | ||
| } | ||
| fs.copySync(__dirname + '/template', projectRoot); | ||
| // 将依赖安装到项目中 | ||
| console.log('初始化完成'); | ||
| console.log('请执行 npm install 安装依赖'); | ||
| console.log('npm run dev 启动项目'); | ||
| }); | ||
| commander.command('dev').action(() => { | ||
| build.start(); | ||
| }); | ||
| commander.command("pubdev").action(() => { | ||
| devTools.pubdev(); | ||
| }); | ||
| commander.parse(process.argv); |
+28
-29
| { | ||
| "name": "@focusbe/cli", | ||
| "version": "1.0.18", | ||
| "version": "2.0.0", | ||
| "description": "用于开发的命令行工具", | ||
| "main": "index.js", | ||
| "scripts": { | ||
| "test": "echo \"Error: no test specified\" && exit 1" | ||
| "test": "echo \"Error: no test specified\" && exit 1" | ||
| }, | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "git+https://github.com/focusbe/focusbe-cli.git" | ||
| "type": "git", | ||
| "url": "git+https://github.com/focusbe/focusbe-cli.git" | ||
| }, | ||
| "keywords": [ | ||
| "focusbe", | ||
| "cli" | ||
| "focusbe", | ||
| "cli" | ||
| ], | ||
@@ -20,30 +20,29 @@ "author": "pegzai", | ||
| "bin": { | ||
| "ztgame": "index.js", | ||
| "focusbe": "index.js", | ||
| "fb": "index.js", | ||
| "focus": "index.js" | ||
| "ztgame": "index.js", | ||
| "focusbe": "index.js", | ||
| "fb": "index.js", | ||
| "focus": "index.js" | ||
| }, | ||
| "bugs": { | ||
| "url": "https://github.com/focusbe/focusbe-cli/issues" | ||
| "url": "https://github.com/focusbe/focusbe-cli/issues" | ||
| }, | ||
| "homepage": "https://github.com/focusbe/focusbe-cli#readme", | ||
| "dependencies": { | ||
| "@babel/core": "^7.12.3", | ||
| "@babel/preset-env": "^7.12.1", | ||
| "@rollup/plugin-babel": "^5.2.1", | ||
| "@rollup/plugin-commonjs": "^16.0.0", | ||
| "@rollup/plugin-node-resolve": "^10.0.0", | ||
| "@ztgame/devtools": "^0.0.8", | ||
| "autoprefixer": "^10.0.1", | ||
| "browser-sync": "^2.26.13", | ||
| "chokidar": "^3.4.3", | ||
| "commander": "^6.1.0", | ||
| "core-js": "^3.7.0", | ||
| "fs-extra": "^9.0.1", | ||
| "glob": "^7.1.6", | ||
| "poststylus": "^1.0.1", | ||
| "rollup": "^2.33.1", | ||
| "stylus": "^0.54.8" | ||
| "@babel/core": "^7.12.3", | ||
| "@babel/preset-env": "^7.12.1", | ||
| "@rollup/plugin-babel": "^5.2.1", | ||
| "@rollup/plugin-commonjs": "^16.0.0", | ||
| "@rollup/plugin-node-resolve": "^10.0.0", | ||
| "@ztgame/devtools": "^0.0.8", | ||
| "autoprefixer": "^10.0.1", | ||
| "browser-sync": "^2.26.13", | ||
| "chokidar": "^3.4.3", | ||
| "commander": "^6.1.0", | ||
| "core-js": "^3.7.0", | ||
| "fs-extra": "^9.1.0", | ||
| "glob": "^7.1.6", | ||
| "poststylus": "^1.0.1", | ||
| "rollup": "^2.33.1", | ||
| "stylus": "^0.54.8" | ||
| } | ||
| } | ||
| } |
+34
-8
| # Focusbe Cli | ||
| Focusbe Cli is a minimalist front-end development tool that provides local server, stylus packaging, JS packaging, and other functions. It is suitable for simple projects developed using native JS. If you need to write some simple demos that only require advanced JS syntax conversion and stylus compilation, then this tool is your best choice. | ||
| # Features | ||
| * Local server | ||
| * Stylus packaging | ||
| * JS packaging | ||
| # Installation | ||
| ```bash | ||
| npm install @focusbe/cli -g | ||
| ``` | ||
| # Usage | ||
| ## Initialize project | ||
| Please execute in an empty folder. | ||
| ```bash | ||
| focusbe init | ||
| ``` | ||
| ## Local development | ||
| ```bash | ||
| npm run dev | ||
| ``` | ||
| github: https://github.com/focusbe/cli | ||
| npm: https://www.npmjs.com/package/@focusbe/cli | ||
| --- | ||
| Focusbe Cli ———— 是极简的前端开发工具, | ||
| 提供了本地服务器,stylus打包,js打包等功能。 | ||
| 适合采用原生js开发的简单项目。 | ||
| 如果你需要写一些简单的demo,只需要JS高级语法转化,和stylus的编译,那么这个工具是你的不二选择。 | ||
| ## 安装 | ||
@@ -20,3 +50,3 @@ | ||
| ### 初始化项目 | ||
| 请在空文件夹下执行 | ||
| ```bash | ||
@@ -26,13 +56,9 @@ focusbe init | ||
| ### 发布到测试服 | ||
| ```bash | ||
| focusbe pubdev | ||
| ``` | ||
| ### 本地开发 | ||
| ```bash | ||
| focusbe dev | ||
| npm run dev | ||
| ``` | ||
| github: https://github.com/focusbe/cli | ||
| npm: https://www.npmjs.com/package/@focusbe/cli |
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
62833
3.37%13
44.44%235
2.62%63
70.27%3
50%Updated