@aleleba/create-node-ts-graphql-server 1.0.16 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,30 @@
1
+ name: NPM testing and publish package
2
+
3
+ on:
4
+ push:
5
+ branches: [ master ]
6
+ jobs:
7
+ build:
8
+ runs-on: ubuntu-latest
9
+ steps:
10
+ - uses: actions/checkout@v3
11
+ - uses: actions/setup-node@v3
12
+ with:
13
+ node-version: 16
14
+ registry-url: https://registry.npmjs.org/
15
+ - run: npm ci --legacy-peer-deps
16
+ - run: npm test
17
+
18
+ publish-npm:
19
+ needs: build
20
+ runs-on: ubuntu-latest
21
+ steps:
22
+ - uses: actions/checkout@v3
23
+ - uses: actions/setup-node@v3
24
+ with:
25
+ node-version: 16
26
+ registry-url: https://registry.npmjs.org/
27
+ - run: npm ci --legacy-peer-deps
28
+ - run: npm publish --access=public
29
+ env:
30
+ NODE_AUTH_TOKEN: ${{secrets.npm_token}}
@@ -0,0 +1,33 @@
1
+ name: Testing package
2
+
3
+ on:
4
+ pull_request:
5
+ branches: ['*']
6
+ jobs:
7
+ test:
8
+ runs-on: ubuntu-latest
9
+ strategy:
10
+ matrix:
11
+ node-version: [16.x]
12
+ # See supported Node.js release schedule at https://nodejs.org/en/about/releases/
13
+ steps:
14
+ - uses: actions/checkout@v3
15
+ - name: Use Node.js 16
16
+ uses: actions/setup-node@v3
17
+ with:
18
+ node-version: 16
19
+ cache: 'npm'
20
+ registry-url: https://registry.npmjs.org/
21
+ - run: npm ci --legacy-peer-deps
22
+ - run: npm test
23
+ test-build-package:
24
+ needs: test
25
+ runs-on: ubuntu-latest
26
+ steps:
27
+ - uses: actions/checkout@v3
28
+ - uses: actions/setup-node@v3
29
+ with:
30
+ node-version: 16
31
+ registry-url: https://registry.npmjs.org/
32
+ - run: npm ci --legacy-peer-deps
33
+ - run: npm run build
package/bin/cli.js CHANGED
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  const { execSync } = require('child_process');
3
+ const isWin = process.platform === "win32";
3
4
 
