Skip to content

Commit

Permalink
Merge pull request #14 from Glowstudent777/CoreSubmodule
Browse files Browse the repository at this point in the history
Core submodule
  • Loading branch information
Glowstudent777 authored Jan 1, 2025
2 parents e703e12 + 3ef7de2 commit 0b8a6ef
Show file tree
Hide file tree
Showing 23 changed files with 2,261 additions and 1,632 deletions.
5 changes: 0 additions & 5 deletions .babelrc

This file was deleted.

5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
.git
.gitignore
*.md
dist
34 changes: 21 additions & 13 deletions .github/workflows/assignIssues.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
name: Assign Issues
name: Tests

on:
issues:
types: [opened]
push:
branches: [main]
pull_request:
branches: [main]

jobs:
auto-assign:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: 'Auto-assign issue'
uses: pozil/auto-assign-issue@v2
with:
assignees: Glowstudent777
allowSelfAssign: false
tests:
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
submodules: true

- name: Set up Node
uses: actions/setup-node@v3

- name: Install dependencies
run: npm install

- run: npm run test
27 changes: 18 additions & 9 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
name: Publish Docker
on: [push]

on:
release:
types: [created]
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: glowstudent/youversion-api
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
default_branch: main
- name: Checkout repo
uses: actions/checkout@v3
with:
submodules: true

- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: glowstudent/youversion-api
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
default_branch: main
30 changes: 25 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,42 @@ name: Tests

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

jobs:
tests:
function-tests:
runs-on: ubuntu-latest

steps:
- name : Checkout repo
- name: Checkout repo
uses: actions/checkout@v2
with:
submodules: true

- name: Set up Node
uses: actions/setup-node@v3

- name: Install dependencies
run: npm install

- run: npm run test
- run: npm run test

docker-tests:
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
submodules: true

- name: Set up Node
uses: actions/setup-node@v3

- name: Install dependencies
run: npm install

- name: Build Docker image
run: docker build -t youversion-api .
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "src/api/v1/core"]
path = src/api/v1/core
url = https://github.com/Glowstudent777/YouVersion-Core.git
10 changes: 6 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ FROM node:23-alpine AS builder

WORKDIR /app

RUN npm install -g pnpm
RUN yarn global add pnpm

COPY package.json pnpm-lock.yaml ./
COPY package.json ./
COPY pnpm-lock.yaml ./

RUN pnpm install

Expand All @@ -17,12 +18,13 @@ FROM node:23-alpine AS runtime

WORKDIR /app

COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/package.json ./package.json
COPY --from=builder /app/pnpm-lock.yaml ./pnpm-lock.yaml

RUN npm install -g pnpm && pnpm install --prod
RUN yarn global add pnpm && pnpm install --prod

EXPOSE 3000

CMD ["node", "dist/index.js"]
CMD ["node", "dist/index.js"]
11 changes: 11 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = function (api) {
api.cache(true);

const presets = ["@babel/preset-env", "@babel/preset-typescript"];
const ignore = ["**/__tests__", "**/*.test.ts", "!src/db/**"];

return {
presets,
ignore
};
}
8 changes: 8 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const gulp = require('gulp');
const babel = require('gulp-babel');

gulp.task('default', () =>
gulp.src('src')
.pipe(babel())
.pipe(gulp.dest('dist'))
);
1 change: 0 additions & 1 deletion index.js

This file was deleted.

6 changes: 0 additions & 6 deletions jest.config.js

This file was deleted.

19 changes: 13 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@
"types": "./dist/index.d.ts",
"main": "./dist/index.js",
"scripts": {
"build": "tsc",
"build": "npm run babel && npx tsc",
"clean": "npx rimraf --glob dist/",
"copyfiles": "cp ./src/api/v1/core/db/ ./dist/api/v1/core/db/ -r",
"babel": "npm run clean && npx babel src -d dist --extensions .ts --no-copy-ignored && npm run copyfiles",
"start": "npm run build && node ./dist/index.js",
"dev": "tsc-watch --onSuccess \"node ./dist/index.js\"",
"test": "vitest",
"test:coverage": "vitest run --coverage"
"test:coverage": "vitest run --coverage"
},
"repository": {
"type": "git",
Expand All @@ -35,15 +38,19 @@
"swagger-ui-express": "^5.0.1"
},
"devDependencies": {
"@babel/cli": "^7.19.3",
"@babel/core": "^7.20.2",
"@babel/preset-env": "^7.20.2",
"@babel/cli": "^7.26.4",
"@babel/core": "^7.26.0",
"@babel/preset-env": "^7.26.0",
"@babel/preset-typescript": "^7.26.0",
"@types/express": "^4.17.17",
"@types/node": "^18.13.0",
"@types/swagger-jsdoc": "^6.0.4",
"@types/swagger-ui-express": "^4.1.6",
"gulp": "^5.0.0",
"gulp-babel": "^8.0.0",
"rimraf": "^6.0.1",
"tsc-watch": "^6.0.0",
"typescript": "^4.9.5",
"vitest": "^1.6.0"
}
}
}
Loading

0 comments on commit 0b8a6ef

Please sign in to comment.