🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@sanity-codegen/core

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sanity-codegen/core - npm Package Compare versions

Comparing version
1.0.0-alpha.42
to
1.0.0-alpha.45
+4
-0
CHANGELOG.md

@@ -6,2 +6,6 @@ # Change Log

# [1.0.0-alpha.45](https://github.com/ricokahler/sanity-codegen/compare/v1.0.0-alpha.44...v1.0.0-alpha.45) (2023-05-10)
**Note:** Version bump only for package @sanity-codegen/core
# [1.0.0-alpha.42](https://github.com/ricokahler/sanity-codegen/compare/v1.0.0-alpha.41...v1.0.0-alpha.42) (2023-01-27)

@@ -8,0 +12,0 @@

+4
-8

@@ -22,6 +22,5 @@ "use strict";

function getCommonProps(i, omitOriginalNode) {
var _i$codegen;
return {
codegen: {
required: !!((_i$codegen = i.codegen) !== null && _i$codegen !== void 0 && _i$codegen.required)
required: !!i.codegen?.required
},

@@ -58,9 +57,7 @@ description: i.description || null,

function normalizeFields(t, parents, omitOriginalNode) {
var _t$fields;
const fields = t.fields || [];
if (!(t !== null && t !== void 0 && (_t$fields = t.fields) !== null && _t$fields !== void 0 && _t$fields.length)) {
if (!t?.fields?.length) {
throw new SchemaParseError(`Expected type \`${parents.join('.')}\` to have property \`fields\` with at least one field.`);
}
return fields.map(f => {
var _f$codegen;
const pathname = parents.join('.');

@@ -80,3 +77,3 @@ if (typeof f.name !== 'string') {

codegen: {
required: !!((_f$codegen = f.codegen) !== null && _f$codegen !== void 0 && _f$codegen.required)
required: !!f.codegen?.required
},

@@ -237,4 +234,3 @@ hasValidation: !!f.validation,

function normalizeList(t, parents) {
var _t$options;
const list = t === null || t === void 0 ? void 0 : (_t$options = t.options) === null || _t$options === void 0 ? void 0 : _t$options.list;
const list = t?.options?.list;
const pathname = parents.join('.');

@@ -241,0 +237,0 @@ if (!list) return null;

@@ -208,3 +208,2 @@ "use strict";

{
var _node$fields;
const properties = [];

@@ -263,3 +262,3 @@ if (node.type === 'Document') {

}
const fieldProperties = (_node$fields = node.fields) === null || _node$fields === void 0 ? void 0 : _node$fields.map(field => ({
const fieldProperties = node.fields?.map(field => ({
key: field.name,

@@ -266,0 +265,0 @@ value: transformSchemaNodeToStructure({

@@ -64,3 +64,3 @@ "use strict";

// e.g. `base._type == 'foo'`
if (variableIdentifierNode !== null && variableIdentifierNode !== void 0 && variableIdentifierNode.base) {
if (variableIdentifierNode?.base) {
return {

@@ -67,0 +67,0 @@ type: 'UnknownExpression',

@@ -79,3 +79,3 @@ "use strict";

});
if ((matchingExportSpecifier === null || matchingExportSpecifier === void 0 ? void 0 : matchingExportSpecifier.type) === 'ExportSpecifier') {
if (matchingExportSpecifier?.type === 'ExportSpecifier') {
resolve({

@@ -82,0 +82,0 @@ node: matchingExportSpecifier,

{
"name": "@sanity-codegen/core",
"version": "1.0.0-alpha.42",
"version": "1.0.0-alpha.45",
"keywords": [

@@ -76,3 +76,3 @@ "sanity",

},
"gitHead": "66206d42d307cd6e9046082fee51c0ed5ee69091"
"gitHead": "8f9acfc8d675c6279d75c082e62221300249a6c1"
}

@@ -38,3 +38,3 @@ # @sanity-codegen/core

3. The second argument must be a tagged template literal with the tag being exactly `groq`.
4. The template literal may _not_ contain any expressions. If you need to use parameters, use [GROQ parameters](https://www.sanity.io/docs/groq-parameters) (e.g. `$parameter`).
4. The template literal has limited support for expressions. It can follow identifiers to resolve static query fragements but it _not_ contain any complex javascript expressions (the full query has to be resolveable statically, without evaluating JS). If you need to use parameters, use [GROQ parameters](https://www.sanity.io/docs/groq-parameters) (e.g. `$parameter`).

@@ -41,0 +41,0 @@ If any source file contains a groq query in the form described above, Sanity Codegen will attempt to parse it and generate TypeScript types for it.