chore: Initial commit - setup tooling

wip-related-pages
sebastien.arod@gmail.com 2024-06-02 14:34:08 +02:00
commit 3315a45326
18 changed files with 5084 additions and 0 deletions

10
.editorconfig Normal file
View File

@ -0,0 +1,10 @@
root = true
[*]
end_of_line = lf
insert_final_newline = true
[*.{js,json,yml}]
charset = utf-8
indent_style = space
indent_size = 2

4
.gitattributes vendored Normal file
View File

@ -0,0 +1,4 @@
/.yarn/** linguist-vendored
/.yarn/releases/* binary
/.yarn/plugins/**/* binary
/.pnp.* binary linguist-generated

18
.gitignore vendored Normal file
View File

@ -0,0 +1,18 @@
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
# Swap the comments on the following lines if you wish to use zero-installs
# In that case, don't forget to run `yarn config set enableGlobalCache false`!
# Documentation here: https://yarnpkg.com/features/caching#zero-installs
#!.yarn/cache
.pnp.*
.env
dist
test-coverage
node_modules

1
.husky/pre-commit Normal file
View File

@ -0,0 +1 @@
yarn lint-staged

4
.lintstagedrc Normal file
View File

@ -0,0 +1,4 @@
{
"*.{js,jsx,ts,tsx}": ["prettier --write", "eslint --fix", "eslint"],
"*.{json,css,md}": ["prettier --write"]
}

4
.prettierignore Normal file
View File

@ -0,0 +1,4 @@
.yarn
yarn.lock
.husky
.prettierignore

7
.vscode/extensions.json vendored Normal file
View File

@ -0,0 +1,7 @@
{
"recommendations": [
"arcanis.vscode-zipfs",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode"
]
}

7
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,7 @@
{
// 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": []
}

6
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,6 @@
{
"search.exclude": {
"**/.yarn": true,
"**/.pnp.*": true
}
}

1
.yarnrc.yml Normal file
View File

@ -0,0 +1 @@
nodeLinker: node-modules

9
README.md Normal file
View File

@ -0,0 +1,9 @@
# Statistiques
# Setup
- Configure a .env defining the NOTION_TOKEN variable
- Run
`yarn install
yarn run update-stats
`

14
eslint.config.mjs Normal file
View File

@ -0,0 +1,14 @@
import pluginJs from "@eslint/js";
import prettier from "eslint-config-prettier";
import globals from "globals";
import tseslint from "typescript-eslint";
export default [
{ languageOptions: { globals: globals.browser } },
pluginJs.configs.recommended,
...tseslint.configs.recommended,
prettier,
{
ignores: [".yarn/*"],
},
];

15
jest.config.ts Normal file
View File

@ -0,0 +1,15 @@
import type { Config } from "jest";
const config: Config = {
collectCoverage: true,
coverageDirectory: "../test-coverage",
coverageProvider: "v8",
preset: "ts-jest/presets/default-esm",
testEnvironment: "jest-environment-node",
transform: {
"^.+\\.m?[t]s?$": ["ts-jest", { useESM: true }],
},
rootDir: "src",
};
export default config;

28
package.json Normal file
View File

@ -0,0 +1,28 @@
{
"name": "statistiques",
"packageManager": "yarn@4.2.2",
"dependencies": {
"@notionhq/client": "^2.2.14",
"date-fns": "^3.6.0"
},
"devDependencies": {
"@eslint/js": "^9.3.0",
"@jest/globals": "^29.7.0",
"@types/node": "^20.12.12",
"eslint": "9.x",
"eslint-config-prettier": "^9.1.0",
"globals": "^15.3.0",
"husky": "^9.0.11",
"jest": "^29.7.0",
"lint-staged": "^15.2.5",
"prettier": "^2.8.4",
"ts-jest": "^29.1.4",
"ts-node": "^10.9.2",
"typescript": "^5.4.5",
"typescript-eslint": "^7.11.0"
},
"scripts": {
"start": "node -r ts-node/register --env-file=.env src/index.ts",
"test": "jest"
}
}

8
src/index.test.ts Normal file
View File

@ -0,0 +1,8 @@
import { describe, expect, test } from "@jest/globals";
import { hello } from ".";
describe("module", () => {
test("test hello", () => {
expect(hello()).toBe("hello");
});
});

3
src/index.ts Normal file
View File

@ -0,0 +1,3 @@
export function hello() {
return "hello";
}

17
tsconfig.json Normal file
View File

@ -0,0 +1,17 @@
{
"compilerOptions": {
"target": "ES2022",
"lib": ["ES2022"],
"module": "Node16",
"moduleResolution": "Node16",
"rootDir": "src",
"outDir": "dist",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true,
"allowSyntheticDefaultImports": true
},
"include": ["src/**/*"],
"exclude": ["node_modules"]
}

4928
yarn.lock Normal file

File diff suppressed because it is too large Load Diff