2.0.0 • Published 2 years ago

@lo-fi/cli v2.0.0

Weekly downloads
-
License
-
Repository
-
Last release
2 years 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

2 years ago

1.13.2

2 years ago

1.13.1

2 years ago

1.13.0

2 years ago

1.12.1

2 years ago

1.11.2

2 years ago

1.12.0

2 years ago

1.11.1

2 years ago

1.11.0

2 years ago

1.2.0

3 years ago

1.10.2

2 years ago

1.9.1

3 years ago

1.7.3

3 years ago

1.9.0

3 years ago

1.7.2

3 years ago

1.8.0

3 years ago

1.7.1

3 years ago

1.7.0

3 years ago

1.1.6

3 years ago

1.6.0

3 years ago

1.5.1

3 years ago

1.4.2

3 years ago

1.1.5

3 years ago

1.5.0

3 years ago

1.4.1

3 years ago

1.4.0

3 years ago

1.3.0

3 years ago

1.9.5

3 years ago

1.9.4

3 years ago

1.9.3

3 years ago

1.9.2

3 years ago

1.7.4

3 years ago

1.10.1

2 years ago

1.10.0

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.2.0

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago