Skip to content

Commit 91a17de

Browse files
arashagpnjfamirm
andauthored
refactor(eleventy-config)!: migrate to eleventy v3 (#4)
* fix(eleventy): update eleventy in package.json * feat(eleventy): implement build functionality with watch mode support * refactor(eleventy-config): remove unused tsconfig and update package.json paths * feat(eleventy): add date and time formatting utilities and a trim function Co-authored-by: S. Amir Mohammad Najafi <[email protected]> * chore: change extension files * feat: add logger method * chore: change from devDependencies to dependencies * Lint: Make Happy :)) * fix(eleventy-config): remove extra deps * feat: complete setup Co-authored-by: arashagp <[email protected]> * feat(eleventy-config): generate d.dt.s * refactor(eleventy-config): us ts Co-authored-by: arashagp <[email protected]> * fix: review --------- Co-authored-by: S. Amir Mohammad Najafi <[email protected]>
1 parent 5ecb0fa commit 91a17de

15 files changed

+721
-820
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "application-toolkit-monorepo",
33
"private": true,
44
"description": "Necessary library for all ECMAScript (JavaScript/TypeScript) projects.",
5-
"repository": "https://github.com/the-nexim/application-toolkit",
5+
"repository": "https://github.com/the-nexim/web-application-toolkit",
66
"license": "AGPL-3.0-only",
77
"author": "S. Amir Mohammad Najafi <[email protected]> (https://www.njfamirm.ir)",
88
"contributors": [

packages/eleventy-config/README.md

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# @nexim/eleventy-config
2+
3+
![NPM Version](https://img.shields.io/npm/v/%40nexim%2Eeleventy-config)
4+
![npm bundle size](https://img.shields.io/bundlephobia/min/%40nexim%2Eeleventy-config)
5+
![Build & Lint & Test](https://github.com/the-nexim/web-application-toolkit/actions/workflows/build-lint-test.yaml/badge.svg)
6+
![NPM Downloads](https://img.shields.io/npm/dm/%40nexim%2Eeleventy-config)
7+
![NPM License](https://img.shields.io/npm/l/%40nexim%2Eeleventy-config)
8+
9+
## Overview
10+
11+
An optimized, production-ready configuration for the [Eleventy](https://www.11ty.dev/) static site generator tailored for the [Nexim APP Template](https://github.com/the-nexim/nexim-app) structure. This setup ensures efficient Eleventy projects by integrating HTML minification, PostCSS processing, service worker generation, and other performance-focused enhancements for scalable and maintainable web applications.
12+
13+
## Installation
14+
15+
Install the package using npm or yarn:
16+
17+
```sh
18+
npm install @nexim/eleventy-config
19+
20+
# Or using yarn
21+
yarn add @nexim/eleventy-config
22+
```
23+
24+
## API
25+
26+
### eleventyConfiguration
27+
28+
Configures Eleventy with nexim app specification and html minify, postcss, workbox, etc.
29+
30+
```ts
31+
import {eleventyConfiguration} from '@nexim/eleventy-config';
32+
33+
export default function (eleventyConfig) {
34+
return eleventyConfiguration(eleventyConfig);
35+
}
36+
```
37+
38+
> Returning the `eleventyConfiguration` function is necessary to ensure the configuration is applied to the Eleventy instance.
39+
40+
## TODO
41+
42+
- in the future, we will take the customization configuration from the User.
43+
- Separate package for plugins.

packages/eleventy-config/package.json

+42-49
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
{
22
"name": "@nexim/eleventy-config",
3-
"version": "1.0.0",
4-
"description": "Enhanced production ready eleventy config.",
3+
"version": "0.0.0",
4+
"description": "An optimized, production-ready configuration for the Eleventy static site generator tailored for the Nexim APP Template structure. This setup ensures efficient Eleventy projects by integrating HTML minification, PostCSS processing, service worker generation, and other performance-focused enhancements for scalable and maintainable web applications.",
55
"keywords": [
66
"eleventy",
77
"ssg",
8-
"context",
8+
"jamstack",
9+
"config",
910
"typescript",
1011
"nexim"
1112
],
12-
"homepage": "https://github.com/the-nexim/application-toolkit/tree/next/packages/eleventy-config#readme",
13+
"homepage": "https://github.com/the-nexim/web-application-toolkit/tree/next/packages/eleventy-config#readme",
1314
"bugs": {
14-
"url": "https://github.com/the-nexim/application-toolkit/issues"
15+
"url": "https://github.com/the-nexim/web-application-toolkit/issues"
1516
},
1617
"repository": {
1718
"type": "git",
18-
"url": "https://github.com/the-nexim/application-toolkit",
19+
"url": "https://github.com/the-nexim/web-application-toolkit",
1920
"directory": "packages/eleventy-config"
2021
},
2122
"license": "AGPL-3.0-only",
@@ -37,64 +38,65 @@
3738
"files": [
3839
"**/*.{js,mjs,cjs,map,d.ts,html,md,LEGAL.txt}",
3940
"LICENSE",
40-
"!**/*.test.js",
41-
"!demo/**/*"
41+
"!**/*.test.js"
4242
],
4343
"scripts": {
4444
"build": "wireit",
4545
"test": "wireit",
4646
"watch": "wireit"
4747
},
48-
"devDependencies": {
49-
"@11ty/eleventy": "^2.0.1",
48+
"dependencies": {
49+
"@11ty/eleventy": "^3.0.0",
5050
"@11ty/eleventy-plugin-directory-output": "^1.0.1",
51+
"@11ty/eleventy-upgrade-help": "3",
5152
"@alwatr/logger": "^5.0.0",
52-
"@alwatr/nano-build": "^5.0.0",
53-
"@alwatr/type-helper": "^5.0.0",
54-
"@nexim/typescript-config": "^1.0.1",
53+
"@alwatr/package-tracer": "^5.0.0",
54+
"@alwatr/platform-info": "^5.0.0",
5555
"@swc/html": "^1.10.1",
56-
"@types/node": "^22.10.2",
57-
"ava": "^6.2.0",
5856
"cssnano": "^7.0.6",
5957
"markdown-it": "^14.1.0",
6058
"markdown-it-anchor": "^9.2.0",
61-
"markdown-it-attrs": "^4.3.0",
59+
"markdown-it-attrs": "^4.3.1",
6260
"postcss": "^8.4.49",
6361
"postcss-import": "^16.1.0",
6462
"postcss-preset-env": "^10.1.2",
6563
"postcss-variable-compress": "^3.0.0",
6664
"postcss-viewport-unit-fallback": "^1.0.1",
6765
"tailwindcss": "^3.4.17",
68-
"typescript": "^5.7.2",
69-
"wireit": "^0.14.9",
7066
"workbox-build": "^7.3.0"
7167
},
68+
"devDependencies": {
69+
"@alwatr/nano-build": "^5.0.0",
70+
"@alwatr/type-helper": "^5.0.0",
71+
"@nexim/typescript-config": "^1.0.1",
72+
"@types/11ty__eleventy-plugin-directory-output": "^1.0.0",
73+
"@types/eleventy-plugin-toc": "^1.1.0",
74+
"@types/markdown-it": "^14.1.2",
75+
"@types/markdown-it-attrs": "^4.1.3",
76+
"@types/node": "^22.10.2",
77+
"@types/postcss-import": "^14.0.3",
78+
"ava": "^6.2.0",
79+
"typescript": "^5.7.2",
80+
"wireit": "^0.14.9"
81+
},
82+
"peerDependencies": {
83+
"@11ty/eleventy": "^3.0.0"
84+
},
7285
"publishConfig": {
7386
"access": "public"
7487
},
7588
"wireit": {
76-
"build": {
77-
"dependencies": [
78-
"build:11ty"
79-
]
89+
"test": {
90+
"command": "NODE_OPTIONS=\"$NODE_OPTIONS --enable-source-maps --experimental-vm-modules\" ava"
8091
},
81-
"build:11ty": {
82-
"command": "yarn node script/build.mjs",
83-
"files": [
84-
"site",
85-
"assets",
86-
"dist/es"
87-
],
88-
"output": [
89-
"dist",
90-
"!dist/es"
91-
],
92+
"build": {
9293
"dependencies": [
94+
"build:type",
9395
"build:es"
9496
]
9597
},
9698
"build:es": {
97-
"command": "nano-build --preset=weaver",
99+
"command": "nano-build --preset=module",
98100
"files": [
99101
"src",
100102
"tsconfig.json"
@@ -105,31 +107,22 @@
105107
"tsconfig.tsbuildinfo"
106108
]
107109
},
108-
"serve": {
109-
"command": "wds",
110-
"service": true
111-
},
112-
"start": {
113-
"dependencies": [
114-
"build",
115-
"serve"
116-
]
110+
"build:type": {
111+
"command": "tsc --build"
117112
},
118113
"watch": {
119114
"dependencies": [
120-
"watch:11ty",
121-
"serve"
115+
"watch:ts"
122116
]
123117
},
124-
"watch:11ty": {
125-
"command": "yarn run build:11ty -- --watch",
126-
"service": true,
118+
"watch:ts": {
119+
"command": "tsc --build --watch --preserveWatchOutput",
127120
"dependencies": [
128121
"watch:es"
129122
]
130123
},
131124
"watch:es": {
132-
"command": "yarn run build:es -- --watch",
125+
"command": "nano-build --preset=module -- --watch",
133126
"service": true
134127
}
135128
}

packages/eleventy-config/src/lib/eleventy-config.mjs

-157
This file was deleted.

0 commit comments

Comments
 (0)