@content-collections/vite 0.2.7 → 0.2.8
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/.turbo/turbo-build.log +10 -12
- package/CHANGELOG.md +7 -0
- package/dist/index.d.ts +6 -5
- package/dist/index.js +46 -76
- package/package.json +6 -6
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
|
|
2
|
-
> @content-collections/vite@0.2.
|
|
3
|
-
>
|
|
2
|
+
> @content-collections/vite@0.2.8 build /home/runner/work/content-collections/content-collections/packages/vite
|
|
3
|
+
> tsdown src/index.ts --format esm --dts -d dist
|
|
4
4
|
|
|
5
|
-
[
|
|
6
|
-
[
|
|
7
|
-
[
|
|
8
|
-
[
|
|
9
|
-
[
|
|
10
|
-
[
|
|
11
|
-
[
|
|
12
|
-
[
|
|
13
|
-
[32mDTS[39m ⚡️ Build success in 3371ms
|
|
14
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[32m279.00 B[39m
|
|
5
|
+
[34mℹ[39m tsdown [2mv0.15.12[22m powered by rolldown [2mv1.0.0-beta.45[22m
|
|
6
|
+
[34mℹ[39m entry: [34msrc/index.ts[39m
|
|
7
|
+
[34mℹ[39m tsconfig: [34mtsconfig.json[39m
|
|
8
|
+
[34mℹ[39m Build start
|
|
9
|
+
[34mℹ[39m [2mdist/[22m[1mindex.js[22m [2m1.78 kB[22m [2m│ gzip: 0.66 kB[22m
|
|
10
|
+
[34mℹ[39m [2mdist/[22m[32m[1mindex.d.ts[22m[39m [2m0.31 kB[22m [2m│ gzip: 0.21 kB[22m
|
|
11
|
+
[34mℹ[39m 2 files, total: 2.08 kB
|
|
12
|
+
[32m✔[39m Build complete in [32m4247ms[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @content-collections/vite
|
|
2
2
|
|
|
3
|
+
## 0.2.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`92abb38`](https://github.com/sdorra/content-collections/commit/92abb380a8c39c558a5fc10ac347008b8a4ceb03)]:
|
|
8
|
+
- @content-collections/integrations@0.4.0
|
|
9
|
+
|
|
3
10
|
## 0.2.7
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Plugin, UserConfig } from "vite";
|
|
2
2
|
|
|
3
|
+
//#region src/index.d.ts
|
|
3
4
|
type Options = {
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
configPath: string;
|
|
6
|
+
isEnabled?: (config: UserConfig) => boolean;
|
|
6
7
|
};
|
|
7
8
|
declare function contentCollectionsPlugin(options?: Partial<Options>): Plugin;
|
|
8
|
-
|
|
9
|
-
export {
|
|
9
|
+
//#endregion
|
|
10
|
+
export { Options, contentCollectionsPlugin as default };
|
package/dist/index.js
CHANGED
|
@@ -1,83 +1,53 @@
|
|
|
1
|
-
// src/index.ts
|
|
2
1
|
import { createBuilder } from "@content-collections/core";
|
|
3
2
|
import { configureLogging } from "@content-collections/integrations";
|
|
4
3
|
import path from "node:path";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
};
|
|
4
|
+
|
|
5
|
+
//#region src/index.ts
|
|
6
|
+
const defaultOptions = { configPath: "content-collections.ts" };
|
|
8
7
|
function resolveConfigPath(root, configPath) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
return configPath;
|
|
8
|
+
if (!path.isAbsolute(configPath)) configPath = path.resolve(root, configPath);
|
|
9
|
+
return configPath;
|
|
13
10
|
}
|
|
14
11
|
function contentCollectionsPlugin(options = {}) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
let configPath = resolveConfigPath(config.root, pluginOptions.configPath);
|
|
55
|
-
console.log(
|
|
56
|
-
"Starting content-collections with config",
|
|
57
|
-
path.relative(process.cwd(), configPath)
|
|
58
|
-
);
|
|
59
|
-
builder = await createBuilder(configPath);
|
|
60
|
-
configureLogging(builder);
|
|
61
|
-
return;
|
|
62
|
-
},
|
|
63
|
-
async buildStart() {
|
|
64
|
-
if (!builder) {
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
console.log("Start initial build");
|
|
68
|
-
await builder.build();
|
|
69
|
-
return;
|
|
70
|
-
},
|
|
71
|
-
async configureServer() {
|
|
72
|
-
if (!builder) {
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
console.log("Start watching");
|
|
76
|
-
builder.watch();
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
};
|
|
12
|
+
const pluginOptions = {
|
|
13
|
+
...defaultOptions,
|
|
14
|
+
...options
|
|
15
|
+
};
|
|
16
|
+
let builder;
|
|
17
|
+
function isEnabled(config) {
|
|
18
|
+
return options.isEnabled ? options.isEnabled(config) : true;
|
|
19
|
+
}
|
|
20
|
+
return {
|
|
21
|
+
name: "content-collections",
|
|
22
|
+
config(config) {
|
|
23
|
+
let configPath = resolveConfigPath(config.root || process.cwd(), pluginOptions.configPath);
|
|
24
|
+
const directory = path.resolve(path.dirname(configPath), "./.content-collections/generated");
|
|
25
|
+
const configPatch = {
|
|
26
|
+
optimizeDeps: { exclude: ["content-collections"] },
|
|
27
|
+
resolve: { alias: { "content-collections": directory } }
|
|
28
|
+
};
|
|
29
|
+
if ((config.server?.fs?.allow || []).length > 0) configPatch.server = { fs: { allow: [directory] } };
|
|
30
|
+
return configPatch;
|
|
31
|
+
},
|
|
32
|
+
async configResolved(config) {
|
|
33
|
+
if (!isEnabled(config)) return;
|
|
34
|
+
let configPath = resolveConfigPath(config.root, pluginOptions.configPath);
|
|
35
|
+
console.log("Starting content-collections with config", path.relative(process.cwd(), configPath));
|
|
36
|
+
builder = await createBuilder(configPath);
|
|
37
|
+
configureLogging(builder);
|
|
38
|
+
},
|
|
39
|
+
async buildStart() {
|
|
40
|
+
if (!builder) return;
|
|
41
|
+
console.log("Start initial build");
|
|
42
|
+
await builder.build();
|
|
43
|
+
},
|
|
44
|
+
async configureServer() {
|
|
45
|
+
if (!builder) return;
|
|
46
|
+
console.log("Start watching");
|
|
47
|
+
builder.watch();
|
|
48
|
+
}
|
|
49
|
+
};
|
|
80
50
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
};
|
|
51
|
+
|
|
52
|
+
//#endregion
|
|
53
|
+
export { contentCollectionsPlugin as default };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@content-collections/vite",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.8",
|
|
5
5
|
"description": "Use content-collections with Vite",
|
|
6
6
|
"author": "Sebastian Sdorra <s.sdorra@gmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -22,20 +22,20 @@
|
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@content-collections/integrations": "0.
|
|
25
|
+
"@content-collections/integrations": "0.4.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/node": "20.x",
|
|
29
|
-
"
|
|
29
|
+
"tsdown": "^0.15.12",
|
|
30
30
|
"typescript": "^5.5.4",
|
|
31
|
-
"vite": "^5.4.
|
|
32
|
-
"@content-collections/core": "0.
|
|
31
|
+
"vite": "^5.4.21",
|
|
32
|
+
"@content-collections/core": "0.13.0"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"@content-collections/core": "^0.x",
|
|
36
36
|
"vite": "^5 || ^6 || ^7"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|
|
39
|
-
"build": "
|
|
39
|
+
"build": "tsdown src/index.ts --format esm --dts -d dist"
|
|
40
40
|
}
|
|
41
41
|
}
|