16 | {/* NeutralinoJs example for get current available and total ram in Gb*
17 | remove comment for below line*/}
18 | {/* */}
19 |
20 |
21 | );
22 | }
23 | }
24 |
25 | export default reactComponents;
26 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ## Notice 🔔
2 |
3 | Please use https://github.com/neutralinojs/neutralinojs-minimal instead of this template, if you are trying Neutralinojs v2.
4 |
5 | # neutralinojs-react
6 |
7 | 
8 |
9 | React starter project for Neutralinojs
10 |
11 | ## Get started
12 |
13 | Install [neu-cli](https://neutralino.js.org/docs/#/tools/cli)
14 |
15 | ```bash
16 | $ npm i -g @neutralinojs/neu
17 | ```
18 |
19 | Create Neutralino app with React template
20 |
21 | ```bash
22 | $ neu create myapp --template react
23 | $ cd myapp
24 | ```
25 |
26 | Bundle source files
27 |
28 | ```bash
29 | $ neu build
30 | ```
31 |
32 | Learn more about neu-cli from [docs](https://neutralino.js.org/docs/#/tools/cli)
33 |
--------------------------------------------------------------------------------
/configs/webpack.dev.js:
--------------------------------------------------------------------------------
1 | const merge = require("webpack-merge");
2 | const common = require("./webpack.common.js");
3 | const path = require("path");
4 | const MiniCssExtractPlugin = require("mini-css-extract-plugin");
5 |
6 | module.exports = merge(common, {
7 | mode: "development",
8 | devtool: "inline-source-map",
9 | module: {
10 | rules: [
11 | {
12 | test: /\.css$/,
13 | use: [{ loader: "style-loader" }, { loader: "css-loader" }]
14 | },
15 | {
16 | test: /\.s(a|c)ss$/,
17 | use: [
18 | { loader: "style-loader" },
19 | { loader: "css-loader" },
20 | { loader: "sass-loader" }
21 | ]
22 | }
23 | ]
24 | },
25 | plugins: [
26 | new MiniCssExtractPlugin({
27 | filename: "app.css"
28 | })
29 | ]
30 | });
31 |
--------------------------------------------------------------------------------
/app/assets/app.vendors~main.js.LICENSE.txt:
--------------------------------------------------------------------------------
1 | /*
2 | object-assign
3 | (c) Sindre Sorhus
4 | @license MIT
5 | */
6 |
7 | /** @license React v0.19.1
8 | * scheduler.production.min.js
9 | *
10 | * Copyright (c) Facebook, Inc. and its affiliates.
11 | *
12 | * This source code is licensed under the MIT license found in the
13 | * LICENSE file in the root directory of this source tree.
14 | */
15 |
16 | /** @license React v16.13.1
17 | * react-dom.production.min.js
18 | *
19 | * Copyright (c) Facebook, Inc. and its affiliates.
20 | *
21 | * This source code is licensed under the MIT license found in the
22 | * LICENSE file in the root directory of this source tree.
23 | */
24 |
25 | /** @license React v16.13.1
26 | * react.production.min.js
27 | *
28 | * Copyright (c) Facebook, Inc. and its affiliates.
29 | *
30 | * This source code is licensed under the MIT license found in the
31 | * LICENSE file in the root directory of this source tree.
32 | */
33 |
--------------------------------------------------------------------------------
/.github/workflows/pushPullAction.yml:
--------------------------------------------------------------------------------
1 | # This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
2 | # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3 |
4 | name: React-Neu on CI
5 |
6 | on:
7 | push:
8 | branches: [ master ]
9 | pull_request:
10 | branches: [ master ]
11 |
12 | jobs:
13 | build:
14 |
15 | strategy:
16 | matrix:
17 | node-version: [10.x, 12.x]
18 | os: [windows-latest,ubuntu-latest,macos-latest]
19 |
20 | runs-on: ${{matrix.os}}
21 |
22 | steps:
23 | - uses: actions/checkout@v2
24 | - name: Use Node.js ${{ matrix.node-version }}
25 | uses: actions/setup-node@v1
26 | with:
27 | node-version: ${{ matrix.node-version }}
28 | - run: npm install
29 | - run: npm run build --if-present
30 | env:
31 | CI: true
32 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2020 99X Technology Incubator
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/configs/webpack.prod.js:
--------------------------------------------------------------------------------
1 | const merge = require("webpack-merge");
2 | const common = require("./webpack.common.js");
3 | const path = require("path");
4 | const MiniCssExtractPlugin = require("mini-css-extract-plugin");
5 | const TerserJSPlugin = require("terser-webpack-plugin");
6 | const OptimizeCssAssetsPlugin = require("optimize-css-assets-webpack-plugin");
7 | const { CleanWebpackPlugin } = require("clean-webpack-plugin");
8 | const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
9 |
10 | module.exports = merge(common, {
11 | mode: "production",
12 | optimization: {
13 | minimizer: [
14 | new TerserJSPlugin({}),
15 | new OptimizeCssAssetsPlugin({}),
16 | new UglifyJsPlugin()
17 | ]
18 | },
19 | module: {
20 | rules: [
21 | {
22 | test: /\.css$/,
23 | use: [{ loader: MiniCssExtractPlugin.loader }, { loader: "css-loader" }]
24 | },
25 | {
26 | test: /\.s(a|c)ss$/,
27 | use: [
28 | { loader: MiniCssExtractPlugin.loader },
29 | { loader: "css-loader" },
30 | { loader: "sass-loader" }
31 | ]
32 | }
33 | ]
34 | },
35 | plugins: [
36 | new OptimizeCssAssetsPlugin(),
37 | new MiniCssExtractPlugin({
38 | filename: "app.css"
39 | }),
40 | new CleanWebpackPlugin({
41 | root: process.cwd(),
42 | verbose: true,
43 | dry: false,
44 | cleanOnceBeforeBuildPatterns: ["**/*", "!neutralino.js"]
45 | })
46 | ]
47 | });
48 |
--------------------------------------------------------------------------------
/src/neu.css:
--------------------------------------------------------------------------------
1 | /*
2 | MIT License
3 |
4 | Copyright (c) 2018 Neutralinojs
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 | #neutralinoapp {
25 | text-align: center;
26 | }
27 | #neutralinoapp h1 {
28 | font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
29 | font-size: 20px;
30 | color: #000000;
31 | }
32 | #neutralinoapp a {
33 | margin-left: 12px;
34 | }
35 | #neutralinoapp span {
36 | font-size: 12px;
37 | font-weight: normal;
38 | }
39 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "react-for-neu-cli",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "@testing-library/jest-dom": "^5.8.0",
7 | "@testing-library/react": "^9.5.0",
8 | "@testing-library/user-event": "^10.3.5",
9 | "react": "^16.13.0",
10 | "react-dom": "^16.13.0",
11 | "react-scripts": "3.4.0"
12 | },
13 | "scripts": {
14 | "start": "webpack -p --config=configs/webpack.dev.js --watch",
15 | "build": "webpack -p --config=configs/webpack.prod.js",
16 | "webpack": "webpack --progress",
17 | "test": "react-scripts test"
18 | },
19 | "eslintConfig": {
20 | "extends": "react-app"
21 | },
22 | "browserslist": {
23 | "production": [
24 | ">0.2%",
25 | "not dead",
26 | "not op_mini all"
27 | ],
28 | "development": [
29 | "last 1 chrome version",
30 | "last 1 firefox version",
31 | "last 1 safari version"
32 | ]
33 | },
34 | "devDependencies": {
35 | "@babel/core": "^7.12.10",
36 | "@babel/plugin-proposal-class-properties": "^7.8.3",
37 | "@babel/preset-env": "^7.9.5",
38 | "@babel/preset-react": "^7.8.3",
39 | "babel-loader": "8.2.2",
40 | "clean-webpack-plugin": "^3.0.0",
41 | "css-loader": "^3.5.2",
42 | "mini-css-extract-plugin": "^0.9.0",
43 | "optimize-css-assets-webpack-plugin": "^5.0.3",
44 | "terser-webpack-plugin": "^2.3.5",
45 | "uglifyjs-webpack-plugin": "^2.2.0",
46 | "webpack": "4.41.5",
47 | "webpack-cli": "^3.3.11",
48 | "webpack-merge": "^4.2.2"
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/app/index.html:
--------------------------------------------------------------------------------
1 |
23 |
24 |
25 |
26 |
27 |
28 | NeutralinoJs
29 |
30 |
31 |
32 |
33 |
..
34 |
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/src/App-core/mainApp.js:
--------------------------------------------------------------------------------
1 | // MIT License
2 |
3 | // Copyright (c) 2018 Neutralinojs
4 |
5 | // Permission is hereby granted, free of charge, to any person obtaining a copy
6 | // of this software and associated documentation files (the "Software"), to deal
7 | // in the Software without restriction, including without limitation the rights
8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | // copies of the Software, and to permit persons to whom the Software is
10 | // furnished to do so, subject to the following conditions:
11 |
12 | // The above copyright notice and this permission notice shall be included in all
13 | // copies or substantial portions of the Software.
14 |
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | // SOFTWARE.
22 |
23 | import React from "react";
24 | import ReactDOM from "react-dom";
25 |
26 | import "../neu.css";
27 | import App from "../App";
28 | import * as serviceWorker from "../serviceWorker";
29 |
30 | Neutralino.init({
31 | load: function() {},
32 | pingSuccessCallback: function() {},
33 | pingFailCallback: function() {}
34 | });
35 |
36 | ReactDOM.render(, document.getElementById("root"));
37 |
38 | // If you want your app to work offline and load faster, you can change
39 | // unregister() to register() below. Note this comes with some pitfalls.
40 | // Learn more about service workers: https://bit.ly/CRA-PWA
41 | serviceWorker.unregister();
42 |
--------------------------------------------------------------------------------
/src/Components/RamUsageExample .js:
--------------------------------------------------------------------------------
1 | import React, { Component } from "react";
2 | class RamUsageExample extends Component {
3 | state = {
4 | aMemVal: "",
5 | tMemVal: "",
6 | isbtnRamUsage: 0,
7 | };
8 |
9 | styles = {
10 | btnRamUsage: {
11 | color: " #fff",
12 | backgroundColor: "#28a745",
13 | borderColor: "#28a745",
14 | borderRadius: "0.25rem",
15 | fontWeight: 400,
16 | textAlign: "center",
17 | border: "1px solid transparent",
18 | padding: ".375rem .75rem",
19 | fontSize: " 1rem",
20 | lineHeight: "1.5",
21 | cursor: "pointer",
22 | },
23 | spanStyles: {
24 | margin: 10,
25 | },
26 | };
27 |
28 | render() {
29 | return (
30 |