4.8.2 • Published 4 months ago

@verdant-web/cli v4.8.2

Weekly downloads
-
License
-
Repository
-
Last release
4 months ago

verdant code generator CLI

Generate a client from schema

Beginning with a schema file like this:

const todoCollection = collection({
	name: 'todo',
	primaryKey: 'id',
	fields: {
		id: { type: 'string', indexed: true, unique: true },
		content: {
			type: 'string',
			indexed: false,
			unique: false,
		},
		done: {
			type: 'boolean',
		},
		tags: {
			type: 'array',
			items: {
				type: 'string',
			},
		},
		category: {
			type: 'string',
		},
		attachments: {
			type: 'array',
			items: {
				type: 'object',
				properties: {
					name: {
						type: 'string',
					},
				},
			},
		},
	},
	synthetics: {
		example: {
			type: 'string',
			compute: (doc) => doc.content,
			unique: false,
		},
	},
	compounds: {
		tagsSortedByDone: {
			of: ['tags', 'done'],
		},
		categorySortedByDone: {
			of: ['category', 'done'],
		},
	},
});

export default schema({
	version: 1,
	collections: {
		todo: todoCollection,
	},
});

Point the CLI to the location of your schema file and give it an output directory path to create the client module in.

4.8.2

4 months ago

4.8.1

5 months ago

4.8.0

5 months ago

4.7.3

5 months ago

4.7.2

7 months ago

4.7.1

7 months ago

4.7.1-alpha.0

8 months ago

4.7.0

9 months ago

4.6.2-next.0

9 months ago

4.5.0-next.0

12 months ago

4.5.0

12 months ago

4.4.1

1 year ago

4.6.1

12 months ago

4.6.0

12 months ago

4.4.0

1 year ago

4.3.2

1 year ago

4.3.1

1 year ago

4.3.0

1 year ago

4.2.4

1 year ago

4.2.3

1 year ago

4.2.2

1 year ago

4.2.1

2 years ago

4.2.0

2 years ago

4.2.0-next.0

2 years ago

3.0.0

2 years ago

4.0.5

2 years ago

2.2.1

2 years ago

2.1.2

2 years ago

4.0.4

2 years ago

2.2.0

2 years ago

2.1.1

2 years ago

4.1.0

2 years ago

4.0.1

2 years ago

4.0.0

2 years ago

4.0.3

2 years ago

4.0.2

2 years ago

2.0.3

2 years ago

2.0.2

2 years ago

2.1.0

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago