diff --git a/README.md b/README.md index e09c816..a2633f3 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ ## What is dkan-ddev-addon? -DKAN DDev Addon provides some glue scripts and config for doing local development of -DKAN itself and also DKAN-related Drupal sites. +DKAN DDev Add-on provides commands and config for development of +DKAN itself and DKAN-enabled Drupal sites in a local docker environment. ## Documentation diff --git a/commands/host/dkan-init b/commands/host/dkan-init index 7559d3d..432bd02 100644 --- a/commands/host/dkan-init +++ b/commands/host/dkan-init @@ -90,8 +90,6 @@ if [ $INIT_MODULEDEV = true ]; then ddev composer require getdkan/dkan:@dev --no-install fi -# TODO: Change this after https://www.drupal.org/project/moderated_content_bulk_publish/issues/3301389 -ddev composer require drupal/pathauto:^1.10 --no-install ddev composer install # Adjust settings for our special case. diff --git a/commands/web/dkan-frontend-install b/commands/web/dkan-frontend-install index 46ef8d4..162f200 100755 --- a/commands/web/dkan-frontend-install +++ b/commands/web/dkan-frontend-install @@ -1,33 +1,13 @@ #!/bin/bash #ddev-generated -## Description: Add the frontend for DKAN. +## Description: Add the decoupled frontend for DKAN. ## Usage: dkan-frontend-install ## Flags: [{"Name":"theme", "Usage":"Whether or not to install default front-end Drupal theme. 0 or 1.", "DefValue": "1"}] ## Example: "ddev dkan-frontend-install" (will install default frontend theme by default), "ddev dkan-frontend-install --theme 0" # TODO: Make a CI flag. -# Glean flag arguments. -FRONTEND_THEME_INSTALL=1 -while :; do - case ${1:-} in - --theme) - shift - FRONTEND_THEME_INSTALL=${1:-} - ;; - --) # End of all options. - break - ;; - -?*) - printf 'WARN: Unknown option (ignored): %s\n' "$1" >&2 - ;; - *) # Default case: No more options, so break out of the loop. - break ;; - esac - shift -done - FRONTEND_TMP='src/tmp' FRONTEND_DOCROOT_DIR='docroot/frontend' FRONTEND_VCS_URL='https://github.com/GetDKAN/data-catalog-app/' @@ -35,7 +15,6 @@ FRONTEND_VCS_URL='https://github.com/GetDKAN/data-catalog-app/' #FRONTEND_VCS_REF='cypress-update-8.7.0' #FRONTEND_VCS_REF='1.0.4' FRONTEND_VCS_REF='no-node-sass' -FRONTEND_THEME='dkan_js_frontend_bartik' if [[ -L $FRONTEND_DOCROOT_DIR ]]; then echo "ERROR: Symlink $FRONTEND_DOCROOT_DIR already exists." @@ -55,11 +34,6 @@ if [ ! -z "$DKAN_MODULE_PATH" ]; then fi fi -# TODO: We're hardcoding this VCS ref because dkan module's configured one breaks the build. -FRONTEND_VCS_URL='https://github.com/GetDKAN/data-catalog-app/' -FRONTEND_VCS_REF='no-node-sass' - - drush pm-enable dkan_js_frontend -y drush config-set system.site page.front '/home' -y drush cr @@ -76,4 +50,8 @@ cd $FRONTEND_DOCROOT_DIR || exit # TODO: Make sure we don't miss important warnings. npm --loglevel=error install +drush pm-enable dkan_js_frontend -y +drush config-set system.site page.front '/home' -y +drush cr + echo " ** Frontend install complete." diff --git a/docs/frontend.md b/docs/frontend.md index 4835b79..27b9a0c 100644 --- a/docs/frontend.md +++ b/docs/frontend.md @@ -1,6 +1,6 @@ # Frontend Application Management -DKAN includes a front-end application to display and query data. +DKAN includes a decoupled front-end application to display and query data. This front end can be managed using the following tools: diff --git a/docs/getting-started.md b/docs/getting-started.md index d07932b..272417b 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -2,23 +2,32 @@ ## Start a new DKAN site -First, set up your DKAN site: +First, make a directory for your project. + + mkdir my-project && cd my-project + +Give DDev just enough configuration to get started. - # Make a directory for your project. - mkdir my-project && cd my_project - # Give DDev just enough configuration to get started. ddev config --auto - # Grab the addon so you get the fun stuff. - # Note that eventually we'll be 'official' and you won't have - # to install this from a tarball. + +Grab the DKAN addon to get helpful DKAN commands. +Note that eventually we'll be 'official' and you won't have +to install this from a tarball. + ddev get https://github.com/GetDKAN/dkan-ddev-addon/archive/refs/heads/main.tar.gz - # Make sure we're using the addon. + +Make sure we're using the addon. + ddev restart - # Initialize the site. + +Initialize the site. + ddev dkan-init - # This will ask you if it's OK to remove most of the files in your project. - # You can answer yes since there's nothing there right now anyway. - # Now install Drupal. + +This will ask you if it's OK to remove most of the files in your project. +You can answer yes since there's nothing there right now anyway. +Now install Drupal. + ddev dkan-site-install Now we have a useful DKAN-based Drupal site, so let's take a look, and use the @@ -31,29 +40,35 @@ standard tools to log in: Note that if you need help with any of the DDev commands, you can add `--help` on the command line and get help: - % ddev dkan-init --help + ddev dkan-init --help Build the Drupal codebase for a DKAN site. (shell host container command) Usage: - ddev dkan-init [flags] + ddev dkan-init [flags] + + Examples: + dkan-init + dkan-init --project-version 10.0.x-dev Flags: - --force Force init even if there are files present which could be deleted. - -h, --help help for dkan-init - --moduledev Set up the file system for DKAN module development. + --force Force init even if there are files present which could be deleted. + -h, --help help for dkan-init + --moduledev Set up the file system for DKAN module development. + --project-version Specify a Drupal core version. Default 9.5.x-dev. Global Flags: -j, --json-output If true, user-oriented output will be in JSON format. -## Dev work on the DKAN module +## Contributing to DKAN + +If you are doing development work on the DKAN module itself, add the --moduledev flag to the dkan-init command: -If you are doing development work on the DKAN module itself, you can substitute -the `ddev dkan-init --moduledev` command for `ddev dkan-init`. + ddev dkan-init --moduledev This will clone the dkan project into its own directory and tell Composer to use that repo as the getdkan/dkan package. -## Frontend app installation and build +## Decoupled Frontend app installation and build DKAN can integrate with a JS/headless app. The DKAN DDev addon has special commands for dealing with this. @@ -64,11 +79,6 @@ First we gather all the dependencies and files necessary for the frontend: ddev dkan-frontend-install -Note that this command installs the default frontend Drupal theme into the Drupal -site. If have your own and would rather not add the default one, you can use - - ddev dkan-frontend-install --theme 0 - ### Build Now that you have all the dependencies, you can build the frontend: @@ -77,3 +87,13 @@ Now that you have all the dependencies, you can build the frontend: Currently this command essentially calls `npm run build` within the web container of DDev. + +## Additional Commands + +Run `ddev` by itself to get a list of commands available to you. + +Run `ddev get --list --all` to get a list of other DDEV add-ons. +## Additional Resources + +- [DDEV Documentation](https://ddev.readthedocs.io/en/stable/users/usage/) +- [DKAN Documentation](https://demo.getdkan.org/modules/contrib/dkan/docs/index.html)