create-fate 1.3.1 → 1.3.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-fate",
3
- "version": "1.3.1",
3
+ "version": "1.3.2",
4
4
  "description": "Create a new fate app.",
5
5
  "homepage": "https://github.com/nkzw-tech/fate",
6
6
  "license": "MIT",
@@ -22,7 +22,7 @@
22
22
  ],
23
23
  "type": "module",
24
24
  "dependencies": {
25
- "@clack/prompts": "^1.5.0"
25
+ "@clack/prompts": "^1.7.0"
26
26
  },
27
27
  "engines": {
28
28
  "node": ">=24.0.0"
@@ -17,6 +17,7 @@
17
17
  "prepare:void": "void prepare"
18
18
  },
19
19
  "dependencies": {
20
+ "@lucide/vue": "^1.24.0",
20
21
  "@nkzw/core": "^1.3.1",
21
22
  "@nkzw/define-env": "^1.1.0",
22
23
  "@trpc/client": "^11.17.0",
@@ -25,7 +26,6 @@
25
26
  "clsx": "^2.1.1",
26
27
  "dotenv": "^17.4.2",
27
28
  "graphql-sse": "^2.6.0",
28
- "lucide-vue-next": "^0.561.0",
29
29
  "tailwind-merge": "^3.5.0",
30
30
  "void": "^0.9.2",
31
31
  "vue": "^3.5.24",
@@ -1,6 +1,6 @@
1
1
  <script setup lang="ts">
2
+ import { Search } from '@lucide/vue';
2
3
  import { Link } from '@void/vue';
3
- import { Search } from 'lucide-vue-next';
4
4
  import Button from './Button.vue';
5
5
  </script>
6
6
 
@@ -1,4 +1,4 @@
1
- import { expect, test } from 'vitest';
1
+ import { expect, test } from 'vite-plus/test';
2
2
 
3
3
  test('1 + 1', () => {
4
4
  expect(1 + 1).toBe(2);
@@ -1,4 +1,4 @@
1
- import { expect, test } from 'vitest';
1
+ import { expect, test } from 'vite-plus/test';
2
2
 
3
3
  test('1 + 1', () => {
4
4
  expect(1 + 1).toBe(2);
@@ -1,4 +1,4 @@
1
- import { expect, test } from 'vitest';
1
+ import { expect, test } from 'vite-plus/test';
2
2
 
3
3
  test('1 + 1', () => {
4
4
  expect(1 + 1).toBe(2);
@@ -1,93 +0,0 @@
1
- import SchemaBuilder, {
2
- BasePlugin,
3
- PothosOutputFieldConfig,
4
- PothosTypeConfig,
5
- SchemaTypes,
6
- } from '@pothos/core';
7
- import { FieldAuthScopes, TypeAuthScopes } from '@pothos/plugin-scope-auth';
8
-
9
- declare global {
10
- export namespace PothosSchemaTypes {
11
- export interface Plugins<Types extends SchemaTypes> {
12
- authDirectives: AuthDirectivesPlugin<Types>;
13
- }
14
- }
15
- }
16
-
17
- export class AuthDirectivesPlugin<Types extends SchemaTypes> extends BasePlugin<Types> {
18
- override onOutputFieldConfig(
19
- fieldConfig: PothosOutputFieldConfig<Types>,
20
- ): PothosOutputFieldConfig<Types> | null {
21
- const { authScopes } = fieldConfig.pothosOptions;
22
-
23
- if (!authScopes) {
24
- return fieldConfig;
25
- }
26
-
27
- const scopes = this.#resolveScopes(authScopes);
28
-
29
- return {
30
- ...fieldConfig,
31
- extensions: {
32
- ...fieldConfig.extensions,
33
- directives: {
34
- ...(fieldConfig.extensions?.directives as Record<string, unknown>),
35
- auth: scopes,
36
- },
37
- },
38
- };
39
- }
40
-
41
- override onTypeConfig(typeConfig: PothosTypeConfig): PothosTypeConfig {
42
- if (
43
- typeConfig.kind === 'Enum' ||
44
- typeConfig.kind === 'Scalar' ||
45
- typeConfig.kind === 'InputObject' ||
46
- typeConfig.kind === 'Union' ||
47
- !typeConfig.pothosOptions.authScopes
48
- ) {
49
- return typeConfig;
50
- }
51
-
52
- const scopes = this.#resolveScopes(typeConfig.pothosOptions.authScopes);
53
-
54
- return {
55
- ...typeConfig,
56
- extensions: {
57
- ...typeConfig.extensions,
58
- directives: {
59
- ...(typeConfig.extensions?.directives as Record<string, unknown>),
60
- auth: scopes,
61
- },
62
- },
63
- };
64
- }
65
-
66
- #resolveScopes(
67
- authScopes:
68
- | FieldAuthScopes<Types, object, Record<string, unknown>>
69
- | TypeAuthScopes<SchemaTypes, object>,
70
- ) {
71
- if (typeof authScopes !== 'function') {
72
- return authScopes;
73
- }
74
-
75
- try {
76
- const resolved = authScopes({}, {}, {}, {} as never);
77
-
78
- if (typeof resolved !== 'object' || !resolved) {
79
- return {};
80
- }
81
-
82
- return Object.fromEntries(
83
- Object.entries(resolved).map(([key, value]) => [key, value === undefined ? true : value]),
84
- );
85
- } catch {
86
- return {};
87
- }
88
- }
89
- }
90
-
91
- SchemaBuilder.registerPlugin('authDirectives', AuthDirectivesPlugin);
92
-
93
- export default 'authDirectives';
@@ -1,12 +0,0 @@
1
- export default function decodeGlobalID(globalID: string) {
2
- const separator = globalID.indexOf('-');
3
- if (separator <= 0 || separator >= globalID.length - 1) {
4
- throw new Error(`decodeGlobalID: Invalid global ID '${globalID}'.`);
5
- }
6
- const typename = globalID.slice(0, separator);
7
- const id = globalID.slice(separator + 1);
8
- if (!id) {
9
- throw new Error(`decodeGlobalID: Provided an empty id for '${typename}'.`);
10
- }
11
- return { id, typename };
12
- }
@@ -1,10 +0,0 @@
1
- import PrismaTypes from '../../prisma/pothos-types.ts';
2
- import decodeGlobalID from './decodeGlobalID.tsx';
3
-
4
- export default function decodeIDOrThrow(type: keyof PrismaTypes, globalID: string) {
5
- const { id, typename } = decodeGlobalID(globalID);
6
- if (typename !== type || !id) {
7
- throw new Error(`Expected '${type}' but received '${typename}' with id '${id}'.`);
8
- }
9
- return id;
10
- }
@@ -1,5 +0,0 @@
1
- import PrismaTypes from '../../prisma/pothos-types.ts';
2
-
3
- export default function encodeGlobalID(typename: keyof PrismaTypes, id: string | number | bigint) {
4
- return `${typename}-${id}`;
5
- }