coralite-scripts 0.28.3 → 0.28.4
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 +29 -15
- package/dist/libs/config.d.ts +6 -2
- package/dist/libs/config.d.ts.map +1 -1
- package/dist/types/index.d.ts +18 -0
- package/dist/types/index.d.ts.map +1 -1
- package/libs/config.js +6 -2
- package/package.json +1 -1
- package/types/index.js +8 -0
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# Coralite
|
|
1
|
+
# Coralite Scripts
|
|
2
2
|
|
|
3
|
-
Welcome to **Coralite
|
|
3
|
+
Welcome to **Coralite Scripts**, a lightweight script toolset for building and serving Coralite applications. This guide walks you through setting up your local development environment using the provided `coralite-scripts` package and configuration files.
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -12,8 +12,8 @@ Coralite expects a standard folder layout:
|
|
|
12
12
|
my-coralite-site/
|
|
13
13
|
├── src/
|
|
14
14
|
│ ├── pages/ # Your page components (e.g., `about.html`, `index.html`)
|
|
15
|
-
│ ├── scss/ # SCSS/Sass styles
|
|
16
|
-
│ └── components/
|
|
15
|
+
│ ├── scss/ # SCSS/Sass/CSS styles
|
|
16
|
+
│ └── components/ # Reusable component files
|
|
17
17
|
├── public/ # Static assets (CSS, JS, images)
|
|
18
18
|
├── dist/ # Output directory for built site (auto-generated)
|
|
19
19
|
├── coralite.config.js # Configuration file
|
|
@@ -34,13 +34,26 @@ export default defineConfig({
|
|
|
34
34
|
public: 'public',
|
|
35
35
|
pages: 'src/pages',
|
|
36
36
|
components: 'src/components',
|
|
37
|
-
|
|
37
|
+
styles: {
|
|
38
|
+
type: 'scss', // can be 'scss', 'sass', or 'css'
|
|
38
39
|
input: 'src/scss'
|
|
39
|
-
}
|
|
40
|
+
},
|
|
41
|
+
// Optional: copy static assets from other packages
|
|
42
|
+
assets: [
|
|
43
|
+
{ pkg: 'some-package', path: 'dist/asset.js', dest: 'assets/asset.js' }
|
|
44
|
+
],
|
|
45
|
+
// Optional: ignore processing elements with specific attributes
|
|
46
|
+
ignoreByAttribute: [
|
|
47
|
+
{ name: 'data-ignore', value: 'true' }
|
|
48
|
+
],
|
|
49
|
+
// Optional: skip rendering elements with specific attributes
|
|
50
|
+
skipRenderByAttribute: [
|
|
51
|
+
{ name: 'data-skip', value: 'true' }
|
|
52
|
+
]
|
|
40
53
|
})
|
|
41
54
|
```
|
|
42
55
|
|
|
43
|
-
> This tells Coralite where to find your source files, compile CSS from SCSS, and serve static assets.
|
|
56
|
+
> This tells Coralite where to find your source files, compile CSS from SCSS/Sass/CSS, and serve static assets. It also sets up advanced features like copying static assets or ignoring/skipping rendering of specific elements based on attributes.
|
|
44
57
|
|
|
45
58
|
---
|
|
46
59
|
|
|
@@ -48,10 +61,11 @@ export default defineConfig({
|
|
|
48
61
|
|
|
49
62
|
Update your `package.json` scripts to include:
|
|
50
63
|
|
|
51
|
-
```json
|
|
64
|
+
```json
|
|
52
65
|
{
|
|
53
66
|
"scripts": {
|
|
54
|
-
"start": "coralite-
|
|
67
|
+
"start": "coralite-scripts start",
|
|
68
|
+
"build": "coralite-scripts build"
|
|
55
69
|
}
|
|
56
70
|
}
|
|
57
71
|
```
|
|
@@ -62,7 +76,7 @@ Then start the dev server:
|
|
|
62
76
|
npm run start
|
|
63
77
|
```
|
|
64
78
|
|
|
65
|
-
>
|
|
79
|
+
> The server runs on `http://localhost:3000` by default.
|
|
66
80
|
|
|
67
81
|
---
|
|
68
82
|
|
|
@@ -72,7 +86,7 @@ Coralite provides real-time development workflows out of the box:
|
|
|
72
86
|
|
|
73
87
|
| Feature | How It Works |
|
|
74
88
|
|-------|-------------|
|
|
75
|
-
| **Live Reload** | Automatically reloads browser when any `.html`, `.scss`, or `.
|
|
89
|
+
| **Live Reload** | Automatically reloads browser when any `.html`, `.scss`, `.sass`, or `.css` file changes. |
|
|
76
90
|
| **Hot CSS Updates** | Sass/SCSS files are compiled instantly and injected into your page via Server-Sent Events (SSE). |
|
|
77
91
|
| **File Watching** | Monitors `src/pages`, `src/scss`, `public`, and `src/components`. |
|
|
78
92
|
| **Dev Logs** | Shows real-time build times, file changes, and status codes in terminal. |
|
|
@@ -82,8 +96,8 @@ Coralite provides real-time development workflows out of the box:
|
|
|
82
96
|
## How it works under the hood
|
|
83
97
|
|
|
84
98
|
- **Routing**: `/` → `index.html`, `/about` → `about.html`
|
|
85
|
-
- **HTML Compilation**: Pages are compiled with embedded live reload scripts.
|
|
86
|
-
- **Sass Support**: `.scss
|
|
99
|
+
- **HTML Compilation**: Pages are compiled with embedded live reload scripts during development.
|
|
100
|
+
- **Sass/CSS Support**: `.scss`, `.sass`, or `.css` files are auto-compiled to CSS in `dist/css`.
|
|
87
101
|
- **Server-Sent Events (SSE)**: Used for real-time updates without full page refresh.
|
|
88
102
|
|
|
89
103
|
> No extra tooling needed — everything is built-in!
|
|
@@ -109,6 +123,6 @@ Coralite provides real-time development workflows out of the box:
|
|
|
109
123
|
|
|
110
124
|
---
|
|
111
125
|
|
|
112
|
-
> **Feedback?** Found a bug or want a feature? Open an issue!
|
|
126
|
+
> **Feedback?** Found a bug or want a feature? [Open an issue](https://codeberg.org/tjdavid/coralite/issues) on our Codeberg repository!
|
|
113
127
|
|
|
114
|
-
Happy building with Coralite!
|
|
128
|
+
Happy building with Coralite!
|
package/dist/libs/config.d.ts
CHANGED
|
@@ -19,9 +19,13 @@
|
|
|
19
19
|
* server: {
|
|
20
20
|
* port: 3000
|
|
21
21
|
* },
|
|
22
|
-
*
|
|
22
|
+
* styles: {
|
|
23
|
+
* type: 'scss',
|
|
23
24
|
* input: './src/styles/main.scss'
|
|
24
|
-
* }
|
|
25
|
+
* },
|
|
26
|
+
* assets: [
|
|
27
|
+
* { pkg: 'some-package', path: 'dist/asset.js', dest: 'assets/asset.js' }
|
|
28
|
+
* ]
|
|
25
29
|
* })
|
|
26
30
|
* ```
|
|
27
31
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../libs/config.js"],"names":[],"mappings":"AAKA
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../libs/config.js"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,sCAzBW,oBAAoB,GAClB,oBAAoB,CA+HhC;0CA1IsC,mBAAmB"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,10 +1,28 @@
|
|
|
1
1
|
declare const _default: {};
|
|
2
2
|
export default _default;
|
|
3
|
+
export type CoraliteStaticAsset = {
|
|
4
|
+
/**
|
|
5
|
+
* - The package name to copy assets from.
|
|
6
|
+
*/
|
|
7
|
+
pkg: string;
|
|
8
|
+
/**
|
|
9
|
+
* - The path to the asset within the package.
|
|
10
|
+
*/
|
|
11
|
+
path: string;
|
|
12
|
+
/**
|
|
13
|
+
* - The destination path for the asset in the output directory.
|
|
14
|
+
*/
|
|
15
|
+
dest: string;
|
|
16
|
+
};
|
|
3
17
|
export type CoraliteScriptBaseConfig = {
|
|
4
18
|
/**
|
|
5
19
|
* - The path to the directory containing static assets.
|
|
6
20
|
*/
|
|
7
21
|
public: string;
|
|
22
|
+
/**
|
|
23
|
+
* - Static assets to copy during build.
|
|
24
|
+
*/
|
|
25
|
+
assets?: CoraliteStaticAsset[];
|
|
8
26
|
/**
|
|
9
27
|
* - Server configuration options.
|
|
10
28
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../types/index.js"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../types/index.js"],"names":[],"mappings":";;;;;;SAOc,MAAM;;;;UACN,MAAM;;;;UACN,MAAM;;;;;;YAKN,MAAM;;;;aACN,mBAAmB,EAAE;;;;aAEhC;QAA0B,IAAI,EAAnB,MAAM;KACjB;aACA;QAA2C,IAAI,EAApC,KAAK,GAAG,MAAM,GAAG,MAAM;QACR,KAAK,EAApB,MAAM;KACjB;;;;kBAAW,QAAQ,OAAO,CAAC;;;;iBAChB,OAAO,SAAS,EAAE,cAAc,EAAE;;;;WAClC,YAAY,GAAG,aAAa;;mCAI7B,wBAAwB,GAAG,cAAc;;;;;UAKxC,OAAO;;;;YACP,OAAO;;;;cACP,OAAO;;6BAhCK,MAAM;oCADC,gBAAgB"}
|
package/libs/config.js
CHANGED
|
@@ -24,9 +24,13 @@ import { staticAssetPlugin } from 'coralite/plugins'
|
|
|
24
24
|
* server: {
|
|
25
25
|
* port: 3000
|
|
26
26
|
* },
|
|
27
|
-
*
|
|
27
|
+
* styles: {
|
|
28
|
+
* type: 'scss',
|
|
28
29
|
* input: './src/styles/main.scss'
|
|
29
|
-
* }
|
|
30
|
+
* },
|
|
31
|
+
* assets: [
|
|
32
|
+
* { pkg: 'some-package', path: 'dist/asset.js', dest: 'assets/asset.js' }
|
|
33
|
+
* ]
|
|
30
34
|
* })
|
|
31
35
|
* ```
|
|
32
36
|
*/
|
package/package.json
CHANGED
package/types/index.js
CHANGED
|
@@ -3,9 +3,17 @@
|
|
|
3
3
|
* @import {Options} from 'sass'
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* @typedef {Object} CoraliteStaticAsset
|
|
8
|
+
* @property {string} pkg - The package name to copy assets from.
|
|
9
|
+
* @property {string} path - The path to the asset within the package.
|
|
10
|
+
* @property {string} dest - The destination path for the asset in the output directory.
|
|
11
|
+
*/
|
|
12
|
+
|
|
6
13
|
/**
|
|
7
14
|
* @typedef {Object} CoraliteScriptBaseConfig
|
|
8
15
|
* @property {string} public - The path to the directory containing static assets.
|
|
16
|
+
* @property {CoraliteStaticAsset[]} [assets] - Static assets to copy during build.
|
|
9
17
|
* @property {Object} [server] - Server configuration options.
|
|
10
18
|
* @property {number} server.port - The port number on which the development server will run.
|
|
11
19
|
* @property {Object} [styles]
|