Skip to content

Commit b20b40b

Browse files
Ensuring that the website works as expected.
1 parent 98f0af7 commit b20b40b

File tree

5 files changed

+63
-58
lines changed

5 files changed

+63
-58
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ To deploy this stack:
44

55
``` shell
66
yarn build
7-
yarn pack-build
7+
yarn package-build
88
yarn aws-package
99
yarn aws-deploy
1010
```

package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@
4444
"@types/throttle-debounce": "^2.1.0",
4545
"babel-loader": "^8.2.2",
4646
"babel-plugin-transform-class-properties": "^6.24.1",
47-
"concurrently": "^5.3.0",
4847
"csp-html-webpack-plugin": "^5.1.0",
4948
"css-loader": "^5.0.1",
5049
"html-webpack-plugin": "^5.0.0-beta.4",
5150
"http-server-spa": "^1.3.0",
5251
"json-schema-to-typescript": "^10.1.2",
52+
"npm-run-all": "^4.1.5",
5353
"source-map-loader": "^2.0.0",
5454
"style-loader": "^2.0.0",
5555
"ts-loader": "^8.0.14",
@@ -65,13 +65,16 @@
6565
"build-dev": "webpack -c webpack.dev.js",
6666
"build-prod": "webpack -c webpack.prod.js",
6767
"build": "rm -fr dist && webpack -c webpack.prod.js",
68-
"pack-clean": "rm -rf *.zip source/witch/nodejs/node_modules/",
68+
"clean": "rm -rf *.zip source/witch/nodejs/node_modules/",
6969
"pack-witch": "cd aws/witch && npm install --prefix nodejs mime-types && cp witch.js nodejs/node_modules/ && zip -r ../../witch.zip nodejs",
7070
"pack-secured-headers": "cd aws/secured-headers/ && zip -r ../../s-headers.zip index.js",
7171
"pack-website": "cd dist && zip -r ../website.zip *",
72-
"pack-build": "npm run pack-clean && concurrently npm:pack-witch npm:pack-secured-headers npm:pack-website",
72+
"package-all": "run-p pack-witch pack-secured-headers pack-website",
73+
"package-build": "run-s clean package-all",
7374
"aws-package": "aws cloudformation package --template-file templates/main.yaml --s3-bucket json-schema-viewer-cloudformation --output-template-file packaged.template",
7475
"aws-deploy": "aws --region us-east-1 cloudformation deploy --stack-name json-schema-viewer --template-file packaged.template --capabilities CAPABILITY_NAMED_IAM CAPABILITY_AUTO_EXPAND --parameter-overrides DomainName=json-schema.app SubDomain=www CreateApex=yes",
76+
"build-and-deploy": "run-s build package-build aws-package aws-deploy",
77+
"upload": "aws s3 sync --exclude 'index.html' --delete dist s3://json-schema-viewer-customresourcesta-s3bucketroot-vjmtja1bzua1 && aws s3 cp --cache-control \"max-age=300\" dist/index.html s3://json-schema-viewer-customresourcesta-s3bucketroot-vjmtja1bzua1",
7578
"storybook": "start-storybook -p 6006",
7679
"build-storybook": "build-storybook",
7780
"gen-schema": "json2ts json-schema.draft-07.json > src/schema.ts",

templates/cloudfront-site.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ Resources:
114114
ResponsePagePath: '/index.html'
115115
- ErrorCachingMinTTL: 60
116116
ErrorCode: 403
117-
ResponseCode: 403
118-
ResponsePagePath: '/403.html'
117+
ResponseCode: 200
118+
ResponsePagePath: '/index.html'
119119
Enabled: true
120120
HttpVersion: 'http2'
121121
DefaultRootObject: 'index.html'

