-
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
95217e4
commit ea07622
Showing
19 changed files
with
17,521 additions
and
0 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,2 @@ | ||
node_modules | ||
dist |
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,27 @@ | ||
--- | ||
root: true | ||
|
||
plugins: | ||
- jest | ||
- babel | ||
|
||
env: | ||
node: true | ||
jest: true | ||
browser: true | ||
|
||
parser: "@babel/eslint-parser" | ||
|
||
parserOptions: | ||
parser: '@babel/eslint-parser' | ||
requireConfigFile: false | ||
ecmaVersion: 2018 | ||
sourceType: 'module' | ||
|
||
extends: | ||
- "airbnb-base" | ||
- "plugin:jest/recommended" | ||
|
||
rules: | ||
no-console: 0 | ||
import/extensions: 0 |
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,46 @@ | ||
# Name of workflow | ||
name: Node CI | ||
|
||
# Trigger the workflow on push or pull request | ||
on: | ||
- push | ||
- pull_request | ||
|
||
jobs: | ||
build: | ||
|
||
# The type of machine to run the job on | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
# Node versions list | ||
matrix: | ||
node-version: [18.x] | ||
|
||
steps: | ||
# Check-out repository under GitHub workspace | ||
# https://github.com/actions/checkout | ||
- uses: actions/checkout@v3 | ||
# Step's name | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
# Configures the node version used on GitHub-hosted runners | ||
# https://github.com/actions/setup-node | ||
uses: actions/setup-node@v3 | ||
# The Node.js version to configure | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- name: npm install, build | ||
# Install and build project | ||
run: | | ||
make install | ||
make build | ||
# Add environment variables | ||
env: | ||
CI: true | ||
|
||
- name: Run linter | ||
run: make lint | ||
|
||
- name: Run tests | ||
run: make test |
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,4 @@ | ||
/node_modules/ | ||
*.log | ||
dist | ||
assets |
Empty file.
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 @@ | ||
legacy-peer-deps=true |
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,16 @@ | ||
develop: | ||
npx webpack serve | ||
|
||
install: | ||
npm ci | ||
|
||
build: | ||
NODE_ENV=production npx webpack | ||
|
||
test: | ||
npm test | ||
|
||
lint: | ||
npx eslint . | ||
|
||
.PHONY: test |
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 @@ | ||
<div id="point"></div> |
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,16 @@ | ||
// @ts-check | ||
|
||
import { promises as fs } from 'fs'; | ||
import path from 'path'; | ||
import init from '../src/init'; | ||
|
||
beforeEach(async () => { | ||
const pathToHtml = path.resolve(__dirname, '__fixtures__/index.html'); | ||
const html = await fs.readFile(pathToHtml, 'utf8'); | ||
document.body.innerHTML = html; | ||
}); | ||
|
||
test('init', () => { | ||
init(); | ||
expect(true).toBeDefined(); | ||
}); |
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,12 @@ | ||
{ | ||
"presets": [ | ||
[ | ||
"@babel/preset-env", | ||
{ | ||
"targets": { | ||
"node": "current" | ||
} | ||
} | ||
] | ||
] | ||
} |
Oops, something went wrong.