Skip to content

Commit b932103

Browse files
author
wangshan
committed
close #29
1 parent 111e2bb commit b932103

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+35916
-8578
lines changed

.browserslistrc

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# 目标环境监测配置, 或者通过package.json【browserslist】字段指定目标环境
2+
last 1 version
3+
> 1%
4+
IE 10

.eslintignore

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# don't ever lint node_modules
2+
node_modules
3+
# don't lint build output (make sure it's set to your correct build folder name)
4+
dist
5+
# don't lint nyc coverage output
6+
coverage
7+
public
8+
config

.eslintrc.json

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"root": true, // 指定项目根目录作为规则位置
3+
"env": {
4+
"browser": true,
5+
"es2021": true
6+
},
7+
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"], // 扩展核心规则
8+
"parser": "@typescript-eslint/parser",
9+
"parserOptions": {
10+
"ecmaVersion": 12,
11+
"sourceType": "module"
12+
},
13+
"plugins": ["@typescript-eslint"],
14+
"rules": {
15+
"@typescript-eslint/no-explicit-any": "error"
16+
}
17+
}

.github/FUNDING.yml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# These are supported funding model platforms
2+
3+
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4+
patreon: #
5+
open_collective: 'jiuke'
6+
ko_fi: # Replace with a single Ko-fi username
7+
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9+
liberapay: # Replace with a single Liberapay username
10+
issuehunt: # Replace with a single IssueHunt username
11+
otechie: # Replace with a single Otechie username
12+
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
13+
14+
custom: ['https://github.com/PachVerb']

.github/dependabot.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# package ecosystems to update and where the package manifests are located.
2+
# Please see the documentation for all configuration options:
3+
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
4+
5+
version: 2
6+
updates:
7+
- package-ecosystem: "npm" # See documentation for possible values
8+
directory: "/" # Location of package manifests
9+
schedule:
10+
interval: "daily"
11+
commit-message:
12+
prefix: "deps"
13+
target-branch: "docs"
14+
reviewers:
15+
- "front-end-open"
16+
assignees:
17+
- "new/bird"

.github/workflows/deploy.yml

-53
This file was deleted.

.gitignore

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
node_modules
2-
.temp
3-
.cache
1+
.DS_Store
2+
node_modules/
3+
dist/
4+

.npmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@OWNER:registry=https://www.npmjs.com/package/pachverb-chat

