Skip to content

Commit

Permalink
rm package-lock
Browse files Browse the repository at this point in the history
  • Loading branch information
DaveInchy committed Aug 3, 2022
0 parents commit 495eb09
Show file tree
Hide file tree
Showing 46 changed files with 36,990 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"presets": [
"@babel/preset-env",
"@babel/preset-react",
"@babel/preset-typescript"
]
}
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
36 changes: 36 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
node_modules

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test
.vscode

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml

# yarn v3
.yarn/*
!.yarn/releases
!.yarn/plugins
!.yarn/sdks
!.yarn/versions
.pnp.*

# End of https://www.toptal.com/developers/gitignore/api/node
package-lock.json
50 changes: 50 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@

# >_ npm run dev

This is a template for a native app, it uses electron for desktop functionality and uses webpack + create-react-app to handle compiling to Android & iOS. It is intended to be used with a [create-react-app]('https://github.com/DaveInchy/tailwind-app') example project... Make sure to export your original "create react app template" into the `src/` folder and copy every static file to the `public/` folder.

<br>

<br>

# >_ npm install
### - Setup by Webpack & Babel
### - Design by TailwindCSS
### - Desktop by Electron
### - Mobile by React Native

<br>

```
Multi-platform Application Development Template
```

never say never, one day itll work itself out, thats what life does, figure shit out --wtfdave

<br>

<br>

# >_ NPM scripts


```
$ npm run dev <-- A Development setup
$ npm run start
$ npm run test
$ npm run eject
$ npm run build
$ npm run build:dev
$ npm run build:prod
$ npm run build:react
$ npm run build:electron
$ npm run build:windows
$ npm run electron:start
$ npm run eslint:start
$ npm run eslint:fix
$ npm run format:fix
$ npm run format:start
# ----------------------------- #
Are you sure to continue? [y/n] |
>_ maybe? |
```
176 changes: 176 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
{
"name": "electron-tailwind-react-native-webpack-babel-postcss",
"version": "1.0.0",
"description": "",
"main": "public/electron.js",
"private": true,
"scripts": {
"dev": "concurrently -k \"cross-env BROWSER=none npm start\" \"npm run electron:start\"",
"start": "cross-env PORT=8080 webpack serve --mode=development --node-env development",
"test": "react-scripts test",
"eject": "echo \"Are you sure, there is no way back! [y/n]\"; read _answer && [[ \"${_answer}\" -eq \"y\" ]] && react-scripts eject || echo \"Aborted.\"",
"build": "webpack --mode=production --node-env production",
"build:dev": "webpack --mode=development --node-env development",
"build:prod": "webpack --mode=production --node-env production",
"build:react": "react-scripts build",
"build:electron": "electron-builder --dir",
"build:windows": "electron-builder --win",
"electron:start": "wait-on tcp:8080 && electron --trace-warnings .",
"eslint:start": "eslint --ext .js,.jsx,.ts,.tsx src --ignore-path .gitignore",
"eslint:fix": "eslint --ext .js,.jsx,.ts,.tsx src --fix --ignore-path .gitignore",
"format:fix": "prettier --write \"src/**/*.{js,jsx,ts,tsx,json,css,scss,md}\" --ignore-path .gitignore",
"format:start": "prettier --check \"src/**/*.{js,jsx,ts,tsx,json,css,scss,md}\" --ignore-path .gitignore"
},
"keywords": [],
"author": "",
"license": "MIT",
"dependencies": {
"@babel/core": "7.17.9",
"@babel/eslint-parser": "^7.18.9",
"@babel/preset-env": "7.16.11",
"@babel/preset-react": "7.16.7",
"@babel/preset-typescript": "^7.18.6",
"@electron/remote": "^2.0.8",
"@vercel/node": "^2.5.2",
"autoprefixer": "10.4.4",
"babel-loader": "8.2.4",
"concurrently": "^7.3.0",
"core-js": "3.22.0",
"cross-env": "7.0.3",
"css-loader": "6.7.1",
"daisyui": "^2.20.0",
"electron": "19.0.10",
"electron-builder": "23.1.0",
"electron-is-dev": "2.0.0",
"eslint": "^8.20.0",
"eslint-config-react-app": "^7.0.1",
"eslint-plugin-react-app": "^6.2.2",
"file-loader": "^6.2.0",
"html-loader": "^4.1.0",
"html-webpack-plugin": "5.5.0",
"jest": "^28.1.3",
"node": "16.0.0",
"npm": "8.15.1",
"postcss": "8.4.12",
"postcss-html": "^1.5.0",
"postcss-import": "^14.1.0",
"postcss-loader": "6.2.1",
"prettier": "^2.7.1",
"react": "18.0.0",
"react-dom": "18.0.0",
"react-native": "0.69.3",
"react-native-web": "0.17.5",
"react-router-dom": "6.3.0",
"react-router-native": "6.3.0",
"react-scripts": "5.0.1",
"style-loader": "^3.3.1",
"stylelint": "^14.9.1",
"stylelint-config-recommended": "^8.0.0",
"stylelint-config-recommended-scss": "^7.0.0",
"stylelint-config-standard": "^26.0.0",
"tailwindcss": "3.1.6",
"tsc": "^2.0.4",
"typescript": "^4.7.4",
"typescript-eslint": "^0.0.1-alpha.0",
"wait-on": "6.0.1",
"webpack": "5.72.0",
"webpack-dev-server": "4.9.2"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"eslintConfig": {
"parser": "@babel/eslint-parser",
"root": true,
"env": {
"browser": true,
"node": true
},
"extends": [
"react-app",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"plugin:jsx-a11y/recommended"
],
"plugins": [
"react",
"jsx-a11y"
],
"rules": {
"@typescript-eslint/explicit-module-boundary-types": 0,
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/no-unused-vars": [
0,
{
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_"
}
],
"quote-props": [
0,
"as-needed"
],
"no-unused-vars": [
0,
{
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_"
}
]
},
"settings": {
"react": {
"version": "detect"
}
},
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"overrides": [
{
"files": [
"*.ts",
"*.tsx"
],
"parser": "@typescript-eslint/parser",
"env": {
"browser": true,
"node": true
},
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
},
"warnOnUnsupportedTypeScriptVersion": true
},
"plugins": [
"typescript-eslint"
],
"extends": [
"react-app",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"plugin:jsx-a11y/recommended"
]
}
]
},
"devDependencies": {
"webpack-cli": "^4.10.0"
}
}
9 changes: 9 additions & 0 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

