nuxt-google-sheets-import 0.1.24 → 0.1.26

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/module.mjs CHANGED
@@ -1,5 +1,6 @@
1
- import { defineNuxtModule, createResolver, extendPages, addServerHandler, addImportsDir, addComponentsDir, addImports, addServerImports, addTemplate } from '@nuxt/kit';
2
- import { existsSync } from 'node:fs';
1
+ import { defineNuxtModule, createResolver, addTemplate, extendPages, addServerHandler, addImportsDir, addComponentsDir, addImports, addServerImports } from '@nuxt/kit';
2
+ import { existsSync, readFileSync } from 'node:fs';
3
+ import { resolve } from 'node:path';
3
4
 
4
5
  const module$1 = defineNuxtModule({
5
6
  meta: {
@@ -14,21 +15,6 @@ const module$1 = defineNuxtModule({
14
15
  "@nuxt/ui": {
15
16
  version: ">=4"
16
17
  }
17
- // 'zod': {
18
- // version: '>=4',
19
- // },
20
- },
21
- onInstall() {
22
- const resolver = createResolver(import.meta.url);
23
- const templatePathTs = resolver.resolve("./runtime/app/examples/googleSheetsImportSchemas.ts");
24
- const templatePathJs = resolver.resolve("./runtime/app/examples/googleSheetsImportSchemas.js");
25
- const templateSource = existsSync(templatePathTs) ? templatePathTs : templatePathJs;
26
- addTemplate({
27
- filename: "googleSheetsImportSchemas",
28
- src: templateSource,
29
- dst: "app/utils/googleSheetsImportSchemas.ts",
30
- write: true
31
- });
32
18
  },
33
19
  defaults: {
34
20
  apiBase: "/api/google-sheets-import",
@@ -37,6 +23,18 @@ const module$1 = defineNuxtModule({
37
23
  },
38
24
  setup(options, nuxt) {
39
25
  const resolver = createResolver(import.meta.url);
26
+ const userSchemaPath = resolve(nuxt.options.rootDir, "app/utils/googleSheetsImportSchemas.ts");
27
+ if (!existsSync(userSchemaPath)) {
28
+ const templatePathTs = resolver.resolve("./runtime/app/examples/googleSheetsImportSchemas.ts");
29
+ const templatePathJs = resolver.resolve("./runtime/app/examples/googleSheetsImportSchemas.js");
30
+ const templateSource = existsSync(templatePathTs) ? templatePathTs : templatePathJs;
31
+ addTemplate({
32
+ filename: "googleSheetsImportSchemas.ts",
33
+ getContents: () => readFileSync(templateSource, "utf8"),
34
+ dst: "app/utils/googleSheetsImportSchemas.ts",
35
+ write: true
36
+ });
37
+ }
40
38
  nuxt.options.runtimeConfig.googleSheetsImport = {
41
39
  ...nuxt.options.runtimeConfig.googleSheetsImport,
42
40
  apiBase: options.apiBase,
@@ -120,7 +118,7 @@ const module$1 = defineNuxtModule({
120
118
  ]);
121
119
  addServerImports([
122
120
  {
123
- from: "~/utils/googleSheetsImportSchemas.ts",
121
+ from: "~/utils/googleSheetsImportSchemas",
124
122
  name: "googleSheetsImportSchemas",
125
123
  as: "googleSheetsImportSchemas"
126
124
  }
@@ -1,4 +1,4 @@
1
- import * as z from 'zod/v4';
1
+ import { z } from 'zod/v4';
2
2
  export declare const googleSheetsImportSchemas: {
3
3
  example: z.ZodObject<{
4
4
  slug: z.ZodString;
@@ -1,4 +1,4 @@
1
- import * as z from "zod/v4";
1
+ import { z } from "zod/v4";
2
2
  const example = z.object({
3
3
  slug: z.string().min(1).max(100),
4
4
  pageOrder: z.coerce.number().int(),
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "nuxt-google-sheets-import",
3
- "version": "0.1.24",
3
+ "version": "0.1.26",
4
4
  "description": "Schema-driven Google Sheets import module for Nuxt Content",
5
5
  "repository": "tribeweb/nuxt-google-sheets-import",
6
6
  "license": "MIT",
7
7
  "type": "module",
8
+ "packageManager": "pnpm@10.32.1",
8
9
  "exports": {
9
10
  ".": {
10
11
  "types": "./dist/types.d.mts",
@@ -22,10 +23,6 @@
22
23
  "files": [
23
24
  "dist"
24
25
  ],
25
- "workspaces": [
26
- "playground",
27
- "docs"
28
- ],
29
26
  "scripts": {
30
27
  "docs:dev": "cd docs && nuxt dev --extends docus",
31
28
  "docs:build": "nuxt build docs --extends docus",
@@ -49,6 +46,9 @@
49
46
  "tailwindcss": "^4.2.1",
50
47
  "zod": "^4.3.6"
51
48
  },
49
+ "peerDependencies": {
50
+ "zod": "^4.3.6"
51
+ },
52
52
  "devDependencies": {
53
53
  "@iconify-json/heroicons": "^1.2.3",
54
54
  "@iconify-json/lucide": "^1.2.95",