From 4f52c37cb3526a4361cf83c7220aad876ffe1292 Mon Sep 17 00:00:00 2001 From: Filip Rojek Date: Sat, 30 Mar 2024 15:46:18 +0100 Subject: [PATCH] Drop support for javascript --- src/create.ts | 4 +- src/make-files/express-js/controller.js | 8 -- src/make-files/express-js/middleware.js | 10 -- src/make-files/express-js/model.js | 17 --- src/make-files/express-js/route.js | 8 -- src/make-files/express-js/test.js | 9 -- src/make-files/express-js/view.ejs | 15 --- src/skeletons/express-js/.env.example | 2 - src/skeletons/express-js/.gitignore | 107 ------------------ src/skeletons/express-js/README.md | 0 src/skeletons/express-js/norkconfig.json | 3 - src/skeletons/express-js/package.json | 24 ---- src/skeletons/express-js/src/app.js | 41 ------- .../src/controllers/rootController.js | 8 -- .../express-js/src/middlewares/index.js | 8 -- .../src/middlewares/sayHiMiddleware.js | 10 -- .../express-js/src/public/expressjs.png | Bin 5032 -> 0 bytes .../express-js/src/public/nodejs_logo.svg | 1 - src/skeletons/express-js/src/routes/index.js | 13 --- .../express-js/src/routes/rootRoutes.js | 8 -- .../express-js/src/tests/home.test.js | 9 -- .../src/tests/modules/reqRes.module.js | 16 --- src/skeletons/express-js/src/utils/REAME.md | 1 - src/skeletons/express-js/src/views/home.ejs | 69 ----------- 24 files changed, 2 insertions(+), 389 deletions(-) delete mode 100644 src/make-files/express-js/controller.js delete mode 100644 src/make-files/express-js/middleware.js delete mode 100644 src/make-files/express-js/model.js delete mode 100644 src/make-files/express-js/route.js delete mode 100644 src/make-files/express-js/test.js delete mode 100644 src/make-files/express-js/view.ejs delete mode 100644 src/skeletons/express-js/.env.example delete mode 100644 src/skeletons/express-js/.gitignore delete mode 100644 src/skeletons/express-js/README.md delete mode 100644 src/skeletons/express-js/norkconfig.json delete mode 100644 src/skeletons/express-js/package.json delete mode 100644 src/skeletons/express-js/src/app.js delete mode 100644 src/skeletons/express-js/src/controllers/rootController.js delete mode 100644 src/skeletons/express-js/src/middlewares/index.js delete mode 100644 src/skeletons/express-js/src/middlewares/sayHiMiddleware.js delete mode 100644 src/skeletons/express-js/src/public/expressjs.png delete mode 100644 src/skeletons/express-js/src/public/nodejs_logo.svg delete mode 100644 src/skeletons/express-js/src/routes/index.js delete mode 100644 src/skeletons/express-js/src/routes/rootRoutes.js delete mode 100644 src/skeletons/express-js/src/tests/home.test.js delete mode 100644 src/skeletons/express-js/src/tests/modules/reqRes.module.js delete mode 100644 src/skeletons/express-js/src/utils/REAME.md delete mode 100644 src/skeletons/express-js/src/views/home.ejs diff --git a/src/create.ts b/src/create.ts index dc659ce..98fd91d 100644 --- a/src/create.ts +++ b/src/create.ts @@ -21,8 +21,8 @@ export default class Create { message: `Pick the technology you're using:`, name: 'lang', choices: [ - { name: 'Typescript', value: 'ts' }, - { name: 'Javascript - DEPRECATED', value: 'js' } + { name: 'Typescript', value: 'ts' } + //{ name: 'Javascript - DEPRECATED', value: 'js' } ] }, { diff --git a/src/make-files/express-js/controller.js b/src/make-files/express-js/controller.js deleted file mode 100644 index 798dfa4..0000000 --- a/src/make-files/express-js/controller.js +++ /dev/null @@ -1,8 +0,0 @@ -const root_get = (req, res) => { - res.render('home') - return true -} - -module.exports = { - root_get -} diff --git a/src/make-files/express-js/middleware.js b/src/make-files/express-js/middleware.js deleted file mode 100644 index 154e3b2..0000000 --- a/src/make-files/express-js/middleware.js +++ /dev/null @@ -1,10 +0,0 @@ -const { Router } = require('express') - -const router = Router() - -router.use((req, res, next) => { - console.log('Hi :)') - next() -}) - -module.exports = router diff --git a/src/make-files/express-js/model.js b/src/make-files/express-js/model.js deleted file mode 100644 index 60243a9..0000000 --- a/src/make-files/express-js/model.js +++ /dev/null @@ -1,17 +0,0 @@ -const mongoose = require('mongoose') -const Schema = mongoose.Schema - -const modelSchema = new Schema( - { - title: { - type: String, - required: true - } - }, - { - timestamps: true - } -) - -const ModelName = mongoose.model('ModelName', modelSchema) -module.exports = ModelName diff --git a/src/make-files/express-js/route.js b/src/make-files/express-js/route.js deleted file mode 100644 index 9d0925b..0000000 --- a/src/make-files/express-js/route.js +++ /dev/null @@ -1,8 +0,0 @@ -const { Router } = require('express') -const rootController = require('../controllers/rootController') - -const router = Router() - -router.get('/', rootController.root_get) - -module.exports = router diff --git a/src/make-files/express-js/test.js b/src/make-files/express-js/test.js deleted file mode 100644 index 7949993..0000000 --- a/src/make-files/express-js/test.js +++ /dev/null @@ -1,9 +0,0 @@ -const { getReq, getRes } = require('./modules/reqRes.module.js') -const { root_get } = require('../controllers/rootController.ts') - -test('Home page render test', () => { - const req = getReq() - const res = getRes() - - expect(root_get(req, res)).toBe(true) -}) diff --git a/src/make-files/express-js/view.ejs b/src/make-files/express-js/view.ejs deleted file mode 100644 index faf15cc..0000000 --- a/src/make-files/express-js/view.ejs +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - New Project - - - - - - - - \ No newline at end of file diff --git a/src/skeletons/express-js/.env.example b/src/skeletons/express-js/.env.example deleted file mode 100644 index b1a432b..0000000 --- a/src/skeletons/express-js/.env.example +++ /dev/null @@ -1,2 +0,0 @@ -APP_PORT = 8080 -DB_URI = 'mongodb://username:password@localhost:27017/database?authSource=admin' diff --git a/src/skeletons/express-js/.gitignore b/src/skeletons/express-js/.gitignore deleted file mode 100644 index 66e0c76..0000000 --- a/src/skeletons/express-js/.gitignore +++ /dev/null @@ -1,107 +0,0 @@ -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* -lerna-debug.log* - -# Diagnostic reports (https://nodejs.org/api/report.html) -report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json - -# Runtime data -pids -*.pid -*.seed -*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage -*.lcov - -# nyc test coverage -.nyc_output - -# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Bower dependency directory (https://bower.io/) -bower_components - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (https://nodejs.org/api/addons.html) -build/Release - -# Dependency directories -node_modules/ -jspm_packages/ - -# TypeScript v1 declaration files -typings/ - -# TypeScript cache -*.tsbuildinfo - -# Optional npm cache directory -.npm - -# Optional eslint cache -.eslintcache - -# Microbundle cache -.rpt2_cache/ -.rts2_cache_cjs/ -.rts2_cache_es/ -.rts2_cache_umd/ - -# Optional REPL history -.node_repl_history - -# Output of 'npm pack' -*.tgz - -# Yarn Integrity file -.yarn-integrity - -# dotenv environment variables file -.env -.env.test - -# parcel-bundler cache (https://parceljs.org/) -.cache - -# Next.js build output -.next - -# Nuxt.js build / generate output -.nuxt -dist - -# Gatsby files -.cache/ -# Comment in the public line in if your project uses Gatsby and *not* Next.js -# https://nextjs.org/blog/next-9-1#public-directory-support -# public - -# vuepress build output -.vuepress/dist - -# Serverless directories -.serverless/ - -# FuseBox cache -.fusebox/ - -# DynamoDB Local files -.dynamodb/ - -# TernJS port file -.tern-port - -# package lock file -package-lock.json \ No newline at end of file diff --git a/src/skeletons/express-js/README.md b/src/skeletons/express-js/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/src/skeletons/express-js/norkconfig.json b/src/skeletons/express-js/norkconfig.json deleted file mode 100644 index e8fbc3b..0000000 --- a/src/skeletons/express-js/norkconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "lang": "js" -} diff --git a/src/skeletons/express-js/package.json b/src/skeletons/express-js/package.json deleted file mode 100644 index b0f19d4..0000000 --- a/src/skeletons/express-js/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "project-name", - "version": "1.0.0", - "description": "", - "main": "src/app.js", - "scripts": { - "start": "node src/app.js", - "dev": "nodemon src/app.js", - "test": "jest" - }, - "author": "", - "license": "ISC", - "dependencies": { - "cors": "^2.8.5", - "dotenv": "^8.2.0", - "ejs": "^3.1.6", - "express": "^4.17.1", - "mongoose": "^5.12.3", - "morgan": "^1.10.0" - }, - "devDependencies": { - "jest": "^27.0.6" - } -} diff --git a/src/skeletons/express-js/src/app.js b/src/skeletons/express-js/src/app.js deleted file mode 100644 index 985765e..0000000 --- a/src/skeletons/express-js/src/app.js +++ /dev/null @@ -1,41 +0,0 @@ -const express = require('express') -const morgan = require('morgan') -const mongoose = require('mongoose') -const dotenv = require('dotenv').config() -const cors = require('cors') -const path = require('path') - -const routes = require('./routes') -const middlewares = require('./middlewares') - -const port = process.env.APP_PORT || 8080 -const app = express() - -// MongoDB -const dbURI = process.env.DB_URI -mongoose - .connect(dbURI, { useNewUrlParser: true, useUnifiedTopology: true, useCreateIndex: true }) - .then((result) => { - console.log('connected to db') - app.listen(port, () => { - console.log(`server is running on http://localhost:${port}`) - }) - }) - .catch((err) => { - console.log(err) - }) - -// View engine -app.set('view engine', 'ejs') - -// Middlewares -app.use(middlewares) -app.set('views', path.join(__dirname, 'views')) -app.use(express.static(path.join(__dirname, 'public'))) -app.use(cors()) -app.use(morgan('dev')) -app.use(express.urlencoded({ extended: true })) -app.use(express.json()) - -// Routes -app.use(routes) diff --git a/src/skeletons/express-js/src/controllers/rootController.js b/src/skeletons/express-js/src/controllers/rootController.js deleted file mode 100644 index 798dfa4..0000000 --- a/src/skeletons/express-js/src/controllers/rootController.js +++ /dev/null @@ -1,8 +0,0 @@ -const root_get = (req, res) => { - res.render('home') - return true -} - -module.exports = { - root_get -} diff --git a/src/skeletons/express-js/src/middlewares/index.js b/src/skeletons/express-js/src/middlewares/index.js deleted file mode 100644 index ca227fd..0000000 --- a/src/skeletons/express-js/src/middlewares/index.js +++ /dev/null @@ -1,8 +0,0 @@ -const { Router } = require('express') -const sayHiMiddleware = require('./sayHiMiddleware') - -const router = Router() - -router.use(sayHiMiddleware) - -module.exports = router diff --git a/src/skeletons/express-js/src/middlewares/sayHiMiddleware.js b/src/skeletons/express-js/src/middlewares/sayHiMiddleware.js deleted file mode 100644 index 154e3b2..0000000 --- a/src/skeletons/express-js/src/middlewares/sayHiMiddleware.js +++ /dev/null @@ -1,10 +0,0 @@ -const { Router } = require('express') - -const router = Router() - -router.use((req, res, next) => { - console.log('Hi :)') - next() -}) - -module.exports = router diff --git a/src/skeletons/express-js/src/public/expressjs.png b/src/skeletons/express-js/src/public/expressjs.png deleted file mode 100644 index 487c5a83af37b9b93507a08a761c0788c764b169..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5032 zcmbtXXEYp8lpdlaYJ!kNM5JhwFnSk#)X^DYL>WEW7+tg|(Su-&(Ty5JNrY(8joy1_ zm?+UZS^IN;?4I4T@0|C(ci(;AJKsI8og1MA0aH^vq5uE@)GEpfIsgFC&`m$)_N|+C zf&E+j4UpK#YRCcr6>*f8=A<|FQ%hwX4FJFq1pv6k0szx$06@qR0N}R+08HMv`NaSL z79Qlc>bC#@@rIVVp5niM|Mm|KF0Zcs?(Xd$9G;z@-{8^F@%j11_Re4Y24Q7w{owGZ zXJGj3?5uBSw7Yk3X=QD8e(C!98rL^?a(X&CF}1L?@@I2~?_>JR}lljHvi;Ih~ z$(e!Sv5h~Qxc;H7oxi;U!<*YX!()?k3rm|@+kJy06Vr1$e|HI+TZ1FxH;QNG7yF0D z)(L+KN-KjR;@^7&7+SoS(=?V)){})8>zmozx%qtvi;YjsEGnyR@9s^)@Miz4Dt?*8G@YKESHpF*M&TRVHAzodQpUYC-Qr>tkDZDQje9`_|JyRoIC z;dgssS=EikpAElblQ2p;rZx4=&23$I#osiIt+Y(6y@DdbS&C2)r7^SEK`}8@b zt*bXYE~T{UCn^)`;`6b#p~b}71b7BU)Hk=GCqXH+#K?^>PJF17eF4V1JS*~|8HS>SEGNk29bpt zSOM^fltuZ*xZ|R1X$v=1s+UN9&wn=Mqz0EP~jHe9sby7PhlLTawb zDF#zDFK~;FoSo*-b&(a|mMBchMtk|IbbKgh%dvP7*E{a6Ui8R4O>`e#?d{=$?i z`O|u*T;I>V!g@lIl=5BXEU#iN8<5%5? zP2sr@0>}%RtX+2rDKqyFVTp*wr^+UfG7(TJ$@Q-3v|0>PqHkN-MH`URa)J6wKUUH^}gz94}e&uPXw6!weC$9hFle%}sV(gKb=m)XIFEI0UhUKyp;{8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2}1?`)Wo0KN`@8Iuajk}8?*CP(Yy8mFzwIfMz-Mm7 z_&x-pf<@?bDmdIDg*Y=j!XPrg$6%k3+&6e_ZG`NkZeI=M{eHnsvLnNG;ry(ZO!{l_ zf}Z~?91)$)KuLLfbCZ*3pmf+dl-`~A zqvfM|K0nQ}%H4gtl`)duSOh)~-&Klx=e8-p3oL#+m!oDJ*5{=IKX(7pT#ygDTmyWz{l#4z4E=>u*Q zZ$X}L$agW72wxt42zzDOAt{^rHo3FI#Mfla*>%nZ!cL##+Zg^YO1z zmH#n|O?b5UFFLUaC1}8Ybdz_#L@Gj&aC4-UxFy2s1_1mZK9ScT!Pop^dLVvrkg&J_ p|7(zlI0)3Nd(QY@2#(HhJ8SR%o=`y}SA0VNs3<}d%H+&~{{wT0#Ss7i diff --git a/src/skeletons/express-js/src/public/nodejs_logo.svg b/src/skeletons/express-js/src/public/nodejs_logo.svg deleted file mode 100644 index 41d044a..0000000 --- a/src/skeletons/express-js/src/public/nodejs_logo.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/skeletons/express-js/src/routes/index.js b/src/skeletons/express-js/src/routes/index.js deleted file mode 100644 index 27fb8d8..0000000 --- a/src/skeletons/express-js/src/routes/index.js +++ /dev/null @@ -1,13 +0,0 @@ -const { Router } = require('express') -const rootRoutes = require('./rootRoutes') - -const router = Router() - -router.use(rootRoutes) - -// 404 -router.use((req, res) => { - res.status(404).send('E404') -}) - -module.exports = router diff --git a/src/skeletons/express-js/src/routes/rootRoutes.js b/src/skeletons/express-js/src/routes/rootRoutes.js deleted file mode 100644 index 9d0925b..0000000 --- a/src/skeletons/express-js/src/routes/rootRoutes.js +++ /dev/null @@ -1,8 +0,0 @@ -const { Router } = require('express') -const rootController = require('../controllers/rootController') - -const router = Router() - -router.get('/', rootController.root_get) - -module.exports = router diff --git a/src/skeletons/express-js/src/tests/home.test.js b/src/skeletons/express-js/src/tests/home.test.js deleted file mode 100644 index 188e0c3..0000000 --- a/src/skeletons/express-js/src/tests/home.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const { getReq, getRes } = require('./modules/reqRes.module.js') -const { root_get } = require('../controllers/rootController.js') - -test('Home page render test', () => { - const req = getReq() - const res = getRes() - - expect(root_get(req, res)).toBe(true) -}) diff --git a/src/skeletons/express-js/src/tests/modules/reqRes.module.js b/src/skeletons/express-js/src/tests/modules/reqRes.module.js deleted file mode 100644 index 0341a26..0000000 --- a/src/skeletons/express-js/src/tests/modules/reqRes.module.js +++ /dev/null @@ -1,16 +0,0 @@ -module.exports.getReq = () => { - const req = {} - req.body = {} - return req -} - -module.exports.getRes = () => { - const res = {} - res.locals = {} - res.status = () => res - res.json = () => res - res.send = () => res - res.render = () => res - - return res -} diff --git a/src/skeletons/express-js/src/utils/REAME.md b/src/skeletons/express-js/src/utils/REAME.md deleted file mode 100644 index 7e1a454..0000000 --- a/src/skeletons/express-js/src/utils/REAME.md +++ /dev/null @@ -1 +0,0 @@ -# Folder for utils and other config files diff --git a/src/skeletons/express-js/src/views/home.ejs b/src/skeletons/express-js/src/views/home.ejs deleted file mode 100644 index d841985..0000000 --- a/src/skeletons/express-js/src/views/home.ejs +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - New Project - - - - - - -
-
-

Let's make something amazing!

-
- node.js logo - express.js logo -
-
- -
- - \ No newline at end of file