Commit graph

160 commits

Author SHA1 Message Date
Pavel Djundik 41e5090fb0 Do not crash on first run due to config.js not existing 2019-10-22 15:00:05 +03:00
Pavel Djundik 5d13e4c97d Check config owner synchronously
Fixes async warning printing during prompt when adding a user
2019-09-24 22:06:04 +03:00
Pavel Djundik 4753d58c0b Display an error on unknown command 2019-08-12 11:03:52 +03:00
Alistair McKinlay 20816d509d Add check for outdated packages, and show on the help screen. 2019-07-19 13:33:09 +01:00
Alistair McKinlay 133e7bf710 Format js/vue with prettier 2019-07-19 11:27:40 +01:00
Pavel Djundik 295b3a4251 Correctly parse numbers when passed in CLI
Fixes #3295
2019-07-12 10:56:19 +03:00
Pavel Djundik 1425130436 Update eslint and eslint-plugin-vue, fix rules 2019-06-25 11:51:47 +03:00
Pavel Djundik a9e774b13b Print a warning when running as root 2019-05-20 18:17:35 +03:00
Pavel Djundik 7c1efb18d1 Print a warning on invalid keys in config 2019-03-05 13:49:50 +02:00
Pavel Djundik c870545b46 Use require.resolve for yarn 2019-01-24 18:52:15 +02:00
Pavel Djundik 6937e6e772 Set yarn cache folder in the packages folder
Fixes thelounge/thelounge-docker#71
2019-01-16 12:51:52 +02:00
Pavel Djundik e033010841 Rename manifest.json to thelounge.webmanifest
This makes express serve it with correct content-type of application/manifest+json

Refs:
- https://w3c.github.io/manifest/#media-type-registration
- https://webhint.io/docs/user-guide/hints/hint-manifest-file-extension/
2018-11-13 13:33:25 +02:00
Pavel Djundik d9abe9224e Warn if config owner doesn't match process uid 2018-06-19 17:18:06 +03:00
Pavel Djundik 472d618033 Remove log from global 2018-06-15 23:31:06 +03:00
Jake Walker cd81a2bcec Added upgrade command
Using suggested changes


Changes suggested by astorije


Upgrade parameter removed and allow multiple packages to upgrade


Fixed


