setup(prototype): init project

just initiated the project and added a few possible dependencies i'd have to clean up in a next step
This commit is contained in:
Benjamin Wegener
2021-10-09 12:47:38 +02:00
commit 4bbc5cc832
8 changed files with 3335 additions and 0 deletions

19
.editorconfig Normal file
View File

@@ -0,0 +1,19 @@
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = tab
indent_size = 20
trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false
[*.yml]
charset = utf-8
indent_style = space
indent_size = 4
end_of_line = lf
insert_final_newline = false

4
.gitignore vendored Normal file
View File

@@ -0,0 +1,4 @@
.DS_Store
node_modules
npm-debug.log
delete-me

21
LICENSE Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2021 Benjamin Wegener
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.

2
README.md Normal file
View File

@@ -0,0 +1,2 @@
# 🚀 simplecomplete becomes a *simple👌* yet *powerful* and *versatile* js library for search elements
a simple js auto completion feature for everyone

23
babel.config.js Normal file
View File

@@ -0,0 +1,23 @@
module.exports = function (api) {
api.cache(true)
return {
presets: [
[
"@babel/preset-env",
{
corejs: {
version: "3.8",
proposals: false
},
useBuiltIns: "usage" // browserslist in package.json
}
],
],
plugins: [
[
"@babel/plugin-transform-for-of",
{ allowArrayLike: true }
],
]
}
}

41
package.json Normal file
View File

@@ -0,0 +1,41 @@
{
"name": "simplecomplete",
"version": "1.0.0",
"description": "simple and fun autocomplete library",
"keywords": [
"autocomplete",
"simple",
"inputs",
"search"
],
"repository": "git@github.com:bennigames/simplecomplete.js.git",
"author": {
"name": "Benjamin Wegener",
"url": "https://benni.games/"
},
"license": "MIT",
"private": false,
"homepage": "https://benni.games",
"bugs": "https://github.com/bennigames/simplecomplete.js/issues",
"main": "dist/simplecomplete.bundle.js",
"dependencies": {
"core-js": "^3.18.2",
"extract-loader": "^5.1.0",
"fetch": "^1.1.0"
},
"browserslist": "defaults, > 0.25%, IE 11",
"devDependencies": {
"@babel/core": "^7.15.5",
"@babel/preset-env": "^7.15.6",
"babel-loader": "^8.2.2",
"css-loader": "^6.3.0",
"file-loader": "^6.2.0",
"sass": "^1.42.1",
"sass-loader": "^12.1.0",
"style-loader": "^3.3.0",
"terser-webpack-plugin": "^5.2.4",
"webpack": "^5.57.0",
"webpack-cli": "^4.8.0",
"webpack-shell-plugin-next": "^2.2.2"
}
}

93
webpack.config.js Normal file
View File

@@ -0,0 +1,93 @@
const path = require("path");
const WebpackShellPluginNext = require("webpack-shell-plugin-next");
const configJS = (minimize = false) => {
return {
entry: ["./src/simplecomplete/index.js"],
mode: "production",
module: {
rules: [{
test: /\.js$/,
exclude: [
/(node_modules|bower_components)/,
/\bcore-js\b/,
/\bwebpack\/buildin\b/
],
use: {
loader: "babel-loader",
options: {
babelrc: false,
configFile: path.resolve(__dirname, "babel.config.js"),
compact: false,
cacheDirectory: true,
sourceMaps: false,
}
}
}, {
test: /\.html$/i,
loader: "html-loader",
options: {
sources: false,
}
}]
},
optimization: {
minimize: minimize,
},
output: {
libraryTarget: "umd",
path: path.resolve(__dirname, minimize ? "dist/min" : "dist"),
filename: minimize ? "simplecomplete.min.js" : "simplecomplete.js",
}
}
}
const configCSS = (minimize = false) => {
return {
entry: ["./src/scss/simplecomplete.scss"],
mode: "production",
module: {
rules: [{
test: /\.scss$/,
use: [{
loader: "file-loader",
options: {
name: minimize ? "[name].min.css" : "[name].css",
}
}, {
loader: "extract-loader",
}, {
loader: "css-loader",
}, {
loader: "sass-loader",
options: {
sassOptions: {
outputStyle: minimize ? "compressed" : "expanded",
},
},
}],
}],
},
optimization: {
minimize: false,
},
output: {
path: path.resolve(__dirname, minimize ? "dist/min" : "dist"),
filename: "delete-me"
},
plugins: [
new WebpackShellPluginNext({
onBuildEnd: {
scripts: ["rm -f dist/delete-me && rm -f dist/min/delete-me"],
}
})
]
};
};
module.exports = [
configJS(),
configJS(true),
configCSS(),
configCSS(true),
];

3132
yarn.lock Normal file

File diff suppressed because it is too large Load Diff