Skip to content

Commit

Permalink
Bring up to date
Browse files Browse the repository at this point in the history
  • Loading branch information
momander committed Nov 7, 2022
1 parent 1b7a54c commit 0c46851
Show file tree
Hide file tree
Showing 221 changed files with 25,080 additions and 10,547 deletions.
41 changes: 14 additions & 27 deletions build/base.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,17 @@ const path = require('path');
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const CopyWebpackPlugin = require('copy-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const AsyncCssPlugin = require("async-css-plugin");
const {GenerateSW} = require('workbox-webpack-plugin');
const VueLoaderPlugin = require('vue-loader/lib/plugin')

module.exports = {
devtool: 'source-map',
target: ['web', 'es5'],
entry: {
polyfill: '@babel/polyfill',
index: './static/index.js',
view: './static/view.js',
faq: './static/faq.js',
view_account: './static/view-account.js',
admin: './static/admin/index.js',
shared_wheel: './static/index.js',
},
output: {
filename: '[name]-[contenthash].js',
Expand Down Expand Up @@ -86,7 +85,7 @@ module.exports = {
}]
},
{
test: /\.(png|jpg|gif|ico)$/,
test: /\.(png|jpg|jpeg|gif|ico)$/,
use: [
{
loader: 'file-loader',
Expand Down Expand Up @@ -124,36 +123,24 @@ module.exports = {
filename: './index.html',
chunks: ['index', 'vendor']
}),
new AsyncCssPlugin(),
new HtmlWebpackPlugin({
template: './static/view.html',
filename: './view.html',
chunks: ['view', 'vendor']
}),
new HtmlWebpackPlugin({
template: './static/faq.html',
filename: './faq.html',
chunks: ['faq', 'vendor']
}),
new HtmlWebpackPlugin({
template: './static/view-account.html',
filename: './view-account.html',
chunks: ['view_account', 'vendor']
}),
new HtmlWebpackPlugin({
template: './static/admin/index.html',
filename: './admin.html',
chunks: ['admin', 'vendor']
template: './static/shared_wheel.html',
filename: './shared-wheel.html',
chunks: ['index', 'vendor']
}),
new CopyWebpackPlugin({patterns: [
{ from: './static/third_party', to: 'third_party' },
{ from: './static/manifest.json', to: '.' },
{ from: './static/images/favicon.ico', to: '.' },
{ from: './static/404.html', to: '.' },
{ from: './static/images/favicon.ico', to: '.' }
]}),
new GenerateSW({
exclude: [
/\.map$/, /\.png$/, /\.mp3$/, /\.xml$/, /\.ico$/,
/\.map$/, /\.png$/, /\.jpg$/, /\.mp3$/, /\.xml$/, /\.ico$/,
/faq/, /privacy/, /translate/, /404/, /vendors~/, /^locale/,
/admin/, /view/, /index/, /polyfill/, /precache/, /vendor/
/admin/, /index/, /classroom/, /tutorials/, /polyfill/, /precache/,
/vendor/, /view/, /e628cc/, /shared/, /carousel/, /notFound/, /export/,
/firebase/, /howler/, /translations/, /vibrant/, /workbox/
],
skipWaiting: true,
clientsClaim: true,
Expand Down
2 changes: 1 addition & 1 deletion build/test.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const {merge} = require('webpack-merge');
const baseConfig = require('./base.config.js');

module.exports = merge(baseConfig, {
mode: 'production',
mode: 'development',
devtool: 'source-map',
plugins: [
new dotenv({
Expand Down
2 changes: 2 additions & 0 deletions build_and_serve_local.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
call .\build_dev.bat
firebase serve --project=test
4 changes: 4 additions & 0 deletions build_and_serve_local.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

./build_dev.sh
firebase serve --project=test
2 changes: 2 additions & 0 deletions build_dev.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
rmdir /s /q dist
call npx webpack --config build/dev.config.js
6 changes: 5 additions & 1 deletion build_dev.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

rm -r dist/*
npx webpack --config build/dev.config.js --display=minimal
npx webpack --config build/dev.config.js
5 changes: 5 additions & 0 deletions build_prod.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
rmdir /s /q dist
call npx webpack --config build/prod.config.js
ECHO
ECHO 'npm audit:'
call npm audit --parseable
12 changes: 5 additions & 7 deletions build_prod.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

rm -r dist/*
npx webpack --config build/prod.config.js --display=minimal
ls -lh dist/index*.js
ls -lh dist/vendor-*.js
ls -lh dist/css/vendor*.css
echo
echo 'npm audit:'
npm audit --parseable | awk -F $'\t' '{print $2,$3}'
npx webpack --config build/prod.config.js
2 changes: 2 additions & 0 deletions build_test.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
rmdir /s /q dist
call npx webpack --config build/test.config.js
9 changes: 5 additions & 4 deletions build_test.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

rm -r dist/*
npx webpack --config build/test.config.js --display=minimal
ls -lh dist/index*.js
ls -lh dist/vendor-*.js
ls -lh dist/css/vendor*.css
npx webpack --config build/test.config.js
6 changes: 5 additions & 1 deletion cloc.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
npx cloc --vcs=git --not-match-f=package

npx cloc --vcs=git --exclude-ext=json,xml --exclude-dir=old_bundles
4 changes: 4 additions & 0 deletions debug-tests.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

npx mocha debug --require @babel/register
1 change: 1 addition & 0 deletions deploy_prod.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
firebase deploy --project=prod
4 changes: 4 additions & 0 deletions deploy_prod.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

firebase deploy --project=prod
1 change: 1 addition & 0 deletions deploy_test.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
firebase deploy --project=test
4 changes: 4 additions & 0 deletions deploy_test.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

firebase deploy --project=test
1 change: 1 addition & 0 deletions deploy_test_firestore.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
firebase deploy --only=firestore --project=test
18 changes: 4 additions & 14 deletions backup_firestore.sh → deploy_test_firestore.sh
Original file line number Diff line number Diff line change
@@ -1,25 +1,15 @@
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

PROJECT_ID=[enter your GCP Project id here]

gcloud firestore export gs://$PROJECT_ID \
--project=PROJECT_ID

# Export specific collection.
# gcloud firestore export gs://$PROJECT_ID \
# --project=$PROJECT_ID \
# --collection-ids=shared-wheels

# Import into test environment (skip last line to import all collections).
# gcloud firestore import gs://$PROJECT_ID-backup/2020-03-22T17:47:21_54737 \
# --project=$PROJECT_ID-test \
# --collection-ids=shared-wheels
firebase deploy --only=firestore --project=test
1 change: 1 addition & 0 deletions deploy_test_hosting.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
firebase deploy --only=hosting --project=test
15 changes: 15 additions & 0 deletions deploy_test_hosting.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

firebase deploy --only=hosting --project=test
40 changes: 0 additions & 40 deletions export_firestore_to_bigquery.sh

This file was deleted.

40 changes: 5 additions & 35 deletions firebase.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,46 +7,16 @@
},
"hosting": {
"public": "dist",
"redirects": [
],
"rewrites": [
{
"source": "/[A-Za-z0-9][A-Za-z0-9][A-Za-z0-9]-[A-Za-z0-9][A-Za-z0-9][A-Za-z0-9]",
"destination": "/index.html"
},
{
"source": "/[a-z][a-z]/[A-Za-z0-9][A-Za-z0-9][A-Za-z0-9]-[A-Za-z0-9][A-Za-z0-9][A-Za-z0-9]",
"destination": "/index.html"
},
{
"source": "/[a-z][a-z][a-z]/[A-Za-z0-9][A-Za-z0-9][A-Za-z0-9]-[A-Za-z0-9][A-Za-z0-9][A-Za-z0-9]",
"destination": "/index.html"
},
{
"source": "/[a-z][a-z]-[A-Z][A-Z]/[A-Za-z0-9][A-Za-z0-9][A-Za-z0-9]-[A-Za-z0-9][A-Za-z0-9][A-Za-z0-9]",
"destination": "/index.html"
"source": "**/[A-Za-z0-9][A-Za-z0-9][A-Za-z0-9]-[A-Za-z0-9][A-Za-z0-9][A-Za-z0-9]",
"destination": "/shared-wheel.html"
},
{
"source": "/[a-z][a-z]",
"source": "**",
"destination": "/index.html"
},
{
"source": "/[a-z][a-z][a-z]",
"destination": "/index.html"
},
{
"source": "/[a-z][a-z]-[A-Z][A-Z]",
"destination": "/index.html"
},
{
"source": "/view/**",
"destination": "/view.html"
},
{
"source": "/faq",
"destination": "/faq.html"
},
{
"source": "/faq/*",
"destination": "/faq.html"
}
],
"ignore": [
Expand Down
Loading

0 comments on commit 0c46851

Please sign in to comment.