https://github.com/vulcanjs/vulcan-vscode-snippets
The official snippets extension for Vulcan.js
https://github.com/vulcanjs/vulcan-vscode-snippets
Last synced: 5 months ago
JSON representation
The official snippets extension for Vulcan.js
- Host: GitHub
- URL: https://github.com/vulcanjs/vulcan-vscode-snippets
- Owner: VulcanJS
- Created: 2019-09-05T14:39:40.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-10-24T19:35:04.000Z (over 6 years ago)
- Last Synced: 2025-06-27T17:51:59.490Z (12 months ago)
- Size: 12.7 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# VulcanJS Snippets
The official Snippets extension for VulcanJS.
## Supported languages
- JavaScript (.js)
- JavaScript React (.jsx)
Support for TypeScript and TypeScript React will be added when the core framework supports it.
## Supported snippets
### `addRoute`
[Docs](http://docs.vulcanjs.org/routing.html#Adding-Routes) | Add a route with a registered component
```js
addRoute({ name: '', path: '/path', componentName: '' });
```
### `addRouteComponent`
[Docs](http://docs.vulcanjs.org/routing.html#Adding-Routes) | Add a route with a direct component
```js
addRoute({ name: '', path: '/path', component: });
```
### `createCollection`
[Docs](http://docs.vulcanjs.org/schemas.html#Creating-Collections) | Create a collection with custom queries & mutations
```js
const MyDocuments = createCollection({
collectionName: 'MyDocuments',
typeName: 'MyDocument',
schema: mySchema,
resolvers: myResolvers,
mutations: myMutations,
});
```
### `createDefaultCollection`
[Docs](http://docs.vulcanjs.org/schemas.html#Creating-Collections) | Create a collection with default queries & mutations
```js
const MyDocuments = createCollection({
collectionName: 'MyDocuments',
typeName: 'MyDocument',
schema: mySchema,
resolvers: getDefaultResolvers('MyDocument'),
mutations: getDefaultMutations('MyDocument'),
});
```
### `registerComponent`
[Docs](http://docs.vulcanjs.org/theming.html#Registering-Components) | Register a new component
```js
registerComponent({ name: 'MyComponent', component: MyComponent, hocs: [] });
```
### `registerFragment`
[Docs](http://docs.vulcanjs.org/fragments.html#Registering-Fragments) | Register a new fragment
```js
registerFragment(`
fragment myFragment on MyType {
}
`)
```
### `newField`
[Docs](http://docs.vulcanjs.org/schemas.html#Example) | Insert a field inside a schema
```js
myFieldName: {
type: String,
label: 'MyFieldName',
optional: true,
canRead: [],
canCreate: [],
canUpdate: [],
},
```
### `addField`
[Docs](http://docs.vulcanjs.org/schemas.html#Extending-Schemas) | Extend an exisiting collection with a new field
```js
.addField({
fieldName: 'myFieldName',
fieldSchema: {
type: String,
optional: true,
canRead: [],
canCreate: [],
canUpdate: [],
},
});
```
### `importvulcancore`
Create an import from `meteor/vulcan:core`
```js
import { } from 'meteor/vulcan:core';
```