Skip to content

Commit

Permalink
close #29
Browse files Browse the repository at this point in the history
  • Loading branch information
wangshan committed Nov 16, 2021
1 parent 111e2bb commit b932103
Show file tree
Hide file tree
Showing 86 changed files with 35,916 additions and 8,578 deletions.
4 changes: 4 additions & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# 目标环境监测配置, 或者通过package.json【browserslist】字段指定目标环境
last 1 version
> 1%
IE 10
8 changes: 8 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# don't ever lint node_modules
node_modules
# don't lint build output (make sure it's set to your correct build folder name)
dist
# don't lint nyc coverage output
coverage
public
config
17 changes: 17 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"root": true, // 指定项目根目录作为规则位置
"env": {
"browser": true,
"es2021": true
},
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"], // 扩展核心规则
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 12,
"sourceType": "module"
},
"plugins": ["@typescript-eslint"],
"rules": {
"@typescript-eslint/no-explicit-any": "error"
}
}
14 changes: 14 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# These are supported funding model platforms

github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: #
open_collective: 'jiuke'
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

custom: ['https://github.com/PachVerb']
17 changes: 17 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "npm" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "daily"
commit-message:
prefix: "deps"
target-branch: "docs"
reviewers:
- "front-end-open"
assignees:
- "new/bird"
53 changes: 0 additions & 53 deletions .github/workflows/deploy.yml

This file was deleted.

7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
.temp
.cache
.DS_Store
node_modules/
dist/

1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@OWNER:registry=https://www.npmjs.com/package/pachverb-chat
13 changes: 13 additions & 0 deletions .releaserc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
branches:
[
"+([0-9])?(.{+([0-9]),x}).x",
"main",
"next",
"next-major",
{ name: "beta", prerelease: true },
{ name: "alpha", prerelease: true },
]
repositoryUrl: https://github.com/front-end-open/wt_run.git
ci: false
dryRun: false
debug: false
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 front-end-open

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<h3 align="center">Algorithm</h3>

---

一个使用 js 构建的数据结构与算法的 box

## Feature

- 数据结构
1. [线性表(List)](https://github.com/front-end-open/algorithm/blob/15cb2689016dd361bff00138365fe6432f73af7f/src/dataStructure/List/LinkedList.ts)
2. [栈(Stack)](https://github.com/front-end-open/algorithm/blob/main/src/dataStructure/stack/Stack.ts)
- 算法
- 测试(Jest)

## Document
[see](https://front-end-open.github.io/algorithm/)

## Example
更新中...

## 交流

[Email-Pachverb](1506262681@qq.com)
14 changes: 14 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* @Author: wangshan
* @Date: 2021-11-03 23:54:45
* @LastEditors: wangshan
* @LastEditTime: 2021-11-03 23:54:45
* @Description:
*/

module.exports = {
presets: [
["@babel/preset-env", { targets: { node: "current" } }],
"@babel/preset-typescript",
],
};
62 changes: 62 additions & 0 deletions config/webpack.common.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/*
* @Author: wangshan
* @Date: 2021-06-22 01:31:05
* @LastEditors: wangshan
* @LastEditTime: 2021-10-17 18:12:49
* @Description:
*/
// import "@babel/polyfill"; // 所有模块项导入前导入babel/polyfill

const path = require("path");
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const BundleAnalyzerPlugin =
require("webpack-bundle-analyzer").BundleAnalyzerPlugin; // 分析打包后包体积
const currdir = __dirname;
module.exports = {
entry: path.resolve(currdir, "../src/index.ts"),
output: {
path: path.resolve(currdir, "../dist"),
filename: "js/[name].[hash:8].js",
chunkFilename: "js/[name].[hash:8].js", // 入口文件内懒加载模块文件推断打包
},
module: {
// loader配置
rules: [
{
test: /\.ts$/,
use: {
loader: "ts-loader",
options: {
transpileOnly: true, // 只做语言转换,而不做类型检查
},
},
},
{
test: /\.js$/,
use: {
loader: "babel-loader",
options: {
presets: ["@babel/preset-env", { modules: false }], // 设置modules完全开启tree-shaeking
},
},
exclude: /node_modules/,
},
],
},
resolve: {
alias: {
// 模块查询路径配置
"@": "../src",
},
extensions: ["*", ".ts", ".js", ".json"], // 模块文件解析顺序;能够在引入模块时不带扩展
},
plugins: [
new CleanWebpackPlugin(),
// new BundleAnalyzerPlugin(),
new HtmlWebpackPlugin({
// 使用插件,使用自定义插件
template: path.resolve(currdir, "../public/index.html"),
}),
],
};
32 changes: 32 additions & 0 deletions config/webpack.dev.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* @Author: wangshan
* @Date: 2021-06-22 01:31:57
* @LastEditors: wangshan
* @LastEditTime: 2021-10-16 16:13:05
* @Description:
*/

const { merge } = require("webpack-merge");
const common = require("./webpack.common.js");
const Webpack = require("webpack");
const ErrorOverlayPlugin = require("error-overlay-webpack-plugin"); // 错误预览插件
const path = require("path");

// const UglifyJsPlugin = require("uglifyjs-webpack-plugin"); // 混淆js

module.exports = merge(common, {
mode: "development",
// 开发工具
devtool: "eval-cheap-module-source-map", // 开发环境下特定source-map
// 对 webpack-dev-server 进行配置

devServer: {
contentBase: "../dist",
port: 9000,
hot: true, //热更新
},
plugins: [
new ErrorOverlayPlugin(),
new Webpack.HotModuleReplacementPlugin(), // 配置热更新
],
});
72 changes: 72 additions & 0 deletions config/webpack.prod.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
/*
* @Author: wangshan
* @Date: 2021-06-22 01:33:57
* @LastEditors: wangshan
* @LastEditTime: 2021-06-24 00:57:53
* @Description:
*/
const { merge } = require("webpack-merge");
const common = require("./webpack.common.js");
const CopyPlugin = require("copy-webpack-plugin");
const UglifyJSPlugin = require("uglifyjs-webpack-plugin");

module.exports = merge(common, {
mode: "production", // 启用特定模式,用于资源打包时的优化.
plugins: [
new CopyPlugin([
{
pattherns: [
{
from: "../public",
to: "../dist",
},
],
},
]),
],
optimization: {
minimizer: [
new UglifyJSPlugin({
//压缩js
cache: true, // 启用特定模式,用于资源打包时的优化
parallel: true, //多线程构建
sourceMap: true, // 启用sourceMap
}),
],
splitChunks: {
// SplitChunksPlugin 通用分块策略, webpack v4+新提供的开箱即用功能
chunks: "all",
cacheGroups: {
libs: {
name: "chunk-libs",
test: /[\\/]node_modules[\\/]/,
priority: 10,
chunks: "initial", // 只打包初始时依赖的第三方
},
},
},
},
module: {
rules: [
{
test: /\.ts$/,
exclude: /node_modules/,
use: [
{
loader: "babel-loader",
},
{
loader: "ts-loader",
},
],
},
],
},
devtool: "source-map", // 源码使用source-map, 用于调试追踪
// plugins: [uglifyJSPlugin],
// 设置出口文件地址与文件名
// output: {
// path: path.resolve(__dirname, "../dist"),
// filename: "[name].[hash:8].js",
// },
});
Loading

0 comments on commit b932103

Please sign in to comment.