Skip to content

Commit

Permalink
update deployments again (google#4407)
Browse files Browse the repository at this point in the history
  • Loading branch information
elalish authored and JL-Vidinoti committed Apr 22, 2024
1 parent 094b4bb commit ba39790
Show file tree
Hide file tree
Showing 10 changed files with 57 additions and 48 deletions.
6 changes: 0 additions & 6 deletions lerna.json

This file was deleted.

52 changes: 34 additions & 18 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"clean": "npm run clean --workspaces",
"build": "npm run build --workspaces",
"serve": "./node_modules/.bin/http-server -c-1",
"update:package-lock": "npm install --save && npm run clean --workspaces && node ./scripts/postinstall.js"
"update:package-lock": "npm exec -y --workspaces -- npx rimraf package_lock.json node_modules && npx rimraf package_lock.json node_modules && npm install --save && npm run clean --workspaces && node ./scripts/postinstall.js"
},
"husky": {
"hooks": {
Expand Down
5 changes: 1 addition & 4 deletions packages/modelviewer.dev/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,7 @@
"@types/prismjs": "^1.16.6",
"focus-visible": "^5.2.0",
"lit": "^2.7.2",
"prismjs": "^1.24.1",
"simple-dropzone": "^0.8.1",
"js-beautify": "^1.14.0",
"web-animations-js": "^2.3.2"
"prismjs": "^1.24.1"
},
"devDependencies": {
"rollup": "^2.77.2",
Expand Down
22 changes: 12 additions & 10 deletions packages/modelviewer.dev/scripts/ci-before-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ DEPLOYABLE_STATIC_FILES=( \
CNAME \
LICENSE \
README.md \
node_modules/@google/model-viewer/dist \
node_modules/@google/model-viewer-effects/dist \
node_modules/js-beautify \
node_modules/web-animations-js \
shared-assets/models/*.* \
shared-assets/models/twitter \
shared-assets/models/glTF-Sample-Models/2.0/2CylinderEngine \
Expand Down Expand Up @@ -110,26 +106,32 @@ mkdir -p $DEPLOY_ROOT/node_modules
mkdir -p $DEPLOY_ROOT/node_modules/@google
mkdir -p $DEPLOY_ROOT/node_modules/@google/model-viewer
mkdir -p $DEPLOY_ROOT/node_modules/@google/model-viewer/dist
mkdir -p $DEPLOY_ROOT/node_modules/@google/model-viewer-effects
mkdir -p $DEPLOY_ROOT/node_modules/@google/model-viewer-effects/dist
mkdir -p $DEPLOY_ROOT/node_modules/js-beautify
mkdir -p $DEPLOY_ROOT/node_modules/web-animations-js

mv ../render-fidelity-tools/test/results $DEPLOY_ROOT/fidelity/results
cp ../render-fidelity-tools/test/results-viewer.html $DEPLOY_ROOT/fidelity/index.html
cp ../render-fidelity-tools/dist/* $DEPLOY_ROOT/dist/
cp ../space-opera/editor/index.html $DEPLOY_ROOT/editor/
cp ../space-opera/editor/view/index.html $DEPLOY_ROOT/editor/view/
cp ../space-opera/dist/space-opera.js $DEPLOY_ROOT/dist/
cp ../model-viewer/dist/* $DEPLOY_ROOT/dist/
cp ../model-viewer-effects/dist/* $DEPLOY_ROOT/dist/
cp ../model-viewer/dist/* $DEPLOY_ROOT/node_modules/@google/model-viewer/dist/
cp ../model-viewer-effects/dist/* $DEPLOY_ROOT/node_modules/@google/model-viewer/dist/
cp ../model-viewer-effects/dist/* $DEPLOY_ROOT/node_modules/@google/model-viewer-effects/dist/
cp ../../node_modules/js-beautify/* $DEPLOY_ROOT/node_modules/js-beautify
cp ../../node_modules/web-animations-js/* $DEPLOY_ROOT/node_modules/web-animations-js

FILES_TO_PATCH_WITH_MINIFIED_BUNDLE=($(find $DEPLOY_ROOT \( -type d -name node_modules -prune \) -o -type f | grep \.html))

for file_to_patch in "${FILES_TO_PATCH_WITH_MINIFIED_BUNDLE[@]}"; do
sed -i.bak 's ../../node_modules/@google/model-viewer/dist/model-viewer.js dist/model-viewer.min.js g' $file_to_patch
sed -i.bak 's model-viewer.js model-viewer.min.js g' $file_to_patch
rm $file_to_patch.bak
sed -i.bak 's ../../node_modules/@google/model-viewer/dist/model-viewer-module.js dist/model-viewer-module.min.js g' $file_to_patch
sed -i.bak 's model-viewer-module.js model-viewer-module.min.js g' $file_to_patch
rm $file_to_patch.bak
sed -i.bak 's ../../node_modules/@google/model-viewer-effects/dist/model-viewer-effects.js dist/model-viewer-effects.min.js g' $file_to_patch
sed -i.bak 's model-viewer-effects.js model-viewer-effects.min.js g' $file_to_patch
rm $file_to_patch.bak
sed -i.bak 's ../../node_modules/ node_modules/ g' $file_to_patch
rm $file_to_patch.bak
done

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
</filament-viewer>
</renderer-harness>

<script src="../../../node_modules/filament/filament.js"></script>
<script src="../../../../../node_modules/filament/filament.js"></script>
<script type="module" src="../../../dist/renderer-harness.js"></script>
<script type="module" src="../../../dist/filament-viewer.js"></script>
<script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

<script type="module" src="../../../dist/renderer-harness.js"></script>
<script src="https://www.gstatic.com/draco/v1/decoders/draco_decoder_gltf.js"></script>
<script src="../../../node_modules/@khronosgroup/gltf-viewer/dist/libs/libktx.js"></script>
<script src="../../../../../node_modules/@khronosgroup/gltf-viewer/dist/libs/libktx.js"></script>
<script type="module" src="../../../dist/gltf-sample-viewer.js"></script>
<script>
harness.addEventListener('scenario-change', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

<script type="module" src="../../../dist/renderer-harness.js"></script>
<script src="https://www.gstatic.com/draco/v1/decoders/draco_decoder_gltf.js"></script>
<script src="../../../node_modules/@khronosgroup/gltf-viewer/dist/libs/libktx.js"></script>
<script src="../../../../../node_modules/@khronosgroup/gltf-viewer/dist/libs/libktx.js"></script>
<script type="module" src="../../../dist/three-gpu-pathtracer-viewer.js"></script>
<script>
harness.addEventListener('scenario-change', () => {
Expand Down
6 changes: 3 additions & 3 deletions packages/space-opera/editor/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
<link rel="shortcut icon" type="image/png" href="../../shared-assets/icons/favicon.png"/>
<script defer src="https://web3dsurvey.com/collector.js"></script>
<!-- Web animations for paper-dropdown -->
<script src="../node_modules/web-animations-js/web-animations-next-lite.min.js"></script>
<script src="../node_modules/js-beautify/js/lib/beautify-html.js"></script>
<script src="../node_modules/js-beautify/js/lib/beautify-css.js"></script>
<script src="../../../node_modules/web-animations-js/web-animations-next-lite.min.js"></script>
<script src="../../../node_modules/js-beautify/js/lib/beautify-html.js"></script>
<script src="../../../node_modules/js-beautify/js/lib/beautify-css.js"></script>
<script>
// Necessary hack for Redux. See: https://github.com/reduxjs/redux/pull/2910
window.process = {
Expand Down
6 changes: 3 additions & 3 deletions packages/space-opera/editor/view/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
<link href="https://fonts.googleapis.com/css?family=Material+Icons&display=block" rel="stylesheet">
<link rel="shortcut icon" type="image/png" href="../../../shared-assets/icons/favicon.png"/>
<!-- Web animations for paper-dropdown -->
<script src="../../node_modules/web-animations-js/web-animations-next-lite.min.js"></script>
<script src="../../node_modules/js-beautify/js/lib/beautify-html.js"></script>
<script src="../../node_modules/js-beautify/js/lib/beautify-css.js"></script>
<script src="../../../../node_modules/web-animations-js/web-animations-next-lite.min.js"></script>
<script src="../../../../node_modules/js-beautify/js/lib/beautify-html.js"></script>
<script src="../../../../node_modules/js-beautify/js/lib/beautify-css.js"></script>
<script>
// Necessary hack for Redux. See: https://github.com/reduxjs/redux/pull/2910
window.process = {
Expand Down

0 comments on commit ba39790

Please sign in to comment.