diff --git a/.eslintrc.yml b/.eslintrc.yml new file mode 100644 index 0000000..9cf110b --- /dev/null +++ b/.eslintrc.yml @@ -0,0 +1,11 @@ +root: true +extends: + - "eslint:recommended" + - "plugin:@typescript-eslint/eslint-recommended" + - "plugin:@typescript-eslint/recommended" + - "prettier" +parser: "@typescript-eslint/parser" +plugins: + - "@typescript-eslint" +parserOptions: + ecmaVersion: "latest" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..e20c4ae --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,20 @@ +name: main +on: [push] + +jobs: + check-pre-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: 3.x + - uses: actions/setup-node@v3 + with: + node-version: 18 + - run: python -m pip install pre-commit + - uses: actions/cache@v3 + with: + path: ~/.cache/pre-commit + key: pre-commit|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }} + - run: pre-commit run --show-diff-on-failure --color=always --all-files diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..3b40507 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,20 @@ +# See https://pre-commit.com for more information +# See https://pre-commit.com/hooks.html for more hooks +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v3.2.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + - id: check-added-large-files + + - repo: https://github.com/pre-commit/mirrors-prettier + rev: "v2.7.1" + hooks: + - id: prettier + + - repo: https://github.com/pre-commit/mirrors-eslint + rev: "v8.23.0" + hooks: + - id: eslint diff --git a/.prettierrc.yml b/.prettierrc.yml new file mode 100644 index 0000000..f6acb5c --- /dev/null +++ b/.prettierrc.yml @@ -0,0 +1,3 @@ +printWidth: 110 +tabWidth: 4 +singleQuote: false diff --git a/package.json b/package.json new file mode 100644 index 0000000..96529ee --- /dev/null +++ b/package.json @@ -0,0 +1,34 @@ +{ + "name": "vite-plugin-runtime-config", + "version": "1.0.0-dev1", + "description": "A vite plugin for runtime configuration", + "main": "dist/index.js", + "files": [ + "dist", + "src" + ], + "scripts": { + "lint": "npm run lint:eslint && npm run lint:prettier", + "lint:eslint": "eslint src/", + "lint:prettier": "prettier --check src/", + "format": "prettier --write src/", + "build": "tsc --build" + }, + "author": { + "name": "Viva con Agua", + "email": "it@vivaconagua.org", + "url": "https://github.com/Viva-con-Agua/" + }, + "maintainers": [ + "Finn-Thorben Sell " + ], + "license": "MIT", + "devDependencies": { + "@typescript-eslint/eslint-plugin": "^5.36.1", + "@typescript-eslint/parser": "^5.36.1", + "eslint": "^8.23.0", + "eslint-config-prettier": "^8.5.0", + "prettier": "^2.7.1", + "typescript": "^4.8.2" + } +} diff --git a/src/main.ts b/src/main.ts new file mode 100644 index 0000000..7b54d0f --- /dev/null +++ b/src/main.ts @@ -0,0 +1,4 @@ +export function VitePluginRuntimeConfig() { + throw new Error("Not Implemented"); +} +export default VitePluginRuntimeConfig; diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..9cea6f4 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,11 @@ +{ + "include": ["src/"], + "compilerOptions": { + "baseUrl": ".", + "outDir": "dist/", + "declaration": true, + "paths": { + "@/*": ["./src/*"] + } + } +}