Skip to content

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
e-adrien committed Nov 29, 2024
0 parents commit f9cac4d
Show file tree
Hide file tree
Showing 26 changed files with 1,336 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
root = true

[*]
indent_style = tab
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = false

[*.yml]
indent_style = space
indent_size = 2

[.whitesource]
indent_style = space
indent_size = 2

[*.{js,ts,cjs,mjs}]
indent_style = space
indent_size = 2
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
24 changes: 24 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"extends": ["config:recommended", ":semanticCommits"],
"timezone": "Europe/Paris",
"schedule": ["before 4:00 am on the first day of the month"],
"rangeStrategy": "bump",
"packageRules": [
{
"matchDatasources": ["npm"],
"minimumReleaseAge": "3 days"
},
{
"matchDatasources": ["npm"],
"matchPackageNames": ["*"],
"matchUpdateTypes": ["minor", "patch"],
"groupName": "all non-major dependencies",
"groupSlug": "all-minor-patch",
"automerge": true,
"automergeType": "pr",
"automergeStrategy": "squash"
}
],
"ignoreDeps": [],
"ignorePaths": []
}
70 changes: 70 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [main]
pull_request:
# The branches below must be a subset of the branches above
branches: [main]
schedule:
- cron: "20 18 * * 0"

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: ["javascript"]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://git.io/codeql-language-support

steps:
- name: Checkout repository
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
35 changes: 35 additions & 0 deletions .github/workflows/quality-control.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: QC Checks

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
checks:
name: QC Checks
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Use Node.js 22
uses: actions/setup-node@v4
with:
node-version: "22"

- name: Install
run: npm install

- name: ESLint checks
run: npm run eslint-check

- name: Prettier checks
run: npm run prettier-check

- name: TSC checks
run: npm run tsc-check

- name: Build JS
run: npm run build
19 changes: 19 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Generated files
lib

# Yarn lockfile
yarn.lock

# Yarn & node.js dependencies
node_modules/
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# Configuration & Tests folders
config
texts
5 changes: 5 additions & 0 deletions .mocharc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"extension": ["ts"],
"spec": "tests/**/*.spec.ts",
"require": ["ts-node/register", "tests/fixtures.ts"]
}
11 changes: 11 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.github
.vscode
.yarn
node_modules
.editorconfig
eslint.config.mjs
.gitattributes
.yarnrc.yml
tsconfig.build.json
tsconfig.json
.whitesource
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
8 changes: 8 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Generated files
lib

# Yarn & node.js dependencies
package.json
node_modules/
.pnp.*
.yarn/*
17 changes: 17 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Tests",
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/mocha",
"runtimeArgs": [],
"outputCapture": "std",
"skipFiles": ["<node_internals>/**/*.js"]
}
]
}
41 changes: 41 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"search.exclude": {
"**/.git/**": true,
"**/node_modules/**": true,
"**/.yarn/**": true,
"**/lib/**": true
},
"files.exclude": {
"**/.git/**": true,
"**/node_modules/**": true,
"**/.yarn/**": true,
"**/lib/**": true
},
"files.watcherExclude": {
"**/.git/**": true,
"**/node_modules/**": true,
"**/.yarn/**": true,
"**/lib/**": true
},
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
"source.fixAll": "explicit",
"source.organizeImports": "explicit"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"eslint.enable": true,
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact"
],
"prettier.configPath": "prettier.config.mjs",
"prettier.ignorePath": ".prettierignore"
}
21 changes: 21 additions & 0 deletions .whitesource
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"scanSettings": {
"configMode": "AUTO",
"enableLicenseViolations": false,
"baseBranches": []
},
"checkRunSettings": {
"vulnerableCheckRunConclusionLevel": "failure",
"displayMode": "diff",
"useMendCheckNames": true
},
"issueSettings": {
"minSeverityLevel": "LOW",
"issueType": "DEPENDENCY"
},
"remediateSettings": {
"workflowRules": {
"enabled": true
}
}
}
7 changes: 7 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
compressionLevel: mixed

enableGlobalCache: true

enableScripts: true

nodeLinker: node-modules
47 changes: 47 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import eslint from "@eslint/js";
import prettierConfig from "eslint-config-prettier";
import globals from "globals";
import tseslint from "typescript-eslint";

export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommended,
{
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
ecmaVersion: 2022,
globals: {
...globals.es2022,
...globals.node,
},
},
},
},
prettierConfig,
{
ignores: [
"package.json",
"eslint.config.mjs",
"prettier.config.mjs",
"node_modules/*",
".yarn/*",
"lib/*",
],
},
{
files: ["**/*.ts"],
rules: {
"@typescript-eslint/no-unused-vars": [
"error",
{
args: "all",
argsIgnorePattern: "^_",
caughtErrors: "all",
caughtErrorsIgnorePattern: "^_",
},
],
},
}
);
7 changes: 7 additions & 0 deletions license
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Copyright 2021 Les Jours SAS

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.
Loading

0 comments on commit f9cac4d

Please sign in to comment.