Skip to content

Commit

Permalink
chore: add nx to the repo
Browse files Browse the repository at this point in the history
  • Loading branch information
vsavkin authored and kentcdodds committed May 9, 2022
1 parent 4c2f1af commit 5453ed7
Show file tree
Hide file tree
Showing 5 changed files with 112 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ node_modules
/postgres-data

/app/styles/tailwind.css

/.idea
31 changes: 31 additions & 0 deletions nx.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"extends": "nx/presets/core.json",
"npmScope": "remix",
"tasksRunnerOptions": {
"default": {
"runner": "nx/tasks-runners/default",
"options": {
"cacheableOperations": [
"build-all",
"validate-all",
"build:css",
"build:remix",
"build:server",
"typecheck",
"test:run",
"lint",
"test:e2e:run"
]
}
}
},
"cli": {
"defaultProjectName": "blues-stack"
},
"pluginsConfig": {
"@nrwl/js": {
"analyzeSourceFiles": false,
"analyzePackageJson": false
}
}
}
44 changes: 39 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@
"license": "",
"sideEffects": false,
"scripts": {
"build": "run-s build:*",
"build:css": "npm run generate:css -- --minify",
"build:remix": "remix build",
"build:server": "esbuild --platform=node --format=cjs ./server.ts --outdir=build",
"dev": "run-p dev:*",
"dev:server": "cross-env NODE_ENV=development node --inspect --require ./node_modules/dotenv/config --require ./mocks ./build/server.js",
"dev:build": "cross-env NODE_ENV=development npm run build:server -- --watch",
"dev:remix": "cross-env NODE_ENV=development remix watch",
Expand All @@ -22,11 +20,13 @@
"start": "cross-env NODE_ENV=production node ./build/server.js",
"start:mocks": "cross-env NODE_ENV=production node --require ./mocks --require dotenv/config ./build/server.js",
"test": "vitest",
"test:run": "vitest --run",
"test:e2e:dev": "start-server-and-test dev http://localhost:3000 \"cypress open\"",
"pretest:e2e:run": "npm run build",
"test:e2e:run": "cross-env PORT=8811 start-server-and-test start:mocks http://localhost:8811 \"cypress run\"",
"typecheck": "tsc -b && tsc -b cypress",
"validate": "run-p \"test -- --run\" lint typecheck test:e2e:run"
"build": "nx build-all --output-style=compact",
"dev": "nx build-all --output-style=compact && nx dev-all",
"validate": "nx validate-all --output-style=compact"
},
"prettier": {},
"eslintIgnore": [
Expand Down Expand Up @@ -76,7 +76,7 @@
"eslint-config-prettier": "^8.5.0",
"happy-dom": "^2.55.0",
"msw": "^0.39.2",
"npm-run-all": "^4.1.5",
"nx": "14.1.4",
"postcss": "^8.4.12",
"prettier": "^2.6.1",
"prettier-plugin-tailwindcss": "^0.1.8",
Expand All @@ -95,5 +95,39 @@
},
"prisma": {
"seed": "ts-node --require tsconfig-paths/register prisma/seed.ts"
},
"nx": {
"targets": {
"build:remix": {
"outputs": [
"/build/index.js",
"/public/build"
]
},
"build:server": {
"outputs": [
"/build/server.js"
]
},
"build:css": {
"outputs": [
"/app/styles/tailwind.css"
]
},
"test:e2e:run": {
"outputs": [
"/cypress/screenshots",
"/cypress/videos"
],
"dependsOn": [
"build-all"
]
},
"test:e2e:dev": {
"dependsOn": [
"build-all"
]
}
}
}
}
40 changes: 40 additions & 0 deletions project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"name": "blues-stack",
"targets": {
"dev-all": {
"executor": "nx:run-commands",
"options": {
"commands": [
{
"command": "nx dev:server blues-stack",
"prefix": "[SERVER]",
"color": "blue"
},
{
"command": "nx dev:build blues-stack",
"prefix": "[BUILD-]",
"color": "green"
},
{
"command": "nx dev:remix blues-stack",
"prefix": "[REMIX-]",
"color": "yellow"
},
{
"command": "nx dev:css blues-stack",
"prefix": "[CSS---]",
"color": "cyan"
}
]
}
},
"validate-all": {
"executor": "nx:noop",
"dependsOn": ["test:run", "lint", "typecheck", "test:e2e:run"]
},
"build-all": {
"executor": "nx:noop",
"dependsOn": ["build:css", "build:remix", "build:server"]
}
}
}
Binary file removed public/favicon.ico
Binary file not shown.

0 comments on commit 5453ed7

Please sign in to comment.