Browse Source

misc: Better build

develop v0.1.0.1-gql
Dale 4 weeks ago
parent
commit
6377e85225
Signed by: Deiru GPG Key ID: AA250C0277B927E1
3 changed files with 19 additions and 10 deletions
  1. +18
    -7
      default.nix
  2. +1
    -1
      package.json
  3. +0
    -2
      tsconfig.json

+ 18
- 7
default.nix View File

@ -15,7 +15,7 @@ in mkYarnPackage rec {
yarnNix = "${src}/yarn.nix";
configurePhase = ''
ln -s $node_modules node_modules/
ln -s $node_modules ./node_modules
'';
buildPhase = ''
@ -25,21 +25,32 @@ in mkYarnPackage rec {
installPhase = ''
mkdir $out
mkdir -p $out/node_modules
cp -r ./* $out
cp tsconfig.json $out/tsconfig.json
cp -r $node_modules/* $out/node_modules
cp -r src $out/src
mkdir -p $out/graphql/schema
cp -r src/graphql/schema/* $out/graphql/schema
cp tsconfig.json $out/tsconfig.json
cp package.json $out/package.json
makeWrapper ${yarnPkg}/bin/yarn $out/bin/${name} \
--add-flags "--cwd $out" \
--add-flags server
--add-flags server \
--set node_modules $node_modules \
--set NODE_PATH $NODE_PATH:$node_modules
makeWrapper ${yarnPkg}/bin/yarn $out/bin/${name}-start \
--add-flags "--cwd $out" \
--add-flags daemon:start
--add-flags daemon:start \
--set node_modules $node_modules \
--set NODE_PATH $NODE_PATH:$node_modules
makeWrapper ${yarnPkg}/bin/yarn $out/bin/${name}-stop \
--add-flags "--cwd $out" \
--add-flags daemon:stop
--add-flags daemon:stop \
--set node_modules $node_modules \
--set NODE_PATH $NODE_PATH:$node_modules
makeWrapper ${yarnPkg}/bin/yarn $out/bin/${name}-restart \
--add-flags "--cwd $out" \
--add-flags daemon:restart
--add-flags daemon:restart \
--set node_modules $node_modules \
--set NODE_PATH $NODE_PATH:$node_modules
'';
distPhase = ''


+ 1
- 1
package.json View File

@ -8,7 +8,7 @@
"daemon:start": "NODE_ENV=production name=miracle-tv pm2 start yarn --name miracle-tv -- server",
"daemon:stop": "pm2 delete miracle-tv",
"daemon:restart": "name=miracle-tv pm2 restart miracle-tv --update-env",
"server": "NODE_ENV=production ts-node -r tsconfig-paths/register src/server.ts",
"server": "NODE_ENV=production $node_modules/.bin/ts-node -r tsconfig-paths/register src/server.ts",
"codegen": "graphql-codegen --config codegen.yml",
"dev": "nodemon -e ts,tsx,graphql --exec \"yarn run server\""
},


+ 0
- 2
tsconfig.json View File

@ -11,8 +11,6 @@
"sourceMap": false,
"outDir": "./dist",
"baseUrl": ".",
"types": [],
"typeRoots" : ["./node_modules", "./node_modules/@types"],
"paths": {
"miracle-tv/*": [ "src/*" ]
}


Loading…
Cancel
Save