diff --git a/.gitpod.yml b/.gitpod.yml index b67287a..c16c732 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -2,35 +2,36 @@ image: file: .gitpod/.gitpod.Dockerfile tasks: - # Nuxt/Druxt - - name: nuxt/druxt + # Drupal + - name: ddev/drupal init: | - # Installing Nuxt/Druxt frontend. - .gitpod/setup-nuxt.sh - gp sync-done npm + # Installing DDev and Drupal backend. + .gitpod/download-ddev-images.sh + .gitpod/setup-drupal.sh command: | - .gitpod/setup-nuxt.sh - gp sync-done npm - gp sync-await drupal - cd $GITPOD_REPO_ROOT/nuxt && NUXT_TELEMETRY_DISABLED=1 npm run dev + .gitpod/setup-ddev.sh + cd $GITPOD_REPO_ROOT/drupal && ddev start + gp sync-done drupal -# Nuxt/Storybook + # Nuxt/Storybook - name: nuxt/storybook command: | gp sync-await npm gp sync-await drupal cd $GITPOD_REPO_ROOT/nuxt && NUXT_TELEMETRY_DISABLED=1 npx nuxt storybook --ci -# Drupal - - name: ddev/drupal + # Nuxt/Druxt + - name: nuxt/druxt init: | - # Installing DDev and Drupal backend. - .gitpod/download-ddev-images.sh - .gitpod/setup-drupal.sh + # Installing Nuxt/Druxt frontend. + .gitpod/setup-nuxt.sh + gp sync-done npm command: | - .gitpod/setup-ddev.sh - cd $GITPOD_REPO_ROOT/drupal && ddev start - gp sync-done drupal + .gitpod/setup-nuxt.sh + gp sync-done npm + clear && echo "Waiting for ddev/drupal..." + gp sync-await drupal + cd $GITPOD_REPO_ROOT/nuxt && NUXT_TELEMETRY_DISABLED=1 npm run dev # VScode xdebug extension vscode: @@ -46,55 +47,55 @@ ports: onOpen: ignore visibility: public -# Nuxt/Druxt + # Nuxt/Druxt - port: 3000 onOpen: ignore visibility: public -# Nuxt/Druxt + # Nuxt/Druxt - port: 3003 onOpen: ignore visibility: public -# Currently un-notified and unsupported mailhog http port + # Currently un-notified and unsupported mailhog http port - port: 8025 onOpen: ignore -# Currently un-notified and unsupported mailhog https port + # Currently un-notified and unsupported mailhog https port - port: 8026 onOpen: ignore -# Currently un-notified and unsupported phpmyadmin http port + # Currently un-notified and unsupported phpmyadmin http port - port: 8036 onOpen: ignore -# Currently un-notified and unsupported phpmyadmin https port + # Currently un-notified and unsupported phpmyadmin https port - port: 8037 onOpen: ignore -# router http port that we're ignoring. + # router http port that we're ignoring. - port: 8888 onOpen: ignore -# router https port that we're ignoring. + # router https port that we're ignoring. - port: 8889 onOpen: ignore -# xdebug port + # xdebug port - port: 9000 onOpen: ignore -# projector port + # projector port - port: 9999 github: prebuilds: # enable for the master/default branch (defaults to true) master: true -# enable for all branches in this repo (defaults to false) + # enable for all branches in this repo (defaults to false) branches: true -# enable for pull requests coming from this repo (defaults to true) + # enable for pull requests coming from this repo (defaults to true) pullRequests: true -# enable for pull requests coming from forks (defaults to false) + # enable for pull requests coming from forks (defaults to false) pullRequestsFromForks: true -# add a check to pull requests (defaults to true) + # add a check to pull requests (defaults to true) addCheck: true -# add a "Review in Gitpod" button as a comment to pull requests (defaults to false) + # add a "Review in Gitpod" button as a comment to pull requests (defaults to false) addComment: false -# add a "Review in Gitpod" button to the pull request's description (defaults to false) + # add a "Review in Gitpod" button to the pull request's description (defaults to false) addBadge: true -# add a label once the prebuild is ready to pull requests (defaults to false) + # add a label once the prebuild is ready to pull requests (defaults to false) addLabel: true diff --git a/nuxt/nuxt.config.js b/nuxt/nuxt.config.js index 2faa2e9..c6e2897 100644 --- a/nuxt/nuxt.config.js +++ b/nuxt/nuxt.config.js @@ -1,3 +1,5 @@ +import opn from 'opn' + const baseUrl = process.env.BASE_URL export default { @@ -45,5 +47,10 @@ export default { // Build Configuration: https://go.nuxtjs.dev/config-build build: { + }, + + hooks: { + // Open browser once build is done. + 'build:done': () => opn('https://localhost:3000') } } diff --git a/nuxt/package-lock.json b/nuxt/package-lock.json index cc4b3a0..4cde291 100644 --- a/nuxt/package-lock.json +++ b/nuxt/package-lock.json @@ -12,6 +12,9 @@ "core-js": "3.17.3", "druxt-site": "0.8.0", "nuxt": "2.15.8" + }, + "devDependencies": { + "opn": "^6.0.0" } }, "node_modules/@babel/code-frame": { @@ -15934,6 +15937,28 @@ "opener": "bin/opener-bin.js" } }, + "node_modules/opn": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/opn/-/opn-6.0.0.tgz", + "integrity": "sha512-I9PKfIZC+e4RXZ/qr1RhgyCnGgYX0UEIlXgWnCOVACIvFgaC9rz6Won7xbdhoHrd8IIhV7YEpHjreNUNkqCGkQ==", + "deprecated": "The package has been renamed to `open`", + "dev": true, + "dependencies": { + "is-wsl": "^1.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/opn/node_modules/is-wsl": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz", + "integrity": "sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0=", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/optimize-css-assets-webpack-plugin": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/optimize-css-assets-webpack-plugin/-/optimize-css-assets-webpack-plugin-5.0.8.tgz", @@ -37978,6 +38003,23 @@ "resolved": "https://registry.npmjs.org/opener/-/opener-1.5.2.tgz", "integrity": "sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A==" }, + "opn": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/opn/-/opn-6.0.0.tgz", + "integrity": "sha512-I9PKfIZC+e4RXZ/qr1RhgyCnGgYX0UEIlXgWnCOVACIvFgaC9rz6Won7xbdhoHrd8IIhV7YEpHjreNUNkqCGkQ==", + "dev": true, + "requires": { + "is-wsl": "^1.1.0" + }, + "dependencies": { + "is-wsl": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz", + "integrity": "sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0=", + "dev": true + } + } + }, "optimize-css-assets-webpack-plugin": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/optimize-css-assets-webpack-plugin/-/optimize-css-assets-webpack-plugin-5.0.8.tgz", diff --git a/nuxt/package.json b/nuxt/package.json index 4500f5b..4fc73c0 100644 --- a/nuxt/package.json +++ b/nuxt/package.json @@ -13,5 +13,8 @@ "core-js": "3.17.3", "druxt-site": "0.8.0", "nuxt": "2.15.8" + }, + "devDependencies": { + "opn": "^6.0.0" } }