webpack.common.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,15 @@ module.exports = {
2424
extensions: [ '.tsx', '.ts', '.js' ],
2525
},
2626
output: {
27-
filename: 'bundle.js',
27+
filename: 'bundle.[chunkhash].js',
2828
path: path.resolve(__dirname, 'dist'),
2929
},
3030
plugins: [
3131
new HtmlWebpackPlugin({
3232
title: 'JSON Schema Viewer',
3333
template: 'index.html',
34-
publicPath: '/'
34+
publicPath: '/',
35+
filename: 'index.html'
3536
}),
3637
new CspHtmlWebpackPlugin({
3738
'script-src': ["'strict-dynamic'"],

yarn.lock

Lines changed: 51 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115
"@atlaskit/theme" "^11.0.0"
116116
"@babel/runtime" "^7.0.0"
117117

118-
"@atlaskit/icon@^21.1.0":
118+
"@atlaskit/icon@^21.1.0", "@atlaskit/icon@^21.2.0":
119119
version "21.2.1"
120120
resolved "https://registry.yarnpkg.com/@atlaskit/icon/-/icon-21.2.1.tgz#802bbf77b0c8febf5eeab545285383e1546f5eee"
121121
integrity sha512-1L4y3JF/p/11u2Ddd66uJffVR1eEa6nwfovQfESubR0NOamf/EUbpx6Awx90mhcx0qmXBeJlJsz7fkZUP+MSSg==
@@ -124,15 +124,6 @@
124124
tslib "^2.0.0"
125125
uuid "^3.1.0"
126126

127-
"@atlaskit/icon@^21.2.0":
128-
version "21.2.0"
129-
resolved "https://registry.yarnpkg.com/@atlaskit/icon/-/icon-21.2.0.tgz#158109cb7bdea046fb59abf47ba82dd02f46f0de"
130-
integrity sha512-TcM7FUSzfBYSoFbQ0cRW+1dmO9IvwD1je1MZWqeXDgQrXFgJf8iLC8ERLrJNSUKu/L0l4LokwKw+yqYPh4IuGg==
131-
dependencies:
132-
"@atlaskit/theme" "^11.0.0"
133-
tslib "^2.0.0"
134-
uuid "^3.1.0"
135-
136127
"@atlaskit/logo@*", "@atlaskit/logo@^13.0.7":
137128
version "13.0.7"
138129
resolved "https://registry.yarnpkg.com/@atlaskit/logo/-/logo-13.0.7.tgz#3c10f66c39ad46cf871e4df86b40dcfbc7a38926"
@@ -4470,21 +4461,6 @@ concat-stream@^1.5.0:
44704461
readable-stream "^2.2.2"
44714462
typedarray "^0.0.6"
44724463

4473-
concurrently@^5.3.0:
4474-
version "5.3.0"
4475-
resolved "https://registry.yarnpkg.com/concurrently/-/concurrently-5.3.0.tgz#7500de6410d043c912b2da27de3202cb489b1e7b"
4476-
integrity sha512-8MhqOB6PWlBfA2vJ8a0bSFKATOdWlHiQlk11IfmQBPaHVP8oP2gsh2MObE6UR3hqDHqvaIvLTyceNW6obVuFHQ==
4477-
dependencies:
4478-
chalk "^2.4.2"
4479-
date-fns "^2.0.1"
4480-
lodash "^4.17.15"
4481-
read-pkg "^4.0.1"
4482-
rxjs "^6.5.2"
4483-
spawn-command "^0.0.2-1"
4484-
supports-color "^6.1.0"
4485-
tree-kill "^1.2.2"
4486-
yargs "^13.3.0"
4487-
44884464
connect-history-api-fallback@^1.6.0:
44894465
version "1.6.0"
44904466
resolved "https://registry.yarnpkg.com/connect-history-api-fallback/-/connect-history-api-fallback-1.6.0.tgz#8b32089359308d111115d81cad3fceab888f97bc"
@@ -4697,7 +4673,7 @@ [email protected]:
46974673
shebang-command "^2.0.0"
46984674
which "^2.0.1"
46994675

4700-
cross-spawn@^6.0.0:
4676+
cross-spawn@^6.0.0, cross-spawn@^6.0.5:
47014677
version "6.0.5"
47024678
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4"
47034679
integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==
@@ -4958,11 +4934,6 @@ dashdash@^1.12.0:
49584934
dependencies:
49594935
assert-plus "^1.0.0"
49604936

4961-
date-fns@^2.0.1:
4962-
version "2.16.1"
4963-
resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.16.1.tgz#05775792c3f3331da812af253e1a935851d3834b"
4964-
integrity sha512-sAJVKx/FqrLYHAQeN7VpJrPhagZc9R4ImZIWYRFZaaohR3KzmuK88touwsSwSVT8Qcbd4zoDsnGfX4GFB4imyQ==
4965-
49664937
[email protected], debug@^2.2.0, debug@^2.3.3, debug@^2.6.0, debug@^2.6.8:
49674938
version "2.6.9"
49684939
resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
@@ -7946,6 +7917,16 @@ lines-and-columns@^1.1.6:
79467917
resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.1.6.tgz#1c00c743b433cd0a4e80758f7b64a57440d9ff00"
79477918
integrity sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=
79487919

7920+
load-json-file@^4.0.0:
7921+
version "4.0.0"
7922+
resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-4.0.0.tgz#2f5f45ab91e33216234fd53adab668eb4ec0993b"
7923+
integrity sha1-L19Fq5HjMhYjT9U62rZo607AmTs=
7924+
dependencies:
7925+
graceful-fs "^4.1.2"
7926+
parse-json "^4.0.0"
7927+
pify "^3.0.0"
7928+
strip-bom "^3.0.0"
7929+
79497930
loader-runner@^2.4.0:
79507931
version "2.4.0"
79517932
resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-2.4.0.tgz#ed47066bfe534d7e84c4c7b9998c2a75607d9357"
@@ -8282,6 +8263,11 @@ memory-fs@^0.5.0:
82828263
errno "^0.1.3"
82838264
readable-stream "^2.0.1"
82848265

8266+
memorystream@^0.3.1:
8267+
version "0.3.1"
8268+
resolved "https://registry.yarnpkg.com/memorystream/-/memorystream-0.3.1.tgz#86d7090b30ce455d63fbae12dda51a47ddcaf9b2"
8269+
integrity sha1-htcJCzDORV1j+64S3aUaR93K+bI=
8270+
82858271
82868272
version "1.0.1"
82878273
resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61"
@@ -8723,6 +8709,21 @@ normalize-url@^3.0.0:
87238709
resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-3.3.0.tgz#b2e1c4dc4f7c6d57743df733a4f5978d18650559"
87248710
integrity sha512-U+JJi7duF1o+u2pynbp2zXDW2/PADgC30f0GsHZtRh+HOcXHnw137TrNlyxxRvWW5fjKd3bcLHPxofWuCjaeZg==
87258711

8712+
npm-run-all@^4.1.5:
8713+
version "4.1.5"
8714+
resolved "https://registry.yarnpkg.com/npm-run-all/-/npm-run-all-4.1.5.tgz#04476202a15ee0e2e214080861bff12a51d98fba"
8715+
integrity sha512-Oo82gJDAVcaMdi3nuoKFavkIHBRVqQ1qvMb+9LHk/cF4P6B2m8aP04hGf7oL6wZ9BuGwX1onlLhpuoofSyoQDQ==
8716+
dependencies:
8717+
ansi-styles "^3.2.1"
8718+
chalk "^2.4.1"
8719+
cross-spawn "^6.0.5"
8720+
memorystream "^0.3.1"
8721+
minimatch "^3.0.4"
8722+
pidtree "^0.3.0"
8723+
read-pkg "^3.0.0"
8724+
shell-quote "^1.6.1"
8725+
string.prototype.padend "^3.0.0"
8726+
87268727
npm-run-path@^2.0.0:
87278728
version "2.0.2"
87288729
resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f"
@@ -9257,6 +9258,11 @@ picomatch@^2.0.4, picomatch@^2.0.5, picomatch@^2.2.1:
92579258
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.2.tgz#21f333e9b6b8eaff02468f5146ea406d345f4dad"
92589259
integrity sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==
92599260

9261+
pidtree@^0.3.0:
9262+
version "0.3.1"
9263+
resolved "https://registry.yarnpkg.com/pidtree/-/pidtree-0.3.1.tgz#ef09ac2cc0533df1f3250ccf2c4d366b0d12114a"
9264+
integrity sha512-qQbW94hLHEqCg7nhby4yRC7G2+jYHY4Rguc2bjw7Uug4GIJuu1tvf2uHaZv5Q8zdt+WKJ6qK1FOI6amaWUo5FA==
9265+
92609266
pify@^2.0.0:
92619267
version "2.3.0"
92629268
resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c"
@@ -10292,14 +10298,14 @@ reactcss@^1.2.0:
1029210298
dependencies:
1029310299
lodash "^4.0.1"
1029410300

10295-
read-pkg@^4.0.1:
10296-
version "4.0.1"
10297-
resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-4.0.1.tgz#963625378f3e1c4d48c85872b5a6ec7d5d093237"
10298-
integrity sha1-ljYlN48+HE1IyFhytabsfV0JMjc=
10301+
read-pkg@^3.0.0:
10302+
version "3.0.0"
10303+
resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-3.0.0.tgz#9cbc686978fee65d16c00e2b19c237fcf6e38389"
10304+
integrity sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=
1029910305
dependencies:
10306+
load-json-file "^4.0.0"
1030010307
normalize-package-data "^2.3.2"
10301-
parse-json "^4.0.0"
10302-
pify "^3.0.0"
10308+
path-type "^3.0.0"
1030310309

1030410310
"readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.3, readable-stream@^2.3.6, readable-stream@~2.3.6:
1030510311
version "2.3.7"
@@ -10708,7 +10714,7 @@ run-queue@^1.0.0, run-queue@^1.0.3:
1070810714
dependencies:
1070910715
aproba "^1.1.1"
1071010716

10711-
rxjs@^6.5.2, rxjs@^6.5.3, rxjs@^6.6.0:
10717+
rxjs@^6.5.3, rxjs@^6.6.0:
1071210718
version "6.6.3"
1071310719
resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.3.tgz#8ca84635c4daa900c0d3967a6ee7ac60271ee552"
1071410720
integrity sha512-trsQc+xYYXZ3urjOiJOuCOa5N3jAZ3eiSpQB5hIT8zGlL2QfnHLJ2r7GMkBGuIausdJN1OneaI6gQlsqNHHmZQ==
@@ -10977,7 +10983,7 @@ shebang-regex@^3.0.0:
1097710983
resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172"
1097810984
integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==
1097910985

10980-
10986+
[email protected], shell-quote@^1.6.1:
1098110987
version "1.7.2"
1098210988
resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.7.2.tgz#67a7d02c76c9da24f99d20808fcaded0e0e04be2"
1098310989
integrity sha512-mRz/m/JVscCrkMyPqHc/bczi3OQHkLTqXHEFu0zDhK/qfv3UcOA4SVmRCLmos4bhjr9ekVQubj/R7waKapmiQg==
@@ -11136,11 +11142,6 @@ space-separated-tokens@^1.0.0:
1113611142
resolved "https://registry.yarnpkg.com/space-separated-tokens/-/space-separated-tokens-1.1.5.tgz#85f32c3d10d9682007e917414ddc5c26d1aa6899"
1113711143
integrity sha512-q/JSVd1Lptzhf5bkYm4ob4iWPjx0KiRe3sRFBNrVqbJkFaBm5vbbowy1mymoPNLRa52+oadOhJ+K49wsSeSjTA==
1113811144

11139-
spawn-command@^0.0.2-1:
11140-
version "0.0.2-1"
11141-
resolved "https://registry.yarnpkg.com/spawn-command/-/spawn-command-0.0.2-1.tgz#62f5e9466981c1b796dc5929937e11c9c6921bd0"
11142-
integrity sha1-YvXpRmmBwbeW3Fkpk34RycaSG9A=
11143-
1114411145
spdx-correct@^3.0.0:
1114511146
version "3.1.1"
1114611147
resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.1.tgz#dece81ac9c1e6713e5f7d1b6f17d468fa53d89a9"
@@ -11438,6 +11439,11 @@ strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0:
1143811439
dependencies:
1143911440
ansi-regex "^4.1.0"
1144011441

11442+
strip-bom@^3.0.0:
11443+
version "3.0.0"
11444+
resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3"
11445+
integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=
11446+
1144111447
strip-eof@^1.0.0:
1144211448
version "1.0.0"
1144311449
resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf"
@@ -11858,11 +11864,6 @@ tough-cookie@~2.5.0:
1185811864
psl "^1.1.28"
1185911865
punycode "^2.1.1"
1186011866

11861-
tree-kill@^1.2.2:
11862-
version "1.2.2"
11863-
resolved "https://registry.yarnpkg.com/tree-kill/-/tree-kill-1.2.2.tgz#4ca09a9092c88b73a7cdc5e8a01b507b0790a0cc"
11864-
integrity sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==
11865-
1186611867
trim-trailing-lines@^1.0.0:
1186711868
version "1.1.4"
1186811869
resolved "https://registry.yarnpkg.com/trim-trailing-lines/-/trim-trailing-lines-1.1.4.tgz#bd4abbec7cc880462f10b2c8b5ce1d8d1ec7c2c0"
@@ -12754,7 +12755,7 @@ yargs-parser@^13.1.2:
1275412755
camelcase "^5.0.0"
1275512756
decamelize "^1.2.0"
1275612757

12757-
yargs@^13.3.0, yargs@^13.3.2:
12758+
yargs@^13.3.2:
1275812759
version "13.3.2"
1275912760
resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.3.2.tgz#ad7ffefec1aa59565ac915f82dccb38a9c31a2dd"
1276012761
integrity sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==

0 commit comments

Comments
 (0)