Skip to content

Commit

Permalink
refactor(frontend): move sveltekit to frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
eXodes committed May 15, 2022
1 parent db139e5 commit cbed464
Show file tree
Hide file tree
Showing 25 changed files with 20 additions and 23 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module.exports = {
{
files: ["*.ts", "*.js", "*.svelte"],
parserOptions: {
project: ["apps/sveltekit/tsconfig.*?.json"],
project: ["apps/frontend/tsconfig.*?.json"],
},
rules: {},
},
Expand Down
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions apps/sveltekit/Dockerfile → apps/frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ RUN npm install
EXPOSE 3000
EXPOSE 24678

CMD ["nx", "run", "sveltekit:serve"]
CMD ["nx", "run", "frontend:serve"]

FROM node:latest AS build

Expand All @@ -22,16 +22,16 @@ COPY . .

RUN npm install

RUN npx nx run sveltekit:build
RUN npx nx run frontend:build

FROM node:alpine AS serve

USER node:node

WORKDIR /home/apps/sveltekit
WORKDIR /home/apps/frontend

COPY --from=build --chown=node:node /home/dist/apps/sveltekit ./build
COPY --chown=node:node ./apps/sveltekit/package.json .
COPY --from=build --chown=node:node /home/dist/apps/frontend ./build
COPY --chown=node:node ./apps/frontend/package.json .

ENV PORT 3000
EXPOSE 3000
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion apps/sveltekit/package.json → apps/frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@nx-monorepo/sveltekit",
"name": "@nx-monorepo/frontend",
"version": "0.0.0",
"type": "module",
"dependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { PlaywrightTestConfig } from "@playwright/test";

const config: PlaywrightTestConfig = {
webServer: {
command: "nx run sveltekit:preview",
command: "nx run frontend:preview",
cwd: "../../",
port: 3000,
},
Expand Down
25 changes: 11 additions & 14 deletions apps/sveltekit/project.json → apps/frontend/project.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"root": "apps/sveltekit",
"sourceRoot": "apps/sveltekit/src",
"root": "apps/frontend",
"sourceRoot": "apps/frontend/src",
"projectType": "application",
"tags": ["scope:app"],
"targets": {
Expand Down Expand Up @@ -52,23 +52,23 @@
"lint": {
"executor": "@nrwl/linter:eslint",
"options": {
"lintFilePatterns": ["apps/sveltekit/**/*.{ts,svelte,spec.ts}"],
"ignorePath": "apps/sveltekit/.gitignore"
"lintFilePatterns": ["apps/frontend/**/*.{ts,svelte,spec.ts}"],
"ignorePath": "apps/frontend/.gitignore"
}
},
"check": {
"executor": "@nrwl/workspace:run-commands",
"options": {
"command": "svelte-check",
"cwd": "apps/sveltekit",
"cwd": "apps/frontend",
"tsconfig": "./tsconfig.app.json"
}
},
"e2e": {
"executor": "@nrwl/workspace:run-commands",
"options": {
"command": "playwright test",
"cwd": "apps/sveltekit"
"cwd": "apps/frontend"
},
"dependsOn": [
{
Expand All @@ -84,7 +84,7 @@
"commitMessageFormat": "release(${projectName}): bump to ${version} [skip ci]",
"tagPrefix": "${projectName}@v",
"trackDeps": true,
"postTargets": ["sveltekit:github"]
"postTargets": ["frontend:github"]
}
},
"github": {
Expand All @@ -97,33 +97,30 @@
"docker-alpha": {
"executor": "@nx-tools/nx-docker:build",
"options": {
"tags": ["nx-monorepo/sveltekit:alpha"],
"tags": ["nx-monorepo/frontend:alpha"],
"target": "serve"
}
},
"docker-alpha-push": {
"executor": "@nx-tools/nx-docker:build",
"options": {
"push": true,
"tags": ["nx-monorepo/sveltekit:alpha", "nx-monorepo/sveltekit:${tag}"],
"tags": ["nx-monorepo/frontend:alpha", "nx-monorepo/frontend:${tag}"],
"target": "serve"
}
},
"docker": {
"executor": "@nx-tools/nx-docker:build",
"options": {
"tags": ["nx-monorepo/sveltekit:latest"],
"tags": ["nx-monorepo/frontend:latest"],
"target": "serve"
}
},
"docker-push": {
"executor": "@nx-tools/nx-docker:build",
"options": {
"push": true,
"tags": [
"nx-monorepo/sveltekit:latest",
"nx-monorepo/sveltekit:${tag}"
],
"tags": ["nx-monorepo/frontend:latest", "nx-monorepo/frontend:${tag}"],
"target": "serve"
}
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const config = {
},
kit: {
adapter: node({
out: "../../dist/apps/sveltekit",
out: "../../dist/apps/frontend",
}),
vite: {
mode,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit cbed464

Please sign in to comment.