Minor fix
2018-04-29 08:47:39 +01:00
Pavel Djundik f7d34739b5 Make a separate function to execute yarn commands; fallback to global yarn
Fixes #2301
Fixes #2348
2018-04-24 21:38:54 +03:00
Jérémie Astori d6e6dab565 Fix a forgotten npm reference 2018-04-06 12:52:53 +03:00
Ben Harris 56004ec338 catch stderr from yarn subprocess, addresses #2301 2018-03-28 12:27:51 -04:00
Jérémie Astori 2954afd77d
Remove thelounge config from the CLI 2018-03-11 14:36:57 -04:00
realies a941fe97a6 Add install command support for package version 2018-03-07 19:59:03 +02:00
Jérémie Astori 9107f9e351
Merge pull request #2145 from thelounge/xpaw/chalk
Replace colors.js with chalk
2018-03-03 02:42:04 -05:00
Pavel Djundik fee81e78e1 Replace colors.js with chalk 2018-03-02 20:28:54 +02:00
Pavel Djundik eaf8c35f40 Warn about old config folder 2018-03-02 19:05:30 +02:00
Pavel Djundik 913e88185e Change (un)install commands to use locally installed yarn 2018-02-20 11:28:14 +02:00
Pavel Djundik c733e72e7a Auto-fix code for padding-line-between-statements rule 2018-02-20 09:28:04 +02:00
Pavel Djundik 6c7ddd0f47
Merge pull request #1734 from thelounge/astorije/thelounge_home
Switch default home location to `~/.thelounge`
2018-02-19 20:54:57 +02:00
Pavel Djundik 51684f7a2a Switch default home location to ~/.thelounge and remove support of .lounge_home 2018-02-19 20:43:53 +02:00
Jérémie Astori c7ad6d9d3d
Merge pull request #2077 from thelounge/astorije/rm-lounge-cli
Remove support for the `lounge` CLI (which was replaced with `thelounge`)
2018-02-19 13:27:47 -05:00
Jérémie Astori 69a4207ea4
Remove support for the lounge CLI (which was replaced with thelounge) 2018-02-19 13:14:14 -05:00
Pavel Djundik a3e448acf5 Enable no-var rule
Fixes #1961
2018-02-19 19:49:39 +02:00
Pavel Djundik 2685f46669
Merge pull request #1834 from thelounge/astorije/rm-deprecated-options
Remove deprecated options for `thelounge start`
2018-02-19 19:10:14 +02:00
Pavel Djundik a09b21decd
Merge pull request #1733 from thelounge/astorije/home_option_env_var
Remove deprecated support for the `--home` option and `$LOUNGE_HOME` environment variable
2018-02-19 18:51:44 +02:00
Jérémie Astori 416f45d1e3 Use some ES6/Node v4-only syntax when possible 2018-02-19 18:30:00 +02:00
Jérémie Astori c432ee431d Switch to Node v6 as the oldest version we support
Removed a deprecation notice I added in an earlier commit (ef1c59072c).
2018-02-19 18:30:00 +02:00
Pavel Djundik 0d074f1cbe Provide exact version into npm install command 2018-02-14 12:09:02 +02:00
Jérémie Astori 6d931e8dcb
Make sure packages are correctly removed from package.json when uninstalled 2018-02-13 01:06:31 -05:00
Jérémie Astori 2c570fa9ef
Load packages from package.json, fix loading thelounge metadata from the wrong file, add tests 2018-02-13 01:06:31 -05:00
Jérémie Astori 432023fc7e
Make sure existing packages (and themes) are not deleted when installing a new one on Node.js v8
- When installing a package on Node v8 (or whatever npm version ships with it - v5), all packages not listed in `package.json` are removed. Since we explicitly added `--no-save`, installing a theme would delete the previous one. I am now checking that the file already exists or not. This means that it will still happen to people the next time they run `thelounge install`, because the previous install did not save into `package.json` :/
- Adding `--save` to make sure that the same, correct behavior is done on Node v6 as well (npm v3)
- Adding `--save-exact` for good measure.
2018-01-16 20:25:35 -05:00
Jérémie Astori 45dc52886e
Fix thelounge uninstall command
- Exit with code 1 when package was not installed
- Run a pre-step to check if package is installed before uninstalling. I have tried every possible way I could think of without that first `npm list` step based on output of `npm uninstall`, but different npm versions produce different outputs, so there is nothing reliable. This is a more robust way to do so anyway.
- Consolidate error handlers
2018-01-13 02:00:37 -05:00
Jérémie Astori d2388dc623
Bail when uninstalling if package.json for TL packages does not exist
It is on purpose that the message is the same than when a package was not installed. From a user standpoint, it only matters that this specific package was not installed.
2018-01-06 12:12:10 -05:00
Jérémie Astori 3971ecff63
Customize a bit thelounge install|uninstall
- Hides progress bars that flash when installing/uninstalling as it does not bring real value here, at least for now
- Inform user if package being uninstalled was not actually installed
- Do not display npm outputs, mention which version was installed (this will probably need refining when installing packages with dependencies)
2018-01-06 12:12:10 -05:00
Jérémie Astori d9cb640c2a
Add a thelounge uninstall command to remove themes and packages 2018-01-06 12:12:09 -05:00
Jérémie Astori 96d3e58734
Remove deprecated options for thelounge start
This was replaced with the `--config` option.
2017-12-13 01:33:25 -05:00
Jérémie Astori 826482bb5b
Remove deprecated support for the --home option and $LOUNGE_HOME environment variable 2017-12-12 02:54:50 -05:00
Jérémie Astori d89112173d
Fix command line index parsing options (--home and --config) twice 2017-12-11 23:53:51 -05:00
Jérémie Astori 6547d18e7f
Color all references to deprecations in bold red 2017-12-11 23:48:52 -05:00
Jérémie Astori 07a01b0547
Deprecate existing options of thelounge start in favor or -c, --config 2017-12-11 23:48:52 -05:00
Jérémie Astori df2787d3e9
Add a --config / -c option to the start CLI command to arbitrarily override any configuration key
The biggest caveat is that JS code (such as functions) will not be interpreted as such, on purpose, for security precautions. If such thing is needed, then a configuration file must be used.
2017-12-11 23:48:52 -05:00
Jérémie Astori b90c224a99
Define a raw logger to avoid using console.log, use it in extra help for environment variables, and add a test for this
This has multiple benefits:

- Respects the "Do not mock what you do not own" principle, instead we mock `log.raw` when necessary
- Lets us not re-assign `console.log`, which breaks as Mocha uses `console.log` as well
- Save and restore initial `log.raw` in test hooks (before/after), otherwise this would break Mocha/Chai
2017-12-11 23:48:51 -05:00
Jérémie Astori c21aee3d4a
Do not load user commands or display them on --help if public mode or using LDAP 2017-12-09 01:51:08 -05:00