Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

foal CLI [request] #607

Closed
anonimusprogramus opened this issue Dec 26, 2019 · 2 comments
Closed

foal CLI [request] #607

anonimusprogramus opened this issue Dec 26, 2019 · 2 comments

Comments

@anonimusprogramus
Copy link
Contributor

Based on my experiences (ymmv):

  1. From time to time, I added controller/entities/services to its folder, usually by using CLI, but sometimes manually.

Would it be possible to have a command to re-index the index.ts with newest file list, like foal do reindex?

  1. Sometimes I had to clean compiled files in /build folder before re-starting server.

A command for cleaning then starting server might be a good idea.

FoalTS rocks, thanks!

@LoicPoullain
Copy link
Member

FoalTS rocks, thanks!

Thanks!

Sometimes I had to clean compiled files in /build folder before re-starting server.

Thank for the suggestion. It's true that it is sometimes annoying (especially with migrations and spec files). I added a new command foal rmdir build to remove recursively a directory. It will be released with v1.6. Once done, here is a way to update your package.json to obtain the desired behavior:

  "scripts": {
    "build:app": "foal rmdir build/app && copy-cli \"src/**/*.html\" build && tsc -p tsconfig.app.json",
    "build:app:w": "tsc -p tsconfig.app.json -w",
    "start": "node ./build/index.js",
    "start:w": "supervisor -w ./build --no-restart-on error ./build/index.js",
    "develop": "npm run build:app && concurrently \"npm run build:app:w\" \"npm run start:w\"",
    "build:test": "foal rmdir build && copy-cli \"src/**/*.html\" build && tsc -p tsconfig.test.json",
    "build:test:w": "tsc -p tsconfig.test.json -w",
    "start:test": "mocha --file \"./build/test.js\" \"./build/**/*.spec.js\"",
    "start:test:w": "mocha --file \"./build/test.js\" -w \"./build/**/*.spec.js\"",
    "test": "npm run build:test && concurrently \"npm run build:test:w\" \"npm run start:test:w\"",
    "build:e2e": "foal rmdir build/e2e && copy-cli \"src/**/*.html\" build && tsc -p tsconfig.e2e.json",
    "build:e2e:w": "tsc -p tsconfig.e2e.json -w",
    "start:e2e": "mocha --file \"./build/e2e.js\" \"./build/e2e/**/*.js\"",
    "start:e2e:w": "mocha --file \"./build/e2e.js\" -w \"./build/e2e/**/*.js\"",
    "e2e": "npm run build:e2e && concurrently \"npm run build:e2e:w\" \"npm run start:e2e:w\"",
    "build:scripts": "foal rmdir build/scripts && tsc -p tsconfig.scripts.json",
    "build:scripts:w": "tsc -p tsconfig.scripts.json -w",
    "lint": "eslint --ext ts src",
    "lint:fix": "eslint --ext ts --fix src",
    "build:migrations": "foal rmdir build/migrations && tsc -p tsconfig.migrations.json",
    "migration:generate": "./node_modules/.bin/typeorm migration:generate",
    "migration:run": "./node_modules/.bin/typeorm migration:run",
    "migration:revert": "./node_modules/.bin/typeorm migration:revert"
  },

Would it be possible to have a command to re-index the index.ts with newest file list, like foal do reindex?

I'm not sure this problem is shared by many users and implementing this feature would require a bit of work. I'd rather focus on other features for now ;)

@LoicPoullain
Copy link
Member

PR merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

2 participants