Skip to content

Commit

Permalink
[CLOSES #9] Add library for HTTP Status Codes and HTTP Method (#239)
Browse files Browse the repository at this point in the history
* [CLOSES #9] Add http-method-enum and status-code-enum

* Add enum-utils

* Use status-code enums instead of hard coded numbers

* [RELEASE] 0.1.5-14
  • Loading branch information
adrw committed Mar 4, 2019
1 parent 132caf2 commit dc76c08
Show file tree
Hide file tree
Showing 16 changed files with 235 additions and 160 deletions.
285 changes: 158 additions & 127 deletions common/config/rush/shrinkwrap.yaml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion common/config/rush/version-policies.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
{
"definitionName": "lockStepVersion",
"policyName": "MiskWeb",
"version": "0.1.5-13",
"version": "0.1.5-14",
"nextBump": "prerelease"
}
// {
Expand Down
13 changes: 8 additions & 5 deletions examples/tabs/palette-exemplar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
"zip": "tar --exclude='.gitignore' --exclude='.old_build_files' --exclude='package.json' --exclude='package-lock.json' --exclude='prettier.config.js' --exclude='tsconfig.json' --exclude='tslint.json' --exclude='webpack.config.js' --exclude='yarn.lock' --exclude='demo' --exclude='lib' --exclude='.DS_Store' --exclude='*.log' --exclude='node_modules' --exclude='palette-exemplar.tgz' -czvf palette-exemplar.tgz ./"
},
"dependencies": {
"@misk/common": "0.1.5-13",
"@misk/core": "0.1.5-13",
"@misk/simpleredux": "0.1.5-13",
"@misk/common": "0.1.5-14",
"@misk/core": "0.1.5-14",
"@misk/simpleredux": "0.1.5-14",
"@blueprintjs/core": "^3.9.0",
"@blueprintjs/datetime": "^3.4.0",
"@blueprintjs/icons": "^3.3.0",
Expand All @@ -34,7 +34,9 @@
"axios": "^0.18.0",
"connected-react-router": "^5.0.1",
"dayjs": "^1.7.7",
"enum-utils": "^1.0.0",
"history": "^4.7.2",
"http-method-enum": "^1.0.0",
"immutable": "^4.0.0-rc.12",
"react": "^16.6.3",
"react-dom": "^16.6.3",
Expand All @@ -49,11 +51,12 @@
"reselect": "^4.0.0",
"re-reselect": "2.2.0",
"skeleton-css": "^2.0.4",
"status-code-enum": "^1.0.0",
"styled-components": "^4.1.2"
},
"devDependencies": {
"@misk/dev": "0.1.5-13",
"@misk/tslint": "0.1.5-13",
"@misk/dev": "0.1.5-14",
"@misk/tslint": "0.1.5-14",
"@types/history": "^4.7.2",
"@types/node": "^10.12.18",
"@types/react": "^16.7.18",
Expand Down
Binary file modified examples/tabs/palette-exemplar/palette-exemplar.tgz
Binary file not shown.
2 changes: 1 addition & 1 deletion examples/tabs/palette/demo/@misk/common/vendors.js.map

Large diffs are not rendered by default.

20 changes: 18 additions & 2 deletions examples/tabs/palette/demo/@misk/simpleredux/simpleredux.js

Large diffs are not rendered by default.

13 changes: 8 additions & 5 deletions examples/tabs/palette/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
"zip": "tar --exclude='.gitignore' --exclude='.old_build_files' --exclude='package.json' --exclude='package-lock.json' --exclude='prettier.config.js' --exclude='tsconfig.json' --exclude='tslint.json' --exclude='webpack.config.js' --exclude='yarn.lock' --exclude='demo' --exclude='lib' --exclude='.DS_Store' --exclude='*.log' --exclude='node_modules' --exclude='palette.tgz' -czvf palette.tgz ./"
},
"dependencies": {
"@misk/common": "0.1.5-13",
"@misk/core": "0.1.5-13",
"@misk/simpleredux": "0.1.5-13",
"@misk/common": "0.1.5-14",
"@misk/core": "0.1.5-14",
"@misk/simpleredux": "0.1.5-14",
"@blueprintjs/core": "^3.9.0",
"@blueprintjs/datetime": "^3.4.0",
"@blueprintjs/icons": "^3.3.0",
Expand All @@ -34,7 +34,9 @@
"axios": "^0.18.0",
"connected-react-router": "^5.0.1",
"dayjs": "^1.7.7",
"enum-utils": "^1.0.0",
"history": "^4.7.2",
"http-method-enum": "^1.0.0",
"immutable": "^4.0.0-rc.12",
"react": "^16.6.3",
"react-dom": "^16.6.3",
Expand All @@ -49,11 +51,12 @@
"reselect": "^4.0.0",
"re-reselect": "2.2.0",
"skeleton-css": "^2.0.4",
"status-code-enum": "^1.0.0",
"styled-components": "^4.1.2"
},
"devDependencies": {
"@misk/dev": "0.1.5-13",
"@misk/tslint": "0.1.5-13",
"@misk/dev": "0.1.5-14",
"@misk/tslint": "0.1.5-14",
"@types/history": "^4.7.2",
"@types/node": "^10.12.18",
"@types/react": "^16.7.18",
Expand Down
Binary file modified examples/tabs/palette/palette.tgz
Binary file not shown.
6 changes: 3 additions & 3 deletions packages/@misk/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@misk/cli",
"version": "0.1.5-13",
"version": "0.1.5-14",
"license": "SEE LICENSE IN https://github.com/square/misk-web",
"description": "Misk-Web CLI Build Tool",
"author": "Square/Misk Authors (https://github.com/square/misk-web/graphs/contributors)",
Expand Down Expand Up @@ -28,8 +28,8 @@
"yargs": "^12.0.4"
},
"devDependencies": {
"@misk/dev": "0.1.5-13",
"@misk/tslint": "0.1.5-13",
"@misk/dev": "0.1.5-14",
"@misk/tslint": "0.1.5-14",
"@types/fs-extra": "^5.0.4",
"@types/klaw": "^3.0.0",
"@types/lodash": "^4.14.121",
Expand Down
15 changes: 13 additions & 2 deletions packages/@misk/cli/src/utils/changelog.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export enum MiskVersion {
"latest" = "0.1.5-13",
"alpha" = "0.1.5-13",
"latest" = "0.1.5-14",
"alpha" = "0.1.5-14",
"v015_14" = "0.1.5-14",
"v015_13" = "0.1.5-13",
"v015_11" = "0.1.5-11",
"v015_4" = "0.1.5-4",
Expand Down Expand Up @@ -108,6 +109,16 @@ export const getPackageVersion = (
}

export const MiskTabVersions: IMiskTabVersions = {
[MiskVersion.v015_14]: {
[MiskPkg.cli]: `${[MiskVersion.v015_14]}`,
[MiskPkg.common]: `${[MiskVersion.v015_14]}`,
[MiskPkg.core]: `${[MiskVersion.v015_14]}`,
[MiskPkg.dev]: `${[MiskVersion.v015_14]}`,
[MiskPkg.simpleredux]: `${[MiskVersion.v015_14]}`,
[MiskPkg.tslint]: `${[MiskVersion.v015_14]}`,
date: "2019-03-04",
notes: "Add http-method-enum, status-code-enum, and enum-utils libraries."
},
[MiskVersion.v015_13]: {
[MiskPkg.cli]: `${[MiskVersion.v015_13]}`,
[MiskPkg.common]: `${[MiskVersion.v015_13]}`,
Expand Down
9 changes: 6 additions & 3 deletions packages/@misk/common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@misk/common",
"version": "0.1.5-13",
"version": "0.1.5-14",
"license": "SEE LICENSE IN https://github.com/square/misk-web",
"description": "Misk-Web Common Libraries, Styles",
"author": "Square/Misk Authors (https://github.com/square/misk-web/graphs/contributors)",
Expand Down Expand Up @@ -43,7 +43,9 @@
"axios": "^0.18.0",
"connected-react-router": "^5.0.1",
"dayjs": "^1.7.7",
"enum-utils": "^1.0.0",
"history": "^4.7.2",
"http-method-enum": "^1.0.0",
"immutable": "^4.0.0-rc.12",
"lodash": "^4.17.11",
"react": "^16.6.3",
Expand All @@ -59,11 +61,12 @@
"reselect": "^4.0.0",
"re-reselect": "2.2.0",
"skeleton-css": "^2.0.4",
"status-code-enum": "^1.0.0",
"styled-components": "^4.1.2"
},
"devDependencies": {
"@misk/dev": "0.1.5-13",
"@misk/tslint": "0.1.5-13",
"@misk/dev": "0.1.5-14",
"@misk/tslint": "0.1.5-14",
"@types/history": "^4.7.2",
"@types/lodash": "^4.14.121",
"@types/node": "^10.12.18",
Expand Down
11 changes: 7 additions & 4 deletions packages/@misk/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@misk/core",
"version": "0.1.5-13",
"version": "0.1.5-14",
"license": "SEE LICENSE IN https://github.com/square/misk-web",
"description": "Misk-Web Core",
"author": "Square/Misk Authors (https://github.com/square/misk-web/graphs/contributors)",
Expand Down Expand Up @@ -33,7 +33,7 @@
"updateDevCache": "cd ..; ./updateLocalCache.sh"
},
"dependencies": {
"@misk/common": "0.1.5-13",
"@misk/common": "0.1.5-14",
"@blueprintjs/core": "^3.9.0",
"@blueprintjs/datetime": "^3.4.0",
"@blueprintjs/icons": "^3.3.0",
Expand All @@ -43,7 +43,9 @@
"axios": "^0.18.0",
"connected-react-router": "^5.0.1",
"dayjs": "^1.7.7",
"enum-utils": "^1.0.0",
"history": "^4.7.2",
"http-method-enum": "^1.0.0",
"immutable": "^4.0.0-rc.12",
"lodash": "^4.17.11",
"react": "^16.6.3",
Expand All @@ -59,11 +61,12 @@
"reselect": "^4.0.0",
"re-reselect": "2.2.0",
"skeleton-css": "^2.0.4",
"status-code-enum": "^1.0.0",
"styled-components": "^4.1.2"
},
"devDependencies": {
"@misk/dev": "0.1.5-13",
"@misk/tslint": "0.1.5-13",
"@misk/dev": "0.1.5-14",
"@misk/tslint": "0.1.5-14",
"@types/history": "^4.7.2",
"@types/lodash": "^4.14.121",
"@types/node": "^10.12.18",
Expand Down
2 changes: 1 addition & 1 deletion packages/@misk/dev/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@misk/dev",
"version": "0.1.5-13",
"version": "0.1.5-14",
"license": "SEE LICENSE IN https://github.com/square/misk-web",
"description": "Misk-Web Build and Dev Tools",
"author": "Square/Misk Authors (https://github.com/square/misk-web/graphs/contributors)",
Expand Down
11 changes: 7 additions & 4 deletions packages/@misk/simpleredux/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@misk/simpleredux",
"version": "0.1.5-13",
"version": "0.1.5-14",
"license": "SEE LICENSE IN https://github.com/square/misk-web",
"description": "Misk-Web SimpleRedux",
"author": "Square/Misk Authors (https://github.com/square/misk-web/graphs/contributors)",
Expand Down Expand Up @@ -33,7 +33,7 @@
"updateDevCache": "cd ..; ./updateLocalCache.sh"
},
"dependencies": {
"@misk/common": "0.1.5-13",
"@misk/common": "0.1.5-14",
"@blueprintjs/core": "^3.9.0",
"@blueprintjs/datetime": "^3.4.0",
"@blueprintjs/icons": "^3.3.0",
Expand All @@ -43,7 +43,9 @@
"axios": "^0.18.0",
"connected-react-router": "^5.0.1",
"dayjs": "^1.7.7",
"enum-utils": "^1.0.0",
"history": "^4.7.2",
"http-method-enum": "^1.0.0",
"immutable": "^4.0.0-rc.12",
"lodash": "^4.17.11",
"react": "^16.6.3",
Expand All @@ -59,11 +61,12 @@
"reselect": "^4.0.0",
"re-reselect": "2.2.0",
"skeleton-css": "^2.0.4",
"status-code-enum": "^1.0.0",
"styled-components": "^4.1.2"
},
"devDependencies": {
"@misk/dev": "0.1.5-13",
"@misk/tslint": "0.1.5-13",
"@misk/dev": "0.1.5-14",
"@misk/tslint": "0.1.5-14",
"@types/history": "^4.7.2",
"@types/lodash": "^4.14.121",
"@types/node": "^10.12.18",
Expand Down
4 changes: 3 additions & 1 deletion packages/@misk/simpleredux/src/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import isEmpty from "lodash/isEmpty"
import isRegExp from "lodash/isRegExp"
import createCachedSelector from "re-reselect"
import { createSelector, OutputSelector, ParametricSelector } from "reselect"
import { StatusCode } from "status-code-enum"

/**
* Default State with Redux flow metadata wrapped in an Immutable JS object for more efficient use in Reducers
Expand Down Expand Up @@ -80,7 +81,8 @@ export const errorMessage = (error: any) => {
let code = error.errorCode
if (!code) {
code =
error.response && error.response.status === 401
error.response &&
error.response.status === StatusCode.ClientErrorUnauthorized
? "Unauthorized"
: "InternalServerError"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/@misk/tslint/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@misk/tslint",
"version": "0.1.5-13",
"version": "0.1.5-14",
"license": "SEE LICENSE IN https://github.com/square/misk-web",
"description": "Misk-Web TsLint",
"author": "Square/Misk Authors (https://github.com/square/misk-web/graphs/contributors)",
Expand Down

0 comments on commit dc76c08

Please sign in to comment.