prettier-plugin-astro
Advanced tools
Comparing version 0.9.1 to 0.10.0
'use strict'; | ||
var node_module = require('node:module'); | ||
var synckit = require('synckit'); | ||
var sync = require('@astrojs/compiler/sync'); | ||
require('prettier'); | ||
var utils = require('@astrojs/compiler/utils'); | ||
var _doc = require('prettier/doc'); | ||
@@ -84,11 +85,2 @@ var node_buffer = require('node:buffer'); | ||
const req$1 = node_module.createRequire((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('index.js', document.baseURI).href))); | ||
let workerPath$1; | ||
try { | ||
workerPath$1 = req$1.resolve('../workers/serialize-worker.js'); | ||
} | ||
catch (e) { | ||
workerPath$1 = req$1.resolve('prettier-plugin-astro/workers/serialize-worker.js'); | ||
} | ||
const serialize = synckit.createSyncFn(req$1.resolve(workerPath$1)); | ||
const openingBracketReplace = '_Pé'; | ||
@@ -120,3 +112,3 @@ const closingBracketReplace = 'èP_'; | ||
} | ||
let raw = node.children.reduce((prev, curr) => prev + serialize(curr), ''); | ||
let raw = node.children.reduce((prev, curr) => prev + utils.serialize(curr), ''); | ||
if (!stripLeadingAndTrailingNewline) { | ||
@@ -789,11 +781,2 @@ return raw; | ||
const req = node_module.createRequire((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('index.js', document.baseURI).href))); | ||
let workerPath; | ||
try { | ||
workerPath = req.resolve('../workers/parse-worker.js'); | ||
} | ||
catch (e) { | ||
workerPath = req.resolve('prettier-plugin-astro/workers/parse-worker.js'); | ||
} | ||
const parse = synckit.createSyncFn(req.resolve(workerPath)); | ||
const languages = [ | ||
@@ -809,3 +792,3 @@ { | ||
astro: { | ||
parse: (source) => parse(source), | ||
parse: (source) => sync.parse(source, { position: true }).ast, | ||
astFormat: 'astro', | ||
@@ -812,0 +795,0 @@ locStart: (node) => node.position.start.offset, |
{ | ||
"name": "prettier-plugin-astro", | ||
"version": "0.9.1", | ||
"version": "0.10.0", | ||
"type": "commonjs", | ||
@@ -32,24 +32,23 @@ "description": "A Prettier Plugin for formatting Astro files", | ||
"dependencies": { | ||
"@astrojs/compiler": "^1.0.1", | ||
"prettier": "^2.8.3", | ||
"sass-formatter": "^0.7.5", | ||
"synckit": "^0.8.4" | ||
"@astrojs/compiler": "^1.5.0", | ||
"prettier": "^2.8.8", | ||
"sass-formatter": "^0.7.6" | ||
}, | ||
"devDependencies": { | ||
"@changesets/cli": "^2.26.0", | ||
"@rollup/plugin-commonjs": "^24.0.1", | ||
"@rollup/plugin-typescript": "^11.0.0", | ||
"@types/node": "^18.11.18", | ||
"@types/prettier": "^2.7.2", | ||
"@typescript-eslint/eslint-plugin": "^5.49.0", | ||
"@typescript-eslint/parser": "^5.49.0", | ||
"@vitest/ui": "^0.28.1", | ||
"eslint": "^8.32.0", | ||
"eslint-config-prettier": "^8.6.0", | ||
"@changesets/cli": "^2.26.1", | ||
"@rollup/plugin-commonjs": "^25.0.0", | ||
"@rollup/plugin-typescript": "^11.1.1", | ||
"@types/node": "^20.2.5", | ||
"@types/prettier": "^2.7.3", | ||
"@typescript-eslint/eslint-plugin": "^5.59.8", | ||
"@typescript-eslint/parser": "^5.59.8", | ||
"@vitest/ui": "^0.31.3", | ||
"eslint": "^8.41.0", | ||
"eslint-config-prettier": "^8.8.0", | ||
"eslint-plugin-prettier": "^4.2.1", | ||
"eslint-plugin-prettier-doc": "^1.1.0", | ||
"rollup": "^3.10.1", | ||
"tslib": "^2.4.1", | ||
"typescript": "^4.9.4", | ||
"vitest": "^0.28.1" | ||
"rollup": "^3.23.0", | ||
"tslib": "^2.5.2", | ||
"typescript": "^5.0.4", | ||
"vitest": "^0.31.3" | ||
}, | ||
@@ -56,0 +55,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses eval() which is a dangerous function. This prevents the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
3
1
0
102117
5
802
- Removedsynckit@^0.8.4
- Removed@pkgr/core@0.1.1(transitive)
- Removedsynckit@0.8.8(transitive)
- Removedtslib@2.7.0(transitive)
Updated@astrojs/compiler@^1.5.0
Updatedprettier@^2.8.8
Updatedsass-formatter@^0.7.6