nuxt-google-sheets-import 0.1.8 → 0.1.9
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.d.mts +4 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +9 -6
- package/dist/runtime/app/components/GoogleSheetsImportExecute.vue +3 -3
- package/dist/runtime/app/examples/googleSheetsImportSchemas.d.ts +29 -0
- package/dist/runtime/app/examples/googleSheetsImportSchemas.js +28 -0
- package/dist/runtime/app/pages/google-sheets-import.vue +3 -4
- package/package.json +1 -1
- package/dist/runtime/app/examples/googleSheetsImportSchemasExample.d.ts +0 -1
- package/dist/runtime/app/examples/googleSheetsImportSchemasExample.js +0 -0
package/dist/module.d.mts
CHANGED
|
@@ -3,6 +3,10 @@ import * as _nuxt_schema from '@nuxt/schema';
|
|
|
3
3
|
interface ModuleOptions {
|
|
4
4
|
apiBase: string;
|
|
5
5
|
defaultContentDir: string;
|
|
6
|
+
googleSheets: Array<{
|
|
7
|
+
id: string;
|
|
8
|
+
label: string;
|
|
9
|
+
}>;
|
|
6
10
|
}
|
|
7
11
|
declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
|
|
8
12
|
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -15,25 +15,28 @@ const module$1 = defineNuxtModule({
|
|
|
15
15
|
},
|
|
16
16
|
defaults: {
|
|
17
17
|
apiBase: "/api/google-sheets-import",
|
|
18
|
-
defaultContentDir: "content/data"
|
|
18
|
+
defaultContentDir: "content/data",
|
|
19
|
+
googleSheets: []
|
|
19
20
|
},
|
|
20
21
|
setup(options, nuxt) {
|
|
21
22
|
const resolver = createResolver(import.meta.url);
|
|
22
23
|
addTemplate({
|
|
23
|
-
filename: "
|
|
24
|
-
src: resolver.resolve("./runtime/app/examples/
|
|
25
|
-
dst: "utils
|
|
24
|
+
filename: "googleSheetsImportSchemas.ts",
|
|
25
|
+
src: resolver.resolve("./runtime/app/examples/googleSheetsImportSchemas.ts"),
|
|
26
|
+
dst: "utils/.googleSheetsImportSchemas.ts",
|
|
26
27
|
write: true
|
|
27
28
|
});
|
|
28
29
|
nuxt.options.runtimeConfig.googleSheetsImport = {
|
|
29
30
|
...nuxt.options.runtimeConfig.googleSheetsImport,
|
|
30
31
|
apiBase: options.apiBase,
|
|
31
|
-
defaultContentDir: options.defaultContentDir
|
|
32
|
+
defaultContentDir: options.defaultContentDir,
|
|
33
|
+
googleSheets: options.googleSheets
|
|
32
34
|
};
|
|
33
35
|
nuxt.options.runtimeConfig.public.googleSheetsImport = {
|
|
34
36
|
...nuxt.options.runtimeConfig.public.googleSheetsImport,
|
|
35
37
|
apiBase: options.apiBase,
|
|
36
|
-
defaultContentDir: options.defaultContentDir
|
|
38
|
+
defaultContentDir: options.defaultContentDir,
|
|
39
|
+
googleSheets: options.googleSheets
|
|
37
40
|
};
|
|
38
41
|
nuxt.options.css.push(resolver.resolve("./runtime/app/assets/css/main.css"));
|
|
39
42
|
extendPages((pages) => {
|
|
@@ -12,9 +12,9 @@ const outputFormatOptions = [
|
|
|
12
12
|
{ label: "YAML (.yml)", value: "yaml" }
|
|
13
13
|
];
|
|
14
14
|
const overwriteModeOptions = [
|
|
15
|
-
{ label: "
|
|
16
|
-
{ label: "
|
|
17
|
-
{ label: "Overwrite
|
|
15
|
+
{ label: "Skip existing files", value: "skip" },
|
|
16
|
+
{ label: "Overwrite frontmatter only (.md files)", value: "overwrite-frontmatter" },
|
|
17
|
+
{ label: "Overwrite all", value: "overwrite" }
|
|
18
18
|
];
|
|
19
19
|
const {
|
|
20
20
|
status,
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const googleSheetsImportSchemas: {
|
|
3
|
+
example: z.ZodObject<{
|
|
4
|
+
slug: z.ZodString;
|
|
5
|
+
pageOrder: z.ZodCoercedNumber<unknown>;
|
|
6
|
+
number: z.ZodCoercedNumber<unknown>;
|
|
7
|
+
string: z.ZodString;
|
|
8
|
+
enumString: z.ZodEnum<{
|
|
9
|
+
foo: "foo";
|
|
10
|
+
bar: "bar";
|
|
11
|
+
baz: "baz";
|
|
12
|
+
}>;
|
|
13
|
+
literalString: z.ZodLiteral<"foo">;
|
|
14
|
+
unionString: z.ZodUnion<readonly [z.ZodLiteral<"foo">, z.ZodLiteral<"bar">]>;
|
|
15
|
+
unionStringArray: z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"foo">, z.ZodLiteral<"bar">]>>;
|
|
16
|
+
exclusiveUnionString: z.ZodXor<readonly [z.ZodLiteral<"foo">, z.ZodLiteral<"bar">]>;
|
|
17
|
+
stringArray: z.ZodArray<z.ZodString>;
|
|
18
|
+
numberArray: z.ZodArray<z.ZodCoercedNumber<unknown>>;
|
|
19
|
+
boolean: z.ZodCoercedBoolean<unknown>;
|
|
20
|
+
object: z.ZodObject<{
|
|
21
|
+
key1: z.ZodString;
|
|
22
|
+
key2: z.ZodString;
|
|
23
|
+
}, z.core.$strip>;
|
|
24
|
+
objectArray: z.ZodArray<z.ZodObject<{
|
|
25
|
+
keyA: z.ZodString;
|
|
26
|
+
keyB: z.ZodString;
|
|
27
|
+
}, z.core.$strip>>;
|
|
28
|
+
}, z.core.$strip>;
|
|
29
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
const example = z.object({
|
|
3
|
+
slug: z.string().min(1).max(100),
|
|
4
|
+
pageOrder: z.coerce.number().int(),
|
|
5
|
+
number: z.coerce.number(),
|
|
6
|
+
string: z.string().min(1).max(100),
|
|
7
|
+
enumString: z.enum(["foo", "bar", "baz"]),
|
|
8
|
+
literalString: z.literal("foo"),
|
|
9
|
+
unionString: z.union([z.literal("foo"), z.literal("bar")]),
|
|
10
|
+
unionStringArray: z.union([z.literal("foo"), z.literal("bar")]).array(),
|
|
11
|
+
exclusiveUnionString: z.xor([z.literal("foo"), z.literal("bar")]),
|
|
12
|
+
stringArray: z.string().array(),
|
|
13
|
+
numberArray: z.coerce.number().array(),
|
|
14
|
+
boolean: z.coerce.boolean(),
|
|
15
|
+
object: z.object({
|
|
16
|
+
key1: z.string().min(1),
|
|
17
|
+
key2: z.string().min(1)
|
|
18
|
+
}),
|
|
19
|
+
objectArray: z.array(
|
|
20
|
+
z.object({
|
|
21
|
+
keyA: z.string().min(1),
|
|
22
|
+
keyB: z.string().min(1)
|
|
23
|
+
})
|
|
24
|
+
)
|
|
25
|
+
});
|
|
26
|
+
export const googleSheetsImportSchemas = {
|
|
27
|
+
example
|
|
28
|
+
};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { ref } from "vue";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
]);
|
|
3
|
+
import { useRuntimeConfig } from "#imports";
|
|
4
|
+
const config = useRuntimeConfig();
|
|
5
|
+
const sheetsList = config.public.googleSheetsImport?.googleSheets ?? [];
|
|
7
6
|
const items = ref([
|
|
8
7
|
{
|
|
9
8
|
label: "Setup Google Sheet",
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
File without changes
|