diff --git a/.github/workflows/build.checks.yml b/.github/workflows/build.checks.yml new file mode 100644 index 0000000..60a70ff --- /dev/null +++ b/.github/workflows/build.checks.yml @@ -0,0 +1,35 @@ +name: Ensure build command works + +on: + # Runs on pull requests targeting the default branch + # but not when the only changes are docs and README.md files + pull_request: + branches: ["main"] + paths-ignore: + - '**.md' + - 'docs/**' + +jobs: + build-webpage: + runs-on: ubuntu-latest + permissions: + contents: read + + name: Build static webpage + steps: + - name: Checkout + uses: actions/checkout@v4 + + # Build the static assets + - name: Build + run: npm ci --legacy-peer-deps && npm run build + working-directory: ./ + + # Upload ./webpage as artifact + - name: Upload Build Artifact + uses: actions/upload-artifact@v4 + with: + path: webpage/** # the only required field + name: built-webpage + if-no-files-found: error + compression-level: 0 # skip compression to save time diff --git a/.gitignore b/.gitignore index b393645..21f56de 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ node_modules # Bundle public/bundle.js +public/bundle.js.* # Compiled CSS file public/resources/styles/style.css diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 5a77852..0000000 --- a/.travis.yml +++ /dev/null @@ -1,7 +0,0 @@ -language: node_js -node_js: - - "6" - - "6.1" - - "5.11" -notifications: - email: false \ No newline at end of file diff --git a/LICENSE b/LICENSE index c4a4564..c2b87b5 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2016 Ollie Bannister +Copyright (c) 2016-2026 Ollie Bannister, Troy Lamerton, Sean, Vai, Miles Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/client/.babelrc b/client/.babelrc deleted file mode 100644 index 4687bc4..0000000 --- a/client/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["es2015", "react", "stage-0"] -} diff --git a/client/components/App.js b/client/components/App.jsx similarity index 100% rename from client/components/App.js rename to client/components/App.jsx diff --git a/client/components/Backgroundtrack.js b/client/components/Backgroundtrack.jsx similarity index 100% rename from client/components/Backgroundtrack.js rename to client/components/Backgroundtrack.jsx diff --git a/client/components/Board.js b/client/components/Board.jsx similarity index 100% rename from client/components/Board.js rename to client/components/Board.jsx diff --git a/client/components/CommandPane.js b/client/components/CommandPane.jsx similarity index 100% rename from client/components/CommandPane.js rename to client/components/CommandPane.jsx diff --git a/client/components/CommandQueue.js b/client/components/CommandQueue.jsx similarity index 100% rename from client/components/CommandQueue.js rename to client/components/CommandQueue.jsx diff --git a/client/components/Nav.js b/client/components/Nav.jsx similarity index 100% rename from client/components/Nav.js rename to client/components/Nav.jsx diff --git a/client/components/Robot.js b/client/components/Robot.jsx similarity index 100% rename from client/components/Robot.js rename to client/components/Robot.jsx diff --git a/client/components/RunButtons.js b/client/components/RunButtons.jsx similarity index 100% rename from client/components/RunButtons.js rename to client/components/RunButtons.jsx diff --git a/client/components/Win.js b/client/components/Win.jsx similarity index 100% rename from client/components/Win.js rename to client/components/Win.jsx diff --git a/client/index.js b/client/index.jsx similarity index 100% rename from client/index.js rename to client/index.jsx diff --git a/client/webpack.config.js b/client/webpack.config.js deleted file mode 100644 index 9909f77..0000000 --- a/client/webpack.config.js +++ /dev/null @@ -1,46 +0,0 @@ -const webpack = require('webpack') -const path = require('path') - -const NODE_ENV = process.env.NODE_ENV || 'production'; - -const plugins = [ - new webpack.DefinePlugin({ - 'process.env.NODE_ENV': JSON.stringify(NODE_ENV) - }) -]; - -if (NODE_ENV !== 'development') { - const minifyPlugin = new webpack.optimize.UglifyJsPlugin({ - compress: { - warnings: false - } - }); - plugins.push(minifyPlugin); -} - -module.exports = { - entry: [ - './index.js' // Your appʼs entry point - ], - output: { - path: path.join(__dirname, '../public'), - filename: 'bundle.js', - publicPath: '/' - }, - resolve: { - extensions: ['', '.js'] - }, - module: { - loaders: [ - { - test: /\.js$/, - loaders: ['babel'], - include: __dirname - } - ] - }, - devServer: { - contentBase: '../public' - }, - plugins, -} diff --git a/docs/RUNBOOK.md b/docs/RUNBOOK.md index a6ba2d0..96dab53 100644 --- a/docs/RUNBOOK.md +++ b/docs/RUNBOOK.md @@ -19,8 +19,14 @@ npm install --legacy-peer-deps `npm run watch:styles` 1. Rebuild code and serve all static files: - `npm run dev-wp` -1. Open [localhost:8080](http://localhost:8080) in your browser + `npm start` +1. Open [localhost:5173](http://localhost:5173) in your browser + +#### Bundler + +Webpack v5 - slow and old, but it works +Vite - good, using it now +Parcel - fails to load images from css urls, fails to build JS at all ### Quality checks diff --git a/public/index.html b/index.html similarity index 94% rename from public/index.html rename to index.html index e51dfa1..3c42ec3 100644 --- a/public/index.html +++ b/index.html @@ -17,6 +17,6 @@
- +