Skip to content

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Nov 24, 2021
0 parents commit 296f896
Show file tree
Hide file tree
Showing 27 changed files with 1,227 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"env": {
"node": true,
"es6": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"plugins": ["import", "prettier"],
"parserOptions": {
"project": "./tsconfig.eslint.json"
},
"rules": {
"prettier/prettier": "error",
"import/order": [
"error",
{
"groups": ["type", "builtin", ["sibling", "parent"], "index", "object"],
"newlines-between": "never",
"alphabetize": {
"order": "asc",
"caseInsensitive": true
}
}
],
"@typescript-eslint/consistent-type-imports": [
"error",
{
"prefer": "type-imports"
}
],
"@typescript-eslint/no-explicit-any": "off"
}
}
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "daily"
26 changes: 26 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: test
on: [push, pull_request]
jobs:
test:
name: Node ${{ matrix.node-version }} and ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
node-version: [16.x, 17.x]
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v1
- name: Use Node ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: npm install
run: npm i
- name: npm run build
run: npm run build
- name: npm run lint
run: npm run lint
if: matrix.os == 'ubuntu-latest'
- name: npm test
run: npm test
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_modules
package-lock.json
coverage
.nyc_output
/lib
/test/support/ts-app/lib
*.tsbuildinfo
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
7 changes: 7 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"arrowParens": "avoid",
"bracketSpacing": false,
"singleQuote": true,
"printWidth": 120,
"trailingComma": "none"
}
20 changes: 20 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Copyright (c) 2021 Sebastian Riedel

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.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<p align="center">
<a href="https://mojojs.org">
<img src="https://github.com/mojolicious/mojo.js/blob/main/docs/images/logo.png?raw=true" style="margin: 0 auto;">
</a>
</p>

[![](https://github.com/mojolicious/dom.js/workflows/test/badge.svg)](https://github.com/mojolicious/dom.js/actions)
[![npm](https://img.shields.io/npm/v/@mojojs/dom.svg)](https://www.npmjs.com/package/@mojojs/dom)

A convenient DOM API. Written in TypeScript.

```js
import DOM from '@mojojs/dom';
```

## Installation

All you need is Node.js 16.0.0 (or newer).

```
$ npm install @mojojs/dom
```
65 changes: 65 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
"name": "@mojojs/dom",
"version": "0.0.1",
"description": "DOM",
"keywords": [
"dom",
"html",
"css"
],
"author": "Sebastian Riedel <[email protected]>",
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/mojolicious/dom.js.git"
},
"bugs": {
"url": "https://github.com/mojolicious/dom.js/issues"
},
"homepage": "https://mojojs.org",
"scripts": {
"build": "npx tsc --build ./",
"build:clean": "npm run clean && npm run build",
"build:coverage": "npm run build && npm run coverage",
"build:lint": "npm run build && npm run lint",
"build:test": "npm run build && npm test",
"build:watch": "npm run build -- --watch",
"clean": "rm -rf tsconfig.tsbuildinfo lib",
"coverage": "tap --node-arg='--no-warnings' --node-arg='--experimental-loader' --node-arg='@istanbuljs/esm-loader-hook' test/*.js",
"coverage:ci": "npm run coverage -- --no-check-coverage && tap --no-check-coverage --coverage-report=text-lcov > .lcov.info",
"lint": "eslint \"test/*.js\" \"src/**/*.ts\" \"src/*.ts\"",
"lint:fix": "npm run lint -- --fix",
"prepublishOnly": "npm run build",
"publish:major": "npm version major && npm publish",
"publish:minor": "npm version minor && npm publish",
"publish:patch": "npm version patch && npm publish",
"test": "tap --no-coverage test/*.js"
},
"exports": "./lib/dom.js",
"types": "./lib/dom.d.ts",
"type": "module",
"files": [
"lib/"
],
"devDependencies": {
"@istanbuljs/esm-loader-hook": "^=0.1.2",
"@types/node": "^16.3.0",
"@types/parse5": "^6.0.2",
"@types/tap": "^15.0.3",
"@typescript-eslint/eslint-plugin": "^5.1.0",
"eslint": "^8.1.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.23.4",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^4.0.0",
"prettier": "^2.3.2",
"tap": "^15.0.6",
"typescript": "^=4.3.2"
},
"engines": {
"node": ">= 16"
},
"dependencies": {
"parse5": "^6.0.0"
}
}
Loading

0 comments on commit 296f896

Please sign in to comment.