├── .gitignore ├── .prettierrc ├── public ├── favicon.ico ├── robots.txt ├── preload.js ├── index.html └── electron.js ├── babel.config.json ├── src ├── index.css ├── index.jsx └── App.jsx ├── jest.config.js ├── postcss.config.js ├── snowpack.config.json ├── jest.setup.js ├── tailwind.config.js ├── README.md ├── package.json └── LICENSE /.gitignore: -------------------------------------------------------------------------------- 1 | .build 2 | build 3 | web_modules 4 | node_modules 5 | .DS_Store 6 | .env -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "trailingComma": "all" 4 | } 5 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oslabs-beta/rigflowv2/HEAD/public/favicon.ico -------------------------------------------------------------------------------- /babel.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@snowpack/app-scripts-react/babel.config.json" 3 | } 4 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /src/index.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | 3 | @tailwind components; 4 | 5 | @tailwind utilities; 6 | -------------------------------------------------------------------------------- /jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | ...require("@snowpack/app-scripts-react/jest.config.js")(), 3 | }; 4 | -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: [require('tailwindcss'), require('autoprefixer')], 3 | }; 4 | -------------------------------------------------------------------------------- /snowpack.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@snowpack/app-scripts-react", 3 | "scripts": { "build:css": "postcss" }, 4 | "plugins": [] 5 | } 6 | -------------------------------------------------------------------------------- /jest.setup.js: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import "@testing-library/jest-dom/extend-expect"; 6 | -------------------------------------------------------------------------------- /tailwind.config.js: -------------------------------------------------------------------------------- 1 | const defaultTheme = require('tailwindcss/defaultTheme'); 2 | 3 | module.exports = { 4 | purge: ['./src/**/*.jsx', './src/**/*.js'], 5 | theme: { 6 | extend: { 7 | fontFamily: { 8 | sans: ['Inter var', ...defaultTheme.fontFamily.sans], 9 | }, 10 | }, 11 | }, 12 | variants: {}, 13 | plugins: [], 14 | }; 15 | -------------------------------------------------------------------------------- /src/index.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import App from './App'; 4 | import './index.css'; 5 | 6 | ReactDOM.render( 7 | 8 | 9 | , 10 | document.getElementById('root'), 11 | ); 12 | 13 | // Hot Module Replacement (HMR) - Remove this snippet to remove HMR. 14 | // Learn more: https://www.snowpack.dev/#hot-module-replacement 15 | if (import.meta.hot) { 16 | import.meta.hot.accept(); 17 | } 18 | -------------------------------------------------------------------------------- /public/preload.js: -------------------------------------------------------------------------------- 1 | const { contextBridge, ipcRenderer } = require('electron'); 2 | 3 | // Expose protected methods that allow the renderer process to use 4 | // the ipcRenderer without exposing the entire object 5 | contextBridge.exposeInMainWorld('api', { 6 | send: (channel, data) => { 7 | // whitelist channels 8 | let validChannels = ['toMain', 'authRequest']; 9 | if (validChannels.includes(channel)) { 10 | ipcRenderer.send(channel, data); 11 | } 12 | }, 13 | receive: (channel, func) => { 14 | let validChannels = ['fromMain', 'authReply']; 15 | if (validChannels.includes(channel)) { 16 | // Deliberately strip event as it includes `sender` 17 | ipcRenderer.on(channel, (event, ...args) => func(...args)); 18 | } 19 | }, 20 | }); 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 📦 React + Snowpack + Tailwindcss 2 | 3 | [React](https://reactjs.org), powered by [Snowpack](https://www.snowpack.dev) 4 | with [Tailwindcss](https://tailwindcss.com). 5 | 6 | ## Available Scripts 7 | 8 | ### npm start 9 | 10 | Runs the app in the development mode. 11 | Open http://localhost:8080 to view it in the browser. 12 | 13 | The page will reload if you make edits. 14 | You will also see any lint errors in the console. 15 | 16 | ### npm test 17 | 18 | Launches the test runner in the interactive watch mode. 19 | See the section about running tests for more information. 20 | 21 | ### npm run build 22 | 23 | Builds a static copy of your site to the `build/` folder. 24 | Your app is ready to be deployed! 25 | 26 | **For the best production performance:** Add a build bundler plugin like "@snowpack/plugin-webpack" or "@snowpack/plugin-parcel" to your `snowpack.config.json` config file. 27 | 28 | ### Q: What about Eject? 29 | 30 | No eject needed! Snowpack guarantees zero lock-in, and CSA strives for the same. 31 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "snowpack-react-tailwind", 3 | "version": "0.0.1", 4 | "license": "MIT", 5 | "main": "public/electron.js", 6 | "browserslist": [ 7 | "since 2017-06" 8 | ], 9 | "scripts": { 10 | "dev": "concurrently \"BROWSER=none npm start\" \"wait-on http://localhost:8080 && electron . --enable-logging\"", 11 | "prepare": "snowpack", 12 | "start": "snowpack dev", 13 | "build": "snowpack build", 14 | "test": "jest" 15 | }, 16 | "dependencies": { 17 | "react": "^16.13.0", 18 | "react-dom": "^16.13.0", 19 | "tailwindcss": "^1.4.6", 20 | "electron": "10.1.4" 21 | }, 22 | "devDependencies": { 23 | "@snowpack/app-scripts-react": "^1.1.4", 24 | "@testing-library/jest-dom": "^5.5.0", 25 | "@testing-library/react": "^10.0.3", 26 | "concurrently": "5.3.0", 27 | "electron-devtools-installer": "3.1.1", 28 | "electron-is-dev": "1.2.0", 29 | "jest": "^25.4.0", 30 | "postcss": "^7.0.32", 31 | "postcss-cli": "^7.1.1", 32 | "prettier": "^2.0.0", 33 | "snowpack": "^2.2.0", 34 | "wait-on": "5.2.0" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 11 | 12 | Snowpack App 13 | 14 | 15 |
16 | 17 | 18 | 28 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /public/electron.js: -------------------------------------------------------------------------------- 1 | const { app, BrowserWindow, ipcMain } = require('electron'); 2 | const path = require('path'); 3 | const isDev = require('electron-is-dev'); 4 | const { 5 | default: installExtension, 6 | REACT_DEVELOPER_TOOLS, 7 | } = require('electron-devtools-installer'); 8 | 9 | // Keep a global reference of the window object, if you don't, the window will 10 | // be closed automatically when the JavaScript object is garbage collected. 11 | let mainWindow; 12 | 13 | async function createWindow() { 14 | mainWindow = new BrowserWindow({ 15 | width: 900, 16 | height: 680, 17 | alwaysOnTop: false, 18 | title: 'rigflo electron', 19 | show: true, 20 | webPreferences: { 21 | contextIsolation: true, 22 | preload: path.resolve(__dirname, 'preload.js'), 23 | }, 24 | }); 25 | 26 | mainWindow.loadURL( 27 | isDev 28 | ? 'http://localhost:8080' 29 | : `file://${path.join(__dirname, '../build/index.html')}`, 30 | ); 31 | mainWindow.on('closed', () => (mainWindow = null)); 32 | 33 | if (isDev) { 34 | console.log('Running in development'); 35 | console.log('DIRNAME', __dirname); 36 | mainWindow.webContents.openDevTools(); 37 | } else { 38 | console.log('Running in production'); 39 | } 40 | } 41 | 42 | app.on('ready', () => { 43 | createWindow(); 44 | 45 | ipcMain.on('toMain', (event, args) => { 46 | console.log('received event'); 47 | mainWindow.webContents.send('fromMain', 'CONNECTED!'); 48 | }); 49 | }); 50 | 51 | app.whenReady().then(() => { 52 | installExtension(REACT_DEVELOPER_TOOLS).then((name) => 53 | console.log(`Added Extension: ${name}`), 54 | ); 55 | // .catch((err) => console.log('An error occurred: ', err)); 56 | }); 57 | 58 | app.on('window-all-closed', () => { 59 | if (process.platform !== 'darwin') { 60 | app.quit(); 61 | } 62 | }); 63 | 64 | app.on('activate', () => { 65 | if (mainWindow === null) { 66 | createWindow(); 67 | } 68 | }); 69 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | """ 2 | MIT License 3 | 4 | Copyright (c) 2020 Mark Ladyshau 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | """ 24 | 25 | This license applies to parts of the repository originating from the 26 | https://github.com/facebook/create-react-app repository: 27 | 28 | """ 29 | MIT License 30 | 31 | Copyright (c) 2013-present, Facebook, Inc. 32 | 33 | Permission is hereby granted, free of charge, to any person obtaining a copy 34 | of this software and associated documentation files (the "Software"), to deal 35 | in the Software without restriction, including without limitation the rights 36 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 37 | copies of the Software, and to permit persons to whom the Software is 38 | furnished to do so, subject to the following conditions: 39 | 40 | The above copyright notice and this permission notice shall be included in all 41 | copies or substantial portions of the Software. 42 | 43 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 44 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 45 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 46 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 47 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 48 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 49 | SOFTWARE. 50 | """ 51 | 52 | This license applies to parts of packages/plugin-react-refresh/plugin.js originating 53 | from the https://github.com/vitejs/vite-plugin-react repository: 54 | 55 | """ 56 | MIT License 57 | 58 | Copyright (c) 2020-present, Yuxi (Evan) You 59 | 60 | Permission is hereby granted, free of charge, to any person obtaining a copy 61 | of this software and associated documentation files (the "Software"), to deal 62 | in the Software without restriction, including without limitation the rights 63 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 64 | copies of the Software, and to permit persons to whom the Software is 65 | furnished to do so, subject to the following conditions: 66 | 67 | The above copyright notice and this permission notice shall be included in all 68 | copies or substantial portions of the Software. 69 | 70 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 71 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 72 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 73 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 74 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 75 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 76 | SOFTWARE. 77 | """ -------------------------------------------------------------------------------- /src/App.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | function App() { 4 | return ( 5 |
6 |
7 | 13 | 17 | 21 | 25 | 29 | 30 | 36 | React 37 | 38 |
39 | 54 |
55 | 66 | 72 | Snowpack 73 | 74 |
75 | 90 |
91 | 123 | 129 | Tailwind 130 | 131 |
132 |
133 | ); 134 | } 135 | 136 | export default App; 137 | --------------------------------------------------------------------------------