New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@sanity/codegen

Package Overview
Dependencies
Maintainers
69
Versions
249
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sanity/codegen - npm Package Compare versions

Comparing version 3.59.2-corel.412 to 3.59.2-corel-fix-presentation-perspective-switching.536

11

lib/index.esm.js

@@ -73,3 +73,5 @@ import fs$1, { readFile } from "node:fs/promises";

}
function parseSourceFile(source, filename, babelOptions) {
function parseSourceFile(_source, _filename, babelOptions) {
let source = _source, filename = _filename;
filename.endsWith(".astro") && (filename += ".ts", source = parseAstro(source));
const result = parse$1(source, {

@@ -83,2 +85,9 @@ ...babelOptions,

}
function parseAstro(source) {
const codeFences = source.match(/---\n([\s\S]*?)\n---/g);
return codeFences ? codeFences.map((codeFence) => codeFence.split(`
`).slice(1, -1).join(`
`)).join(`
`) : "";
}
const debug$2 = createDebug("sanity:codegen:findQueries:debug"), TAGGED_TEMPLATE_ALLOW_LIST = ["groq"], FUNCTION_WRAPPER_ALLOW_LIST = ["defineQuery"];

@@ -85,0 +94,0 @@ function resolveExpression({

@@ -80,3 +80,5 @@ "use strict";

}
function parseSourceFile(source, filename, babelOptions) {
function parseSourceFile(_source, _filename, babelOptions) {
let source = _source, filename = _filename;
filename.endsWith(".astro") && (filename += ".ts", source = parseAstro(source));
const result = core.parse(source, {

@@ -90,2 +92,9 @@ ...babelOptions,

}
function parseAstro(source) {
const codeFences = source.match(/---\n([\s\S]*?)\n---/g);
return codeFences ? codeFences.map((codeFence) => codeFence.split(`
`).slice(1, -1).join(`
`)).join(`
`) : "";
}
const debug$2 = createDebug__default.default("sanity:codegen:findQueries:debug"), TAGGED_TEMPLATE_ALLOW_LIST = ["groq"], FUNCTION_WRAPPER_ALLOW_LIST = ["defineQuery"];

@@ -92,0 +101,0 @@ function resolveExpression({

20

package.json
{
"name": "@sanity/codegen",
"version": "3.59.2-corel.412+97f610e5db",
"version": "3.59.2-corel-fix-presentation-perspective-switching.536+783f0b1856",
"description": "Codegen toolkit for Sanity.io",

@@ -47,3 +47,3 @@ "keywords": [

"clean": "rimraf lib coverage",
"lint": "eslint .",
"lint": "eslint --cache .",
"prepublishOnly": "turbo run build",

@@ -63,5 +63,5 @@ "test": "vitest",

"debug": "^4.3.4",
"globby": "^10.0.0",
"groq": "3.59.2-corel.412+97f610e5db",
"groq-js": "^1.14.0",
"globby": "^11.1.0",
"groq": "3.59.2-corel-fix-presentation-perspective-switching.536+783f0b1856",
"groq-js": "^1.14.2",
"json5": "^2.2.3",

@@ -72,4 +72,4 @@ "tsconfig-paths": "^4.2.0",

"devDependencies": {
"@repo/package.config": "3.65.0",
"@repo/test-config": "3.65.0",
"@repo/package.config": "3.71.0",
"@repo/test-config": "3.71.0",
"@types/babel__core": "^7.20.5",

@@ -80,4 +80,4 @@ "@types/babel__generator": "^7.6.8",

"@types/debug": "^4.1.12",
"rimraf": "^3.0.2",
"vitest": "^2.1.1"
"rimraf": "^5.0.10",
"vitest": "^2.1.8"
},

@@ -90,3 +90,3 @@ "engines": {

},
"gitHead": "97f610e5dbf362553cd664b7fc58cadf357fadd6"
"gitHead": "783f0b18569c0ae5f72d8b2d7bbd9128fa8416bb"
}

@@ -6,6 +6,13 @@ import {parse, type TransformOptions} from '@babel/core'

export function parseSourceFile(
source: string,
filename: string,
_source: string,
_filename: string,
babelOptions: TransformOptions,
): babelTypes.File {
let source = _source
let filename = _filename
if (filename.endsWith('.astro')) {
// append .ts to the filename so babel will parse it as typescript
filename += '.ts'
source = parseAstro(source)
}
const result = parse(source, {

@@ -22,1 +29,15 @@ ...babelOptions,

}
function parseAstro(source: string): string {
// find all code fences, the js code is between --- and ---
const codeFences = source.match(/---\n([\s\S]*?)\n---/g)
if (!codeFences) {
return ''
}
return codeFences
.map((codeFence) => {
return codeFence.split('\n').slice(1, -1).join('\n')
})
.join('\n')
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc