Skip to content

Commit

Permalink
set up files and folder structure; InjectManifest throwing error - no…
Browse files Browse the repository at this point in the history
…t sure what's going on
  • Loading branch information
MaxFrank13 committed May 3, 2022
1 parent 5a629c2 commit ca75dbb
Show file tree
Hide file tree
Showing 22 changed files with 8,777 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ lerna-debug.log*
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# DS Store
**/.DS_Store

# Runtime data
pids
*.pid
Expand Down
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
production=false
14 changes: 14 additions & 0 deletions client/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"env": {
"browser": true
},
"rules": {
// Override our default settings just for this directory
"eqeqeq": "warn",
"strict": "off",
"import/no-extraneous-dependencies": "off",
"import/prefer-default-export": "off",
"no-underscore-dangle": "off",
"no-restricted-globals": "off"
}
}
69 changes: 69 additions & 0 deletions client/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# next.js build output
.next

# lock files
package-lock.json
yarn.lock

.DS_Store
.vscode
*.xslx
Binary file added client/favicon.ico
Binary file not shown.
40 changes: 40 additions & 0 deletions client/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>ETH</title>

<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.52.2/codemirror.min.css">
</link>
<script type="text/javascript"
src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.52.2/codemirror.min.js">
</script>
<script type="text/javascript"
src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.52.2/mode/javascript/javascript.min.js">
</script>
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.52.2/theme/monokai.min.css">
</link>
</head>
<body>
<nav id="navbar">
<div class="nav-btn">
<a class="btn btn-sm btn-dark" id="buttonInstall" role="button">Install!</a>
</div>
<h1> Enter Text Here</h1>

<div class="navbar-brand"
><img src="./assets/icons/icon_96x96.png"
/></div>
</nav>

<main id="main">
<div class="loading-container">
<div class="loading-spinner"></div>
</div>
</main>

</body>
</html>
30 changes: 30 additions & 0 deletions client/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"name": "JATE",
"scripts": {
"dev": "webpack-dev-server",
"build": "webpack --mode production",
"start": "webpack --watch"
},
"author": "2U",
"license": "UNLICENSED",
"devDependencies": {
"@babel/core": "^7.15.0",
"@babel/plugin-transform-runtime": "^7.15.0",
"@babel/preset-env": "^7.15.0",
"@babel/runtime": "^7.15.3",
"babel-loader": "^8.2.2",
"css-loader": "^6.2.0",
"html-webpack-plugin": "^5.3.2",
"http-server": "^0.11.1",
"style-loader": "^3.2.1",
"webpack": "^5.51.1",
"webpack-cli": "^4.8.0",
"webpack-dev-server": "^4.0.0",
"webpack-pwa-manifest": "^4.3.0",
"workbox-webpack-plugin": "^6.2.4"
},
"dependencies": {
"code-mirror-themes": "^1.0.0",
"idb": "^6.1.2"
}
}
43 changes: 43 additions & 0 deletions client/src-sw.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
const { offlineFallback, warmStrategyCache } = require('workbox-recipes');
const { CacheFirst } = require('workbox-strategies');
const { StaleWhileRevalidate } = require('workbox-strategies');
const { registerRoute } = require('workbox-routing');
const { CacheableResponsePlugin } = require('workbox-cacheable-response');
const { ExpirationPlugin } = require('workbox-expiration');
const { precacheAndRoute } = require('workbox-precaching/precacheAndRoute');

precacheAndRoute(self.__WB_MANIFEST);

const pageCache = new CacheFirst({
cacheName: 'page-cache',
plugins: [
new CacheableResponsePlugin({
statuses: [0, 200],
}),
new ExpirationPlugin({
maxAgeSeconds: 30 * 24 * 60 * 60,
}),
],
});

warmStrategyCache({
urls: ['/index.html', '/'],
strategy: pageCache,
});

registerRoute(({ request }) => request.mode === 'navigate', pageCache);

// TODO: Implement asset caching
// Here we define the callback function that will filter the requests we want to cache (in this case, JS and CSS files)
registerRoute(({request}) => ['style', 'script', 'worker'].includes(request.destination),
new StaleWhileRevalidate({
// Name of the cache storage.
cacheName: 'asset-cache',
plugins: [
// This plugin will cache responses with these headers to a maximum-age of 30 days
new CacheableResponsePlugin({
statuses: [0, 200],
}),
],
})
);
Loading

0 comments on commit ca75dbb

Please sign in to comment.