diff --git a/.changeset/angry-panthers-prove.md b/.changeset/angry-panthers-prove.md new file mode 100644 index 000000000..b09085bb1 --- /dev/null +++ b/.changeset/angry-panthers-prove.md @@ -0,0 +1,7 @@ +--- +"druxt-views": minor +--- + +feat(#639): added druxt/views/flushResults mutation +feat(#639): added bypassCache option to druxt/views/getResults action +feat(#639): added druxt.query.bypassCache option to DruxtView diff --git a/.changeset/big-worms-punch.md b/.changeset/big-worms-punch.md deleted file mode 100644 index 086e73744..000000000 --- a/.changeset/big-worms-punch.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"druxt-entity": patch ---- - -fix(#632): add passthrough attrs to DruxtField diff --git a/.changeset/cyan-kings-wonder.md b/.changeset/cyan-kings-wonder.md deleted file mode 100644 index 3b66482a4..000000000 --- a/.changeset/cyan-kings-wonder.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"druxt-views": minor ---- - -feat(#578): updated components to support the DruxtDevelTemplate tool. diff --git a/.changeset/eighty-bikes-float.md b/.changeset/eighty-bikes-float.md deleted file mode 100644 index 7e3093a17..000000000 --- a/.changeset/eighty-bikes-float.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"druxt": patch ---- - -fix(#628): add prefix to included resources fetch diff --git a/.changeset/few-pets-suffer.md b/.changeset/few-pets-suffer.md new file mode 100644 index 000000000..9f5cee8bb --- /dev/null +++ b/.changeset/few-pets-suffer.md @@ -0,0 +1,6 @@ +--- +"druxt": minor +--- + +feat(#639): added druxt/flushCollection and druxt/flushResource mutations +feat(#639): added bypassCache option to druxt/getCollection and druxt/getResource actions diff --git a/.changeset/khaki-glasses-sing.md b/.changeset/khaki-glasses-sing.md new file mode 100644 index 000000000..0879dc757 --- /dev/null +++ b/.changeset/khaki-glasses-sing.md @@ -0,0 +1,5 @@ +--- +"druxt-entity": minor +--- + +feat(#639): add bypassCache druxt setting to DruxtEntity components. diff --git a/.changeset/lemon-oranges-marry.md b/.changeset/lemon-oranges-marry.md deleted file mode 100644 index ac2cfec36..000000000 --- a/.changeset/lemon-oranges-marry.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"druxt": minor ---- - -feat(#578): added DruxtDevelTemplate component to simplify template creation in development mode. diff --git a/.changeset/long-bottles-bake.md b/.changeset/long-bottles-bake.md deleted file mode 100644 index e85dab4c6..000000000 --- a/.changeset/long-bottles-bake.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"druxt-site": minor ---- - -feat(#578): updated component to support the DruxtDevelTemplate tool. diff --git a/.changeset/long-weeks-pay.md b/.changeset/long-weeks-pay.md deleted file mode 100644 index 7c1a349e5..000000000 --- a/.changeset/long-weeks-pay.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"druxt-entity": minor ---- - -feat(#578): updated missing schema/vue component message with DruxtDevelTemplate tool. diff --git a/.changeset/metal-clouds-collect.md b/.changeset/metal-clouds-collect.md deleted file mode 100644 index 53a8d6ff5..000000000 --- a/.changeset/metal-clouds-collect.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"druxt-menu": minor ---- - -feat(#578): updated components to support the DruxtDevelTemplate tool. diff --git a/.changeset/rude-lizards-pretend.md b/.changeset/rude-lizards-pretend.md deleted file mode 100644 index c70c2b3f9..000000000 --- a/.changeset/rude-lizards-pretend.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"druxt-router": minor ---- - -feat(#578): updated component to support the DruxtDevelTemplate tool. diff --git a/.changeset/selfish-scissors-wink.md b/.changeset/selfish-scissors-wink.md deleted file mode 100644 index a9bb8ba2e..000000000 --- a/.changeset/selfish-scissors-wink.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"druxt": minor ---- - -feat(#578): updated missing default slot message with DruxtDevelTemplate tool. diff --git a/.changeset/sharp-glasses-ring.md b/.changeset/sharp-glasses-ring.md deleted file mode 100644 index 1069116be..000000000 --- a/.changeset/sharp-glasses-ring.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"druxt-breadcrumb": minor ---- - -feat(#578): updated component to support the DruxtDevelTemplate tool. diff --git a/.changeset/slow-owls-burn.md b/.changeset/slow-owls-burn.md deleted file mode 100644 index 589910a71..000000000 --- a/.changeset/slow-owls-burn.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"druxt-blocks": minor ---- - -feat(#578): updated missing vue component message with DruxtDevelTemplate tool. diff --git a/.changeset/wise-pots-walk.md b/.changeset/wise-pots-walk.md deleted file mode 100644 index bc7218cd9..000000000 --- a/.changeset/wise-pots-walk.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"druxt": minor ---- - -feat(#583): add Vue devtools plugin diff --git a/docs/nuxt/Dockerfile b/docs/nuxt/Dockerfile index ded453e4b..75fe4df8e 100644 --- a/docs/nuxt/Dockerfile +++ b/docs/nuxt/Dockerfile @@ -1,16 +1,16 @@ -FROM amazeeio/node:14-builder as builder +FROM amazeeio/node:16-builder as builder # Build source files. COPY . /app/ -RUN yarn +RUN yarn || true RUN yarn build RUN yarn build:docs # Build static files. -FROM amazeeio/node:14 +FROM amazeeio/node:16 COPY --from=builder /app/docs/nuxt /app -RUN yarn +RUN yarn || true RUN yarn generate ENV HOST 0.0.0.0 diff --git a/docs/nuxt/package.json b/docs/nuxt/package.json index a6128a5c1..eb72cd632 100644 --- a/docs/nuxt/package.json +++ b/docs/nuxt/package.json @@ -21,6 +21,7 @@ "nuxt-social-meta": "1.0.0" }, "devDependencies": { + "@babel/plugin-proposal-private-property-in-object": "^7.21.11", "@nuxt/postcss8": "1.1.3", "@nuxtjs/google-analytics": "2.4.0", "@nuxtjs/pwa": "3.3.5", diff --git a/docs/nuxt/yarn.lock b/docs/nuxt/yarn.lock index e30822f8e..28e60c721 100644 --- a/docs/nuxt/yarn.lock +++ b/docs/nuxt/yarn.lock @@ -32,6 +32,15 @@ __metadata: languageName: node linkType: hard +"@babel/code-frame@npm:^7.22.5": + version: 7.22.5 + resolution: "@babel/code-frame@npm:7.22.5" + dependencies: + "@babel/highlight": ^7.22.5 + checksum: cfe804f518f53faaf9a1d3e0f9f74127ab9a004912c3a16fda07fb6a633393ecb9918a053cb71804204c1b7ec3d49e1699604715e2cfb0c9f7bc4933d324ebb6 + languageName: node + linkType: hard + "@babel/compat-data@npm:^7.13.11, @babel/compat-data@npm:^7.14.0, @babel/compat-data@npm:^7.14.7, @babel/compat-data@npm:^7.15.0": version: 7.15.0 resolution: "@babel/compat-data@npm:7.15.0" @@ -138,6 +147,18 @@ __metadata: languageName: node linkType: hard +"@babel/generator@npm:^7.22.5": + version: 7.22.5 + resolution: "@babel/generator@npm:7.22.5" + dependencies: + "@babel/types": ^7.22.5 + "@jridgewell/gen-mapping": ^0.3.2 + "@jridgewell/trace-mapping": ^0.3.17 + jsesc: ^2.5.1 + checksum: efa64da70ca88fe69f05520cf5feed6eba6d30a85d32237671488cc355fdc379fe2c3246382a861d49574c4c2f82a317584f8811e95eb024e365faff3232b49d + languageName: node + linkType: hard + "@babel/helper-annotate-as-pure@npm:^7.14.5": version: 7.14.5 resolution: "@babel/helper-annotate-as-pure@npm:7.14.5" @@ -156,6 +177,15 @@ __metadata: languageName: node linkType: hard +"@babel/helper-annotate-as-pure@npm:^7.18.6, @babel/helper-annotate-as-pure@npm:^7.22.5": + version: 7.22.5 + resolution: "@babel/helper-annotate-as-pure@npm:7.22.5" + dependencies: + "@babel/types": ^7.22.5 + checksum: 53da330f1835c46f26b7bf4da31f7a496dee9fd8696cca12366b94ba19d97421ce519a74a837f687749318f94d1a37f8d1abcbf35e8ed22c32d16373b2f6198d + languageName: node + linkType: hard + "@babel/helper-builder-binary-assignment-operator-visitor@npm:^7.14.5": version: 7.14.5 resolution: "@babel/helper-builder-binary-assignment-operator-visitor@npm:7.14.5" @@ -236,6 +266,25 @@ __metadata: languageName: node linkType: hard +"@babel/helper-create-class-features-plugin@npm:^7.21.0": + version: 7.22.5 + resolution: "@babel/helper-create-class-features-plugin@npm:7.22.5" + dependencies: + "@babel/helper-annotate-as-pure": ^7.22.5 + "@babel/helper-environment-visitor": ^7.22.5 + "@babel/helper-function-name": ^7.22.5 + "@babel/helper-member-expression-to-functions": ^7.22.5 + "@babel/helper-optimise-call-expression": ^7.22.5 + "@babel/helper-replace-supers": ^7.22.5 + "@babel/helper-skip-transparent-expression-wrappers": ^7.22.5 + "@babel/helper-split-export-declaration": ^7.22.5 + semver: ^6.3.0 + peerDependencies: + "@babel/core": ^7.0.0 + checksum: f1e91deae06dbee6dd956c0346bca600adfbc7955427795d9d8825f0439a3c3290c789ba2b4a02a1cdf6c1a1bd163dfa16d3d5e96b02a8efb639d2a774e88ed9 + languageName: node + linkType: hard + "@babel/helper-create-regexp-features-plugin@npm:^7.14.5": version: 7.14.5 resolution: "@babel/helper-create-regexp-features-plugin@npm:7.14.5" @@ -314,6 +363,13 @@ __metadata: languageName: node linkType: hard +"@babel/helper-environment-visitor@npm:^7.22.5": + version: 7.22.5 + resolution: "@babel/helper-environment-visitor@npm:7.22.5" + checksum: 248532077d732a34cd0844eb7b078ff917c3a8ec81a7f133593f71a860a582f05b60f818dc5049c2212e5baa12289c27889a4b81d56ef409b4863db49646c4b1 + languageName: node + linkType: hard + "@babel/helper-explode-assignable-expression@npm:^7.14.5": version: 7.14.5 resolution: "@babel/helper-explode-assignable-expression@npm:7.14.5" @@ -354,6 +410,16 @@ __metadata: languageName: node linkType: hard +"@babel/helper-function-name@npm:^7.22.5": + version: 7.22.5 + resolution: "@babel/helper-function-name@npm:7.22.5" + dependencies: + "@babel/template": ^7.22.5 + "@babel/types": ^7.22.5 + checksum: 6b1f6ce1b1f4e513bf2c8385a557ea0dd7fa37971b9002ad19268ca4384bbe90c09681fe4c076013f33deabc63a53b341ed91e792de741b4b35e01c00238177a + languageName: node + linkType: hard + "@babel/helper-get-function-arity@npm:^7.14.5": version: 7.14.5 resolution: "@babel/helper-get-function-arity@npm:7.14.5" @@ -390,6 +456,15 @@ __metadata: languageName: node linkType: hard +"@babel/helper-hoist-variables@npm:^7.22.5": + version: 7.22.5 + resolution: "@babel/helper-hoist-variables@npm:7.22.5" + dependencies: + "@babel/types": ^7.22.5 + checksum: 394ca191b4ac908a76e7c50ab52102669efe3a1c277033e49467913c7ed6f7c64d7eacbeabf3bed39ea1f41731e22993f763b1edce0f74ff8563fd1f380d92cc + languageName: node + linkType: hard + "@babel/helper-member-expression-to-functions@npm:^7.15.0": version: 7.15.0 resolution: "@babel/helper-member-expression-to-functions@npm:7.15.0" @@ -408,6 +483,15 @@ __metadata: languageName: node linkType: hard +"@babel/helper-member-expression-to-functions@npm:^7.22.5": + version: 7.22.5 + resolution: "@babel/helper-member-expression-to-functions@npm:7.22.5" + dependencies: + "@babel/types": ^7.22.5 + checksum: 4bd5791529c280c00743e8bdc669ef0d4cd1620d6e3d35e0d42b862f8262bc2364973e5968007f960780344c539a4b9cf92ab41f5b4f94560a9620f536de2a39 + languageName: node + linkType: hard + "@babel/helper-module-imports@npm:^7.0.0, @babel/helper-module-imports@npm:^7.12.13, @babel/helper-module-imports@npm:^7.13.12, @babel/helper-module-imports@npm:^7.14.5": version: 7.14.5 resolution: "@babel/helper-module-imports@npm:7.14.5" @@ -476,6 +560,15 @@ __metadata: languageName: node linkType: hard +"@babel/helper-optimise-call-expression@npm:^7.22.5": + version: 7.22.5 + resolution: "@babel/helper-optimise-call-expression@npm:7.22.5" + dependencies: + "@babel/types": ^7.22.5 + checksum: c70ef6cc6b6ed32eeeec4482127e8be5451d0e5282d5495d5d569d39eb04d7f1d66ec99b327f45d1d5842a9ad8c22d48567e93fc502003a47de78d122e355f7c + languageName: node + linkType: hard + "@babel/helper-plugin-utils@npm:7.10.4": version: 7.10.4 resolution: "@babel/helper-plugin-utils@npm:7.10.4" @@ -490,6 +583,13 @@ __metadata: languageName: node linkType: hard +"@babel/helper-plugin-utils@npm:^7.20.2": + version: 7.22.5 + resolution: "@babel/helper-plugin-utils@npm:7.22.5" + checksum: c0fc7227076b6041acd2f0e818145d2e8c41968cc52fb5ca70eed48e21b8fe6dd88a0a91cbddf4951e33647336eb5ae184747ca706817ca3bef5e9e905151ff5 + languageName: node + linkType: hard + "@babel/helper-remap-async-to-generator@npm:^7.14.5": version: 7.14.5 resolution: "@babel/helper-remap-async-to-generator@npm:7.14.5" @@ -536,6 +636,20 @@ __metadata: languageName: node linkType: hard +"@babel/helper-replace-supers@npm:^7.22.5": + version: 7.22.5 + resolution: "@babel/helper-replace-supers@npm:7.22.5" + dependencies: + "@babel/helper-environment-visitor": ^7.22.5 + "@babel/helper-member-expression-to-functions": ^7.22.5 + "@babel/helper-optimise-call-expression": ^7.22.5 + "@babel/template": ^7.22.5 + "@babel/traverse": ^7.22.5 + "@babel/types": ^7.22.5 + checksum: af29deff6c6dc3fa2d1a517390716aa3f4d329855e8689f1d5c3cb07c1b898e614a5e175f1826bb58e9ff1480e6552885a71a9a0ba5161787aaafa2c79b216cc + languageName: node + linkType: hard + "@babel/helper-simple-access@npm:^7.14.8": version: 7.14.8 resolution: "@babel/helper-simple-access@npm:7.14.8" @@ -572,6 +686,15 @@ __metadata: languageName: node linkType: hard +"@babel/helper-skip-transparent-expression-wrappers@npm:^7.22.5": + version: 7.22.5 + resolution: "@babel/helper-skip-transparent-expression-wrappers@npm:7.22.5" + dependencies: + "@babel/types": ^7.22.5 + checksum: 1012ef2295eb12dc073f2b9edf3425661e9b8432a3387e62a8bc27c42963f1f216ab3124228015c748770b2257b4f1fda882ca8fa34c0bf485e929ae5bc45244 + languageName: node + linkType: hard + "@babel/helper-split-export-declaration@npm:^7.14.5": version: 7.14.5 resolution: "@babel/helper-split-export-declaration@npm:7.14.5" @@ -590,6 +713,22 @@ __metadata: languageName: node linkType: hard +"@babel/helper-split-export-declaration@npm:^7.22.5": + version: 7.22.5 + resolution: "@babel/helper-split-export-declaration@npm:7.22.5" + dependencies: + "@babel/types": ^7.22.5 + checksum: d10e05a02f49c1f7c578cea63d2ac55356501bbf58856d97ac9bfde4957faee21ae97c7f566aa309e38a256eef58b58e5b670a7f568b362c00e93dfffe072650 + languageName: node + linkType: hard + +"@babel/helper-string-parser@npm:^7.22.5": + version: 7.22.5 + resolution: "@babel/helper-string-parser@npm:7.22.5" + checksum: 836851ca5ec813077bbb303acc992d75a360267aa3b5de7134d220411c852a6f17de7c0d0b8c8dcc0f567f67874c00f4528672b2a4f1bc978a3ada64c8c78467 + languageName: node + linkType: hard + "@babel/helper-validator-identifier@npm:^7.14.5, @babel/helper-validator-identifier@npm:^7.14.9": version: 7.14.9 resolution: "@babel/helper-validator-identifier@npm:7.14.9" @@ -604,6 +743,13 @@ __metadata: languageName: node linkType: hard +"@babel/helper-validator-identifier@npm:^7.22.5": + version: 7.22.5 + resolution: "@babel/helper-validator-identifier@npm:7.22.5" + checksum: 7f0f30113474a28298c12161763b49de5018732290ca4de13cdaefd4fd0d635a6fe3f6686c37a02905fb1e64f21a5ee2b55140cf7b070e729f1bd66866506aea + languageName: node + linkType: hard + "@babel/helper-validator-option@npm:^7.14.5": version: 7.14.5 resolution: "@babel/helper-validator-option@npm:7.14.5" @@ -679,6 +825,17 @@ __metadata: languageName: node linkType: hard +"@babel/highlight@npm:^7.22.5": + version: 7.22.5 + resolution: "@babel/highlight@npm:7.22.5" + dependencies: + "@babel/helper-validator-identifier": ^7.22.5 + chalk: ^2.0.0 + js-tokens: ^4.0.0 + checksum: f61ae6de6ee0ea8d9b5bcf2a532faec5ab0a1dc0f7c640e5047fc61630a0edb88b18d8c92eb06566d30da7a27db841aca11820ecd3ebe9ce514c9350fbed39c4 + languageName: node + linkType: hard + "@babel/parser@npm:^7.1.0, @babel/parser@npm:^7.14.5, @babel/parser@npm:^7.15.0": version: 7.15.3 resolution: "@babel/parser@npm:7.15.3" @@ -697,6 +854,15 @@ __metadata: languageName: node linkType: hard +"@babel/parser@npm:^7.22.5": + version: 7.22.5 + resolution: "@babel/parser@npm:7.22.5" + bin: + parser: ./bin/babel-parser.js + checksum: 470ebba516417ce8683b36e2eddd56dcfecb32c54b9bb507e28eb76b30d1c3e618fd0cfeee1f64d8357c2254514e1a19e32885cfb4e73149f4ae875436a6d59c + languageName: node + linkType: hard + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@npm:^7.16.2": version: 7.16.2 resolution: "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@npm:7.16.2" @@ -1137,6 +1303,20 @@ __metadata: languageName: node linkType: hard +"@babel/plugin-proposal-private-property-in-object@npm:^7.21.11": + version: 7.21.11 + resolution: "@babel/plugin-proposal-private-property-in-object@npm:7.21.11" + dependencies: + "@babel/helper-annotate-as-pure": ^7.18.6 + "@babel/helper-create-class-features-plugin": ^7.21.0 + "@babel/helper-plugin-utils": ^7.20.2 + "@babel/plugin-syntax-private-property-in-object": ^7.14.5 + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 1b880543bc5f525b360b53d97dd30807302bb82615cd42bf931968f59003cac75629563d6b104868db50abd22235b3271fdf679fea5db59a267181a99cc0c265 + languageName: node + linkType: hard + "@babel/plugin-proposal-unicode-property-regex@npm:^7.14.5, @babel/plugin-proposal-unicode-property-regex@npm:^7.4.4": version: 7.14.5 resolution: "@babel/plugin-proposal-unicode-property-regex@npm:7.14.5" @@ -2539,6 +2719,17 @@ __metadata: languageName: node linkType: hard +"@babel/template@npm:^7.22.5": + version: 7.22.5 + resolution: "@babel/template@npm:7.22.5" + dependencies: + "@babel/code-frame": ^7.22.5 + "@babel/parser": ^7.22.5 + "@babel/types": ^7.22.5 + checksum: c5746410164039aca61829cdb42e9a55410f43cace6f51ca443313f3d0bdfa9a5a330d0b0df73dc17ef885c72104234ae05efede37c1cc8a72dc9f93425977a3 + languageName: node + linkType: hard + "@babel/traverse@npm:^7.12.11, @babel/traverse@npm:^7.12.9, @babel/traverse@npm:^7.16.0, @babel/traverse@npm:^7.16.3": version: 7.16.3 resolution: "@babel/traverse@npm:7.16.3" @@ -2573,6 +2764,24 @@ __metadata: languageName: node linkType: hard +"@babel/traverse@npm:^7.22.5": + version: 7.22.5 + resolution: "@babel/traverse@npm:7.22.5" + dependencies: + "@babel/code-frame": ^7.22.5 + "@babel/generator": ^7.22.5 + "@babel/helper-environment-visitor": ^7.22.5 + "@babel/helper-function-name": ^7.22.5 + "@babel/helper-hoist-variables": ^7.22.5 + "@babel/helper-split-export-declaration": ^7.22.5 + "@babel/parser": ^7.22.5 + "@babel/types": ^7.22.5 + debug: ^4.1.0 + globals: ^11.1.0 + checksum: 560931422dc1761f2df723778dcb4e51ce0d02e560cf2caa49822921578f49189a5a7d053b78a32dca33e59be886a6b2200a6e24d4ae9b5086ca0ba803815694 + languageName: node + linkType: hard + "@babel/types@npm:^7.0.0, @babel/types@npm:^7.14.5, @babel/types@npm:^7.14.8, @babel/types@npm:^7.15.0, @babel/types@npm:^7.3.0, @babel/types@npm:^7.4.4, @babel/types@npm:^7.8.3": version: 7.15.0 resolution: "@babel/types@npm:7.15.0" @@ -2593,6 +2802,17 @@ __metadata: languageName: node linkType: hard +"@babel/types@npm:^7.22.5": + version: 7.22.5 + resolution: "@babel/types@npm:7.22.5" + dependencies: + "@babel/helper-string-parser": ^7.22.5 + "@babel/helper-validator-identifier": ^7.22.5 + to-fast-properties: ^2.0.0 + checksum: c13a9c1dc7d2d1a241a2f8363540cb9af1d66e978e8984b400a20c4f38ba38ca29f06e26a0f2d49a70bad9e57615dac09c35accfddf1bb90d23cd3e0a0bab892 + languageName: node + linkType: hard + "@base2/pretty-print-object@npm:1.0.1": version: 1.0.1 resolution: "@base2/pretty-print-object@npm:1.0.1" @@ -2820,6 +3040,55 @@ __metadata: languageName: node linkType: hard +"@jridgewell/gen-mapping@npm:^0.3.2": + version: 0.3.3 + resolution: "@jridgewell/gen-mapping@npm:0.3.3" + dependencies: + "@jridgewell/set-array": ^1.0.1 + "@jridgewell/sourcemap-codec": ^1.4.10 + "@jridgewell/trace-mapping": ^0.3.9 + checksum: 4a74944bd31f22354fc01c3da32e83c19e519e3bbadafa114f6da4522ea77dd0c2842607e923a591d60a76699d819a2fbb6f3552e277efdb9b58b081390b60ab + languageName: node + linkType: hard + +"@jridgewell/resolve-uri@npm:3.1.0": + version: 3.1.0 + resolution: "@jridgewell/resolve-uri@npm:3.1.0" + checksum: b5ceaaf9a110fcb2780d1d8f8d4a0bfd216702f31c988d8042e5f8fbe353c55d9b0f55a1733afdc64806f8e79c485d2464680ac48a0d9fcadb9548ee6b81d267 + languageName: node + linkType: hard + +"@jridgewell/set-array@npm:^1.0.1": + version: 1.1.2 + resolution: "@jridgewell/set-array@npm:1.1.2" + checksum: 69a84d5980385f396ff60a175f7177af0b8da4ddb81824cb7016a9ef914eee9806c72b6b65942003c63f7983d4f39a5c6c27185bbca88eb4690b62075602e28e + languageName: node + linkType: hard + +"@jridgewell/sourcemap-codec@npm:1.4.14": + version: 1.4.14 + resolution: "@jridgewell/sourcemap-codec@npm:1.4.14" + checksum: 61100637b6d173d3ba786a5dff019e1a74b1f394f323c1fee337ff390239f053b87266c7a948777f4b1ee68c01a8ad0ab61e5ff4abb5a012a0b091bec391ab97 + languageName: node + linkType: hard + +"@jridgewell/sourcemap-codec@npm:^1.4.10": + version: 1.4.15 + resolution: "@jridgewell/sourcemap-codec@npm:1.4.15" + checksum: b881c7e503db3fc7f3c1f35a1dd2655a188cc51a3612d76efc8a6eb74728bef5606e6758ee77423e564092b4a518aba569bbb21c9bac5ab7a35b0c6ae7e344c8 + languageName: node + linkType: hard + +"@jridgewell/trace-mapping@npm:^0.3.17, @jridgewell/trace-mapping@npm:^0.3.9": + version: 0.3.18 + resolution: "@jridgewell/trace-mapping@npm:0.3.18" + dependencies: + "@jridgewell/resolve-uri": 3.1.0 + "@jridgewell/sourcemap-codec": 1.4.14 + checksum: 0572669f855260808c16fe8f78f5f1b4356463b11d3f2c7c0b5580c8ba1cbf4ae53efe9f627595830856e57dbac2325ac17eb0c3dd0ec42102e6f227cc289c02 + languageName: node + linkType: hard + "@koa/router@npm:^9.0.1": version: 9.4.0 resolution: "@koa/router@npm:9.4.0" @@ -9070,6 +9339,7 @@ __metadata: version: 0.0.0-use.local resolution: "druxtjs-org@workspace:." dependencies: + "@babel/plugin-proposal-private-property-in-object": ^7.21.11 "@nuxt/content": 1.15.1 "@nuxt/postcss8": 1.1.3 "@nuxtjs/google-analytics": 2.4.0 diff --git a/package.json b/package.json index de911d31b..25cb369f9 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ "husky": "8.0.1", "jest": "27.5.1", "jest-junit": "13.2.0", - "jest-mock-axios": "4.6.1", + "jest-mock-axios": "4.7.2", "regenerator-runtime": "0.13.9", "renovate": "32.0.2", "rimraf": "3.0.2", diff --git a/packages/blocks/CHANGELOG.md b/packages/blocks/CHANGELOG.md index 844d35bfa..6f34a3ff4 100644 --- a/packages/blocks/CHANGELOG.md +++ b/packages/blocks/CHANGELOG.md @@ -1,5 +1,18 @@ # druxt-blocks +## 0.17.0 + +### Minor Changes + +- f6b4a664: feat(#578): updated missing vue component message with DruxtDevelTemplate tool. + +### Patch Changes + +- Updated dependencies [39af33a4] + - druxt-entity@0.27.0 + - druxt@0.21.0 + - druxt-router@0.29.0 + ## 0.16.3 ### Patch Changes @@ -78,7 +91,7 @@ ```js import { DruxtBlocksRegionMixin } from "druxt-blocks"; export default { - mixins: [DruxtBlocksRegionMixin] + mixins: [DruxtBlocksRegionMixin], }; ``` diff --git a/packages/blocks/package.json b/packages/blocks/package.json index 852371e8b..3de19dd5a 100644 --- a/packages/blocks/package.json +++ b/packages/blocks/package.json @@ -1,6 +1,6 @@ { "name": "druxt-blocks", - "version": "0.16.3", + "version": "0.17.0", "description": "Drupal Block and Block Region Druxt components.", "keywords": [ "block", @@ -42,11 +42,11 @@ "templates" ], "dependencies": { - "axios": "^0.27.2", + "axios": "^1.4.0", "drupal-jsonapi-params": "^2.1.0", - "druxt": "^0.20.0", - "druxt-entity": "^0.26.0", - "druxt-router": "^0.28.0" + "druxt": "^0.21.0", + "druxt-entity": "^0.27.0", + "druxt-router": "^0.29.0" }, "optionalDependencies": { "vue": "^2.7.10", diff --git a/packages/breadcrumb/CHANGELOG.md b/packages/breadcrumb/CHANGELOG.md index e6ff93354..a3807267d 100644 --- a/packages/breadcrumb/CHANGELOG.md +++ b/packages/breadcrumb/CHANGELOG.md @@ -1,5 +1,18 @@ # druxt-breadcrumb +## 0.17.0 + +### Minor Changes + +- f6b4a664: feat(#578): updated component to support the DruxtDevelTemplate tool. + +### Patch Changes + +- Updated dependencies [e46a3290] + - druxt@0.21.0 + - druxt-router@0.29.0 + - druxt-blocks@0.17.0 + ## 0.16.0 ### Minor Changes diff --git a/packages/breadcrumb/package.json b/packages/breadcrumb/package.json index b2454aee7..84420d9d9 100644 --- a/packages/breadcrumb/package.json +++ b/packages/breadcrumb/package.json @@ -1,6 +1,6 @@ { "name": "druxt-breadcrumb", - "version": "0.16.0", + "version": "0.17.0", "description": "Decoupled Router based Breadcrumb Druxt component.", "keywords": [ "breadcrumb", @@ -42,9 +42,9 @@ "templates" ], "dependencies": { - "druxt": "^0.20.0", - "druxt-blocks": "^0.16.3", - "druxt-router": "^0.28.0" + "druxt": "^0.21.0", + "druxt-blocks": "^0.17.0", + "druxt-router": "^0.29.0" }, "optionalDependencies": { "vue": "^2.7.10", diff --git a/packages/druxt/CHANGELOG.md b/packages/druxt/CHANGELOG.md index df5716cf8..5e74f5f7a 100644 --- a/packages/druxt/CHANGELOG.md +++ b/packages/druxt/CHANGELOG.md @@ -1,5 +1,19 @@ # druxt +## 0.21.1 + +### Patch Changes + +- e46a3290 by nx-alejandrolacasa: fix(#628): add prefix to included resources fetch + +## 0.21.0 + +### Minor Changes + +- f6b4a664: feat(#578): added DruxtDevelTemplate component to simplify template creation in development mode. +- f6b4a664: feat(#578): updated missing default slot message with DruxtDevelTemplate tool. +- 29905ff6: feat(#583): add Vue devtools plugin + ## 0.20.0 ### Minor Changes @@ -148,9 +162,9 @@ export default { druxt: { proxy: { - api: true - } - } + api: true, + }, + }, }; ``` @@ -165,9 +179,9 @@ export default { druxt: { proxy: { - files: "default" - } - } + files: "default", + }, + }, }; ``` @@ -195,7 +209,7 @@ type, id, attributes: {}, - relationships: {} + relationships: {}, }); ``` @@ -302,9 +316,9 @@ Thanks to [d34dman](https://github.com/d34dman) v-model="{ attributes: { title: 'My Entity', - field_name: 'Value' + field_name: 'Value', }, - relationships: {} + relationships: {}, }" /> ``` @@ -344,7 +358,7 @@ Thanks to [d34dman](https://github.com/d34dman) import { DruxtModule } from "druxt"; export default { name: "MyCustomDruxtModule", - extends: DruxtModule + extends: DruxtModule, }; ``` @@ -391,17 +405,17 @@ Thanks to [d34dman](https://github.com/d34dman) ``` diff --git a/packages/druxt/package.json b/packages/druxt/package.json index 94f59b74e..a96470984 100644 --- a/packages/druxt/package.json +++ b/packages/druxt/package.json @@ -1,6 +1,6 @@ { "name": "druxt", - "version": "0.20.0", + "version": "0.21.1", "description": "The Fully Decoupled Drupal Framework for Nuxt.js.", "keywords": [ "cms", diff --git a/packages/druxt/src/stores/druxt.js b/packages/druxt/src/stores/druxt.js index 5218956b8..883036ac3 100644 --- a/packages/druxt/src/stores/druxt.js +++ b/packages/druxt/src/stores/druxt.js @@ -140,6 +140,44 @@ const DruxtStore = ({ store }) => { Vue.set(state.resources[type][id], prefix, resource) }, + + /** + * @name flushCollection + * @mutator {object} flushCollection=collections Removes JSON:API collections from the Vuex state object. + * @param {flushCollectionContext} context + * + * @example @lang js + * // Flush all collections. + * this.$store.commit('druxt/flushCollection', {}) + * + * // Flush target collection. + * this.$store.commit('druxt/flushCollection', { type, hash, prefix }) + */ + flushCollection (state, { type, hash, prefix }) { + if (!type) Vue.set(state, 'collections', {}) + else if (type && !hash && !prefix) Vue.set(state.collections, type, {}) + else if (type && hash && !prefix) Vue.set(state.collections[type], hash, {}) + else if (type && hash && prefix) Vue.set(state.collections[type][hash], prefix, {}) + }, + + /** + * @name flushResource + * @mutator {object} flushResource=resources Removes JSON:API resources from the Vuex state object. + * @param {flushResourceContext} context + * + * @example @lang js + * // Flush all resources. + * this.$store.commit('druxt/flushResource', {}) + * + * // Flush target resource. + * this.$store.commit('druxt/flushResource', { id, type, prefix, hash }) + */ + flushResource (state, { type, id, prefix }) { + if (!type) Vue.set(state, 'resources', {}) + else if (type && !id && !prefix) Vue.set(state.resources, type, {}) + else if (type && id && !prefix) Vue.set(state.resources[type], id, {}) + else if (type && id && prefix) Vue.set(state.resources[type][id], prefix, {}) + } }, /** @@ -159,15 +197,16 @@ const DruxtStore = ({ store }) => { * const resources = await this.$store.dispatch('druxt/getCollection', { * type: 'node--article', * query: new DrupalJsonApiParams().addFilter('status', '1'), + * bypassCache: false * }) */ - async getCollection ({ commit, state }, { type, query, prefix }) { + async getCollection ({ commit, state }, { type, query, prefix, bypassCache = false }) { // Generate a hash using query data excluding the 'fields' and 'include' data. const queryObject = getDrupalJsonApiParams(query).getQueryObject() const hash = query ? md5(JSON.stringify({ ...queryObject, fields: {}, include: [] })) : '_default' // If collection hash exists, re-hydrate and return the data. - if (((state.collections[type] || {})[hash] || {})[prefix]) { + if (!bypassCache && ((state.collections[type] || {})[hash] || {})[prefix]) { return { ...state.collections[type][hash][prefix], // Hydrate resource data. @@ -197,9 +236,13 @@ const DruxtStore = ({ store }) => { * @return {object} The Drupal JSON:API resource. * * @example @lang js - * const resource = await this.$store.dispatch('druxt/getResource', { type: 'node--article', id }) + * const resource = await this.$store.dispatch('druxt/getResource', { + * type: 'node--article', + * id, + * bypassCache: false + * }) */ - async getResource ({ commit, dispatch, state }, { type, id, query, prefix }) { + async getResource ({ commit, dispatch, state }, { type, id, query, prefix, bypassCache = false }) { // Get the resource from the store if it's avaialble. const storedResource = ((state.resources[type] || {})[id] || {})[prefix] ? { ...state.resources[type][id][prefix] } @@ -257,7 +300,7 @@ const DruxtStore = ({ store }) => { } // Return if we have the full resource. - if ((storedResource || {})._druxt_full) { + if (!bypassCache && (storedResource || {})._druxt_full) { return storedResource } const isFull = typeof (queryObject.fields || {})[type] !== 'string' @@ -279,9 +322,13 @@ const DruxtStore = ({ store }) => { // Request the resource from the DruxtClient if required. let resource - if (!storedResource || fields) { - resource = await this.$druxt.getResource(type, id, getDrupalJsonApiParams(queryObject), prefix) - commit('addResource', { prefix, resource: { ...resource } }) + if (bypassCache || !storedResource || fields) { + try { + resource = await this.$druxt.getResource(type, id, getDrupalJsonApiParams(queryObject), prefix) + commit('addResource', { prefix, resource: { ...resource } }) + } catch(e) { + // Do nothing, just don't error. + } } // Build resource to be returned. @@ -351,6 +398,40 @@ export { DruxtStore } * } */ +/** + * Parameters for the `flushCollection` mutation. + * + * @typedef {object} flushCollectionContext + * + * @param {string} type - The JSON:API collection resource type. + * @param {string} hash - An md5 hash of the query string. + * @param {string} [prefix] - (Optional) The JSON:API endpoint prefix or langcode. + * + * @example @lang js + * { + * type: 'node--page', + * hash: '_default', + * prefix: 'en' + * } + */ + +/** + * Parameters for the `flushResource` mutation. + * + * @typedef {object} flushResourceContext + * + * @param {string} [type] - The JSON:API Resource type. + * @param {string} [id] - The Drupal resource UUID. + * @param {string} [prefix] - (Optional) The JSON:API endpoint prefix or langcode. + * + * @example @lang js + * { + * type: 'node--page', + * id: 'd8dfd355-7f2f-4fc3-a149-288e4e293bdd', + * prefix: 'en' + * } + */ + /** * Parameters for the `getCollection` action. * @@ -359,11 +440,13 @@ export { DruxtStore } * @param {string} type - The JSON:API collection resource type. * @param {DruxtClientQuery} [query] - A correctly formatted JSON:API query string or object. * @param {string} [prefix] - (Optional) The JSON:API endpoint prefix or langcode. + * @param {boolean} [bypassCache] - (Optional) Bypass the Vuex cached collection. * * @example @lang js * { * type: 'node--page', - * query: new DrupalJsonApiParams().addFilter('status', '1') + * query: new DrupalJsonApiParams().addFilter('status', '1'), + * bypassCache: false * } */ @@ -376,12 +459,14 @@ export { DruxtStore } * @param {string} id - The Drupal resource UUID. * @param {DruxtClientQuery} [query] - A correctly formatted JSON:API query string or object. * @param {string} [prefix] - (Optional) The JSON:API endpoint prefix or langcode. + * @param {boolean} [bypassCache] - (Optional) Bypass the Vuex cached resource. * * @example @lang js * { * type: 'node--page', * id: 'd8dfd355-7f2f-4fc3-a149-288e4e293bdd', - * prefix: 'en' + * prefix: 'en', + * bypassCache: false * } */ diff --git a/packages/druxt/test/stores/druxt.test.js b/packages/druxt/test/stores/druxt.test.js index eaa84004e..155ab394a 100644 --- a/packages/druxt/test/stores/druxt.test.js +++ b/packages/druxt/test/stores/druxt.test.js @@ -143,6 +143,22 @@ describe('DruxtStore', () => { expect(mockAxios.get).toHaveBeenCalledTimes(2) expect(storedResource).toStrictEqual(resource) expect(storedResource).toStrictEqual(expected) + + // Assert that: + // - Cache is bypassed + const bypassedResource = await store.dispatch('druxt/getResource', { ...mockPage.data, bypassCache: true }) + delete resource._druxt_full + delete bypassedResource._druxt_full + expect(mockAxios.get).toHaveBeenCalledTimes(3) + expect(bypassedResource).toStrictEqual(resource) + + // Assert that: + // - When bypassing cache, in case live data is unavailable, fallback to cache. + store.$druxt.getResource = jest.fn(() => { throw new Error() }) + const fallback = await store.dispatch('druxt/getResource', { ...mockPage.data, bypassCache: true }) + delete fallback._druxt_full + expect(mockAxios.get).toHaveBeenCalledTimes(3) + expect(fallback).toStrictEqual(bypassedResource) }) test('getResource - filter', async () => { @@ -282,4 +298,51 @@ describe('DruxtStore', () => { await store.dispatch('druxt/getCollection', { type: 'node--page', query: {} }) expect(mockAxios.get).toHaveBeenCalledTimes(2) }) + + test('flushCollection', async () => { + const type = 'node--page' + const hash ='_default' + const prefix = 'en' + + // Ensure that the results state is populated. + const collection = await getMockCollection(type) + store.commit('druxt/addCollection', { collection, type, prefix, hash }) + expect(store.state.druxt.collections[type][hash][prefix]).toStrictEqual(collection) + + store.commit('druxt/flushCollection', { type, hash, prefix }) + expect(store.state.druxt.collections[type][hash][prefix]).toStrictEqual({}) + + store.commit('druxt/flushCollection', { type, hash }) + expect(store.state.druxt.collections[type][hash]).toStrictEqual({}) + + store.commit('druxt/flushCollection', { type }) + expect(store.state.druxt.collections[type]).toStrictEqual({}) + + store.commit('druxt/flushCollection', {}) + expect(store.state.druxt.collections).toStrictEqual({}) + + }) + + test('flushResource', async () => { + const type = 'node--page' + const prefix = 'en' + + // Ensure that the results state is populated. + const resource = await getMockResource(type) + const id = resource.data.id + store.commit('druxt/addResource', { prefix, resource }) + expect(store.state.druxt.resources[type][id][prefix]).toStrictEqual(resource) + + store.commit('druxt/flushResource', { type, id, prefix }) + expect(store.state.druxt.resources[type][id][prefix]).toStrictEqual({}) + + store.commit('druxt/flushResource', { type, id }) + expect(store.state.druxt.resources[type][id]).toStrictEqual({}) + + store.commit('druxt/flushResource', { type }) + expect(store.state.druxt.resources[type]).toStrictEqual({}) + + store.commit('druxt/flushResource', {}) + expect(store.state.druxt.resources).toStrictEqual({}) + }) }) diff --git a/packages/entity/CHANGELOG.md b/packages/entity/CHANGELOG.md index 8f5823bc6..94a3e4846 100644 --- a/packages/entity/CHANGELOG.md +++ b/packages/entity/CHANGELOG.md @@ -1,5 +1,24 @@ # druxt-entity +## 0.27.1 + +### Patch Changes + +- 39af33a4: fix(#632): add passthrough attrs to DruxtField + +## 0.27.0 + +### Minor Changes + +- f6b4a664: feat(#578): updated missing schema/vue component message with DruxtDevelTemplate tool. + +### Patch Changes + +- Updated dependencies [e46a3290] + - druxt@0.21.0 + - druxt-router@0.29.0 + - druxt-schema@0.11.1 + ## 0.26.1 ### Patch Changes @@ -174,10 +193,10 @@ include: ["field_media_image", "field_media_image.field_media_image"], fields: [ ["file--file", ["uri"]], - ["media--image", []] - ] - } - } + ["media--image", []], + ], + }, + }, }; ``` @@ -295,10 +314,10 @@ druxt: { entity: { components: { - fields: false - } - } - } + fields: false, + }, + }, + }, }; ``` diff --git a/packages/entity/package.json b/packages/entity/package.json index f02b9eecb..7949e97ac 100644 --- a/packages/entity/package.json +++ b/packages/entity/package.json @@ -1,6 +1,6 @@ { "name": "druxt-entity", - "version": "0.26.1", + "version": "0.27.1", "description": "Drupal Display Mode powered Entity, Form and Field Druxt components.", "keywords": [ "cms", @@ -46,9 +46,9 @@ "dependencies": { "deepmerge": "^4.2.2", "drupal-jsonapi-params": "^2.1.0", - "druxt": "^0.20.0", - "druxt-router": "^0.28.0", - "druxt-schema": "^0.11.0" + "druxt": "^0.21.0", + "druxt-router": "^0.29.0", + "druxt-schema": "^0.11.1" }, "publishConfig": { "access": "public" diff --git a/packages/entity/src/components/DruxtEntity.vue b/packages/entity/src/components/DruxtEntity.vue index 87f9a0eed..23ccab4d8 100644 --- a/packages/entity/src/components/DruxtEntity.vue +++ b/packages/entity/src/components/DruxtEntity.vue @@ -187,6 +187,14 @@ export default { }, }, + mounted() { + // If static, re-fetch data allowing for cache-bypass. + // @TODO - Don't re-fetch in serverless configuration. + if (this.$store.app.context.isStatic) { + this.$fetch() + } + }, + methods: { /** * Builds the query for the JSON:API request. @@ -318,12 +326,22 @@ export default { } if (this.uuid && !this.value) { + // Check if we need to bypass cache. + let bypassCache = false + if (typeof (settings.query || {}).bypassCache === 'boolean') { + bypassCache = settings.query.bypassCache + } + + // Build query. const query = this.getQuery(settings) + + // Execute the resquest. const resource = await this.getResource({ id: this.uuid, prefix: this.lang, type: this.type, - query + query, + bypassCache }) const entity = { ...(resource.data || {}) } entity.included = resource.included @@ -342,12 +360,20 @@ export default { /** * Component settings. */ - settings: ({ $druxt, settings }, wrapperSettings) => { + settings: (context, wrapperSettings) => { + const { $druxt, settings } = context + // Start with the `nuxt.config.js` `druxt.settings.entity` settings and // merge the Wrapper component settings on top. - let mergedSettings = merge($druxt.settings.entity || {}, wrapperSettings, { arrayMerge: (dest, src) => src }) + let mergedSettings = merge(($druxt.settings || {}).entity || {}, wrapperSettings || {}, { arrayMerge: (dest, src) => src }) // Merge the DruxtEntity component `settings` property on top. - mergedSettings = merge(mergedSettings || {}, settings, { arrayMerge: (dest, src) => src }) + mergedSettings = merge(mergedSettings || {}, settings || {}, { arrayMerge: (dest, src) => src }) + + // Evaluate the bypass cache function. + if (typeof (mergedSettings.query || {}).bypassCache === 'function') { + mergedSettings.query.bypassCache = !!mergedSettings.query.bypassCache(context) + } + // Currently only returning the query settings. return { query: mergedSettings.query || {}, @@ -485,7 +511,8 @@ export default { * property. * * @typedef {object} ModuleSettings - * @param {object} query - Entity Query settings: + * @param {object} query - Entity query settings: + * @param {(boolean|function)} query.bypassCache - Whether to pull the data from the Vuex store or from the JSON:API. * @param {(string[]|array[])} query.fields - An array or arrays of fields to filter from the JSON:API Resources. * @param {string[]} query.include - An array of relationships to include alongside the JSON:API Resource. * @param {boolean} query.schema - Whether to automatically detect fields to filter, per the Display mode. @@ -495,11 +522,12 @@ export default { * export default { * druxt: { * query: { + * bypassCache: ({ $store }) => $store.$auth.loggedIn, * fields: [['title'], ['user--user', ['display_name']]], * include: ['uid'] * schema: true, * }, - * } + * }, * } * * @example DruxtEntity component with settings @lang vue @@ -509,6 +537,7 @@ export default { * :uuid="uuid" * :settings="{ * query: { + * bypassCache: true, * fields: [['title'], ['user--user', ['display_name']]], * include: ['uid'] * schema: true, diff --git a/packages/menu/CHANGELOG.md b/packages/menu/CHANGELOG.md index b918fc739..baad8581a 100644 --- a/packages/menu/CHANGELOG.md +++ b/packages/menu/CHANGELOG.md @@ -1,5 +1,17 @@ # druxt-menu +## 0.19.0 + +### Minor Changes + +- f6b4a664: feat(#578): updated components to support the DruxtDevelTemplate tool. + +### Patch Changes + +- Updated dependencies [e46a3290] + - druxt@0.21.0 + - druxt-blocks@0.17.0 + ## 0.18.0 ### Minor Changes diff --git a/packages/menu/package.json b/packages/menu/package.json index baa0d524c..6b04a459f 100644 --- a/packages/menu/package.json +++ b/packages/menu/package.json @@ -1,6 +1,6 @@ { "name": "druxt-menu", - "version": "0.18.0", + "version": "0.19.0", "description": "Drupal Menu and Menu item Druxt components, with support for the JSON:API Menu Items module.", "keywords": [ "cms", @@ -44,8 +44,8 @@ "dependencies": { "deepmerge": "^4.2.2", "drupal-jsonapi-params": "^2.1.0", - "druxt": "^0.20.0", - "druxt-blocks": "^0.16.3" + "druxt": "^0.21.0", + "druxt-blocks": "^0.17.0" }, "optionalDependencies": { "vue": "^2.7.10", diff --git a/packages/router/CHANGELOG.md b/packages/router/CHANGELOG.md index a6ea82231..6796b2ff5 100644 --- a/packages/router/CHANGELOG.md +++ b/packages/router/CHANGELOG.md @@ -1,5 +1,16 @@ # druxt-router +## 0.29.0 + +### Minor Changes + +- f6b4a664: feat(#578): updated component to support the DruxtDevelTemplate tool. + +### Patch Changes + +- Updated dependencies [e46a3290] + - druxt@0.21.0 + ## 0.28.0 ### Minor Changes @@ -116,9 +127,9 @@ export default { druxt: { router: { - middleware: false - } - } + middleware: false, + }, + }, }; ``` diff --git a/packages/router/package.json b/packages/router/package.json index 6631ae13c..45fd0c2b0 100644 --- a/packages/router/package.json +++ b/packages/router/package.json @@ -1,6 +1,6 @@ { "name": "druxt-router", - "version": "0.28.0", + "version": "0.29.0", "description": "Drupal router for Nuxt, powered by the Drupal Decoupled Router module.", "keywords": [ "cms", @@ -42,7 +42,7 @@ "templates" ], "dependencies": { - "druxt": "^0.20.0", + "druxt": "^0.21.0", "url-parse": "^1.5.10" }, "devDependencies": { diff --git a/packages/schema/CHANGELOG.md b/packages/schema/CHANGELOG.md index 0d42971d5..91b98cde0 100644 --- a/packages/schema/CHANGELOG.md +++ b/packages/schema/CHANGELOG.md @@ -1,5 +1,12 @@ # druxt-schema +## 0.11.1 + +### Patch Changes + +- Updated dependencies [e46a3290] + - druxt@0.21.0 + ## 0.11.0 ### Minor Changes diff --git a/packages/schema/package.json b/packages/schema/package.json index 658f43919..b7787fe40 100644 --- a/packages/schema/package.json +++ b/packages/schema/package.json @@ -1,6 +1,6 @@ { "name": "druxt-schema", - "version": "0.11.0", + "version": "0.11.1", "description": "Drupal Content Entity schema generator for Druxt with support for View and Form displays.", "keywords": [ "cms", @@ -41,7 +41,7 @@ "dependencies": { "consola": "^2.15.3", "drupal-jsonapi-params": "^2.1.0", - "druxt": "^0.20.0" + "druxt": "^0.21.0" }, "optionalDependencies": { "vue": "^2.7.10", diff --git a/packages/site/CHANGELOG.md b/packages/site/CHANGELOG.md index 4cc9e3ba6..1dc4db0c8 100644 --- a/packages/site/CHANGELOG.md +++ b/packages/site/CHANGELOG.md @@ -1,5 +1,23 @@ # druxt-site +## 0.14.0 + +### Minor Changes + +- f6b4a664: feat(#578): updated component to support the DruxtDevelTemplate tool. + +### Patch Changes + +- Updated dependencies [39af33a4] + - druxt-entity@0.27.0 + - druxt-views@0.21.0 + - druxt@0.21.0 + - druxt-menu@0.19.0 + - druxt-router@0.29.0 + - druxt-breadcrumb@0.17.0 + - druxt-blocks@0.17.0 + - druxt-schema@0.11.1 + ## 0.13.0 ### Minor Changes diff --git a/packages/site/package.json b/packages/site/package.json index bbd2c66d8..e03604204 100644 --- a/packages/site/package.json +++ b/packages/site/package.json @@ -1,6 +1,6 @@ { "name": "druxt-site", - "version": "0.13.0", + "version": "0.14.0", "description": "Out of the box Decoupled Drupal sites with Druxt.", "keywords": [ "cms", @@ -43,14 +43,14 @@ ], "dependencies": { "drupal-jsonapi-params": "^2.1.0", - "druxt": "^0.20.0", - "druxt-blocks": "^0.16.3", - "druxt-breadcrumb": "^0.16.0", - "druxt-entity": "^0.26.0", - "druxt-menu": "^0.18.0", - "druxt-router": "^0.28.0", - "druxt-schema": "^0.11.0", - "druxt-views": "^0.20.0", + "druxt": "^0.21.0", + "druxt-blocks": "^0.17.0", + "druxt-breadcrumb": "^0.17.0", + "druxt-entity": "^0.27.0", + "druxt-menu": "^0.19.0", + "druxt-router": "^0.29.0", + "druxt-schema": "^0.11.1", + "druxt-views": "^0.21.0", "md5": "^2.3.0" }, "optionalDependencies": { diff --git a/packages/test-utils/CHANGELOG.md b/packages/test-utils/CHANGELOG.md index 62d052f55..5a3698f1a 100644 --- a/packages/test-utils/CHANGELOG.md +++ b/packages/test-utils/CHANGELOG.md @@ -1,5 +1,12 @@ # druxt-test-utils +## 1.0.0 + +### Patch Changes + +- Updated dependencies [e46a3290] + - druxt@0.21.0 + ## 0.2.13 ### Patch Changes diff --git a/packages/test-utils/package.json b/packages/test-utils/package.json index 04239481e..a7f820744 100644 --- a/packages/test-utils/package.json +++ b/packages/test-utils/package.json @@ -1,6 +1,6 @@ { "name": "druxt-test-utils", - "version": "0.2.13", + "version": "1.0.0", "private": true, "description": "Test utilities for Druxt development.", "keywords": [ @@ -18,7 +18,7 @@ "module": "dist/druxt-test-utils.esm.js", "dependencies": { "drupal-jsonapi-params": "2.1.0", - "jest-mock-axios": "4.6.1" + "jest-mock-axios": "4.7.2" }, "peerDependencies": { "druxt": "*" diff --git a/packages/views/CHANGELOG.md b/packages/views/CHANGELOG.md index 14d7ed5ae..59aea052a 100644 --- a/packages/views/CHANGELOG.md +++ b/packages/views/CHANGELOG.md @@ -1,5 +1,19 @@ # druxt-views +## 0.21.0 + +### Minor Changes + +- f6b4a664: feat(#578): updated components to support the DruxtDevelTemplate tool. + +### Patch Changes + +- Updated dependencies [39af33a4] + - druxt-entity@0.27.0 + - druxt@0.21.0 + - druxt-router@0.29.0 + - druxt-blocks@0.17.0 + ## 0.20.0 ### Minor Changes diff --git a/packages/views/package.json b/packages/views/package.json index 1adb540e8..64187ddab 100644 --- a/packages/views/package.json +++ b/packages/views/package.json @@ -1,6 +1,6 @@ { "name": "druxt-views", - "version": "0.20.0", + "version": "0.21.0", "description": "Drupal Views components for Druxt with support for filters, pagination and sorting.", "keywords": [ "cms", @@ -41,13 +41,13 @@ "templates" ], "dependencies": { - "axios": "^0.27.2", + "axios": "^1.4.0", "deepmerge": "^4.2.2", "drupal-jsonapi-params": "^2.1.0", - "druxt": "^0.20.0", - "druxt-blocks": "^0.16.3", - "druxt-entity": "^0.26.0", - "druxt-router": "^0.28.0", + "druxt": "^0.21.0", + "druxt-blocks": "^0.17.0", + "druxt-entity": "^0.27.0", + "druxt-router": "^0.29.0", "md5": "^2.3.0" }, "optionalDependencies": { diff --git a/packages/views/src/components/DruxtView.vue b/packages/views/src/components/DruxtView.vue index bc066e186..3159645e2 100644 --- a/packages/views/src/components/DruxtView.vue +++ b/packages/views/src/components/DruxtView.vue @@ -78,6 +78,17 @@ export default { default: 'default', }, + /** + * Module settings object. + * + * @type {ModuleSettings} + * @default {} + */ + settings: { + type: Object, + default: () => ({}), + }, + /** * JSON:API Resource type. * @@ -329,6 +340,14 @@ export default { }, }, + mounted() { + // If static, re-fetch data allowing for cache-bypass. + // @TODO - Don't re-fetch in serverless configuration. + if (this.$store.app.context.isStatic) { + this.$fetch() + } + }, + methods: { /** * Builds the query for the JSON:API request. @@ -446,12 +465,22 @@ export default { async fetchData(settings) { const viewId = this.viewId || (((this.view || {}).data || {}).attributes || {}).drupal_internal__id if (viewId) { + // Check if we need to bypass cache. + let bypassCache = false + if (typeof (settings.query || {}).bypassCache === 'boolean') { + bypassCache = settings.query.bypassCache + } + + // Build query. const query = this.getQuery(settings) + + // Execute the resquest. this.resource = await this.getResults({ displayId: this.displayId, prefix: this.lang, query: stringify(query), - viewId + viewId, + bypassCache }) } }, @@ -474,10 +503,24 @@ export default { /** * Component settings. */ - settings: ({ $druxt }, wrapperSettings) => { - const settings = merge($druxt.settings.views || {}, wrapperSettings, { arrayMerge: (dest, src) => src }) + settings: (context, wrapperSettings) => { + const { $druxt, settings } = context + + // Start with the `nuxt.config.js` `druxt.settings.views` settings and + // merge the Wrapper component settings on top. + let mergedSettings = merge(($druxt.settings || {}).views || {}, wrapperSettings || {}, { arrayMerge: (dest, src) => src }) + // Merge the DruxtViews component `settings` property on top. + mergedSettings = merge(mergedSettings || {}, settings || {}, { arrayMerge: (dest, src) => src }) + + // Evaluate the bypass cache function. + if (typeof (mergedSettings.query || {}).bypassCache === 'function') { + mergedSettings.query.bypassCache = !!mergedSettings.query.bypassCache(context) + } + + console.log('mergedSettings', mergedSettings) + return { - query: settings.query || {}, + query: mergedSettings.query || {}, } }, @@ -692,28 +735,40 @@ export default { * or the Wrapper component `druxt` object. * * @typedef {object} ModuleSettings - * @param {boolean} bundleFilter - Whether to automatically detect Resource types to filter, based on the View `bundle` filter. - * @param {string[]} fields - An array of fields to filter from the JSON:API Views Resource types. - * @param {string[]} resourceTypes - An array of Resource types to be used by the Fields filter. - * - * @example @lang js - * { - * bundleFilter: false, - * fields: [], - * resourceTypes: [] - * } + * @param {object} query - View results query settings: + * @param {(boolean|function)} query.bypassCache - Whether to pull the data from the Vuex store or from the JSON:API. + * @param {boolean} query.bundleFilter - Whether to automatically detect Resource types to filter, based on the View `bundle` filter. + * @param {string[]} query.fields - An array of fields to filter from the JSON:API Views Resource types. + * @param {string[]} query.resourceTypes - An array of Resource types to be used by the Fields filter. * - * @example @lang vue + * @example DruxtView Wrapper component @lang vue *