From 5b5d3dcd5bc46dd45abf57ef24674bf48973c9a6 Mon Sep 17 00:00:00 2001 From: Steve Date: Sun, 25 Apr 2021 08:21:21 +0200 Subject: [PATCH 1/7] Remove Husky hooks --- package-lock.json | 8 +------- package.json | 1 - 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4904c93..e550b68 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "typeplate", - "version": "1.4.3", + "version": "1.4.4", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -5290,12 +5290,6 @@ "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", "dev": true }, - "husky": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/husky/-/husky-5.1.3.tgz", - "integrity": "sha512-fbNJ+Gz5wx2LIBtMweJNY1D7Uc8p1XERi5KNRMccwfQA+rXlxWNSdUxswo0gT8XqxywTIw7Ywm/F4v/O35RdMg==", - "dev": true - }, "iconv-lite": { "version": "0.4.23", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.23.tgz", diff --git a/package.json b/package.json index 75ed576..09bee82 100644 --- a/package.json +++ b/package.json @@ -136,7 +136,6 @@ "eslint-plugin-import": "2.22.1", "eslint-plugin-jsdoc": "32.2.0", "eslint-plugin-prefer-arrow": "1.2.3", - "husky": "5.1.3", "leasot": "11.5.0", "mocha": "8.3.0", "nock": "10.0.6", From 236583c5c7737c83b92eda41d969d20a1f269ff9 Mon Sep 17 00:00:00 2001 From: Steve Date: Sun, 25 Apr 2021 08:29:40 +0200 Subject: [PATCH 2/7] Remove Typedoc --- package-lock.json | 109 ---------------------------------------------- package.json | 6 +-- 2 files changed, 2 insertions(+), 113 deletions(-) diff --git a/package-lock.json b/package-lock.json index e550b68..a5fba9a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5490,12 +5490,6 @@ } } }, - "interpret": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", - "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", - "dev": true - }, "ip": { "version": "1.1.5", "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.5.tgz", @@ -6733,12 +6727,6 @@ "yallist": "^3.0.2" } }, - "lunr": { - "version": "2.3.9", - "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz", - "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==", - "dev": true - }, "mailgun-js": { "version": "0.22.0", "resolved": "https://registry.npmjs.org/mailgun-js/-/mailgun-js-0.22.0.tgz", @@ -6918,12 +6906,6 @@ "uc.micro": "^1.0.5" } }, - "marked": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/marked/-/marked-2.0.1.tgz", - "integrity": "sha512-5+/fKgMv2hARmMW7DOpykr2iLhl0NgjyELk5yn92iE7z8Se1IS9n3UsFm86hFXIkvMBmVxki8+ckcpjBeyo/hw==", - "dev": true - }, "mdurl": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", @@ -8219,15 +8201,6 @@ "mimic-fn": "^2.1.0" } }, - "onigasm": { - "version": "2.2.5", - "resolved": "https://registry.npmjs.org/onigasm/-/onigasm-2.2.5.tgz", - "integrity": "sha512-F+th54mPc0l1lp1ZcFMyL/jTs2Tlq4SqIHKIXGZOR/VkHkF9A7Fr5rRr5+ZG/lWeRsyrClLYRq7s/yFQ/XhWCA==", - "dev": true, - "requires": { - "lru-cache": "^5.1.1" - } - }, "optionator": { "version": "0.9.1", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", @@ -8998,15 +8971,6 @@ "util-deprecate": "~1.0.1" } }, - "rechoir": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", - "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", - "dev": true, - "requires": { - "resolve": "^1.1.6" - } - }, "reflect-metadata": { "version": "0.1.13", "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.13.tgz", @@ -9382,33 +9346,12 @@ "integrity": "sha512-2kUqeAGnMAu6YrTPX4E3LfxacH9gKljzVjlkUeSqY0soGwK4KLl7TURXCem712tkhBCeeaFP9QK4dKn88s3Icg==", "dev": true }, - "shelljs": { - "version": "0.8.4", - "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.4.tgz", - "integrity": "sha512-7gk3UZ9kOfPLIAbslLzyWeGiEqx9e3rxwZM0KE6EL8GlGwjym9Mrlx5/p33bWTu9YG6vcS4MBxYZDHYr5lr8BQ==", - "dev": true, - "requires": { - "glob": "^7.0.0", - "interpret": "^1.0.0", - "rechoir": "^0.6.2" - } - }, "shellwords": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/shellwords/-/shellwords-0.1.1.tgz", "integrity": "sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==", "dev": true }, - "shiki": { - "version": "0.9.3", - "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.9.3.tgz", - "integrity": "sha512-NEjg1mVbAUrzRv2eIcUt3TG7X9svX7l3n3F5/3OdFq+/BxUdmBOeKGiH4icZJBLHy354Shnj6sfBTemea2e7XA==", - "dev": true, - "requires": { - "onigasm": "^2.2.5", - "vscode-textmate": "^5.2.0" - } - }, "signal-exit": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", @@ -10221,52 +10164,6 @@ "is-typedarray": "^1.0.0" } }, - "typedoc": { - "version": "0.20.32", - "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.20.32.tgz", - "integrity": "sha512-GSopd/tiqoKE3fEdvhoaEpR9yrEPsR9tknAjkoeSPL6p1Rq5aVsKxBhhF6cwoDJ7oWjpvnm8vs0rQN0BxEHuWQ==", - "dev": true, - "requires": { - "colors": "^1.4.0", - "fs-extra": "^9.1.0", - "handlebars": "^4.7.7", - "lodash": "^4.17.21", - "lunr": "^2.3.9", - "marked": "^2.0.1", - "minimatch": "^3.0.0", - "progress": "^2.0.3", - "shelljs": "^0.8.4", - "shiki": "^0.9.3", - "typedoc-default-themes": "^0.12.9" - }, - "dependencies": { - "handlebars": { - "version": "4.7.7", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz", - "integrity": "sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==", - "dev": true, - "requires": { - "minimist": "^1.2.5", - "neo-async": "^2.6.0", - "source-map": "^0.6.1", - "uglify-js": "^3.1.4", - "wordwrap": "^1.0.0" - } - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, - "typedoc-default-themes": { - "version": "0.12.9", - "resolved": "https://registry.npmjs.org/typedoc-default-themes/-/typedoc-default-themes-0.12.9.tgz", - "integrity": "sha512-Jd5fYTiqzinZdoIY382W7tQXTwAzWRdg8KbHfaxmb78m1/3jL9riXtk23oBOKwhi8GFVykCOdPzEJKY87/D0LQ==", - "dev": true - }, "typeorm": { "version": "0.2.32", "resolved": "https://registry.npmjs.org/typeorm/-/typeorm-0.2.32.tgz", @@ -10605,12 +10502,6 @@ "extsprintf": "^1.2.0" } }, - "vscode-textmate": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-5.2.0.tgz", - "integrity": "sha512-Uw5ooOQxRASHgu6C7GVvUxisKXfSgW4oFlO+aa+PAkgmH89O3CXxEEzNRNtHSqtXFTl0nAC1uYj0GMSH27uwtQ==", - "dev": true - }, "walk": { "version": "2.3.14", "resolved": "https://registry.npmjs.org/walk/-/walk-2.3.14.tgz", diff --git a/package.json b/package.json index 09bee82..30cfc37 100644 --- a/package.json +++ b/package.json @@ -47,10 +47,9 @@ "ci:test": "npm-run-all -s test:*", "doc": "npm-run-all -s doc:*", "doc:apidoc": "apidoc -i src/ -o docs/apidoc/", - "doc:typedoc": "typedoc --name 'API documentation' --defaultCategory 'Root' --categorizeByGroup --out ./docs/typedoc ./src", "kickstart": "npm i typescript@4.2.2 -g && npm i typeorm@0.2.31 -g && npm i rsgen -g && npm i && npm run build && npm run doc", - "kickstart:staging": "npm i typescript@4.2.2 -g && npm i typeorm@0.2.31 -g && npm i && npm run build", - "kickstart:production": "npm i typescript@4.2.2 -g && npm i typeorm@0.2.31 -g && npm i && npm run build:production && tsc", + "kickstart:staging": "npm i typescript@4.2.2 -g && npm i typeorm@0.2.32 -g && npm i && npm run build", + "kickstart:production": "npm i typescript@4.2.2 -g && npm i typeorm@0.2.32 -g && npm i && npm run build:production && tsc", "test": "nyc --reporter=html --report-dir=./reports/nyc-coverage npm-run-all -s test:*", "test:unit": "./node_modules/.bin/mocha ./test/units/00-application.unit.test.js --exit --reporter spec --timeout 10000 --env test", "test:e2e": "typeorm schema:drop && typeorm schema:sync && ./node_modules/.bin/mocha ./test/e2e/00-api.e2e.test.js --exit --reporter spec --timeout 10000 --env test", @@ -146,7 +145,6 @@ "rsgen": "^0.3.0", "sinon": "9.2.4", "supertest": "6.1.3", - "typedoc": "0.20.32", "typescript": "4.2.2", "typescript-eslint": "0.0.1-alpha.0" } From 8858438775cb3ae425d467c5ff83aaca865a08ab Mon Sep 17 00:00:00 2001 From: Steve Date: Sun, 25 Apr 2021 10:09:29 +0200 Subject: [PATCH 3/7] Create directories in env config instead of npm script --- src/api/config/environment.config.ts | 32 +++++++++++----------------- src/env/template.env | 4 ++-- 2 files changed, 14 insertions(+), 22 deletions(-) diff --git a/src/api/config/environment.config.ts b/src/api/config/environment.config.ts index 4c4703a..c965a37 100644 --- a/src/api/config/environment.config.ts +++ b/src/api/config/environment.config.ts @@ -24,7 +24,7 @@ export class Environment { /** * @description Current root dir */ - base: string; + base = 'dist'; /** * @description Cluster with aggregated data @@ -718,21 +718,6 @@ export class Environment { this.environment = ENVIRONMENT[process.argv[process.argv.indexOf('--env') + 1]] as string || process.env.NODE_ENV || ENVIRONMENT.development; } - switch (this.environment) { - case ENVIRONMENT.development: - this.base = 'dist'; - break; - case ENVIRONMENT.staging: - this.base = 'dist'; - break; - case ENVIRONMENT.production: - this.base = 'dist'; - break; - case ENVIRONMENT.test: - this.base = 'dist'; - break; - } - const path = `${process.cwd()}/${this.base}/env/${this.environment}.env`; if (!existsSync(path)) { @@ -881,11 +866,18 @@ export class Environment { * @description Creates files directories if not exists */ directories(): Environment { + const log = this.cluster.LOGS as { PATH: string }; + if ( !existsSync(log.PATH) ) { + mkdirSync(log.PATH); + } + const upload = this.cluster.UPLOAD as { PATH: string }; + if ( !existsSync(upload.PATH) ) { + mkdirSync(upload.PATH); + } this.dirs.forEach(dir => { - const u = this.cluster.UPLOAD as { PATH: string }; - const p = `${u.PATH}/${dir}`; - if ( !existsSync(p) ) { - mkdirSync(p); + const path = `${upload.PATH}/${dir}`; + if ( !existsSync(path) ) { + mkdirSync(path); } }); return this; diff --git a/src/env/template.env b/src/env/template.env index b8bb15d..41c9517 100644 --- a/src/env/template.env +++ b/src/env/template.env @@ -43,7 +43,7 @@ DOMAIN = "localhost" # Linkedin oauth consumer secret # LINKEDIN_CONSUMER_SECRET = "" -# Logs directory name +# Logs directory path starting from process.cwd()/dist # LOGS_PATH = "logs" # Morgan logs pattern. See morgan doc. @@ -130,7 +130,7 @@ TYPEORM_PORT = "3306" # TypeORM cache duration. Relevant only if MEMORY_CACHE is disabled. # TYPEORM_CACHE_DURATION = 5000 -# File upload directory name +# File upload directory path starting from process.cwd()/dist # UPLOAD_PATH = "public" # File upload max file size From 78322fbfad63a7034ceb425f8d8e88cdc4368083 Mon Sep 17 00:00:00 2001 From: Steve Date: Sun, 25 Apr 2021 10:10:47 +0200 Subject: [PATCH 4/7] Simplify starting project --- README.md | 66 ++++++++++++---------------------------------------- package.json | 20 +++++++--------- 2 files changed, 24 insertions(+), 62 deletions(-) diff --git a/README.md b/README.md index d25972b..3d70eee 100644 --- a/README.md +++ b/README.md @@ -21,13 +21,13 @@ Thanks to Daniel F. Sousa for inspiration with her [Express ES2017 REST API boil - **Basics** - **Clear & clean code architecture** with classic layers such controllers, services, repositories, models, ... - - **Business validation** with business service and business rule interface. - **Object Relational Mapping** with [typeorm](https://typeorm.io/#/). - - **Entity generation** (controller, route, repository, model, validations, interfaces, subscriber, test, fixture) with [rsgen](https://github.com/konfer-be/rsgen). + - **Entity generation** with [rsgen](https://github.com/konfer-be/rsgen). + - **Business validation** with self designed business members. - **Logs management** with [morgan](https://github.com/expressjs/morgan) and [winston](https://github.com/winstonjs/winston). - **Changelog completion** with [auto-changelog](https://www.npmjs.com/package/auto-changelog). - **Testing** with included unit and e2e test sets builded with [mocha](https://mochajs.org/), [chai](https://www.chaijs.com/), [sinon](https://sinonjs.org/) and [supertest](https://github.com/visionmedia/supertest). - - **Documentation** with [api-doc](https://apidocjs.com/) and [typedoc](https://typedoc.org/). + - **Documentation** with [api-doc](https://apidocjs.com/). - **Security** - **SSL secure connection** with native [HTTPS node module](https://nodejs.org/docs/latest-v14.x/api/https.html). - **Cross Origin Resource Sharing** with [CORS](https://expressjs.com/en/resources/middleware/cors.html). @@ -35,7 +35,7 @@ Thanks to Daniel F. Sousa for inspiration with her [Express ES2017 REST API boil - **HTTP header pollution** preventing with [hpp](https://www.npmjs.com/package/hpp). - **API request rate limit** with [express-rate-limit](https://www.npmjs.com/package/express-rate-limit). - **Route validation** with [joi](https://github.com/hapijs/joi). - - **HTTP friendly errors** with obfuscated messages based on a custom pipe with [boom](https://github.com/hapijs/boom) and [http-status](https://www.npmjs.com/package/http-status). + - **HTTP friendly errors** with [boom](https://github.com/hapijs/boom) and [http-status](https://www.npmjs.com/package/http-status). - **Authentication** - **JWT authentication process** with [passport.js](http://www.passportjs.org/). - **oAuth authentication process** with [passport.js](http://www.passportjs.org/). @@ -45,7 +45,7 @@ Thanks to Daniel F. Sousa for inspiration with her [Express ES2017 REST API boil - **Database query cache** with [typeorm caching](https://github.com/typeorm/typeorm/blob/master/docs/caching.md). - **Assets management** - **Customizable file upload** with [multer](https://www.npmjs.com/package/multer). - - **Customizable image resizing** designed for front-end requirements with [jimp](https://www.npmjs.com/package/jimp). + - **Customizable image resizing** with [jimp](https://www.npmjs.com/package/jimp). ## > Table of contents @@ -74,7 +74,7 @@ When you're with that, starting your project is a matter of minutes. :clock12: $ git clone https://github.com/konfer-be/typeplate.git path-to/your-project-name/ ``` -### Step 2: go to your project +### Step 2: go to ```bash $ cd path-to/your-project-name/ @@ -83,20 +83,14 @@ $ cd path-to/your-project-name/ ### Step 3: build ```bash -$ npm run kickstart +$ npm run kickstart:dev ``` -### Step 4: setup git - -```bash -$ rm -rf ./.git && npm run build:repo -``` - -### Step 5: setup package.json +### Step 4: setup package.json Open the *./package.json* file and edit it with your own values. -### Step 6: setup environment variables +### Step 5: setup environment Open *./dist/env/development.env* and fill the required env variables (uncommented in the file). See [env variables list](https://github.com/konfer-be/typeplate/wiki/Environment-variables) for more informations. @@ -135,21 +129,13 @@ TYPEORM_PWD = "" TYPEORM_PORT = "3306" ``` -### Step 7: setup cliamrc.json for sending transactional email - -Transactional emails are used in authentication process, to confirm an account or execute a new password request. Currently supported providers are Mailgun, Mailjet, Postmark, Sendgrid, Sendinblue and Sparkpost. If you're not with them, you can use a simple SMTP server (default with [ethereal](https://ethereal.email/)). +### Step 6: setup cliamrc.json -Open the *.cliamrc.json* and fill the [required configuration](https://github.com/konfer-be/cliam/wiki/Configuration) according your sending mode. See Cliam official [documentation](https://github.com/konfer-be/cliam/wiki) for more information. +Transactional emails are send with [cliam](https://github.com/konfer-be/cliam) behind the scene. Open the *.cliamrc.json* and fill the [required configuration](https://github.com/konfer-be/cliam/wiki/Configuration) according your sending mode. See Cliam official [documentation](https://github.com/konfer-be/cliam/wiki) for more information. Sandbox is set to true by default and emails are not send. Pass this value to false when you're ready. -### Step 8: compile - -```bash -$ tsc -``` - -### Step 9: run & enjoy +### Step 7: run ```bash $ nodemon @@ -157,34 +143,20 @@ $ nodemon ## > Entity generation -Some repetitive tasks such as creating resources can be done easily with [rsgen](https://github.com/konfer-be/rsgen). This small tool allow you to generate a complete set of resources who are linked to an entity. +Some repetitive tasks such as creating resources can be done easily with [rsgen](https://github.com/konfer-be/rsgen). -See the [entity generation](https://github.com/konfer-be/typeplate/wiki/Entity-generation) wiki section to see the complete list of generated elements and how to. +See [entity generation](https://github.com/konfer-be/typeplate/wiki/Entity-generation) wiki section to learn more about generated elements and how to use. ## > Documentation ```bash -$ npm run doc:apidoc +$ npm run doc ``` Generate API documentation website into *./docs/apidoc/*. See [apidoc](http://apidocjs.com/) for more informations about customization. -```bash -$ npm run doc:typedoc -``` - -Generate code documentation website into *./docs/typedoc/*. - -See [typedoc](https://typedoc.org/) for more informations about customization. - -```bash -$ npm run doc -``` - -Generate api and code documentation websites into *./docs/*. - ## > Tests ```bash @@ -241,18 +213,10 @@ $ pm2 deploy production setup # Update remote version $ pm2 deploy production update - -# Revert to -1 deployment -$ pm2 deploy production revert 1 ``` More info about [PM2](http://pm2.keymetrics.io/docs/usage/quick-start/) and [PM2 deploy](https://pm2.io/doc/en/runtime/guide/easy-deploy-with-ssh/). -## > Related links - -- More info about [tsconfig.json](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html) -- More info about [ormconfig file](http://typeorm.io/#/using-ormconfig) and [typeorm cli](https://typeorm.io/#/using-cli/installing-cli) - ## > License [MIT](/LICENSE) \ No newline at end of file diff --git a/package.json b/package.json index 30cfc37..4fa76ae 100644 --- a/package.json +++ b/package.json @@ -37,19 +37,17 @@ "commitLimit": false }, "scripts": { - "build": "npm-run-all -s build:*", - "build:directories": "mkdir -p ./dist/env ./dist/logs ./dist/public", - "build:env": "cp -r ./src/env/template.env ./dist/env/development.env && cp -r ./src/env/template.env ./dist/env/test.env && cp -r ./src/env/template.env ./dist/env/staging.env && cp -r ./src/env/template.env ./dist/env/production.env", - "build:repo": "git init && git add . --all && git commit -m \"First commit\"", - "build:staging": "mkdir -p ./dist/env ./dist/logs && cp -r ./src/env/staging.env ./dist/env/", - "build:production": "mkdir -p ./dist/env ./dist/logs && cp -r ./src/env/production.env ./dist/env/", + "init": "npm-run-all -s init:*", + "init:env": "cp ./src/env/template.env ./src/env/development.env && cp ./src/env/template.env ./src/env/test.env && cp ./src/env/template.env ./src/env/staging.env && cp ./src/env/template.env ./src/env/production.env && rm -rf ./src/env/template.env", + "init:repository": "rm -rf ./.git && git init && git add . --all && git commit -m \"First commit\"", "ci:coverage": "nyc --reporter=lcov --report-dir=./reports/coverage npm-run-all -s test:* && cat ./reports/coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./reports/coverage", "ci:test": "npm-run-all -s test:*", - "doc": "npm-run-all -s doc:*", - "doc:apidoc": "apidoc -i src/ -o docs/apidoc/", - "kickstart": "npm i typescript@4.2.2 -g && npm i typeorm@0.2.31 -g && npm i rsgen -g && npm i && npm run build && npm run doc", - "kickstart:staging": "npm i typescript@4.2.2 -g && npm i typeorm@0.2.32 -g && npm i && npm run build", - "kickstart:production": "npm i typescript@4.2.2 -g && npm i typeorm@0.2.32 -g && npm i && npm run build:production && tsc", + "doc": "apidoc -i src/ -o docs/apidoc/", + "kickstart": "npm i typescript@4.2.2 -g && npm i typeorm@0.2.32 -g && npm i rsgen -g && npm i && mkdir -p ./dist/env", + "kickstart:dev": "npm run kickstart && npm run init && cp ./src/env/development.env ./dist/env/development.env && cp ./src/env/test.env ./dist/env/test.env && tsc", + "kickstart:staging": "npm run kickstart && cp ./src/env/staging.env ./dist/env/staging.env && tsc", + "kickstart:production": "npm run kickstart && cp ./src/env/production.env ./dist/env/production.env && tsc", + "kickstart:test": "npm run kickstart && cp ./src/env/test.env ./dist/env/test.env && tsc", "test": "nyc --reporter=html --report-dir=./reports/nyc-coverage npm-run-all -s test:*", "test:unit": "./node_modules/.bin/mocha ./test/units/00-application.unit.test.js --exit --reporter spec --timeout 10000 --env test", "test:e2e": "typeorm schema:drop && typeorm schema:sync && ./node_modules/.bin/mocha ./test/e2e/00-api.e2e.test.js --exit --reporter spec --timeout 10000 --env test", From 05b12e2ef539df3df08dab2b942b55ee5a48ae40 Mon Sep 17 00:00:00 2001 From: Steve Date: Sun, 25 Apr 2021 10:11:21 +0200 Subject: [PATCH 5/7] Improve CI duration --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 389215e..758a4a4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ node_js: services: mysql before_install: - mysql -e 'CREATE DATABASE IF NOT EXISTS typeplate_test;' -script: mkdir -p ./dist/logs ./dist/env ./dist/public/archives ./dist/public/documents ./dist/public/audios ./dist/public/videos ./dist/public/images/master-copy ./dist/public/images/rescale && cp ./src/env/template.env ./dist/env/test.env && npm i typescript -g && npm i typeorm -g && npm i && tsc && typeorm schema:sync && npm run ci:test +script: mkdir -p ./dist/env && cp ./src/env/template.env ./dist/env/test.env && npm i typescript -g && npm i typeorm -g && npm i && tsc && typeorm schema:sync && npm run ci:coverage after_success: npm run ci:coverage cache: directories: From a3415fd365ccc133efb0c69a937162519e52080d Mon Sep 17 00:00:00 2001 From: Steve Date: Sun, 25 Apr 2021 10:19:24 +0200 Subject: [PATCH 6/7] Simplify CI process --- .travis.yml | 3 +-- package.json | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 758a4a4..ea798da 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,8 +4,7 @@ node_js: services: mysql before_install: - mysql -e 'CREATE DATABASE IF NOT EXISTS typeplate_test;' -script: mkdir -p ./dist/env && cp ./src/env/template.env ./dist/env/test.env && npm i typescript -g && npm i typeorm -g && npm i && tsc && typeorm schema:sync && npm run ci:coverage -after_success: npm run ci:coverage +script: mkdir -p ./dist/env && cp ./src/env/template.env ./dist/env/test.env && npm i typescript -g && npm i typeorm -g && npm i && tsc && typeorm schema:sync && npm run ci:test cache: directories: - "node_modules" \ No newline at end of file diff --git a/package.json b/package.json index 4fa76ae..4abea2b 100644 --- a/package.json +++ b/package.json @@ -40,8 +40,7 @@ "init": "npm-run-all -s init:*", "init:env": "cp ./src/env/template.env ./src/env/development.env && cp ./src/env/template.env ./src/env/test.env && cp ./src/env/template.env ./src/env/staging.env && cp ./src/env/template.env ./src/env/production.env && rm -rf ./src/env/template.env", "init:repository": "rm -rf ./.git && git init && git add . --all && git commit -m \"First commit\"", - "ci:coverage": "nyc --reporter=lcov --report-dir=./reports/coverage npm-run-all -s test:* && cat ./reports/coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./reports/coverage", - "ci:test": "npm-run-all -s test:*", + "ci:test": "nyc --reporter=lcov --report-dir=./reports/coverage npm-run-all -s test:* && cat ./reports/coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./reports/coverage", "doc": "apidoc -i src/ -o docs/apidoc/", "kickstart": "npm i typescript@4.2.2 -g && npm i typeorm@0.2.32 -g && npm i rsgen -g && npm i && mkdir -p ./dist/env", "kickstart:dev": "npm run kickstart && npm run init && cp ./src/env/development.env ./dist/env/development.env && cp ./src/env/test.env ./dist/env/test.env && tsc", From d0e8e86739b287be042a9d64cf0a9f63d20509ea Mon Sep 17 00:00:00 2001 From: Steve Date: Sun, 25 Apr 2021 10:20:09 +0200 Subject: [PATCH 7/7] Update changelog --- CHANGELOG.md | 14 +++++++++++++- package.json | 2 +- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d353bd..674a698 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,11 +7,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). -## [v1.4.4](https://github.com/konfer-be/typeplate/compare/v1.4.3...v1.4.4) +## [v1.4.5](https://github.com/konfer-be/typeplate/compare/v1.4.4...v1.4.5) + +### Commits + +- Remove Typedoc [`236583c`](https://github.com/konfer-be/typeplate/commit/236583c5c7737c83b92eda41d969d20a1f269ff9) +- Simplify starting project [`78322fb`](https://github.com/konfer-be/typeplate/commit/78322fbfad63a7034ceb425f8d8e88cdc4368083) +- Create directories in env config instead of npm script [`8858438`](https://github.com/konfer-be/typeplate/commit/8858438775cb3ae425d467c5ff83aaca865a08ab) +- Remove Husky hooks [`5b5d3dc`](https://github.com/konfer-be/typeplate/commit/5b5d3dcd5bc46dd45abf57ef24674bf48973c9a6) +- Simplify CI process [`a3415fd`](https://github.com/konfer-be/typeplate/commit/a3415fd365ccc133efb0c69a937162519e52080d) +- Improve CI duration [`05b12e2`](https://github.com/konfer-be/typeplate/commit/05b12e2ef539df3df08dab2b942b55ee5a48ae40) + +## [v1.4.4](https://github.com/konfer-be/typeplate/compare/v1.4.3...v1.4.4) - 2021-04-24 ### Commits - API doc, update dependencies, fix media routes path in doc [`f9c3043`](https://github.com/konfer-be/typeplate/commit/f9c30436bd99487c6da11725ad3c737cf5ffc3f6) +- Update changelog [`5d02848`](https://github.com/konfer-be/typeplate/commit/5d0284872a30bc33a993c9adf3669654a0981d4d) ## [v1.4.3](https://github.com/konfer-be/typeplate/compare/v1.4.2...v1.4.3) - 2021-04-23 diff --git a/package.json b/package.json index 4abea2b..17ea0f4 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "version": "1.4.4", + "version": "1.4.5", "engines": { "node": ">=14.16", "npm": ">=6.14.11"