[🪢] Merge pull request #2 from Flow-Works/vite

This commit is contained in:
ThinLiquid 2023-10-16 22:46:11 +01:00 committed by GitHub
commit 930f40d972
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 127 additions and 2257 deletions

View file

@ -1,13 +1,46 @@
<div align="center"> <div align="center">
<img src="https://raw.githubusercontent.com/Flow-Works/FlowOS/main/public/assets/logo.svg" width="100px">
<p style="font-size: 28px; font-weight: bold">Flow OS</p>
<img src="https://img.shields.io/github/stars/flow-works/flowos-2.0?style=for-the-badge" />
# FlowOS Next <img src="https://img.shields.io/github/issues-pr/flow-works/flowos-2.0?style=for-the-badge" />
The *future* of FlowOS.
[![TypeScript Style Guide](https://cdn.rawgit.com/standard/standard/master/badge.svg)](https://github.com/standard/ts-standard) <img src="https://img.shields.io/github/forks/flow-works/flowos-2.0?style=for-the-badge&color=orange" />
![GitHub](https://img.shields.io/github/license/Flow-Works/FlowOS-2.0?style=flat) <img src="https://img.shields.io/github/commit-activity/t/Flow-Works/FlowOS-2.0?style=for-the-badge&color=violet" />
[![build](https://github.com/Flow-Works/FlowOS-2.0/actions/workflows/build.yml/badge.svg)](https://github.com/Flow-Works/FlowOS-2.0/actions/workflows/build.yml) <br><br>
![GitHub commit activity (branch)](https://img.shields.io/github/commit-activity/t/Flow-Works/FlowOS-2.0) <i>The next generation of Flow OS</i>
<br>
<a href="https://docs.flow-works.me"><strong>Read the docs »</strong></a>
<hr>
</div>
## What is Flow OS?
Flow OS is a web OS proxy made for the Titanium Network 2023 Proxathon. It's extremly customizable with an API to make your own apps, themes, and modules.
</div> ## Getting Started
To run Flow OS on your local machine, you need Node.js 16 or above.
* Clone the repository
```
git clone https://github.com/flow-works/flowos
```
* Install packages
```
npm install
```
* Build and run!
```
npm run build
npm run serve
```
## Made with
Flow OS is made with the following software:
* [Filer](https://github.com/filerjs/filer)
* [PrismJS](https://github.com/PrismJS/prism)
* [Vite](https://vitejs.dev)
* [Ultraviolet](https://github.com/titaniumnetwork-dev/ultraviolet)
## License
Flow OS is licensed under the MIT license. See the `LICENSE` file for more information.

View file

@ -3,9 +3,10 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title> <title>Flow OS</title>
</head> </head>
<body> <body>
<script src="https://unpkg.com/filer"></script> <script src="https://unpkg.com/filer"></script>
<script src="./src/index.ts" type="module"></script>
</body> </body>
</html> </html>

2210
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -5,8 +5,9 @@
"main": "src/index.ts", "main": "src/index.ts",
"scripts": { "scripts": {
"test": "ts-standard", "test": "ts-standard",
"dev": "vite",
"build": "vite build", "build": "vite build",
"serve": "vite serve" "serve": "vite preview"
}, },
"keywords": [], "keywords": [],
"author": "", "author": "",
@ -15,7 +16,6 @@
"@babel/preset-env": "^7.23.2", "@babel/preset-env": "^7.23.2",
"@babel/preset-typescript": "^7.23.2", "@babel/preset-typescript": "^7.23.2",
"@types/uuid": "^9.0.5", "@types/uuid": "^9.0.5",
"@types/webpack-env": "^1.18.2",
"babel-loader": "^9.1.3", "babel-loader": "^9.1.3",
"css-loader": "^6.8.1", "css-loader": "^6.8.1",
"file-loader": "^6.2.0", "file-loader": "^6.2.0",
@ -27,11 +27,10 @@
"style-loader": "^3.3.3", "style-loader": "^3.3.3",
"ts-standard": "^12.0.2", "ts-standard": "^12.0.2",
"typescript": "^5.2.2", "typescript": "^5.2.2",
"vite-plugin-html": "^3.2.0", "vite": "^4.4.11",
"vite-plugin-node-polyfills": "^0.15.0", "vite-plugin-node-polyfills": "^0.15.0",
"vite-plugin-require": "^1.1.11", "vite-plugin-require": "^1.1.11",
"vite-require": "^0.2.3", "vite-require": "^0.2.3"
"webpack-dev-server": "^4.15.1"
}, },
"dependencies": { "dependencies": {
"@ptkdev/logger": "^1.8.0", "@ptkdev/logger": "^1.8.0",
@ -39,7 +38,6 @@
"filer": "^1.4.1", "filer": "^1.4.1",
"prism-code-editor": "^1.2.2", "prism-code-editor": "^1.2.2",
"prismjs": "^1.29.0", "prismjs": "^1.29.0",
"uuid": "^9.0.1", "uuid": "^9.0.1"
"vite": "^4.4.11"
} }
} }

View file

@ -1,20 +1,9 @@
import { defineConfig } from 'vite' import { defineConfig } from 'vite'
import { createHtmlPlugin } from 'vite-plugin-html'
import { nodePolyfills } from 'vite-plugin-node-polyfills' import { nodePolyfills } from 'vite-plugin-node-polyfills'
import { viteRequire } from 'vite-require' import { viteRequire } from 'vite-require'
export default defineConfig({ export default defineConfig({
plugins: [ plugins: [
createHtmlPlugin({
entry: 'src/index.ts',
template: 'public/index.html',
inject: {
data: {
title: 'index',
injectScript: '<script src="./bundle.js"></script>'
}
}
}),
nodePolyfills(), nodePolyfills(),
viteRequire() viteRequire()
] ]

View file

@ -1,101 +0,0 @@
const HtmlWebpackPlugin = require('html-webpack-plugin')
const { FilerWebpackPlugin } = require('filer/webpack')
const NodePolyfillPlugin = require('node-polyfill-webpack-plugin')
const webpack = require('webpack')
const path = require('path')
module.exports = {
entry: {
flow: './src/index.ts'
},
devtool: 'inline-source-map',
mode: 'production',
module: {
rules: [
{
test: /\.less$/i,
use: [
'style-loader',
'css-loader',
'less-loader'
]
},
{
test: /\.css$/i,
use: [
'style-loader',
'css-loader'
]
},
{
test: /\.(png|jpe?g|gif)$/i,
loader: 'file-loader',
options: {
outputPath: 'images'
}
},
{
test: /\.ts$/,
exclude: /node_modules/,
use: 'babel-loader'
},
{
test: /\.js$/,
use: ['source-map-loader'],
enforce: 'pre'
}
]
},
resolve: {
extensions: ['.tsx', '.ts', '.js']
},
output: {
filename: '[name].bundle.js',
path: path.resolve(__dirname, 'dist'),
clean: true
},
devServer: {
static: {
directory: path.join(__dirname, 'dist')
},
compress: true,
port: 9000
},
plugins: [new HtmlWebpackPlugin(), new FilerWebpackPlugin(),
new NodePolyfillPlugin({
excludeAliases: ['console']
}),
new webpack.optimize.MinChunkSizePlugin({
minChunkSize: 50000
}),
new webpack.optimize.SplitChunksPlugin({
minSize: 45000,
maxSize: 110000
})
],
optimization: {
splitChunks: {
chunks: 'async',
minSize: 20000,
minRemainingSize: 0,
minChunks: 1,
maxAsyncRequests: 30,
maxInitialRequests: 30,
enforceSizeThreshold: 50000,
cacheGroups: {
commons: {
test: /[\\/]node_modules[\\/]/,
name: 'vendor',
chunks: 'initial',
reuseExistingChunk: true
},
default: {
minChunks: 2,
reuseExistingChunk: true
}
}
}
}
}