Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit df54e9e

Browse files
committedMar 9, 2021
🤖 chore: Setup repository.
0 parents  commit df54e9e

25 files changed

+1318
-0
lines changed
 

‎.codacy.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
languages:
2+
JavaScript: true
3+
exclude_paths:
4+
- "doc/**"
5+
- "dist/**"
6+
- "test/**"

‎.codeclimate.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
exclude_patterns:
2+
- "doc/**"
3+
- "dist/**"
4+
- "test/**"

‎.commitlintrc.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
extends: ['@js-library']
3+
};

‎.esdoc.json

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
{
2+
"source": "./src",
3+
"destination": "./gh-pages",
4+
"debug": false,
5+
"index": "./README.md",
6+
"package": "./package.json",
7+
"plugins": [
8+
{
9+
"name": "esdoc-standard-plugin",
10+
"option": {
11+
"accessor": {
12+
"access": [
13+
"public",
14+
"protected",
15+
"private"
16+
],
17+
"autoPrivate": true
18+
},
19+
"brand": {
20+
"title": "@aureooms/js-topological-sorting"
21+
},
22+
"test": {
23+
"type": "ava",
24+
"source": "./test/src"
25+
},
26+
"manual": {
27+
"files": [
28+
"./doc/manual/overview.md",
29+
"./doc/manual/installation.md",
30+
"./doc/manual/usage.md",
31+
"./doc/manual/example.md"
32+
]
33+
}
34+
}
35+
},
36+
{
37+
"name": "esdoc-inject-style-plugin",
38+
"option": {
39+
"enable": true,
40+
"styles": [
41+
"./doc/css/style.css"
42+
]
43+
}
44+
},
45+
{
46+
"name": "esdoc-inject-script-plugin",
47+
"option": {
48+
"enable": true,
49+
"scripts": [
50+
"./doc/scripts/header.js"
51+
]
52+
}
53+
}
54+
]
55+
}

‎.fixpackrc

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
{
2+
"files": [
3+
"package.json"
4+
],
5+
"quiet": false,
6+
"required": [
7+
"name",
8+
"version"
9+
],
10+
"requiredOnPrivate": [],
11+
"sortToTop": [
12+
"name",
13+
"description",
14+
"version",
15+
"license",
16+
"author",
17+
"homepage",
18+
"repository",
19+
"bugs",
20+
"keywords",
21+
"sideEffects",
22+
"source",
23+
"main",
24+
"module",
25+
"unpkg",
26+
"umd:main",
27+
"exports",
28+
"files",
29+
"scripts",
30+
"bundledDependencies",
31+
"dependencies",
32+
"optionalDependencies",
33+
"peerDependencies",
34+
"peerDependenciesMeta",
35+
"devDependencies"
36+
],
37+
"sortedSubItems": [
38+
"keywords",
39+
"files",
40+
"bundledDependencies",
41+
"dependencies",
42+
"optionalDependencies",
43+
"peerDependencies",
44+
"peerDependenciesMeta",
45+
"devDependencies"
46+
],
47+
"warn": [
48+
"description",
49+
"author",
50+
"repository",
51+
"keywords",
52+
"main",
53+
"bugs",
54+
"homepage",
55+
"license",
56+
"files"
57+
],
58+
"warnOnPrivate": [
59+
"name",
60+
"version",
61+
"description",
62+
"main"
63+
],
64+
"dryRun": false,
65+
"wipe": false,
66+
"indent": null,
67+
"newLine": null,
68+
"finalNewLine": null
69+
}

‎.github/workflows/gh-pages.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Build and Deploy GitHub pages
2+
on:
3+
release:
4+
types:
5+
- created
6+
jobs:
7+
build-and-deploy:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout 🛎️
11+
uses: actions/checkout@v2.3.4
12+
13+
- name: Install 🔧
14+
run: npm install
15+
16+
- name: Build 🏗️
17+
run: npm run build-gh-pages
18+
19+
- name: Deploy 🚀
20+
uses: JamesIves/github-pages-deploy-action@4.1.0
21+
with:
22+
branch: gh-pages
23+
folder: gh-pages

