Skip to content

Commit

Permalink
Init Create React Three Fiber App with Next
Browse files Browse the repository at this point in the history
  • Loading branch information
filahf committed Feb 11, 2022
0 parents commit 83485b5
Show file tree
Hide file tree
Showing 49 changed files with 6,985 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"presets": [
[
"next/babel",
{
"preset-env": {},
"transform-runtime": {},
"styled-jsx": {},
"class-properties": {}
}
]
],
"plugins": [
"glsl",
"styled-components"
]
}
11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 2

[{*.json,.*.yml}]
indent_style = space
indent_size = 2
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.next
dist
node_modules/
6 changes: 6 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": [
"next",
"prettier"
]
}
42 changes: 42 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# dependencies
/node_modules

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env.local
.env.development.local
.env.test.local
.env.production.local

# vercel
.vercel

# next-pwa
/public/workbox-*.js
/public/sw.js

# prefer yarn than npm
package-lock.json

report.*.json

# .vscode Debugging
.vscode/*-debug-profile
7 changes: 7 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
build/*
dist/*
public/*
.next/*
node_modules/*
package.json
*.log
18 changes: 18 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"arrowParens": "always",
"bracketSpacing": true,
"embeddedLanguageFormatting": "auto",
"htmlWhitespaceSensitivity": "css",
"insertPragma": false,
"jsxSingleQuote": true,
"printWidth": 80,
"proseWrap": "preserve",
"quoteProps": "as-needed",
"requirePragma": false,
"semi": false,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "es5",
"useTabs": false,
"vueIndentScriptAndStyle": false
}
11 changes: 11 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"bradlc.vscode-tailwindcss",
"dbaeumer.vscode-eslint",
"editorconfig.editorconfig",
"esbenp.prettier-vscode",
"slevesque.shader"
]
}
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"editor.codeActionsOnSave": {
"source.fixAll.eslint": false
}
}
20 changes: 20 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Copyright (c) 2012-2021 Scott Chacon and others

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# next-audio-game

This project was bootstrapped with [`create-r3f-app`](https://github.com/RenaudROHLINGER/create-r3f-app)
5 changes: 5 additions & 0 deletions next-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
83 changes: 83 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
const plugins = require('next-compose-plugins')
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
})

const withOffline = require('next-offline')

const nextConfig = {
webpack(config, { webpack, dev, isServer }) {

// audio support
config.module.rules.push({
test: /\.(ogg|mp3|wav|mpe?g)$/i,
exclude: config.exclude,
use: [
{
loader: require.resolve('url-loader'),
options: {
limit: config.inlineImageLimit,
fallback: require.resolve('file-loader'),
publicPath: `${config.assetPrefix}/_next/static/images/`,
outputPath: `${isServer ? '../' : ''}static/images/`,
name: '[name]-[hash].[ext]',
esModule: config.esModule || false,
},
},
],
})

config.module.rules.push({
test: /\.(glsl|vs|fs|vert|frag)$/,
exclude: /node_modules/,
use: ['raw-loader', 'glslify-loader'],
})

return config
},
}

// manage i18n
if (process.env.EXPORT !== 'true') {
nextConfig.i18n = {
locales: ['en-US'],
defaultLocale: 'en-US',
}
}

module.exports = plugins(
[
[
withOffline,
{
workboxOpts: {
swDest: process.env.NEXT_EXPORT
? 'service-worker.js'
: 'static/service-worker.js',
runtimeCaching: [
{
urlPattern: /^https?.*/,
handler: 'NetworkFirst',
options: {
cacheName: 'offlineCache',
expiration: {
maxEntries: 200,
},
},
},
],
},
async rewrites() {
return [
{
source: '/service-worker.js',
destination: '/_next/static/service-worker.js',
},
]
},
},
],
withBundleAnalyzer,
],
nextConfig
)
59 changes: 59 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"name": "react-three-next",
"version": "2.0.0",
"authors": [
"Renaud ROHLINGER <https://twitter.com/onirenaud>"
],
"license": "MIT",
"private": true,
"engines": {
"node": ">=14"
},
"dependencies": {
"@babel/plugin-transform-runtime": "^7.17.0",
"@react-three/drei": "^8.8.1",
"@react-three/fiber": "^7.0.26",
"babel-plugin-glsl": "^1.0.0",
"babel-plugin-styled-components": "^2.0.2",
"glsl-random": "^0.0.5",
"next": "^12.0.10",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-is": "^17.0.2",
"short-uuid": "^4.2.0",
"styled-components": "^5.3.3",
"three": "^0.137.5",
"three-stdlib": "^2.8.5"
},
"devDependencies": {
"@next/bundle-analyzer": "^12.0.10",
"@types/node": "^17.0.17",
"@types/react": "^17.0.39",
"@types/styled-components": "^5.1.22",
"autoprefixer": "^10.4.2",
"eslint": "^8.8.0",
"eslint-config-next": "^12.0.10",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-tailwind": "^0.2.1",
"file-loader": "^6.2.0",
"glslify": "^7.1.1",
"glslify-loader": "^2.0.0",
"next-compose-plugins": "^2.2.1",
"next-offline": "^5.0.5",
"postcss": "^8.4.6",
"prettier": "^2.5.1",
"raw-loader": "^4.0.2",
"typescript": "^4.5.5",
"url-loader": "^4.1.1"
},
"scripts": {
"lint": "yarn prettier && yarn eslint",
"eslint": "next lint --fix --dir src",
"prettier": "prettier --list-different \"./src/**/*.{ts,tsx,md}\"",
"dev": "next dev",
"build": "next build",
"export": "EXPORT=true next build && EXPORT=true next export",
"analyze": "ANALYZE=true next build",
"start": "next start"
}
}
Binary file added public/icons/android-icon-192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/icons/android-icon-512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/icons/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/icons/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/icons/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/icons/favicon.ico
Binary file not shown.
18 changes: 18 additions & 0 deletions public/icons/safari-pinned-tab.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/icons/share.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions public/img/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/img/scores/lighthouse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npm install -g lighthouse-badges && lighthouse-badges --urls http://r3f-next-starter.vercel.app/ -o public/img/scores
1 change: 1 addition & 0 deletions public/img/scores/lighthouse.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions public/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "R3F Next Starter",
"short_name": "R3F Next Starter",
"icons": [
{
"src": "/icons/favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon",
"purpose": "any maskable"
},
{
"src": "/icons/android-icon-192x192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "any maskable"
},
{
"src": "/icons/android-icon-512x512.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "any maskable"
}
],
"start_url": "/",
"scope": "/",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
Empty file added public/robots.txt
Empty file.
8 changes: 8 additions & 0 deletions sandbox.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"infiniteLoopProtection": true,
"hardReloadOnChange": false,
"view": "browser",
"container": {
"node": "12"
}
}
Loading

0 comments on commit 83485b5

Please sign in to comment.