2.0.0 • Published 1 year ago

@lo-fi/cli v2.0.0

Weekly downloads
-
License
-
Repository
-
Last release
1 year ago

lo-fi 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.

2.0.0

1 year ago

1.13.2

1 year ago

1.13.1

1 year ago

1.13.0

1 year ago

1.12.1

1 year ago

1.11.2

1 year ago

1.12.0

1 year ago

1.11.1

1 year ago

1.11.0

1 year ago

1.2.0

1 year ago

1.10.2

1 year ago

1.9.1

1 year ago

1.7.3

1 year ago

1.9.0

1 year ago

1.7.2

1 year ago

1.8.0

1 year ago

1.7.1

1 year ago

1.7.0

1 year ago

1.1.6

1 year ago

1.6.0

1 year ago

1.5.1

1 year ago

1.4.2

1 year ago

1.1.5

1 year ago

1.5.0

1 year ago

1.4.1

1 year ago

1.4.0

1 year ago

1.3.0

1 year ago

1.9.5

1 year ago

1.9.4

1 year ago

1.9.3

1 year ago

1.9.2

1 year ago

1.7.4

1 year ago

1.10.1

1 year ago

1.10.0

1 year ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.2.0

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago