Skip to content

Commit

Permalink
[6626] Update Dependencies 3/24 (#97)
Browse files Browse the repository at this point in the history
* Bump uuid from 3.4.0 to 9.0.1 #6626

* Upgrade @rollup/plugin-commonjs to v^11.1.0, @rollup/plugin-node-resolve to v^7.1.3 and rollup to v^2.79.1 #6626

* Update content and search redux actions to use @reduxjs/toolkit #6626

* Replace deprecated uglify-es package with terser #6626

* Update redux to v5, and redux observable to v3. Add @reduxjs/toolkit #6626

* Update CHANGELOG.md #6626

* Update redux package README file with actions payload updates #6626
  • Loading branch information
jvega190 authored Apr 18, 2024
1 parent ad2d9c7 commit 0cfee97
Show file tree
Hide file tree
Showing 19 changed files with 1,771 additions and 3,108 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# SDK Changelog

## 4.2.0
* [@craftercms/redux]:
* getTree action payload is now an object with `url` and `depth` properties.
* getNav action payload is now an object with `url`, `depth` and `cyrrebtPageUrl` properties.
* getNavBreadcrumb action payload is now an object with `url` and `root` properties.

## 4.1.3

- Dependency updates
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ N="
"
TSC=$(pwd)/node_modules/.bin/tsc
NGC="node --max-old-space-size=3000 $(pwd)/node_modules/.bin/ngc" # /dist/tools/@angular/compiler-cli/src/main
UGLIFY=$(pwd)/node_modules/.bin/uglifyjs
UGLIFY=$(pwd)/node_modules/.bin/terser
TSCONFIG=./tools/tsconfig.json
ROLLUP=$(pwd)/node_modules/.bin/rollup

Expand Down
5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,5 @@
"react": "^18.2.0",
"typescript": "^5.3.3"
},
"packageManager": "[email protected]",
"resolutions": {
"uglify-es": "3.3.9"
}
"packageManager": "[email protected]"
}
8 changes: 4 additions & 4 deletions packages/classes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
"query-string": "^7.1.3"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^11.1.0",
"@rollup/plugin-node-resolve": "^7.1.3",
"rollup": "^1.32.1",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-node-resolve": "^15.2.3",
"rollup": "^2.79.1",
"rollup-plugin-sourcemaps": "^0.5.0",
"uglify-es": "^3.3.10"
"terser": "^5.30.1"
}
}
8 changes: 4 additions & 4 deletions packages/content/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@
"rxjs": "^7.8.1"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^11.1.0",
"@rollup/plugin-node-resolve": "^7.1.3",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-node-resolve": "^15.2.3",
"@types/mocha": "^7.0.2",
"mocha": "^7.2.0",
"rollup": "^1.32.1",
"rollup": "^2.79.1",
"rollup-plugin-sourcemaps": "^0.5.0",
"uglify-es": "^3.3.10",
"terser": "^5.30.1",
"xhr-mock": "^2.5.1"
}
}
8 changes: 4 additions & 4 deletions packages/ice/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@
"build": "npm run build:ts && npm run rollup && npm run clean:ts"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^11.1.0",
"@rollup/plugin-node-resolve": "^7.1.3",
"rollup": "^1.32.1",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-node-resolve": "^15.2.3",
"rollup": "^2.79.1",
"rollup-plugin-sourcemaps": "^0.5.0",
"uglify-es": "^3.3.10"
"terser": "^5.30.1"
},
"dependencies": {
"@craftercms/models": "0.0.0-PLACEHOLDER"
Expand Down
8 changes: 4 additions & 4 deletions packages/models/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
"build": "npm run build:ts && npm run rollup && npm run clean:ts"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^11.1.0",
"@rollup/plugin-node-resolve": "^7.1.3",
"rollup": "^1.32.1",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-node-resolve": "^15.2.3",
"rollup": "^2.79.1",
"rollup-plugin-sourcemaps": "^0.5.0",
"uglify-es": "^3.3.10"
"terser": "^5.30.1"
}
}
14 changes: 7 additions & 7 deletions packages/redux/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ Creates an action to get the list of Items directly under a folder into your sto
### getTree
Creates an action to get the complete Item hierarchy under the specified folder in the content store.

`getTree(path: string, depth: int)`
`getTree({ path: string, depth: int })`

| Parameters | |
| ------------- |:--------------:|
Expand All @@ -177,13 +177,13 @@ Creates an action to get the complete Item hierarchy under the specified folder

const path = '/site/website';

store.dispatch(getTree(path, 2));
store.dispatch(getTree({ path, depth: 2 }));
```

### getNav
Creates an action to return the navigation tree with the specified depth for the specified store URL.

`getNav(path: string, depth: int, currentPageUrl: string)`
`getNav({ path: string, depth: int, currentPageUrl: string })`

| Parameters | |
| -------------- |:--------------:|
Expand All @@ -200,13 +200,13 @@ Creates an action to return the navigation tree with the specified depth for the

const path = '/site/website';

store.dispatch(getNav(path, 2));
store.dispatch(getNav({ path, depth: 2 }));
```

### getNavBreadcrumb
Creates an action to return the navigation items that form the breadcrumb for the specified store URL.

`getNavBreadcrumb(path: string, root: string)`
`getNavBreadcrumb({ path: string, root: string })`

| Parameters | |
| -------------- |:--------------:|
Expand All @@ -222,7 +222,7 @@ Creates an action to return the navigation items that form the breadcrumb for th

const path = '/site/website/health';

store.dispatch(getNavBreadcrumb(path));
store.dispatch(getNavBreadcrumb({ path }));
```

### search
Expand Down Expand Up @@ -290,7 +290,7 @@ Resulting store state

const path = '/site/website';

store.dispatch(getTree(path));
store.dispatch(getTree({ path }));
```

Store state while loading tree
Expand Down
13 changes: 7 additions & 6 deletions packages/redux/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,20 @@
},
"dependencies": {
"@craftercms/content": "0.0.0-PLACEHOLDER",
"redux": "^4.2.1",
"redux-observable": "^2.0.0",
"@reduxjs/toolkit": "^2.2.2",
"redux": "^5.0.1",
"redux-observable": "^3.0.0-rc.2",
"rxjs": "^7.8.1"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^11.1.0",
"@rollup/plugin-node-resolve": "^7.1.3",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-node-resolve": "^15.2.3",
"@types/mocha": "^7.0.2",
"mocha": "^7.2.0",
"rollup": "^1.32.1",
"rollup": "^2.79.1",
"rollup-plugin-sourcemaps": "^0.5.0",
"terser": "^5.30.1",
"tslib": "^2.6.2",
"uglify-es": "^3.3.10",
"xhr-mock": "^2.5.1"
}
}
134 changes: 13 additions & 121 deletions packages/redux/src/actions/content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,136 +15,28 @@
*/

import { Descriptor, Item, NavigationItem } from '@craftercms/models';
import { createAction } from "@reduxjs/toolkit";

export const GET_ITEM = 'CRAFTERCMS_GET_ITEM';
export const GET_ITEM_COMPLETE = 'CRAFTERCMS_GET_ITEM_COMPLETE';
export const GET_DESCRIPTOR = 'CRAFTERCMS_GET_DESCRIPTOR';
export const GET_DESCRIPTOR_COMPLETE = 'CRAFTERCMS_GET_DESCRIPTOR_COMPLETE';
export const GET_CHILDREN = 'CRAFTERCMS_GET_CHILDREN';
export const GET_CHILDREN_COMPLETE = 'CRAFTERCMS_GET_CHILDREN_COMPLETE';
export const GET_TREE = 'CRAFTERCMS_GET_TREE';
export const GET_TREE_COMPLETE = 'CRAFTERCMS_GET_TREE_COMPLETE';
export const getItem = /*#__PURE__*/ createAction<string>('GET_ITEM');

export const GET_NAV = 'CRAFTERCMS_GET_NAV';
export const GET_NAV_COMPLETE = 'CRAFTERCMS_GET_NAV_COMPLETE';
export const GET_NAV_BREADCRUMB = 'CRAFTERCMS_GET_NAV_BREADCRUMB';
export const GET_NAV_BREADCRUMB_COMPLETE = 'CRAFTERCMS_GET_NAV_BREADCRUMB_COMPLETE';
export const getItemComplete = /*#__PURE__*/ createAction<{ url: string, item?: Item }>('GET_ITEM_COMPLETE');

export function getItem(itemUrl: string) {
return {
type: GET_ITEM,
payload: itemUrl
}
}
export const getDescriptor = /*#__PURE__*/ createAction<string>('GET_DESCRIPTOR');

