From 20b118c86561a93a752e980f03b1ed659b84c34e Mon Sep 17 00:00:00 2001 From: Christian Wolf Date: Sat, 14 Jan 2023 14:05:51 +0100 Subject: [PATCH 1/4] Chnage the root of the app to prevent issues with code checker Signed-off-by: Christian Wolf --- .eslintrc.yml | 2 ++ webpack.config.js | 1 + 2 files changed, 3 insertions(+) diff --git a/.eslintrc.yml b/.eslintrc.yml index c8d7d052e..55545c99a 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -19,6 +19,8 @@ rules: - error - allowForLoopAfterthoughts: true +root: true + settings: "import/resolver": alias: diff --git a/webpack.config.js b/webpack.config.js index 2eeea9c77..89f50e530 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -16,6 +16,7 @@ const isDev = buildMode === 'development' function cookbookConfig (env) { const config = merge(webpackConfig, { + context: path.resolve(__dirname), entry: { guest: path.resolve(path.join('src', 'guest.js')), }, From 2654da4b0dc3a09ed655f6ec69362c56e341ae3e Mon Sep 17 00:00:00 2001 From: Christian Wolf Date: Sat, 14 Jan 2023 14:15:00 +0100 Subject: [PATCH 2/4] Fixed paths to various parts Signed-off-by: Christian Wolf --- .vscode/launch.json | 22 +++++++++++----------- .vscode/settings.json | 2 +- cookbook.code-workspace | 3 ++- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 3ee373bce..68c578734 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -4,23 +4,23 @@ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ - { - "name": "Xdebug on 9000", - "type": "php", - "request": "launch", - "port": 9000, - "pathMappings": { - "/var/www/html/custom_apps/cookbook": "${workspaceFolder:cookbook}", - "/var/www/html": "${workspaceFolder:base}" - } - }, + //{ + // "name": "Xdebug on 9000", + // "type": "php", + // "request": "launch", + // "port": 9000, + // "pathMappings": { + // "/var/www/html/custom_apps/cookbook": "${workspaceFolder:cookbook}", + // "/var/www/html": "${workspaceFolder:base}" + // } + //}, { "name": "Xdebug on 9003", "type": "php", "request": "launch", "port": 9003, "pathMappings": { - "/var/www/html/custom_apps/cookbook": "${workspaceFolder:cookbook}", + "/var/www/html/apps-extra/cookbook": "${workspaceFolder:cookbook}", "/var/www/html": "${workspaceFolder:base}" } } diff --git a/.vscode/settings.json b/.vscode/settings.json index cdc7a577c..285c6318e 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,7 +3,7 @@ "less.validate": false, "scss.validate": false, "intelephense.environment.includePaths": [ - "../../base/lib", + "../../lib", ], "intelephense.files.exclude": [ "**/.git/**", diff --git a/cookbook.code-workspace b/cookbook.code-workspace index 65f467f0c..4a979312b 100644 --- a/cookbook.code-workspace +++ b/cookbook.code-workspace @@ -4,7 +4,8 @@ "path": "." }, { - "path": "../../base" + "path": "../..", + "name": "base" }, { "path": "tests/phpunit/vendor", From e356ca325dbbe9e0d59b030447bead2c0dd648ac Mon Sep 17 00:00:00 2001 From: Christian Wolf Date: Sat, 14 Jan 2023 14:28:38 +0100 Subject: [PATCH 3/4] Update documentation and Chnagelog Signed-off-by: Christian Wolf --- CHANGELOG.md | 4 +++- docs/dev/contributing/setup.md | 4 ---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cf6dc924e..b0def0190 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,11 +2,13 @@ ### Fixed - Make "None" category string translatable - [1323](https://github.com/nextcloud/cookbook/pull/1344) @seyfeb + [#1323](https://github.com/nextcloud/cookbook/pull/1344) @seyfeb ### Maintenance - Update dependency for GitHub pages builder - Fix package.json sort order +- Migrate the dev environment to [docker-dev by Julius Haertl](https://github.com/juliushaertl/nextcloud-docker-dev) + [#1440](https://github.com/nextcloud/cookbook/pull/1440) @christianlupus ## 0.10.1 - 2022-11-09 diff --git a/docs/dev/contributing/setup.md b/docs/dev/contributing/setup.md index d64f0e8f8..3112ac3f6 100644 --- a/docs/dev/contributing/setup.md +++ b/docs/dev/contributing/setup.md @@ -41,10 +41,6 @@ You might need to adopt the path specification according to your local setup. Al Be sure to recreate the containers after modifying `docker-compose.yml` using `docker-compose up -d`. -### Usage of [nextcloud-docker-debug](https://github.com/christianlupus/nextcloud-docker-debug) by christianlupus - -The installation process is described in the README of that project. Feel free to contact the author in cases of problems. - ## Install PHP dependencies The app needs some depdencies in the PHP backend. These are managed via [composer](http://composer.org). Make sure, you have composer ready on your development machine. From 33cf2a2d2f02e5a6186c492fea047072a5f774fc Mon Sep 17 00:00:00 2001 From: Christian Wolf Date: Sat, 14 Jan 2023 14:35:11 +0100 Subject: [PATCH 4/4] Added and fix some documentation Signed-off-by: Christian Wolf --- DEVELOPMENT.md | 15 +-------------- docs/dev/contributing/code_coverage.md | 7 +++++++ docs/dev/contributing/index.md | 5 +++++ docs/dev/contributing/setup.md | 4 +--- 4 files changed, 14 insertions(+), 17 deletions(-) create mode 100644 docs/dev/contributing/code_coverage.md diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index a21a57536..42632c2cc 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -2,17 +2,4 @@ We are happily accepting code contributions of different types. Here are some hints on this. -## Development environment - -For now, there is no included documentation on how to setup your environment best. - -You might however have alook at [this repository](https://github.com/christianlupus/nextcloud-docker-debug). -It describes **one** way to get a running development environment for the app. - -## Unit tests and code coverage - -Currently there is a github action in place that does automatic unit testing upon pushing to github. -These tests are generating code coverage reports as well. - -Firstly, for each such run (see in the actions view or the PR tests) there is the option to download the code coverage as zipped HTML page. -Secondly, the [codecov.io service](https://codecov.io/gh/nextcloud/cookbook) is installed, where more details about the coverage can be found. \ No newline at end of file +Please have a look at the [developer documentation](https://nextcloud.github.io/cookbook/dev/) in general and about [contributing](https://nextcloud.github.io/cookbook/dev/contributing/). diff --git a/docs/dev/contributing/code_coverage.md b/docs/dev/contributing/code_coverage.md new file mode 100644 index 000000000..8e25ddc7a --- /dev/null +++ b/docs/dev/contributing/code_coverage.md @@ -0,0 +1,7 @@ +## Unit tests and code coverage + +Currently there is a github action in place that does automatic unit testing upon pushing to github. +These tests are generating code coverage reports as well. + +Firstly, for each such run (see in the actions view or the PR tests) there is the option to download the code coverage as zipped HTML page. +Secondly, the [codecov.io service](https://codecov.io/gh/nextcloud/cookbook) is installed, where more details about the coverage can be found. diff --git a/docs/dev/contributing/index.md b/docs/dev/contributing/index.md index 7a08f395a..3eb3c9bac 100644 --- a/docs/dev/contributing/index.md +++ b/docs/dev/contributing/index.md @@ -9,7 +9,12 @@ If you need additional information or find any missing parts, feel free to conta ## Coding The first step, when you want to help with coding on the app, will be to setup your development environment. We prepared a [page on the setup](setup) to help you get started with the technical requirements. +See also the page on [code coverage](code_coverage). ## Translating Feel free to have a look at the [transifex page on the cookbook app](https://www.transifex.com/nextcloud/nextcloud/cookbook/). Any translations done there will be synchronized on a nightly base. + +## Documentation +We also need helpers in writing documentation for various levels and user groups. +If you think you can help by writing appropriate documentation or tutorials, feel free to step forward. diff --git a/docs/dev/contributing/setup.md b/docs/dev/contributing/setup.md index 3112ac3f6..711193c8e 100644 --- a/docs/dev/contributing/setup.md +++ b/docs/dev/contributing/setup.md @@ -59,11 +59,9 @@ The frontend is based on Vue. Some Javascript/NPM dependencies are needed in ord Open a terminal to the directory where you cloned the cookbook app. Then download the dependencies with: ``` -npm install +npm ci ``` -To reset you can remove the folder `node_modules` and the file `package-lock.json`. Then you can install all packages from scratch. - ## Create the bundled assets for the frontend Use the NPM script to prepare the Webpack bundle: