Skip to content

Commit 9f87d8b

Browse files
committed
Initial commit
0 parents  commit 9f87d8b

23 files changed

+2430
-0
lines changed

.devcontainer/Dockerfile

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM node:18-alpine
2+
RUN apk add --no-cache \
3+
git \
4+
openssh \
5+
ripgrep

.devcontainer/devcontainer.json

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"name": "eol-rules",
3+
4+
"build": {
5+
"dockerfile": "./Dockerfile",
6+
"context": "."
7+
},
8+
9+
"customizations": {
10+
"vscode": {
11+
"extensions": [
12+
"dbaeumer.vscode-eslint",
13+
"esbenp.prettier-vscode",
14+
"redhat.vscode-yaml"
15+
]
16+
}
17+
},
18+
19+
"postStartCommand": "npm ci",
20+
21+
"remoteUser": "node"
22+
}

.github/workflows/main.yml

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Validate, build and deploy
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
check:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v3
10+
- uses: actions/setup-node@v3
11+
with:
12+
node-version: 18
13+
cache: npm
14+
- run: npm ci
15+
- run: npm run lint
16+
- run: npm run typecheck
17+
- run: npm run validate
18+
build:
19+
if: github.ref == 'refs/heads/main'
20+
needs: check
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v3
24+
- uses: actions/setup-node@v3
25+
with:
26+
node-version: 18
27+
cache: npm
28+
- run: npm ci
29+
- run: |
30+
mkdir pages
31+
npm -s run collect > pages/eol-rules.json
32+
- uses: actions/upload-pages-artifact@v1
33+
with:
34+
path: pages
35+
deploy:
36+
if: github.ref == 'refs/heads/main'
37+
needs: build
38+
permissions:
39+
pages: write
40+
id-token: write
41+
environment:
42+
name: github-pages
43+
url: ${{ steps.deployment.outputs.page_url }}
44+
runs-on: ubuntu-latest
45+
steps:
46+
- name: Deploy to GitHub Pages
47+
id: deployment
48+
uses: actions/deploy-pages@v1

.gitignore

+104
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
lerna-debug.log*
8+
9+
# Diagnostic reports (https://nodejs.org/api/report.html)
10+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
11+
12+
# Runtime data
13+
pids
14+
*.pid
15+
*.seed
16+
*.pid.lock
17+
18+
# Directory for instrumented libs generated by jscoverage/JSCover
19+
lib-cov
20+
21+
# Coverage directory used by tools like istanbul
22+
coverage
23+
*.lcov
24+
25+
# nyc test coverage
26+
.nyc_output
27+
28+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
29+
.grunt
30+
31+
# Bower dependency directory (https://bower.io/)
32+
bower_components
33+
34+
# node-waf configuration
35+
.lock-wscript
36+
37+
# Compiled binary addons (https://nodejs.org/api/addons.html)
38+
build/Release
39+
40+
# Dependency directories
41+
node_modules/
42+
jspm_packages/
43+
44+
# TypeScript v1 declaration files
45+
typings/
46+
47+
# TypeScript cache
48+
*.tsbuildinfo
49+
50+
# Optional npm cache directory
51+
.npm
52+
53+
# Optional eslint cache
54+
.eslintcache
55+
56+
# Microbundle cache
57+
.rpt2_cache/
58+
.rts2_cache_cjs/
59+
.rts2_cache_es/
60+
.rts2_cache_umd/
61+
62+
# Optional REPL history
63+
.node_repl_history
64+
65+
# Output of 'npm pack'
66+
*.tgz
67+
68+
# Yarn Integrity file
69+
.yarn-integrity
70+
71+
# dotenv environment variables file
72+
.env
73+
.env.test
74+
75+
# parcel-bundler cache (https://parceljs.org/)
76+
.cache
77+
78+
# Next.js build output
79+
.next
80+
81+
# Nuxt.js build / generate output
82+
.nuxt
83+
dist
84+
85+
# Gatsby files
86+
.cache/
87+
# Comment in the public line in if your project uses Gatsby and *not* Next.js
88+
# https://nextjs.org/blog/next-9-1#public-directory-support
89+
# public
90+
91+
# vuepress build output
92+
.vuepress/dist
93+
94+
# Serverless directories
95+
.serverless/
96+
97+
# FuseBox cache
98+
.fusebox/
99+
100+
# DynamoDB Local files
101+
.dynamodb/
102+
103+
# TernJS port file
104+
.tern-port

.vscode/settings.json

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"editor.formatOnSave": true,
3+
"eslint.format.enable": true,
4+
"eslint.validate": ["javascript", "typescript"],
5+
"explorer.excludeGitIgnore": true,
6+
"yaml.format.enable": false,
7+
"yaml.validate": true,
8+
"yaml.schemas": {
9+
"./schema/target.schema.json": "/targets/*.yaml"
10+
},
11+
"[json][jsonc][yaml]": {
12+
"editor.defaultFormatter": "esbenp.prettier-vscode"
13+
},
14+
"[javascript][typescript]": {
15+
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
16+
}
17+
}

README.md

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# EOL Rule Database [![Validate, build and deploy](https://github.com/badrap/eol-rules/actions/workflows/main.yml/badge.svg)](https://github.com/badrap/eol-rules/actions/workflows/main.yml)
2+
3+
The collected rules are published to GitHub pages on every push to the `main` branch:
4+
5+
- https://badrap.github.io/eol-rules/rules.json - A JSON collection of rules.
6+
7+
## Getting Started
8+
9+
This repository has a Dev Container setup that can be used with Visual Studio Code. Refer to the article ["Developing inside a Container"](https://code.visualstudio.com/docs/devcontainers/containers) to get started.
10+
11+
## Structure
12+
13+
Each target has their own .yaml file under the the [./targets](./targets) directory. The target's canonical identifier (_"target ID"_) is derived from the filename by removing the .yaml suffix.
14+
15+
A valid target ID follows these rules:
16+
17+
- It must have 1-32 characters.
18+
- It must contain only hyphens and lowercase alphanumerics.
19+
- It must start and end with an alphanumeric.
20+
- It must not contain two consecutive hyphens.
21+
22+
## Target file validation
23+
24+
Target files are validated on every push by GitHub Actions. You can also run validation locally with the following command:
25+
26+
```sh
27+
npm run validate
28+
```
29+
30+
The validation uses the [./schema/target.schema.json](./schema/target.schema.json) file to check the basic structure of each target YAML file.

0 commit comments

Comments
 (0)