module.exports = {
// Add you postcss configuration here
// Learn more about it at https://github.com/webpack-contrib/postcss-loader#config-files
plugins: [
require('tailwindcss'),
require('autoprefixer')
],
}
42 changes: 42 additions & 0 deletions public/electron.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/* eslint-disable @typescript-eslint/no-var-requires */
require('core-js/stable');
require("regenerator-runtime/runtime");

require('@electron/remote/main').initialize();

const { app, BrowserWindow } = require('electron');
const path = require('path');

const port = process.env.PORT || 8080;

function createWindow()
{
const Splash = new BrowserWindow({
width: 420,
height: 840,
webPreferences: {
preload: path.join(__dirname, 'preload.js'),
nodeIntegration: true,
contextIsolation: false,
enableRemoteModule: true
},
frame: true,
transparent: false,
resizable: false,
show: true,
});

Splash.loadURL('http://localhost:' + port);
}

function closeApp()
{
if (process.platform !== 'darwin')
{
app.quit();
}
}

app.on('ready', createWindow);
app.on('window-all-closed', closeApp);
app.on('activate', (e) => BrowserWindow.getAllWindows().length === 0 ? createWindow() : e.preventDefault());
Binary file added public/favicon/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions public/preload.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
require('core-js/stable');
require("regenerator-runtime/runtime");

// eslint-disable-next-line @typescript-eslint/no-var-requires
require('@electron/remote/main').initialize();

window.API = ({
data: {},
state: {},
methods: {},
twStyles: {
defaults: {
container: "flex flex-col justify-center items-center",
},
navBar: {
container: "bg-black h-[80px] w-full fixed z-50 top-0 left-0",
branding: "text-white text-2xl font-bold",
},
controls: {
container: "bg-black h-[50px] w-full fixed z-50 bottom-0 left-0",
}
},
});
26 changes: 26 additions & 0 deletions public/sw.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
// THIS FILE SHOULD NOT BE VERSION CONTROLLED

// https://github.com/NekR/self-destroying-sw

self.addEventListener('install', function (e) {
self.skipWaiting()
})

self.addEventListener('activate', function (e) {
self.registration.unregister()
.then(function () {
return self.clients.matchAll()
})
.then(function (clients) {
clients.forEach(client => client.navigate(client.url))
})
})

self.addEventListener('fetch', (e) => {
e.respondWith(respond())
});

function respond() {
return {};
}
1 change: 1 addition & 0 deletions src/assets/icons/icon-arrow.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 src/assets/img/app/logo-firefox.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 495eb09

Please sign in to comment.