export function getItemComplete(itemData: {
url: string,
item?: Item
}) {
return {
type: GET_ITEM_COMPLETE,
payload: itemData
}
}
export const getDescriptorComplete = /*#__PURE__*/ createAction<{ url: string, descriptor?: Descriptor }>('GET_DESCRIPTOR_COMPLETE');

export function getDescriptor(url: string) {
return {
type: GET_DESCRIPTOR,
payload: url
}
}
export const getChildren = /*#__PURE__*/ createAction<string>('GET_CHILDREN');

export function getDescriptorComplete(descriptorData: {
url: string,
descriptor?: Descriptor
}) {
return {
type: GET_DESCRIPTOR_COMPLETE,
payload: descriptorData
}
}
export const getChildrenComplete = /*#__PURE__*/ createAction<{ url: string, children?: Array<Item> }>('GET_CHILDREN_COMPLETE');

export function getChildren(url: string) {
return {
type: GET_CHILDREN,
payload: url
}
}
export const getTree = /*#__PURE__*/ createAction<{ url: string, depth?: Number }>('GET_TREE');

export function getChildrenComplete(childrenData: {
url: string,
children?: Array<Item>,
}) {
return {
type: GET_CHILDREN_COMPLETE,
payload: childrenData
}
}
export const getTreeComplete = /*#__PURE__*/ createAction<{ url: string, tree?: Item }>('GET_TREE_COMPLETE');

export function getTree(url: string);
export function getTree(url: string, depth: Number);
export function getTree(url: string, depth: Number = 1) {
return {
type: GET_TREE,
payload: {
url,
depth
}
}
}
export const getNav = /*#__PURE__*/ createAction<{ url: string, depth?: Number, currentPageUrl?: string }>('GET_NAV');

export function getTreeComplete(treeData: {
url: string,
tree?: Item
}) {
return {
type: GET_TREE_COMPLETE,
payload: treeData
}
}
export const getNavComplete = /*#__PURE__*/ createAction<{ url: string, nav?: NavigationItem }>('GET_NAV_COMPLETE');

export function getNav(url: string);
export function getNav(url: string, depth: Number);
export function getNav(url: string, depth: Number, currentPageUrl: string)
export function getNav(url: string, depth: Number = 1, currentPageUrl: string = '') {
return {
type: GET_NAV,
payload: {
url,
depth,
currentPageUrl
}
}
}
export const getNavBreadcrumb = /*#__PURE__*/ createAction<{ url: string, root?: string }>('GET_NAV_BREADCRUMB');

export function getNavComplete(navData: {
url: string,
nav?: NavigationItem
}) {
return {
type: GET_NAV_COMPLETE,
payload: navData
}
}

export function getNavBreadcrumb(url: string);
export function getNavBreadcrumb(url: string, root: string);
export function getNavBreadcrumb(url: string, root: string = '') {
return {
type: GET_NAV_BREADCRUMB,
payload: {
url,
root
}
}
}

export function getNavBreadcrumbComplete(navBreadcrumbData: {
url: string,
breadcrumb?: Array<NavigationItem>
}) {
return {
type: GET_NAV_BREADCRUMB_COMPLETE,
payload: navBreadcrumbData
}
}
export const getNavBreadcrumbComplete = /*#__PURE__*/ createAction<{ url: string, breadcrumb?: Array<NavigationItem> }>('GET_NAV_BREADCRUMB_COMPLETE');
19 changes: 3 additions & 16 deletions packages/redux/src/actions/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,10 @@
*/

import { Query } from '@craftercms/search';
import { createAction } from "@reduxjs/toolkit";

export const SEARCH = 'CRAFTERCMS_SEARCH';
export const SEARCH_COMPLETE = 'CRAFTERCMS_SEARCH_COMPLETE';

export function search(query: Query) {
return {
type: SEARCH,
payload: query
}
}
export const search = /*#__PURE__*/ createAction<Query>('GET_ITEM');

export function searchComplete(searchResponseData: {
queryId: string,
response?
}) {
return {
type: SEARCH_COMPLETE,
payload: searchResponseData
}
}
export const searchComplete = /*#__PURE__*/ createAction<{ queryId: string, response? }>(SEARCH_COMPLETE);
Loading

0 comments on commit 0cfee97

Please sign in to comment.