Commit graph

23 commits

Author SHA1 Message Date
Reto Brunner c5fcc5d72f install: allow installation of local packages
It may not be desirable to host all plugins on npm, allow for local packages to
be installed given a package name with a `file:` prefix.

This is still more restrictive than what yarn would support but allows us to still
verify the thelounge compatibility by reading the package.json file.

`yarn add` messes up with local filepaths and generates a lockfile that is
"outdated" as far as any other yarn commands go, which makes them error out.

For some reason `yarn install` fixes that and hence we run that after an install.
Here's the diff of yarn.lock between the broken state after `yarn add file:$path`
and `yarn install`
	--- yarn.lock.2.afterAdd	2021-06-02 00:10:52.365134018 +0200
	+++ yarn.lock.3.afterinstall	2021-06-02 00:13:27.122760442 +0200
	@@ -2194,7 +2194,7 @@
	     safe-buffer "^5.1.2"
	     yallist "^3.0.3"

	-thelounge-plugin-shortcuts@/home/reto/sourcecode/thelounge-plugin-shortcuts:
	+"thelounge-plugin-shortcuts@file:../../sourcecode/thelounge-plugin-shortcuts":
	   version "1.0.12"
	   dependencies:
	     thelounge "4.2.0"

The only thing it does is switch an absolute path to a relative one for whatever
reason.
2021-06-05 13:01:55 +02:00
Al McKinlay 86e570efb2 Add version support for packages. 2020-08-21 15:03:12 +01:00
Pavel Djundik 881b3eda19 Run format after updating to prettier 2.0 2020-03-21 22:55:36 +02:00
Pavel Djundik e3a2fa7dd1 Create packages/package.json on server start 2019-12-14 20:48:25 +02:00
Pavel Djundik 24e41327a3 Provide fake $HOME env to Yarn commands 2019-12-13 17:45:10 +02:00
Alistair McKinlay 133e7bf710 Format js/vue with prettier 2019-07-19 11:27:40 +01: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 472d618033 Remove log from global 2018-06-15 23:31:06 +03: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
Ben Harris 56004ec338 catch stderr from yarn subprocess, addresses #2301 2018-03-28 12:27:51 -04:00
realies a941fe97a6 Add install command support for package version 2018-03-07 19:59:03 +02:00
Pavel Djundik fee81e78e1 Replace colors.js with chalk 2018-03-02 20:28:54 +02:00
Pavel Djundik 913e88185e Change (un)install commands to use locally installed yarn 2018-02-20 11:28:14 +02:00
Pavel Djundik 0d074f1cbe Provide exact version into npm install command 2018-02-14 12:09:02 +02: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 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 0482747781
Only use helpers and not shared variables around path helpers
This refactor has a few benefits, for example there cannot be a rogue update of `Helper.CONFIG_PATH` or something.
2017-12-07 23:02:32 -05:00
Jérémie Astori 1dc92d8934
Enforce dangling commas with ESLint
¯\_(ツ)_/¯
2017-11-15 01:35:15 -05:00
Jérémie Astori 0cc9c4166b Merge pull request #1583 from thelounge/astorije/thelounge-packages
Use `thelounge` instead of `lounge` when it comes to external packages
2017-09-30 23:47:02 -04:00
Pavel Djundik 1c4d9351d5 Add info message before calling packageJson 2017-09-29 10:54:03 +03:00
Jérémie Astori 1e10cc66a6
Use thelounge instead of lounge when it comes to external packages 2017-09-29 00:03:01 -04:00
Pavel Djundik 416ebf97ff Create 'lounge install' command 2017-09-20 10:59:06 +03:00