.releaserc.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
branches:
2+
[
3+
"+([0-9])?(.{+([0-9]),x}).x",
4+
"main",
5+
"next",
6+
"next-major",
7+
{ name: "beta", prerelease: true },
8+
{ name: "alpha", prerelease: true },
9+
]
10+
repositoryUrl: https://github.com/front-end-open/wt_run.git
11+
ci: false
12+
dryRun: false
13+
debug: false

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021 front-end-open
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<h3 align="center">Algorithm</h3>
2+
3+
---
4+
5+
一个使用 js 构建的数据结构与算法的 box
6+
7+
## Feature
8+
9+
- 数据结构
10+
1. [线性表(List)](https://github.com/front-end-open/algorithm/blob/15cb2689016dd361bff00138365fe6432f73af7f/src/dataStructure/List/LinkedList.ts)
11+
2. [栈(Stack)](https://github.com/front-end-open/algorithm/blob/main/src/dataStructure/stack/Stack.ts)
12+
- 算法
13+
- 测试(Jest)
14+
15+
## Document
16+
[see](https://front-end-open.github.io/algorithm/)
17+
18+
## Example
19+
更新中...
20+
21+
## 交流
22+
23+
[Email-Pachverb]([email protected])

babel.config.js

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/*
2+
* @Author: wangshan
3+
* @Date: 2021-11-03 23:54:45
4+
* @LastEditors: wangshan
5+
* @LastEditTime: 2021-11-03 23:54:45
6+
* @Description:
7+
*/
8+
9+
module.exports = {
10+
presets: [
11+
["@babel/preset-env", { targets: { node: "current" } }],
12+
"@babel/preset-typescript",
13+
],
14+
};

config/webpack.common.js

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
/*
2+
* @Author: wangshan
3+
* @Date: 2021-06-22 01:31:05
4+
* @LastEditors: wangshan
5+
* @LastEditTime: 2021-10-17 18:12:49
6+
* @Description:
7+
*/
8+
// import "@babel/polyfill"; // 所有模块项导入前导入babel/polyfill
9+
10+
const path = require("path");
11+
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
12+
const HtmlWebpackPlugin = require("html-webpack-plugin");
13+
const BundleAnalyzerPlugin =
14+
require("webpack-bundle-analyzer").BundleAnalyzerPlugin; // 分析打包后包体积
15+
const currdir = __dirname;
16+
module.exports = {
17+
entry: path.resolve(currdir, "../src/index.ts"),
18+
output: {
19+
path: path.resolve(currdir, "../dist"),
20+
filename: "js/[name].[hash:8].js",
21+
chunkFilename: "js/[name].[hash:8].js", // 入口文件内懒加载模块文件推断打包
22+
},
23+
module: {
24+
// loader配置
25+
rules: [
26+
{
27+
test: /\.ts$/,
28+
use: {
29+
loader: "ts-loader",
30+
options: {
31+
transpileOnly: true, // 只做语言转换,而不做类型检查
32+
},
33+
},
34+
},
35+
{
36+
test: /\.js$/,
37+
use: {
38+
loader: "babel-loader",
39+
options: {
40+
presets: ["@babel/preset-env", { modules: false }], // 设置modules完全开启tree-shaeking
41+
},
42+
},
43+
exclude: /node_modules/,
44+
},
45+
],
46+
},
47+
resolve: {
48+
alias: {
49+
// 模块查询路径配置
50+
"@": "../src",
51+
},
52+
extensions: ["*", ".ts", ".js", ".json"], // 模块文件解析顺序;能够在引入模块时不带扩展
53+
},
54+
plugins: [
55+
new CleanWebpackPlugin(),
56+
// new BundleAnalyzerPlugin(),
57+
new HtmlWebpackPlugin({
58+
// 使用插件,使用自定义插件
59+
template: path.resolve(currdir, "../public/index.html"),
60+
}),
61+
],
62+
};

config/webpack.dev.js

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
* @Author: wangshan
3+
* @Date: 2021-06-22 01:31:57
4+
* @LastEditors: wangshan
5+
* @LastEditTime: 2021-10-16 16:13:05
6+
* @Description:
7+
*/
8+
9+
const { merge } = require("webpack-merge");
10+
const common = require("./webpack.common.js");
11+
const Webpack = require("webpack");
12+
const ErrorOverlayPlugin = require("error-overlay-webpack-plugin"); // 错误预览插件
13+
const path = require("path");
14+
15+
// const UglifyJsPlugin = require("uglifyjs-webpack-plugin"); // 混淆js
16+
17+
module.exports = merge(common, {
18+
mode: "development",
19+
// 开发工具
20+
devtool: "eval-cheap-module-source-map", // 开发环境下特定source-map
21+
// 对 webpack-dev-server 进行配置
22+
23+
devServer: {
24+
contentBase: "../dist",
25+
port: 9000,
26+
hot: true, //热更新
27+
},
28+
plugins: [
29+
new ErrorOverlayPlugin(),
30+
new Webpack.HotModuleReplacementPlugin(), // 配置热更新
31+
],
32+
});

config/webpack.prod.js

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
/*
2+
* @Author: wangshan
3+
* @Date: 2021-06-22 01:33:57
4+
* @LastEditors: wangshan
5+
* @LastEditTime: 2021-06-24 00:57:53
6+
* @Description:
7+
*/
8+
const { merge } = require("webpack-merge");
9+
const common = require("./webpack.common.js");
10+
const CopyPlugin = require("copy-webpack-plugin");
11+
const UglifyJSPlugin = require("uglifyjs-webpack-plugin");
12+
13+
module.exports = merge(common, {
14+
mode: "production", // 启用特定模式,用于资源打包时的优化.
15+
plugins: [
16+
new CopyPlugin([
17+
{
18+
pattherns: [
19+
{
20+
from: "../public",
21+
to: "../dist",
22+
},
23+
],
24+
},
25+
]),
26+
],
27+
optimization: {
28+
minimizer: [
29+
new UglifyJSPlugin({
30+
//压缩js
31+
cache: true, // 启用特定模式,用于资源打包时的优化
32+
parallel: true, //多线程构建
33+
sourceMap: true, // 启用sourceMap
34+
}),
35+
],
36+
splitChunks: {
37+
// SplitChunksPlugin 通用分块策略, webpack v4+新提供的开箱即用功能
38+
chunks: "all",
39+
cacheGroups: {
40+
libs: {
41+
name: "chunk-libs",
42+
test: /[\\/]node_modules[\\/]/,
43+
priority: 10,
44+
chunks: "initial", // 只打包初始时依赖的第三方
45+
},
46+
},
47+
},
48+
},
49+
module: {
50+
rules: [
51+
{
52+
test: /\.ts$/,
53+
exclude: /node_modules/,
54+
use: [
55+
{
56+
loader: "babel-loader",
57+
},
58+
{
59+
loader: "ts-loader",
60+
},
61+
],
62+
},
63+
],
64+
},
65+
devtool: "source-map", // 源码使用source-map, 用于调试追踪
66+
// plugins: [uglifyJSPlugin],
67+
// 设置出口文件地址与文件名
68+
// output: {
69+
// path: path.resolve(__dirname, "../dist"),
70+
// filename: "[name].[hash:8].js",
71+
// },
72+
});

0 commit comments

Comments
 (0)