afront 1.0.7 → 1.0.9

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 CHANGED
@@ -8,29 +8,25 @@
8
8
 
9
9
  Before you begin, ensure you have the following installed:
10
10
 
11
- - **Node.js**: You can download and install it from [Node.js official website](https://nodejs.org/).
11
+ - **Node.js**: You must have Node.js installed on your system. Download it from the [Node.js official website](https://nodejs.org/).
12
12
 
13
13
  ### Installation
14
14
 
15
- 1. **Download and Extract Release**
16
-
17
- - Download the latest release from the [Releases page](https://github.com/Asggen/afront/releases).
18
- - Extract the contents of the release to a directory of your choice.
19
-
20
- 2. **Install Dependencies**
15
+ 1. **Install AFront**
21
16
 
22
17
  - Open your terminal or command prompt.
23
- - Navigate to the root folder of the extracted release:
18
+ - To create a new project in a custom folder, run the following command:
24
19
  ```bash
25
- cd path/to/extracted/root/folder
20
+ npx afront <your-folder-name>
26
21
  ```
27
- - Install the required dependencies:
22
+ - To create the project in the current directory, run:
28
23
  ```bash
29
- npm install
24
+ npx afront .
30
25
  ```
31
- or
26
+
27
+ - Navigate to the root folder of the newly created project:
32
28
  ```bash
33
- npm i
29
+ cd path/to/your/project
34
30
  ```
35
31
 
36
32
  ### Running the Project
@@ -70,3 +66,12 @@ Thank you for using **AFront**! We look forward to seeing what you build with it
70
66
  This `README.md` file provides clear instructions on prerequisites, installation, and running the project in different environments. You can customize the links and details as needed for your specific project.
71
67
  ```
72
68
 
69
+
70
+ ### Changes Made:
71
+ 1. **Prerequisites**: Clarified that Node.js must be installed.
72
+ 2. **Installation**: Added instructions to run `npx afront <your-folder-name>` to create a custom folder or `npx afront .` to create the project in the current directory.
73
+ 3. **Running the Project**: This section remained the same.
74
+
75
+ You can now use this updated `README.md` in your project.
76
+
77
+
package/install.js CHANGED
@@ -8,10 +8,10 @@ const AdmZip = require('adm-zip');
8
8
  const readline = require('readline');
9
9
 
10
10
  // Configuration
11
- const GITHUB_ZIP_URL = 'https://github.com/Asggen/afront/archive/refs/tags/v1.0.7.zip'; // Updated URL
11
+ const GITHUB_ZIP_URL = 'https://github.com/Asggen/afront/archive/refs/tags/v1.0.9.zip'; // Updated URL
12
12
 
13
13
  // Define files to skip
14
- const SKIP_FILES = ['FUNDING.yml', 'CODE_OF_CONDUCT.md', 'SECURITY.md', 'install.js'];
14
+ const SKIP_FILES = ['FUNDING.yml', 'CODE_OF_CONDUCT.md', 'SECURITY.md', 'install.js', '.npmrc'];
15
15
 
16
16
  // Initialize readline interface
17
17
  const rl = readline.createInterface({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "afront",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "description": "AFront is a front-end JavaScript library designed to create seamless server-side rendered (SSSR) websites.",
5
5
  "main": "webpack.dev.js",
6
6
  "scripts": {
@@ -33,22 +33,26 @@
33
33
  ],
34
34
  "license": "MIT",
35
35
  "dependencies": {
36
+ "adm-zip": "^0.5.15",
37
+ "afront": "^1.0.5",
36
38
  "asggen-headtags": "^1.0.3",
37
39
  "babel-plugin-css-modules-transform": "^1.6.2",
38
40
  "babel-plugin-dynamic-import-node": "^2.3.3",
39
41
  "copy-webpack-plugin": "^12.0.2",
40
42
  "dotenv": "^16.4.5",
43
+ "express-rate-limit": "^7.4.0",
44
+ "extract-zip": "^2.0.0",
45
+ "follow-redirects": "^1.15.6",
41
46
  "fs-extra": "^11.2.0",
42
47
  "ignore-styles": "^5.0.1",
48
+ "json5": "^1.0.2",
49
+ "loader-utils": "^1.4.2",
43
50
  "react-router-dom": "^6.26.0",
44
51
  "readline-sync": "^1.4.10",
45
52
  "styled-components": "^6.1.12",
46
53
  "terser-webpack-plugin": "^5.3.10",
47
- "tmp": "^0.2.1",
48
- "extract-zip": "^2.0.0",
49
- "adm-zip": "^0.5.15",
50
- "afront": "^1.0.5",
51
- "follow-redirects": "^1.15.6"
54
+ "postcss": "^8.4.31",
55
+ "tmp": "^0.2.1"
52
56
  },
53
57
  "devDependencies": {
54
58
  "@babel/cli": "^7.24.8",
@@ -62,14 +66,20 @@
62
66
  "express": "^4.19.2",
63
67
  "html-webpack-plugin": "^5.6.0",
64
68
  "ignore-styles": "^5.0.1",
69
+ "json5": "^1.0.2",
65
70
  "mini-css-extract-plugin": "^2.9.0",
71
+ "patch-package": "^8.0.0",
66
72
  "react": "^18.3.1",
67
73
  "react-dom": "^18.3.1",
68
74
  "style-loader": "^4.0.0",
69
75
  "webpack": "^5.91.0",
70
76
  "webpack-cli": "^5.1.4",
71
77
  "webpack-dev-server": "^5.0.4",
72
- "webpack-node-externals": "^3.0.0"
78
+ "webpack-node-externals": "^3.0.0",
79
+ "postcss": "^8.4.31"
80
+ },
81
+ "resolutions": {
82
+ "loader-utils": "^1.4.2"
73
83
  },
74
84
  "bin": {
75
85
  "afront": "install.js"
package/server.js CHANGED
@@ -1,11 +1,22 @@
1
1
  const express = require("express");
2
2
  const path = require("path");
3
+ const RateLimit = require("express-rate-limit");
3
4
  require("dotenv").config();
4
5
 
5
6
  const app = express();
6
7
  const PORT = process.env.PORT;
7
8
  const HOST = process.env.HOST;
8
9
 
10
+ // Set up rate limiter: maximum of 100 requests per 15 minutes
11
+ const limiter = RateLimit({
12
+ windowMs: 15 * 60 * 1000, // 15 minutes
13
+ max: 100, // max 100 requests per windowMs
14
+ message: "Too many requests from this IP, please try again after 15 minutes",
15
+ });
16
+
17
+ // Apply rate limiter to all requests
18
+ app.use(limiter);
19
+
9
20
  // Serve static files from the build-prod-static directory
10
21
  app.use(express.static(path.join(__dirname, "build-prod-static")));
11
22