cosmolo 0.3.5 → 0.3.6

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/dist/cli/init.js CHANGED
@@ -42,6 +42,7 @@ function injectPackageScripts(projectRoot) {
42
42
  return;
43
43
  const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'));
44
44
  pkg.scripts = pkg.scripts ?? {};
45
+ pkg.dependencies = pkg.dependencies ?? {};
45
46
  let added = false;
46
47
  const scripts = {
47
48
  'generate:article': 'cosmolo generate article',
@@ -54,9 +55,13 @@ function injectPackageScripts(projectRoot) {
54
55
  added = true;
55
56
  }
56
57
  }
58
+ if (!pkg.dependencies['cosmolo']) {
59
+ pkg.dependencies['cosmolo'] = 'latest';
60
+ added = true;
61
+ }
57
62
  if (added) {
58
63
  fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, '\t') + '\n');
59
- console.log(' updated package.json (added generate:* scripts)');
64
+ console.log(' updated package.json (added cosmolo dependency + generate:* scripts)');
60
65
  }
61
66
  }
62
67
  // ─── main ─────────────────────────────────────────────────────────────────────
@@ -135,20 +140,20 @@ export async function main() {
135
140
  injectPackageScripts(PROJECT_ROOT);
136
141
  // ── Next steps ──────────────────────────────────────────────────────────
137
142
  console.log('\nDone! Next steps:\n');
138
- console.log(' 1. Install cosmolo: npm install cosmolo (or bun add cosmolo)');
143
+ console.log(' 1. Run: bun install');
139
144
  if (isSSG) {
140
- console.log(' 2. Install adapter: npm install -D @sveltejs/adapter-static');
145
+ console.log(' 2. Install adapter: bun add -D @sveltejs/adapter-static');
141
146
  }
142
147
  else {
143
- console.log(' 2. Install adapter: npm install -D @sveltejs/adapter-cloudflare (or your adapter)');
148
+ console.log(' 2. Install adapter: bun add -D @sveltejs/adapter-cloudflare (or your adapter)');
144
149
  }
145
150
  if (mode === 'full') {
146
- console.log(' 3. Install sass: npm install -D sass (SCSS used in Svelte templates)');
147
- console.log(' 4. Run: npm run dev');
151
+ console.log(' 3. Install sass: bun add -D sass (SCSS used in Svelte templates)');
152
+ console.log(' 4. Run: bun dev');
148
153
  }
149
154
  else {
150
155
  console.log(' 3. Add your own +page.svelte files for each route.');
151
- console.log(' 4. Run: npm run dev');
156
+ console.log(' 4. Run: bun dev');
152
157
  }
153
158
  console.log('\n See https://github.com/alcogy/cosmolo for full documentation.\n');
154
159
  }
package/dist/plugin.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import type { Plugin } from 'vite';
2
2
  import type { CosmoloConfig } from './types.js';
3
+ export { resolveConfig } from './config.js';
3
4
  /**
4
5
  * Vite plugin that generates the `cosmolo:content` virtual module.
5
6
  *
package/dist/plugin.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import fs from 'fs';
2
2
  import path from 'path';
3
3
  import { resolveConfig } from './config.js';
4
+ export { resolveConfig } from './config.js';
4
5
  const VIRTUAL_ID = 'cosmolo:content';
5
6
  const RESOLVED_ID = '\0cosmolo:content';
6
7
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cosmolo",
3
- "version": "0.3.5",
3
+ "version": "0.3.6",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "cosmolo": "./dist/cli/index.js"
@@ -1,4 +1,4 @@
1
- import { resolveConfig } from 'cosmolo';
1
+ import { resolveConfig } from 'cosmolo/plugin';
2
2
 
3
3
  const config = resolveConfig({
4
4
  articlesDir: 'src/content/articles',