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/.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/CHANGELOG.md b/CHANGELOG.md index 6007e9161..5bd0d1823 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ - Fix some prettier style [#1356](https://github.com/nextcloud/cookbook/pull/1356) @christianlupus - Fix styling of package.json file +- Migrate the dev environment to [docker-dev by Julius Haertl](https://github.com/juliushaertl/nextcloud-docker-dev) + [#1441](https://github.com/nextcloud/cookbook/pull/1441) @christianlupus + ## 0.9.18 - 2022-11-09 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/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", 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 d64f0e8f8..711193c8e 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. @@ -63,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: 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')), },