‎.gitignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# lock file
2+
!yarn.lock
3+
4+
# Generated files
5+
/dist
6+
7+
# Dependency directory
8+
node_modules
9+
jspm_packages
10+
11+
# Coverage directory used by nyc
12+
/coverage
13+
/.nyc_output
14+
15+
# Documentation
16+
/gh-pages

‎.husky/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
_

‎.husky/commit-msg

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
function ask () {
5+
6+
# This is a general-purpose function to ask Yes/No questions in Bash, either
7+
# with or without a default answer. It keeps repeating the question until it
8+
# gets a valid answer.
9+
10+
# http://djm.me/ask
11+
12+
if [ "${2:-}" = "Y" ]; then
13+
prompt="Y/n"
14+
default=Y
15+
elif [ "${2:-}" = "N" ]; then
16+
prompt="y/N"
17+
default=N
18+
else
19+
prompt="y/n"
20+
default=
21+
fi
22+
23+
while true; do
24+
25+
# Ask the question (not using "read -p" as it uses stderr not stdout)
26+
echo -n "$1 [$prompt] "
27+
28+
# Read the answer (use /dev/tty in case stdin is redirected from somewhere else)
29+
read REPLY </dev/tty
30+
31+
# Default?
32+
if [ -z "$REPLY" ]; then
33+
REPLY=$default
34+
fi
35+
36+
# Check if the reply is valid
37+
case "$REPLY" in
38+
Y*|y*) return 0 ;;
39+
N*|n*) return 1 ;;
40+
esac
41+
42+
done
43+
44+
}
45+
46+
while ! npm run commit-msg -- "$1" ; do
47+
if ask 'There was an error. Do you wish to amend your commit message?' Y ; then
48+
${GIT_EDITOR:-$EDITOR} "$1" < /dev/tty
49+
else
50+
exit 1
51+
fi
52+
done

‎.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npm run precommit

‎.travis.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
language: node_js
2+
3+
node_js:
4+
- node
5+
6+
install:
7+
- npm install
8+
9+
before_script:
10+
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
11+
- chmod +x ./cc-test-reporter
12+
- ./cc-test-reporter before-build
13+
14+
script:
15+
- npm run travis
16+
17+
after_script:
18+
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
19+
20+
after_success:
21+
- bash <(curl -s https://codecov.io/bash) || true
22+
- coveralls < coverage/lcov.info || true

‎LICENSE

Lines changed: 661 additions & 0 deletions
Large diffs are not rendered by default.

‎README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
:oden: [@aureooms/js-topological-sorting](https://aureooms.github.io/js-topological-sorting)
2+
==
3+
4+
Topological sorting for JavaScript.
5+
See [docs](https://aureooms.github.io/js-topological-sorting/index.html).
6+
7+
> :building_construction: Caveat emptor! This is work in progress. Code may be
8+
> working. Documentation may be present. Coherence may be. Maybe.
9+
10+
> :warning: The code requires `regeneratorRuntime` to be defined, for instance by importing
11+
> [regenerator-runtime/runtime](https://www.npmjs.com/package/regenerator-runtime).
12+
13+
[![License](https://img.shields.io/github/license/aureooms/js-topological-sorting.svg)](https://raw.githubusercontent.com/aureooms/js-topological-sorting/main/LICENSE)
14+
[![Version](https://img.shields.io/npm/v/@aureooms/js-topological-sorting.svg)](https://www.npmjs.org/package/@aureooms/js-topological-sorting)
15+
[![Build](https://img.shields.io/travis/aureooms/js-topological-sorting/main.svg)](https://travis-ci.org/aureooms/js-topological-sorting/branches)
16+
[![Dependencies](https://img.shields.io/david/aureooms/js-topological-sorting.svg)](https://david-dm.org/aureooms/js-topological-sorting)
17+
[![Dev dependencies](https://img.shields.io/david/dev/aureooms/js-topological-sorting.svg)](https://david-dm.org/aureooms/js-topological-sorting?type=dev)
18+
[![GitHub issues](https://img.shields.io/github/issues/aureooms/js-topological-sorting.svg)](https://github.com/aureooms/js-topological-sorting/issues)
19+
[![Downloads](https://img.shields.io/npm/dm/@aureooms/js-topological-sorting.svg)](https://www.npmjs.org/package/@aureooms/js-topological-sorting)
20+
21+
[![Code issues](https://img.shields.io/codeclimate/issues/aureooms/js-topological-sorting.svg)](https://codeclimate.com/github/aureooms/js-topological-sorting/issues)
22+
[![Code maintainability](https://img.shields.io/codeclimate/maintainability/aureooms/js-topological-sorting.svg)](https://codeclimate.com/github/aureooms/js-topological-sorting/trends/churn)
23+
[![Code coverage (cov)](https://img.shields.io/codecov/c/gh/aureooms/js-topological-sorting/main.svg)](https://codecov.io/gh/aureooms/js-topological-sorting)
24+
[![Code technical debt](https://img.shields.io/codeclimate/tech-debt/aureooms/js-topological-sorting.svg)](https://codeclimate.com/github/aureooms/js-topological-sorting/trends/technical_debt)
25+
[![Documentation](https://aureooms.github.io/js-topological-sorting/badge.svg)](https://aureooms.github.io/js-topological-sorting/source.html)
26+
[![Package size](https://img.shields.io/bundlephobia/minzip/@aureooms/js-topological-sorting)](https://bundlephobia.com/result?p=@aureooms/js-topological-sorting)

‎doc/css/style.css

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
h1,
2+
h2,
3+
.navigation,
4+
.layout-container > header,
5+
footer
6+
{
7+
border: none;
8+
}
9+
10+
.project-name {
11+
color: #FC913A;
12+
font-weight: bold;
13+
}
14+
15+
.layout-container > header > a.repo-url-github {
16+
font-size: inherit;
17+
display: inline;
18+
background: none;
19+
vertical-align: inherit;
20+
}
21+
22+
.search-box img {
23+
display: none;
24+
}
25+
26+
.search-box::before{
27+
content: "search";
28+
}
29+
30+
.search-input-edge {
31+
height: 0px;
32+
}
33+
34+
.search-result {
35+
width: 300px;
36+
margin-left: 42px;
37+
box-shadow: 1px 1px 13px rgba(0,0,0,0.2);
38+
}
39+
40+
.search-input {
41+
visibility: visible;
42+
}
43+
44+
.search-result li.search-separator {
45+
text-transform: capitalize;
46+
background-color: #ccc;
47+
}
48+
49+
span[data-ice="signature"] > span {
50+
/*font-weight: bold;*/
51+
font-style: italic;
52+
}

‎doc/manual/example.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Examples
2+
3+
> More examples in [the test files](https://github.com/aureooms/js-topological-sorting/tree/main/test/src).

‎doc/manual/installation.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Installation
2+
3+
Can be managed using
4+
[yarn](https://yarnpkg.com/en/docs),
5+
[npm](https://docs.npmjs.com),
6+
or [jspm](https://jspm.org/docs).
7+
8+
9+
### yarn
10+
```terminal
11+
yarn add @aureooms/js-topological-sorting
12+
```
13+
14+
### npm
15+
```terminal
16+
npm install @aureooms/js-topological-sorting --save
17+
```
18+
19+
### jspm
20+
```terminal
21+
jspm install npm:@aureooms/js-topological-sorting
22+
```

‎doc/manual/overview.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Overview

‎doc/manual/usage.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Usage
2+
3+
> :warning: The code requires `regeneratorRuntime` to be defined, for instance by importing
4+
> [regenerator-runtime/runtime](https://www.npmjs.com/package/regenerator-runtime).
5+
6+
First, require the polyfill at the entry point of your application
7+
```js
8+
require( 'regenerator-runtime/runtime' );
9+
// or
10+
import 'regenerator-runtime/runtime.js' ;
11+
```
12+
13+
Then, import the library where needed
14+
```js
15+
const topologicalSorting = require( '@aureooms/js-topological-sorting' ) ;
16+
// or
17+
import * as topologicalSorting from '@aureooms/js-topological-sorting' ;
18+
```

‎doc/scripts/header.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
const domReady = function (callback) {
2+
const state = document.readyState;
3+
if (state === 'interactive' || state === 'complete') {
4+
callback();
5+
} else {
6+
document.addEventListener('DOMContentLoaded', callback);
7+
}
8+
};
9+
10+
domReady(() => {
11+
const projectname = document.createElement('a');
12+
projectname.classList.add('project-name');
13+
projectname.text = 'aureooms/js-topological-sorting';
14+
projectname.href = './index.html';
15+
16+
const header = document.querySelector('header');
17+
header.insertBefore(projectname, header.firstChild);
18+
19+
const testlink = document.querySelector('header > a[data-ice="testLink"]');
20+
testlink.href = 'https://coveralls.io/github/aureooms/js-topological-sorting';
21+
testlink.target = '_BLANK';
22+
23+
const searchBox = document.querySelector('.search-box');
24+
const input = document.querySelector('.search-input');
25+
26+
// Active search box when focus on searchBox.
27+
input.addEventListener('focus', () => {
28+
searchBox.classList.add('active');
29+
});
30+
});

‎mangle.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"minify": {
3+
"mangle": {
4+
"properties": {
5+
"regex": "^_[^_]"
6+
}
7+
}
8+
},
9+
"props": {
10+
"props": {}
11+
}
12+
}

‎package.json

Lines changed: 209 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,209 @@
1+
{
2+
"name": "@aureooms/js-topological-sorting",
3+
"description": "Topological sorting for JavaScript",
4+
"version": "0.0.0",
5+
"license": "AGPL-3.0",
6+
"author": "aureooms",
7+
"homepage": "https://aureooms.github.io/js-topological-sorting",
8+
"repository": {
9+
"type": "git",
10+
"url": "https://github.com/aureooms/js-topological-sorting"
11+
},
12+
"bugs": {
13+
"url": "https://github.com/aureooms/js-topological-sorting/issues"
14+
},
15+
"keywords": [
16+
"acyclic",
17+
"algorithm",
18+
"dag",
19+
"directed",
20+
"graph",
21+
"sorting",
22+
"topological"
23+
],
24+
"sideEffects": false,
25+
"source": "src/index.js",
26+
"main": "dist/index.js",
27+
"module": "dist/index.module.js",
28+
"unpkg": "dist/index.umd.js",
29+
"exports": "./dist/index.modern.js",
30+
"files": [
31+
"dist"
32+
],
33+
"scripts": {
34+
"build": "NODE_ENV=production microbundle",
35+
"build-docs": "esdoc",
36+
"build-gh-pages": "npm run build-docs",
37+
"commit-msg": "commitlint --edit",
38+
"cover": "c8 --all --src src --reporter=lcov npm test",
39+
"debug": "NODE_ENV=debug npm run test -- -st --fail-fast",
40+
"dev": "npm run lint-config && npm run lint-and-fix && npm run cover -- -- -st --fail-fast",
41+
"install-hooks": "husky install",
42+
"lint": "xo",
43+
"lint-and-fix": "npm run lint -- --fix",
44+
"lint-config": "fixpack --dryRun",
45+
"lint-config-and-fix": "fixpack || fixpack",
46+
"postinstall": "npm run install-hooks",
47+
"postpublish": "pinst --enable",
48+
"precommit": "lint-staged",
49+
"prepare": "npm run build",
50+
"prepublishOnly": "pinst --disable",
51+
"release": "np --message ':hatching_chick: release: v%s'",
52+
"test": "ava",
53+
"travis": "npm run lint && npm run cover"
54+
},
55+
"dependencies": {},
56+
"devDependencies": {
57+
"@babel/cli": "7.13.10",
58+
"@babel/core": "7.13.10",
59+
"@babel/preset-env": "7.13.10",
60+
"@babel/register": "7.13.8",
61+
"@commitlint/cli": "12.0.1",
62+
"@js-library/commitlint-config": "0.0.3",
63+
"ava": "3.15.0",
64+
"babel-plugin-transform-remove-console": "6.9.4",
65+
"babel-plugin-unassert": "3.0.1",
66+
"babel-preset-power-assert": "3.0.0",
67+
"c8": "7.6.0",
68+
"coveralls": "3.1.0",
69+
"esdoc": "1.1.0",
70+
"esdoc-ecmascript-proposal-plugin": "1.0.0",
71+
"esdoc-inject-script-plugin": "1.0.0",
72+
"esdoc-inject-style-plugin": "1.0.0",
73+
"esdoc-standard-plugin": "1.0.0",
74+
"fixpack": "4.0.0",
75+
"husky": "5.1.3",
76+
"lint-staged": "10.5.4",
77+
"microbundle": "0.13.0",
78+
"np": "7.4.0",
79+
"pinst": "2.1.6",
80+
"power-assert": "1.6.1",
81+
"regenerator-runtime": "0.13.7",
82+
"xo": "0.38.2"
83+
},
84+
"ava": {
85+
"files": [
86+
"test/src/**/*"
87+
],
88+
"require": [
89+
"regenerator-runtime/runtime",
90+
"@babel/register"
91+
],
92+
"timeout": "1m"
93+
},
94+
"babel": {
95+
"sourceMaps": true,
96+
"presets": [
97+
[
98+
"@babel/preset-env",
99+
{
100+
"targets": [
101+
"defaults",
102+
"maintained node versions"
103+
]
104+
}
105+
]
106+
],
107+
"env": {
108+
"debug": {
109+
"presets": [
110+
[
111+
"@babel/preset-env",
112+
{
113+
"targets": "current node"
114+
}
115+
],
116+
"babel-preset-power-assert"
117+
]
118+
},
119+
"test": {
120+
"presets": [
121+
[
122+
"@babel/preset-env",
123+
{
124+
"targets": "current node"
125+
}
126+
],
127+
"babel-preset-power-assert"
128+
],
129+
"plugins": [
130+
[
131+
"transform-remove-console",
132+
{
133+
"exclude": [
134+
"log",
135+
"error",
136+
"warn"
137+
]
138+
}
139+
]
140+
]
141+
},
142+
"development": {
143+
"presets": [
144+
"babel-preset-power-assert"
145+
],
146+
"plugins": [
147+
[
148+
"transform-remove-console",
149+
{
150+
"exclude": [
151+
"log",
152+
"error",
153+
"warn"
154+
]
155+
}
156+
]
157+
]
158+
},
159+
"production": {
160+
"plugins": [
161+
"babel-plugin-unassert",
162+
[
163+
"transform-remove-console",
164+
{
165+
"exclude": [
166+
"log",
167+
"error",
168+
"warn"
169+
]
170+
}
171+
]
172+
]
173+
}
174+
}
175+
},
176+
"lint-staged": {
177+
"*.js": [
178+
"npm run lint-and-fix"
179+
],
180+
"package.json": [
181+
"npm run lint-config-and-fix"
182+
]
183+
},
184+
"prettier": {
185+
"trailingComma": "all"
186+
},
187+
"xo": {
188+
"prettier": true,
189+
"plugins": [
190+
"unicorn"
191+
],
192+
"rules": {
193+
"unicorn/filename-case": [
194+
"error",
195+
{
196+
"case": "camelCase"
197+
}
198+
]
199+
},
200+
"overrides": [
201+
{
202+
"files": [
203+
"doc/**"
204+
],
205+
"env": "browser"
206+
}
207+
]
208+
}
209+
}

‎renovate.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"extends": [
3+
"github>aureooms/renovate-config-js-library"
4+
]
5+
}

‎src/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
const answer = 42;
2+
export default answer;

‎test/src/api.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import test from 'ava';
2+
3+
test('API', (t) => {
4+
t.fail();
5+
});

‎tsconfig.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"$schema": "https://json.schemastore.org/tsconfig",
3+
"compilerOptions": {
4+
"allowJs": true,
5+
"emitDeclarationOnly": true,
6+
"declaration": true,
7+
"outDir": "types",
8+
"checkJs": true,
9+
"target": "es2020",
10+
"module": "es2020",
11+
"moduleResolution": "node",
12+
"allowSyntheticDefaultImports": true
13+
},
14+
"include": [
15+
"src/**/*"
16+
]
17+
}

0 commit comments

Comments
 (0)
Please sign in to comment.