dinou 1.0.4 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -15
- package/package.json +2 -1
- package/webpack.config.js +10 -0
package/README.md
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
# **dinou**: Minimal React 19 Framework
|
|
1
|
+
# **dinou**: **A Minimal React 19 Framework**
|
|
2
2
|
|
|
3
|
-
dinou is a React 19 framework
|
|
3
|
+
[**dinou**](https://github.com/roggc/dinou) is a **minimal React 19 framework**. dinou means 19 in catalan. You can create a dinou [app](https://github.com/roggc/dinou-app) by running the command **`npx create-dinou@latest my-app`**.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Or you can create one by yourself with the following steps:
|
|
6
|
+
|
|
7
|
+
- Create an npm project (`npm init -y`)
|
|
6
8
|
|
|
7
9
|
- Install dependencies (`npm i react react-dom dinou`)
|
|
8
10
|
|
|
9
|
-
- Create scripts in `package.json
|
|
11
|
+
- Create scripts in `package.json` for convenience:
|
|
10
12
|
|
|
11
13
|
- "dev": "dinou dev"
|
|
12
14
|
|
|
@@ -26,11 +28,9 @@ dinou is a React 19 framework. dinou means 19 in catalan.
|
|
|
26
28
|
}
|
|
27
29
|
```
|
|
28
30
|
|
|
29
|
-
- Run `npm run dev` to see the page in action in your browser.
|
|
30
|
-
|
|
31
|
-
- If you run `npm run eject`, dinou will be ejected and copied to your root project folder, so you can customize it.
|
|
31
|
+
- Run `npm run dev` (or `npx dinou dev`) to see the page in action in your browser.
|
|
32
32
|
|
|
33
|
-
-
|
|
33
|
+
- If you run `npm run eject` (or `npx dinou eject`), dinou will be ejected and copied to your root project folder, so you can customize it.
|
|
34
34
|
|
|
35
35
|
dinou main features are:
|
|
36
36
|
|
|
@@ -46,7 +46,7 @@ dinou main features are:
|
|
|
46
46
|
|
|
47
47
|
- TypeScript or JavaScript
|
|
48
48
|
|
|
49
|
-
- Full control and customization through the command `npm run eject
|
|
49
|
+
- Full control and customization through the command `npm run eject` (`npx dinou eject`).
|
|
50
50
|
|
|
51
51
|
## Table of contents
|
|
52
52
|
|
|
@@ -92,7 +92,11 @@ dinou main features are:
|
|
|
92
92
|
|
|
93
93
|
- [Not Found Handling](#not-found-handling)
|
|
94
94
|
|
|
95
|
-
- [
|
|
95
|
+
- [`favicons` folder](#favicons-folder)
|
|
96
|
+
|
|
97
|
+
- [`.env` file](#env-file)
|
|
98
|
+
|
|
99
|
+
- [How to run a dinou app](#how-to-run-a-dinou-app)
|
|
96
100
|
|
|
97
101
|
- [Eject dinou](#eject-dinou)
|
|
98
102
|
|
|
@@ -839,16 +843,30 @@ The routing system is file-based and supports static routes, dynamic routes, opt
|
|
|
839
843
|
|
|
840
844
|
- Layouts are applied to `not_found.tsx` pages too, unless a `no_layout` or **`no_layout_not_found`** files (**without extension**) are found in the directory in which the `not_found.tsx` page is defined, in which case layouts will not be applied to `not_found.tsx` page.
|
|
841
845
|
|
|
842
|
-
##
|
|
846
|
+
## `favicons` folder
|
|
847
|
+
|
|
848
|
+
If you want to show a favicon, generate one with an online tool (e.g. [favicon.io](https://favicon.io/)), unzip the downloaded folder with the favicons, paste it in the root of the project and rename it to `favicons`. Then you will have your favicon in your web app.
|
|
849
|
+
|
|
850
|
+
## `.env` file
|
|
851
|
+
|
|
852
|
+
dinou is ready to manage env vars in the code that runs on the Server side (Server Functions, Server Components, and `getProps` function). Create an `.env` file in your project (and add it to your `.gitignore` file to not expose sensitive data to the public) and define there your env variables:
|
|
853
|
+
|
|
854
|
+
```bash
|
|
855
|
+
# .env
|
|
856
|
+
# define here your env vars
|
|
857
|
+
MY_VAR=my_value
|
|
858
|
+
```
|
|
859
|
+
|
|
860
|
+
## How to run a dinou app
|
|
843
861
|
|
|
844
|
-
Run `npm run dev` to start the app in development mode. Wait for the logs of Webpack and `Listening on port <port>` to load the page on your browser.
|
|
862
|
+
Run `npm run dev` (or `npx dinou dev`) to start the dinou app in development mode. Wait for the logs of Webpack and `Listening on port <port>` to load the page on your browser.
|
|
845
863
|
|
|
846
|
-
Run `npm run build` to build the app and `npm start` to run it.
|
|
864
|
+
Run `npm run build` (or `npx dinou build`) to build the app and `npm start` (or `npx dinou start`) to run it.
|
|
847
865
|
|
|
848
866
|
## Eject dinou
|
|
849
867
|
|
|
850
|
-
- You can eject dinou with the command `npm run eject
|
|
868
|
+
- You can eject dinou with the command `npm run eject` (or `npx dinou eject`). This will copy the files defining dinou in the root folder of the project (grouped in a `dinou` folder). You will have full control and customization capabilities.
|
|
851
869
|
|
|
852
870
|
## License
|
|
853
871
|
|
|
854
|
-
dinou is licensed under the [MIT License](LICENSE.md).
|
|
872
|
+
dinou is licensed under the [MIT License](https://github.com/roggc/dinou/blob/master/LICENSE.md).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dinou",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Minimal React 19 Framework",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"@babel/register": "^7.27.1",
|
|
29
29
|
"babel-loader": "^10.0.0",
|
|
30
30
|
"commander": "^14.0.0",
|
|
31
|
+
"copy-webpack-plugin": "^13.0.0",
|
|
31
32
|
"cross-env": "^7.0.3",
|
|
32
33
|
"dotenv": "^16.5.0",
|
|
33
34
|
"express": "^5.1.0",
|
package/webpack.config.js
CHANGED
|
@@ -2,6 +2,7 @@ require("dotenv/config");
|
|
|
2
2
|
const path = require("path");
|
|
3
3
|
const ReactServerWebpackPlugin = require("react-server-dom-webpack/plugin");
|
|
4
4
|
const webpack = require("webpack");
|
|
5
|
+
const CopyWebpackPlugin = require("copy-webpack-plugin");
|
|
5
6
|
|
|
6
7
|
const isDevelopment = process.env.NODE_ENV !== "production";
|
|
7
8
|
|
|
@@ -41,6 +42,15 @@ module.exports = {
|
|
|
41
42
|
plugins: [
|
|
42
43
|
isDevelopment && new webpack.HotModuleReplacementPlugin(),
|
|
43
44
|
new ReactServerWebpackPlugin({ isServer: false }),
|
|
45
|
+
new CopyWebpackPlugin({
|
|
46
|
+
patterns: [
|
|
47
|
+
{
|
|
48
|
+
from: "favicons",
|
|
49
|
+
to: ".",
|
|
50
|
+
noErrorOnMissing: true,
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
}),
|
|
44
54
|
].filter(Boolean),
|
|
45
55
|
resolve: {
|
|
46
56
|
extensions: [".js", ".jsx", ".ts", ".tsx"],
|