Skip to content

Checkstyle #61

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: cd

on:
push:
branches: [main]

jobs:
Deploy:
name: Deploy
runs-on: ubuntu-latest

steps:
# Check out the code from the repository prebuilt action
- name: Check out code
uses: actions/checkout@v4

- name: Set up Node
# Set up Node.js environment
uses: actions/setup-node@v4
with:
node-version: 18

- name: Install dependencies
run: npm ci

- name: Build project
run: npm run build
52 changes: 52 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: ci

on:
pull_request:
branches: [main]

jobs:
tests:
name: Tests
runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@v4

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 18

- name: Install dependencies
run: npm ci

- name: Run tests
run: npm run test -- --coverage

style:
name: Style
runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@v4

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 18

- name: Install dependencies
run: npm ci

- name: Run style check
run: npm run format:check

- name: Run style fix
run: npm run format:write

- name: Run linter
run: npm run lint -- --max-warnings=0


10 changes: 5 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
node_modules/
coverage/
dist/
.env
.vscode
node_modules/
coverage/
dist/
.env
.vscode
22 changes: 11 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM --platform=linux/amd64 node:18-slim

WORKDIR /usr/src/app

ADD . .

RUN npm ci

RUN npm run build

CMD ["node", "dist/main.js"]
FROM --platform=linux/amd64 node:18-slim
WORKDIR /usr/src/app
ADD . .
RUN npm ci
RUN npm run build
CMD ["node", "dist/main.js"]
53 changes: 29 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,29 @@
# learn-cicd-typescript-starter (Notely)

This repo contains the typescript starter code for the "Notely" application for the "Learn CICD" course on [Boot.dev](https://boot.dev).

## Local Development

Make sure you're on Node version 18+.

Create a `.env` file in the root of the project with the following contents:

```bash
PORT="8080"
```

Run the server:

```bash
npm install
npm run dev
```

_This starts the server in non-database mode._ It will serve a simple webpage at `http://localhost:8080`.

You do _not_ need to set up a database or any interactivity on the webpage yet. Instructions for that will come later in the course!
![Test Result](https://github.com/sudhanshubsr/learn-cicd-typescript-starter/actions/workflows/ci.yml/badge.svg)

# learn-cicd-typescript-starter (Notely)

This repo contains the typescript starter code for the "Notely" application for the "Learn CICD" course on [Boot.dev](https://boot.dev).

## Local Development

Make sure you're on Node version 18+.

Create a `.env` file in the root of the project with the following contents:

```bash
PORT="8080"
```

Run the server:

```bash
npm install
npm run dev
```

_This starts the server in non-database mode._ It will serve a simple webpage at `http://localhost:8080`.

You do _not_ need to set up a database or any interactivity on the webpage yet. Instructions for that will come later in the course!

Sudhanshu's Version of Notely App

24 changes: 12 additions & 12 deletions drizzle.config.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { defineConfig } from "drizzle-kit";

import { config } from "./src/config";

export default defineConfig({
out: "./src/db/migrations",
schema: "./src/db/schema.ts",
dialect: "turso",
dbCredentials: {
url: config.db.url || "",
},
});
import { defineConfig } from "drizzle-kit";
import { config } from "./src/config";
export default defineConfig({
out: "./src/db/migrations",
schema: "./src/db/schema.ts",
dialect: "turso",
dbCredentials: {
url: config.db.url || "",
},
});
31 changes: 31 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { default as js, default as pluginJs } from "@eslint/js";
import pluginReact from "eslint-plugin-react";
import pluginSecurity from "eslint-plugin-security";
import { defineConfig } from "eslint/config";
import globals from "globals";
import tseslint from "typescript-eslint";

export default defineConfig([
{
files: ["**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"],
plugins: { js },
extends: ["js/recommended"],
},
{
files: ["**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"],
languageOptions: { globals: globals.browser },
},
{
// ✅ This block sets the React version for eslint-plugin-react
settings: {
react: {
version: "detect",
},
},
},
tseslint.configs.recommended,
pluginReact.configs.flat.recommended,
pluginJs.configs.recommended,
...tseslint.configs.recommended,
pluginSecurity.configs.recommended,
]);
Loading