-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(config): add initial project configuration files
- Added ESLint configuration (.eslintrc.json) to enforce coding standards - Environment setup for ES2021 and Node.js - Extended recommended ESLint and TypeScript configurations - Disabled '@typescript-eslint/no-explicit-any' rule - Ignored 'node_modules' and 'backup' directories - Introduced auto-assign configuration (.github/auto-assign.yaml) for pull requests - Enabled auto-assigning of reviewers and assignees - Configured 'tsdevau' as the default reviewer - Set 0 as the number of reviewers to add all reviewers by default - Set up GitHub Actions workflow for auto-assign (.github/workflows/auto-assign.yaml) - Triggered on issue and pull request events - Utilized 'kentaro-m/[email protected]' for automatic assignment - Configured release-please GitHub Actions workflow (.github/workflows/release-please.yaml) - Triggered on push events to the 'main' branch - Used 'google-github-actions/release-please-action@v4' to manage releases - Added .gitignore file to exclude unnecessary files and directories - Included patterns for Node.js, macOS, Dropbox, Synology, and Visual Studio Code - Added Prettier configuration (.prettierrc.cjs) for code formatting - Used 'prettier-plugin-packagejson' plugin - Set print width to 100 and disabled semicolons - Configured single attribute per line formatting - Introduced release-please configuration (.release-please-config.json) for managing releases - Defined package name as '@tpstech/ecowitt-api' - Configured commit message and pull request title patterns - Customized changelog sections for different commit types - Created release-please manifest (.release-please-manifest.json) to track the current version - Added build script (build.mjs) using esbuild for bundling the project - Configured entry point, bundling, minification, and output directory - Set up Drizzle ORM configuration (drizzle.config.ts) for database schema management - Configured PostgreSQL dialect and database credentials - Defined schema and output paths - Added package.json with project metadata and dependencies - Included dependencies: axios, axios-retry, dotenv, drizzle-orm, postgres, zod - Included devDependencies: @typescript-eslint/eslint-plugin, @typescript-eslint/parser, drizzle-kit, eslint, prettier, prettier-plugin-packagejson, typescript, vitest - Defined scripts for building, formatting, linting, and testing - Defined application settings (src/appSettings.ts) with retry and polling intervals - Created database schema (src/dbSchema.ts) using Drizzle ORM - Defined tables for outdoor, indoor, solarUvi, rainfallPiezo, wind, pressure, lightning, soilCh1, tempHumidityCh1, and various metrics - Added main entry point (src/main.ts) to start the polling process - Loaded environment variables and initiated request polling - Implemented request polling functionality (src/requestPolling.ts) with axios and axios-retry - Handled periodic polling of the specified URL with retry logic - Configured TypeScript compiler options (tsconfig.json) - Set up base URL, module resolution, and output directory - Included types for Vitest testing framework - Applied strict type checking and other compiler settings This commit introduces the initial project setup with essential configurations, scripts, and source code for building, linting, formatting, and running the application.
- Loading branch information
0 parents
commit 905e1b8
Showing
17 changed files
with
3,714 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"env": { | ||
"es2021": true, | ||
"node": true | ||
}, | ||
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"], | ||
"overrides": [ | ||
{ | ||
"env": { | ||
"node": true | ||
}, | ||
"files": [".eslintrc.{js,cjs}"], | ||
"parserOptions": { | ||
"sourceType": "script" | ||
} | ||
} | ||
], | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"ecmaVersion": "latest", | ||
"sourceType": "module" | ||
}, | ||
"plugins": ["@typescript-eslint"], | ||
"rules": { | ||
"@typescript-eslint/no-explicit-any": "off" | ||
}, | ||
"ignorePatterns": ["node_modules", "backup"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Set to true to add reviewers to pull requests | ||
addReviewers: true | ||
|
||
# Set to true to add assignees to pull requests | ||
addAssignees: true | ||
|
||
# A list of reviewers to be added to pull requests (GitHub user name) | ||
reviewers: | ||
- tsdevau | ||
|
||
# A number of reviewers added to the pull request | ||
# Set 0 to add all the reviewers (default: 0) | ||
numberOfReviewers: 0 | ||
# A list of assignees, overrides reviewers if set | ||
# assignees: | ||
# - tsdevau | ||
|
||
# A number of assignees to add to the pull request | ||
# Set to 0 to add all of the assignees. | ||
# Uses numberOfReviewers if unset. | ||
# numberOfAssignees: 2 | ||
|
||
# A list of keywords to be skipped the process that add reviewers if pull requests include it | ||
# skipKeywords: | ||
# - wip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
on: | ||
issues: | ||
types: [opened, reopened, unassigned] | ||
pull_request: | ||
types: [opened, reopened, unassigned, ready_for_review, review_requested] | ||
|
||
name: Auto Assign | ||
|
||
jobs: | ||
add-reviews: | ||
name: Assign Assignee and Reviewers | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: kentaro-m/[email protected] | ||
with: | ||
configuration-path: .github/auto-assign.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
name: release-please | ||
|
||
jobs: | ||
release-please: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: google-github-actions/release-please-action@v4 | ||
with: | ||
config-file: ".release-please-config.json" | ||
token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,210 @@ | ||
# Created by https://www.toptal.com/developers/gitignore/api/node,macos,dropbox,synology,visualstudiocode | ||
# Edit at https://www.toptal.com/developers/gitignore?templates=node,macos,dropbox,synology,visualstudiocode | ||
|
||
### Additional ### | ||
drizzle | ||
|
||
### Dropbox ### | ||
# Dropbox settings and caches | ||
.dropbox | ||
.dropbox.attr | ||
.dropbox.cache | ||
|
||
### macOS ### | ||
# General | ||
.DS_Store | ||
.AppleDouble | ||
.LSOverride | ||
|
||
# Icon must end with two \r | ||
Icon | ||
|
||
# Thumbnails | ||
._* | ||
|
||
# Files that might appear in the root of a volume | ||
.DocumentRevisions-V100 | ||
.fseventsd | ||
.Spotlight-V100 | ||
.TemporaryItems | ||
.Trashes | ||
.VolumeIcon.icns | ||
.com.apple.timemachine.donotpresent | ||
|
||
# Directories potentially created on remote AFP share | ||
.AppleDB | ||
.AppleDesktop | ||
Network Trash Folder | ||
Temporary Items | ||
.apdisk | ||
|
||
### macOS Patch ### | ||
# iCloud generated files | ||
*.icloud | ||
|
||
### Node ### | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
lerna-debug.log* | ||
.pnpm-debug.log* | ||
|
||
# Diagnostic reports (https://nodejs.org/api/report.html) | ||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
*.lcov | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Bower dependency directory (https://bower.io/) | ||
bower_components | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (https://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules/ | ||
jspm_packages/ | ||
|
||
# Snowpack dependency directory (https://snowpack.dev/) | ||
web_modules/ | ||
|
||
# TypeScript cache | ||
*.tsbuildinfo | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Optional stylelint cache | ||
.stylelintcache | ||
|
||
# Microbundle cache | ||
.rpt2_cache/ | ||
.rts2_cache_cjs/ | ||
.rts2_cache_es/ | ||
.rts2_cache_umd/ | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variable files | ||
.env | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
.env.local | ||
|
||
# parcel-bundler cache (https://parceljs.org/) | ||
.cache | ||
.parcel-cache | ||
|
||
# Next.js build output | ||
.next | ||
out | ||
|
||
# Nuxt.js build / generate output | ||
.nuxt | ||
dist | ||
|
||
# Gatsby files | ||
.cache/ | ||
# Comment in the public line in if your project uses Gatsby and not Next.js | ||
# https://nextjs.org/blog/next-9-1#public-directory-support | ||
# public | ||
|
||
# vuepress build output | ||
.vuepress/dist | ||
|
||
# vuepress v2.x temp and cache directory | ||
.temp | ||
|
||
# Docusaurus cache and generated files | ||
.docusaurus | ||
|
||
# Serverless directories | ||
.serverless/ | ||
|
||
# FuseBox cache | ||
.fusebox/ | ||
|
||
# DynamoDB Local files | ||
.dynamodb/ | ||
|
||
# TernJS port file | ||
.tern-port | ||
|
||
# Stores VSCode versions used for testing VSCode extensions | ||
.vscode-test | ||
|
||
# yarn v2 | ||
.yarn/cache | ||
.yarn/unplugged | ||
.yarn/build-state.yml | ||
.yarn/install-state.gz | ||
.pnp.* | ||
|
||
### Node Patch ### | ||
# Serverless Webpack directories | ||
.webpack/ | ||
|
||
# Optional stylelint cache | ||
|
||
# SvelteKit build / generate output | ||
.svelte-kit | ||
|
||
### Synology ### | ||
# Thumbnails | ||
@eaDir | ||
# Recycle bin | ||
\#recycle | ||
|
||
### VisualStudioCode ### | ||
.vscode/* | ||
!.vscode/settings.json | ||
!.vscode/tasks.json | ||
!.vscode/launch.json | ||
!.vscode/extensions.json | ||
!.vscode/*.code-snippets | ||
|
||
# Local History for Visual Studio Code | ||
.history/ | ||
|
||
# Built Visual Studio Code Extensions | ||
*.vsix | ||
|
||
### VisualStudioCode Patch ### | ||
# Ignore all local history of files | ||
.history | ||
.ionide | ||
|
||
# End of https://www.toptal.com/developers/gitignore/api/node,macos,dropbox,synology,visualstudiocode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/** @type {import("prettier").Config} */ | ||
const config = { | ||
plugins: ["prettier-plugin-packagejson"], | ||
printWidth: 100, | ||
semi: false, | ||
singleAttributePerLine: true, | ||
} | ||
|
||
module.exports = config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"package-name": "@tpstech/ecowitt-api", | ||
"release-commit-message-pattern": "build(${scope}): 🔖 Release ${component} v${version}", | ||
"pull-request-title-pattern": "build(${scope}): 🔖 Release ${component} v${version}", | ||
"pull-request-header": ":robot: PR by release-please bot", | ||
"changelog-sections": [ | ||
{ "type": "feat", "section": "Features & Performance Improvements" }, | ||
{ "type": "perf", "section": "Features & Performance Improvements" }, | ||
{ "type": "fix", "section": "Bug Fixes" }, | ||
{ "type": "revert", "section": "Work in Progress" }, | ||
{ "type": "wip", "section": "Work in Progress" }, | ||
{ "type": "docs", "section": "Documentation" }, | ||
{ "type": "refactor", "section": "DX Improvements" }, | ||
{ "type": "style", "section": "DX Improvements" }, | ||
{ "type": "chore", "section": "DX Maintenance & Configuration" }, | ||
{ "type": "build", "section": "DX Maintenance & Configuration" }, | ||
{ "type": "test", "section": "DX Testing" }, | ||
{ "type": "ci", "section": "DX Continuous Integrations" } | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
".": "0.0.1" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import * as esbuild from "esbuild" | ||
|
||
await esbuild.build({ | ||
entryPoints: ["src/main.ts"], | ||
bundle: true, | ||
minify: true, | ||
legalComments: "none", | ||
platform: "node", | ||
target: "node20", | ||
external: [], | ||
format: "esm", | ||
outdir: "build", | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { config } from "dotenv" | ||
import type { Config } from "drizzle-kit" | ||
config() | ||
|
||
export default { | ||
dialect: "postgresql", | ||
dbCredentials: { url: process.env.WEATHER_DB_URL as string }, | ||
schema: "./src/dbSchema.ts", | ||
out: "./drizzle", | ||
} satisfies Config |
Oops, something went wrong.