4
5
  const runCommand = command => {
5
6
  try{
@@ -13,7 +14,11 @@ const runCommand = command => {
13
14
 
14
15
  const repoName = process.argv[2];
15
16
  const gitCheckoutCommand = `git clone --depth 1 https://github.com/aleleba/create-node-ts-graphql-server ${repoName}`;
16
- const installDepsCommand = `cd ${repoName} && rm -rf .git && git init && git add . && git commit -m "Initial commit" && npm install --legacy-peer-deps`;
17
+ const installDepsCommand = `cd ${repoName} && npm install --legacy-peer-deps`;
18
+ const cleanGitHistoryCommand = `cd ${repoName} && rm -rf .git && git init && git add --all -- ":!.github" ":!bin" && git commit -m "Initial commit"`
19
+ const cleanGitHistoryCommandWindows = `cd ${repoName} && rmdir .git /s /q && git init && git add --all -- ":!.github" ":!bin" && git commit -m "Initial commit"`
20
+ const deleteFoldersCommand = `cd ${repoName} && rm -rf .github && rm -rf bin`
21
+ const deleteFoldersCommandWindows = `cd ${repoName} && rmdir .github /s /q && rmdir bin /s /q`
17
22
 
18
23
  console.log(`Cloning the repository with name ${repoName}`);
19
24
  const checkedOut = runCommand(gitCheckoutCommand);
@@ -23,7 +28,14 @@ console.log(`Installing dependencies for ${repoName}`);
23
28
  const installedDeps = runCommand(installDepsCommand);
24
29
  if(!installedDeps) process.exit(-1);
25
30
 
31
+ console.log(`Cleaning History of Git for ${repoName}`);
32
+ const cleanGitHistory = isWin ? runCommand(cleanGitHistoryCommandWindows) : runCommand(cleanGitHistoryCommand);
33
+ if(!cleanGitHistory) process.exit(-1);
34
+
26
35
  console.log("Congratulations! You are ready. Follow the following commands to start");
27
36
  console.log(`cd ${repoName}`);
28
37
  console.log('Create a .env file with ENV=development(defauld: production), PORT=4000 (default: 4000), WHITELIST_URLS=your_url(default: http://localhost), GRAPHIQL=true(default: false)');
29
- console.log(`Then you can run: npm start:dev`);
38
+ console.log(`Then you can run: npm start:dev`);
39
+
40
+ const deleteFolders = isWin ? runCommand(deleteFoldersCommandWindows) : runCommand(deleteFoldersCommand);
41
+ if(!deleteFolders) process.exit(-1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aleleba/create-node-ts-graphql-server",
3
- "version": "1.0.16",
3
+ "version": "1.1.1",
4
4
  "description": "Node with Typescript and GraphQL Server",
5
5
  "bin": "./bin/cli.js",
6
6
  "main": "index.js",
@@ -32,7 +32,7 @@
32
32
  },
33
33
  "homepage": "https://github.com/aleleba/node-ts-graphql-server#readme",
34
34
  "dependencies": {
35
- "@graphql-tools/schema": "^8.5.0",
35
+ "@graphql-tools/schema": "^8.5.1",
36
36
  "body-parser": "^1.20.0",
37
37
  "cookie-parser": "^1.4.6",
38
38
  "cors": "^2.8.5",
@@ -42,26 +42,26 @@
42
42
  "graphql": "^16.5.0",
43
43
  "graphql-playground-middleware-express": "^1.7.23",
44
44
  "graphql-subscriptions": "^2.0.0",
45
- "graphql-tools": "^8.3.0",
45
+ "graphql-tools": "^8.3.1",
46
46
  "graphql-ws": "^5.9.1",
47
47
  "web-push": "^3.5.0",
48
48
  "ws": "^8.8.1"
49
49
  },
50
50
  "devDependencies": {
51
- "@babel/core": "^7.18.9",
52
- "@babel/preset-env": "^7.18.9",
51
+ "@babel/core": "^7.18.10",
52
+ "@babel/preset-env": "^7.18.10",
53
53
  "@babel/preset-typescript": "^7.18.6",
54
54
  "@babel/register": "^7.18.9",
55
55
  "@types/jest": "^28.1.6",
56
- "@types/node": "^18.0.6",
56
+ "@types/node": "^18.6.3",
57
57
  "@types/webpack": "^5.28.0",
58
58
  "@types/webpack-node-externals": "^2.5.3",
59
- "@typescript-eslint/eslint-plugin": "^5.30.7",
60
- "@typescript-eslint/parser": "^5.30.7",
59
+ "@typescript-eslint/eslint-plugin": "^5.32.0",
60
+ "@typescript-eslint/parser": "^5.32.0",
61
61
  "babel-loader": "^8.2.5",
62
62
  "clean-webpack-plugin": "^4.0.0",
63
63
  "compression-webpack-plugin": "^10.0.0",
64
- "eslint": "^8.20.0",
64
+ "eslint": "^8.21.0",
65
65
  "eslint-webpack-plugin": "^3.2.0",
66
66
  "jest": "^28.1.3",
67
67
  "nodemon": "^2.0.19",
@@ -69,7 +69,7 @@
69
69
  "ts-jest": "^28.0.7",
70
70
  "ts-loader": "^9.3.1",
71
71
  "typescript": "^4.7.4",
72
- "webpack": "^5.73.0",
72
+ "webpack": "^5.74.0",
73
73
  "webpack-cli": "^4.10.0",
74
74
  "webpack-manifest-plugin": "^5.0.0",
75
75
  "webpack-node-externals": "^3.0.0",