coralite-scripts 0.18.2 → 0.18.3
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/package.json +4 -11
- package/types/index.js +2 -0
- package/dist/libs/config.d.ts +0 -33
- package/dist/libs/config.d.ts.map +0 -1
- package/dist/libs/index.d.ts +0 -2
- package/dist/libs/index.d.ts.map +0 -1
- package/dist/libs/index.js +0 -42
- package/dist/types/index.d.ts +0 -42
- package/dist/types/index.d.ts.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "coralite-scripts",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.3",
|
|
4
4
|
"description": "Configuration and scripts for Create Coralite.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -16,8 +16,7 @@
|
|
|
16
16
|
"files": [
|
|
17
17
|
"bin",
|
|
18
18
|
"libs",
|
|
19
|
-
"types"
|
|
20
|
-
"dist"
|
|
19
|
+
"types"
|
|
21
20
|
],
|
|
22
21
|
"homepage": "https://coralite.io/docs/create-scripts",
|
|
23
22
|
"author": {
|
|
@@ -34,8 +33,7 @@
|
|
|
34
33
|
},
|
|
35
34
|
"exports": {
|
|
36
35
|
".": {
|
|
37
|
-
"
|
|
38
|
-
"default": "./dist/libs/index.js"
|
|
36
|
+
"default": "./libs/index.js"
|
|
39
37
|
},
|
|
40
38
|
"./types": {
|
|
41
39
|
"default": "./types/index.js"
|
|
@@ -45,17 +43,12 @@
|
|
|
45
43
|
"dependencies": {
|
|
46
44
|
"chokidar": "^4.0.3",
|
|
47
45
|
"commander": "^14.0.0",
|
|
48
|
-
"coralite": "^0.18.
|
|
46
|
+
"coralite": "^0.18.3",
|
|
49
47
|
"express": "^5.1.0",
|
|
50
48
|
"html-validate": "^10.0.0",
|
|
51
49
|
"kleur": "^4.1.5",
|
|
52
50
|
"local-access": "^1.1.0",
|
|
53
51
|
"postcss": "^8.5.6",
|
|
54
52
|
"sass": "^1.91.0"
|
|
55
|
-
},
|
|
56
|
-
"scripts": {
|
|
57
|
-
"build": "premove dist && pnpm build-lib && pnpm build-types",
|
|
58
|
-
"build-lib": "esbuild ./libs/index.js --bundle --format=esm --outdir=dist/libs --platform=node",
|
|
59
|
-
"build-types": "tsc"
|
|
60
53
|
}
|
|
61
54
|
}
|
package/types/index.js
CHANGED
package/dist/libs/config.d.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @import {CoraliteScriptConfig} from '../types/index.js'
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Defines the Coralite configuration for the project.
|
|
6
|
-
*
|
|
7
|
-
* This function validates and returns the provided configuration object,
|
|
8
|
-
* ensuring it conforms to the expected structure for a Coralite script setup.
|
|
9
|
-
*
|
|
10
|
-
* @param {CoraliteScriptConfig} options - The configuration options for Coralite
|
|
11
|
-
* @returns {CoraliteScriptConfig} The validated configuration object
|
|
12
|
-
*
|
|
13
|
-
* @example
|
|
14
|
-
* ```js
|
|
15
|
-
* import { defineConfig } from 'coralite-scripts'
|
|
16
|
-
*
|
|
17
|
-
* export default defineConfig({
|
|
18
|
-
* output: './dist',
|
|
19
|
-
* templates: './src/templates',
|
|
20
|
-
* pages: './src/pages',
|
|
21
|
-
* public: './public',
|
|
22
|
-
* server: {
|
|
23
|
-
* port: 3000
|
|
24
|
-
* },
|
|
25
|
-
* sass: {
|
|
26
|
-
* input: './src/styles/main.scss'
|
|
27
|
-
* }
|
|
28
|
-
* })
|
|
29
|
-
* ```
|
|
30
|
-
*/
|
|
31
|
-
export function defineConfig(options: CoraliteScriptConfig): CoraliteScriptConfig;
|
|
32
|
-
import type { CoraliteScriptConfig } from '../types/index.js';
|
|
33
|
-
//# sourceMappingURL=config.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../libs/config.js"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,sCArBW,oBAAoB,GAClB,oBAAoB,CAuEhC;0CAjFsC,mBAAmB"}
|
package/dist/libs/index.d.ts
DELETED
package/dist/libs/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../libs/index.js"],"names":[],"mappings":""}
|
package/dist/libs/index.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
// libs/config.js
|
|
2
|
-
function defineConfig(options) {
|
|
3
|
-
if (!options || typeof options !== "object") {
|
|
4
|
-
throw new Error("Configuration must be a valid object");
|
|
5
|
-
}
|
|
6
|
-
if (!options.output || typeof options.output !== "string") {
|
|
7
|
-
throw new Error('Configuration must contain a valid "output" property');
|
|
8
|
-
}
|
|
9
|
-
if (!options.templates || typeof options.templates !== "string") {
|
|
10
|
-
throw new Error('Configuration must contain a valid "templates" property');
|
|
11
|
-
}
|
|
12
|
-
if (!options.pages || typeof options.pages !== "string") {
|
|
13
|
-
throw new Error('Configuration must contain a valid "pages" property');
|
|
14
|
-
}
|
|
15
|
-
if (options.server && typeof options.server !== "object") {
|
|
16
|
-
throw new Error('Configuration "server" must be an object');
|
|
17
|
-
}
|
|
18
|
-
if (options.server?.port && (typeof options.server.port !== "number" || options.server.port <= 0)) {
|
|
19
|
-
throw new Error('Configuration "server.port" must be a positive number');
|
|
20
|
-
}
|
|
21
|
-
if (options.styles && typeof options.styles !== "object") {
|
|
22
|
-
throw new Error('Configuration "styles" must be an object');
|
|
23
|
-
}
|
|
24
|
-
if (options.styles?.input && typeof options.styles.input !== "string") {
|
|
25
|
-
throw new Error('Configuration "styles.input" must be a string');
|
|
26
|
-
}
|
|
27
|
-
if (options.styles?.type) {
|
|
28
|
-
const type = options.styles.type;
|
|
29
|
-
if (typeof type !== "string") {
|
|
30
|
-
throw new Error('Configuration "styles.type" must be a string');
|
|
31
|
-
} else if (type !== "css" && type !== "sass" && type !== "scss") {
|
|
32
|
-
throw new Error('Configuration "styles.type" must be equal to either "css", "sass" or "scss" but found: ' + type);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
if (!options.public || typeof options.public !== "string") {
|
|
36
|
-
throw new Error('Configuration must contain a valid "public" property');
|
|
37
|
-
}
|
|
38
|
-
return options;
|
|
39
|
-
}
|
|
40
|
-
export {
|
|
41
|
-
defineConfig
|
|
42
|
-
};
|
package/dist/types/index.d.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
export type CoraliteScriptBaseConfig = {
|
|
2
|
-
/**
|
|
3
|
-
* - The path to the directory containing static assets.
|
|
4
|
-
*/
|
|
5
|
-
public: string;
|
|
6
|
-
/**
|
|
7
|
-
* - Server configuration options.
|
|
8
|
-
*/
|
|
9
|
-
server?: {
|
|
10
|
-
port: number;
|
|
11
|
-
};
|
|
12
|
-
styles?: {
|
|
13
|
-
type: "css" | "sass" | "scss";
|
|
14
|
-
input: string;
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* - Additional options passed to the Sass compiler.
|
|
18
|
-
*/
|
|
19
|
-
sassOptions?: Options<"async">;
|
|
20
|
-
/**
|
|
21
|
-
* - Postcss plugins.
|
|
22
|
-
*/
|
|
23
|
-
cssPlugins?: import("postcss").AcceptedPlugin[];
|
|
24
|
-
};
|
|
25
|
-
export type CoraliteScriptConfig = CoraliteScriptBaseConfig & CoraliteConfig;
|
|
26
|
-
export type CoraliteScriptOptions = {
|
|
27
|
-
/**
|
|
28
|
-
* - Start development server with hot-reloading
|
|
29
|
-
*/
|
|
30
|
-
dev?: boolean;
|
|
31
|
-
/**
|
|
32
|
-
* - Build coralite site for production deployment
|
|
33
|
-
*/
|
|
34
|
-
build?: boolean;
|
|
35
|
-
/**
|
|
36
|
-
* - Enable verbose logging output
|
|
37
|
-
*/
|
|
38
|
-
verbose?: boolean;
|
|
39
|
-
};
|
|
40
|
-
import type { Options } from 'sass';
|
|
41
|
-
import type { CoraliteConfig } from 'coralite/types';
|
|
42
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../types/index.js"],"names":[],"mappings":";;;;YAOc,MAAM;;;;aAEjB;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;;mCAInC,wBAAwB,GAAG,cAAc;;;;;UAKxC,OAAO;;;;YACP,OAAO;;;;cACP,OAAO;;6BAvBK,MAAM;oCADC,gBAAgB"}
|