@lzwme/sserver 0.0.1 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/sserver.js CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- require('./dist/cli');
3
+ require('../dist/cli');
package/dist/cli.js CHANGED
@@ -1,17 +1,14 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  const commander_1 = require("commander");
7
- const chalk_1 = __importDefault(require("chalk"));
8
- const static_server_1 = require("../src/static-server");
4
+ const console_log_colors_1 = require("console-log-colors");
5
+ const static_server_1 = require("./static-server");
9
6
  const pkg = require('../package.json');
10
7
  commander_1.program
11
8
  .aliases(['ss'])
12
9
  .version(pkg.version, '-v, --version')
13
- .description(chalk_1.default.yellow(pkg.description) + ` [version@${chalk_1.default.cyanBright(pkg.version)}]`)
14
- // .option('-c, --config-path [filepath]', `配置文件 ${chalk.yellow(config.configPath)} 的路径`)
10
+ .description(console_log_colors_1.color.yellow(pkg.description) + ` [version@${console_log_colors_1.color.cyanBright(pkg.version)}]`)
11
+ // .option('-c, --config-path [filepath]', `配置文件 ${color.yellow(config.configPath)} 的路径`)
15
12
  .option('-d, --base-dir [baseDir]', '静态服务器的根目录路径')
16
13
  .option('-p, --port [port]', '端口号')
17
14
  .option('-o, --open', '启动后是否打开静态服务器首页')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lzwme/sserver",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "description": "一个基于 nodejs 的简易静态服务器,方便随时开发调试使用",
5
5
  "main": "dist/index.js",
6
6
  "type": "commonjs",
@@ -30,6 +30,7 @@
30
30
  "access": "public",
31
31
  "registry": "https://registry.npmjs.com"
32
32
  },
33
+ "files": ["dist", "ss.config.sample.js"],
33
34
  "scripts": {
34
35
  "prepare": "husky install",
35
36
  "ss": "node bin/sserver.js",
@@ -41,18 +42,18 @@
41
42
  "version": "standard-version"
42
43
  },
43
44
  "dependencies": {
44
- "commander": "^9.3.0",
45
+ "commander": "^9.4.0",
45
46
  "console-log-colors": "^0.2.3",
46
47
  "express": "^4.18.1",
47
48
  "http-proxy-middleware": "^2.0.6"
48
49
  },
49
50
  "devDependencies": {
50
- "@lzwme/fed-lint-helper": "^1.9.1",
51
- "@types/express": "^4.17.13",
52
- "@types/node": "^18.0.0",
51
+ "@lzwme/fed-lint-helper": "^2.0.1",
52
+ "@types/express": "^4.17.14",
53
+ "@types/node": "^18.7.18",
53
54
  "husky": "^8.0.1",
54
55
  "standard-version": "^9.5.0",
55
- "ts-node": "^10.8.1",
56
- "typescript": "^4.7.4"
56
+ "ts-node": "^10.9.1",
57
+ "typescript": "^4.8.3"
57
58
  }
58
59
  }
package/.eslintrc.js DELETED
@@ -1,70 +0,0 @@
1
- // @ts-check
2
- const path = require('path');
3
- const rootDir = path.resolve(__dirname);
4
-
5
- /** @type {import('eslint').Linter.Config} */
6
- module.exports = {
7
- extends: [
8
- 'eslint:recommended',
9
- // https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/docs/getting-started/linting/README.md
10
- 'plugin:@typescript-eslint/recommended',
11
- // 'plugin:@typescript-eslint/recommended-requiring-type-checking',
12
- 'plugin:prettier/recommended',
13
- 'plugin:jest/recommended',
14
- 'plugin:unicorn/recommended',
15
- ],
16
- env: {
17
- browser: true,
18
- es2021: true,
19
- node: true,
20
- },
21
- globals: {
22
- SharedArrayBuffer: 'readonly',
23
- },
24
- parser: '@typescript-eslint/parser',
25
- parserOptions: {
26
- tsconfigRootDir: rootDir,
27
- project: path.resolve(rootDir, './tsconfig.eslint.json'),
28
- projectFolderIgnoreList: ['**/node_modules/**', '**/dist/**', '**/dist-admin/**'],
29
- warnOnUnsupportedTypeScriptVersion: false,
30
- // createDefaultProgram: true,
31
- ecmaFeatures: {
32
- jsx: true,
33
- },
34
- ecmaVersion: 2020,
35
- sourceType: 'module',
36
- },
37
- plugins: ['@typescript-eslint'],
38
- ignorePatterns: [
39
- '**/node_modules/**',
40
- 'dist/**',
41
- 'build/**',
42
- 'mock/**',
43
- '**/*.js',
44
- '**/*.d.ts',
45
- ],
46
- rules: {
47
- 'prettier/prettier': 'warn',
48
- // 关闭 eslint 的 indent,使用 prettier 格式化格式
49
- indent: ['off', 2],
50
- '@typescript-eslint/explicit-module-boundary-types': 'off',
51
- '@typescript-eslint/no-unused-vars': ['warn', { varsIgnorePattern: '^_', argsIgnorePattern: '^_', ignoreRestSiblings: true }],
52
- '@typescript-eslint/ban-ts-comment': 'off',
53
- 'unicorn/prefer-module': 'off',
54
- 'unicorn/prefer-node-protocol': 'off',
55
- 'unicorn/no-nested-ternary': 'off',
56
- 'unicorn/no-process-exit': 'off',
57
- 'unicorn/consistent-destructuring': 'off',
58
- 'jest/no-export': 'off',
59
- 'unicorn/filename-case': 'off',
60
- 'unicorn/no-null': 'off',
61
- 'unicorn/prevent-abbreviations': 'off',
62
- 'unicorn/import-style': ['error', {
63
- styles: {
64
- path: {
65
- named: true,
66
- }
67
- }
68
- }]
69
- },
70
- };
package/.gitattributes DELETED
@@ -1,3 +0,0 @@
1
- * text=auto eol=lf
2
- *.ts text eol=lf
3
- *.bat text eol=crlf
package/.husky/commit-msg DELETED
@@ -1,4 +0,0 @@
1
- #!/bin/sh
2
- . "$(dirname "$0")/_/husky.sh"
3
-
4
- flh --commitlint
package/CHANGELOG.md DELETED
@@ -1,10 +0,0 @@
1
- # Changelog
2
-
3
- All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
-
5
- ### 0.0.1 (2022-07-01)
6
-
7
-
8
- ### Features
9
-
10
- * 新增代理转发支持;使用 ts 重构 ([9d6a960](https://github.com/lzwme/static-server/commit/9d6a960c0a311f1f345f5e9c7b544161920fbae2))