vite-wp 0.1.0 → 0.1.2
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 +2 -2
- package/dist/cli.js +5 -5
- package/dist/commands/init.js +3 -3
- package/package.json +2 -2
- package/starter/astro.config.mjs +1 -1
- package/starter/src/live.config.ts +1 -1
- package/starter/vitewp.config.ts +1 -1
package/README.md
CHANGED
|
@@ -25,8 +25,8 @@ ViteWP is bring-your-own database. It does not start MySQL for you.
|
|
|
25
25
|
mkdir my-site
|
|
26
26
|
cd my-site
|
|
27
27
|
npm init -y
|
|
28
|
-
npm install
|
|
29
|
-
npx
|
|
28
|
+
npm install vite-wp astro typescript @astrojs/check
|
|
29
|
+
npx vite-wp init
|
|
30
30
|
cp .env.example .env
|
|
31
31
|
npm run dev
|
|
32
32
|
```
|
package/dist/cli.js
CHANGED
|
@@ -32,9 +32,9 @@ switch (command) {
|
|
|
32
32
|
process.exitCode = 1;
|
|
33
33
|
}
|
|
34
34
|
function printHelp() {
|
|
35
|
-
console.log(`
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
console.log(`vite-wp\n\nUsage:\n vite-wp init Copy starter project files into the current directory
|
|
36
|
+
vite-wp dev Start the local WordPress + Astro development runtime
|
|
37
|
+
vite-wp doctor Check the current project setup
|
|
38
|
+
vite-wp types Generate TypeScript types from WordPress metadata
|
|
39
|
+
vite-wp smoke Verify the running ViteWP dev runtime\n`);
|
|
40
40
|
}
|
package/dist/commands/init.js
CHANGED
|
@@ -47,9 +47,9 @@ function updatePackageJson(root) {
|
|
|
47
47
|
: { private: true, type: 'module' };
|
|
48
48
|
packageJson.type ??= 'module';
|
|
49
49
|
packageJson.scripts ??= {};
|
|
50
|
-
packageJson.scripts.dev ??= '
|
|
51
|
-
packageJson.scripts.doctor ??= '
|
|
52
|
-
packageJson.scripts.types ??= '
|
|
50
|
+
packageJson.scripts.dev ??= 'vite-wp dev';
|
|
51
|
+
packageJson.scripts.doctor ??= 'vite-wp doctor';
|
|
52
|
+
packageJson.scripts.types ??= 'vite-wp types';
|
|
53
53
|
packageJson.scripts.check ??= 'astro check';
|
|
54
54
|
writeFileSync(file, `${JSON.stringify(packageJson, null, 2)}\n`, 'utf8');
|
|
55
55
|
}
|
package/package.json
CHANGED
package/starter/astro.config.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineLiveCollection } from 'astro/content/config';
|
|
2
|
-
import { wpMenuLoader, wpPostTypeLoader, wpRouteLoader } from '
|
|
2
|
+
import { wpMenuLoader, wpPostTypeLoader, wpRouteLoader } from 'vite-wp/content';
|
|
3
3
|
import { wpContentItemSchema, wpMenuSchema, wpResolvedRouteSchema } from './wordpress/schemas.js';
|
|
4
4
|
|
|
5
5
|
export const collections = {
|
package/starter/vitewp.config.ts
CHANGED