-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3a399cc
commit 20a0022
Showing
7 changed files
with
177 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Github Pages Deploy | ||
|
||
on: | ||
push: | ||
branches: | ||
- "main" | ||
pull_request: | ||
branches: | ||
- "main" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [16.x] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v1 | ||
|
||
- name: Install and Build | ||
run: npm install && npm run jsDoc | ||
|
||
- name: Deploy | ||
uses: JamesIves/github-pages-deploy-action@4.1.1 | ||
with: | ||
branch: gh-pages # The branch the action should deploy to. | ||
folder: docs # The folder the action should deploy. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# https://github.com/marketplace/actions/github-wiki-action | ||
name: Deploy Wiki | ||
|
||
on: | ||
push: | ||
paths: | ||
# Trigger only when wiki directory changes | ||
- "wiki/**" | ||
branches: | ||
# And only on master branch | ||
- main | ||
|
||
jobs: | ||
deploy-wiki: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Push Wiki Changes | ||
uses: Andrew-Chen-Wang/github-wiki-action@v3 | ||
env: | ||
WIKI_DIR: wiki/ # WIKI_DIR's default is wiki/ - Make sure you have that / at the end. We use rsync | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GH_MAIL: ${{ secrets.EMAIL }} # github.event.pusher.email | ||
GH_NAME: ${{ github.repository_owner }} | ||
EXCLUDED_FILES: "_ignore/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
# Custom Build | ||
|
||
## Description | ||
|
||
This project is using [webpack](https://webpack.js.org/) to create a build. | ||
|
||
So it's kinda simple to create a custom build. | ||
|
||
Just follow the steps below. | ||
|
||
## Step 0 - Clone the repository | ||
|
||
(If you want you can clone the repository on [Gitpod](https://www.gitpod.io/) which will do these steps for you automatically) | ||
|
||
To create a custom build, you need to have the repository in your machine. | ||
|
||
### Clone | ||
One way to do that it’s cloning the repository, opening a new terminal, and pasting this code: | ||
|
||
(You need to have git installed on your machine) | ||
```sh | ||
git clone https://gitlab.com/201flaviosilva/utilsjs.git | ||
``` | ||
|
||
### Install the decencies | ||
|
||
#### Move to the project folder | ||
After clone the repository, you need to move to the project folder to start working :) | ||
```sh | ||
cd utilsjs | ||
``` | ||
|
||
#### Install | ||
Then install the dependencies | ||
```sh | ||
npm install | ||
``` | ||
|
||
## Step 1 - webpack.config.js | ||
|
||
In the file tree you'll find a `webpack.config.js` file, open and you will find a configuration more or less similar to the one below. | ||
|
||
```javascript | ||
const path = require("path"); | ||
|
||
module.exports = { | ||
mode: "production", | ||
entry: "./src/index.js", | ||
optimization: { minimize: true, }, // false/true | ||
experiments: { outputModule: true, }, | ||
output: { | ||
path: path.resolve("build"), | ||
filename: "utils.min.js", // "utils.js"/"utils.min.js" | ||
libraryTarget: "window", // module/commonjs2/window // https://webpack.js.org/configuration/output/#outputlibrarytarget | ||
}, | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.js?$/, | ||
exclude: /(node_modules)/, | ||
use: "babel-loader", | ||
}, | ||
], | ||
}, | ||
resolve: { extensions: [".js"], }, | ||
}; | ||
|
||
``` | ||
## Step 2 - change the configuration | ||
|
||
You probably just will want to change 3 properties: | ||
|
||
### Optimization and Minimization | ||
In the property `optimization` you'll find a property called `minimize` that will be used to decide if the build will be development mode or not (minimize or not). | ||
|
||
- If you want to development build, just set it to `false`. | ||
- If you want to production build, just set it to `true`. | ||
|
||
### Filename | ||
In the property `filename` you'll find the name of the file that will be created (the output file). Just change the file name to whatever name you need. | ||
Example: | ||
|
||
- `utils.min.js`; | ||
- `build.js`; | ||
- etc... | ||
|
||
### Library Target | ||
In the property `libraryTarget` you'll find the target of the library. | ||
|
||
- If you want to create a module build, just set it to `module`. | ||
- If you want to create a node build, just set it to `commonjs2`. | ||
- If you want to create a window build, just set it to `window`. | ||
- Etc... you can find more information in the [webpack documentation](https://webpack.js.org/configuration/output/#outputlibrarytarget). | ||
|
||
## Step 3 - Build | ||
|
||
Finally, you'll need to run the command `npm run compile` in the terminal. | ||
|
||
Check your folder tree, and in the folder build you'll find the file build file with the name of the file you've changed in the configuration. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
- [javatpoint - Data Structure](https://www.javatpoint.com/data-structure-tutorial) | ||
- [Code Wars](https://www.codewars.com/dashboard) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# 201flaviosilva-UtilsJS Wiki | ||
|
||
## Description | ||
Just some simple JavaScript Utils and algorithms solutions. Some functions was created to solve a challenge in [Code Wars](https://www.codewars.com/dashboard). | ||
|
||
To see the library documentation: https://201flaviosilva.gitlab.io/utilsjs/ | ||
|