Yarn: Updates to SDK packages (#45043)

This commit is contained in:
Hugo Häggmark 2022-02-08 09:45:42 +01:00 committed by GitHub
parent d0bc3b10bf
commit 31ba5bfea0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 24 additions and 58 deletions

View File

@ -1,6 +1,6 @@
{
"name": "eslint",
"version": "7.28.0-sdk",
"version": "8.8.0-sdk",
"main": "./lib/api.js",
"type": "commonjs"
}

View File

@ -1,6 +1,6 @@
{
"name": "prettier",
"version": "2.2.1-sdk",
"version": "2.5.1-sdk",
"main": "./index.js",
"type": "commonjs"
}

View File

@ -1,20 +0,0 @@
#!/usr/bin/env node
const {existsSync} = require(`fs`);
const {createRequire, createRequireFromPath} = require(`module`);
const {resolve} = require(`path`);
const relPnpApiPath = "../../../../.pnp.cjs";
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath);
if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
// Setup the environment to be able to require stylelint/bin/stylelint.js
require(absPnpApiPath).setup();
}
}
// Defer to the real stylelint/bin/stylelint.js your application uses
module.exports = absRequire(`stylelint/bin/stylelint.js`);

View File

@ -1,20 +0,0 @@
#!/usr/bin/env node
const {existsSync} = require(`fs`);
const {createRequire, createRequireFromPath} = require(`module`);
const {resolve} = require(`path`);
const relPnpApiPath = "../../../../.pnp.cjs";
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath);
if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
// Setup the environment to be able to require stylelint/lib/index.js
require(absPnpApiPath).setup();
}
}
// Defer to the real stylelint/lib/index.js your application uses
module.exports = absRequire(`stylelint/lib/index.js`);

View File

@ -1,6 +0,0 @@
{
"name": "stylelint",
"version": "14.0.1-sdk",
"main": "lib/index.js",
"type": "commonjs"
}

View File

@ -143,8 +143,9 @@ const moduleWrapper = tsserver => {
let hostInfo = `unknown`;
Object.assign(Session.prototype, {
onMessage(/** @type {string} */ message) {
const parsedMessage = JSON.parse(message)
onMessage(/** @type {string | object} */ message) {
const isStringMessage = typeof message === 'string';
const parsedMessage = isStringMessage ? JSON.parse(message) : message;
if (
parsedMessage != null &&
@ -158,9 +159,14 @@ const moduleWrapper = tsserver => {
}
}
return originalOnMessage.call(this, JSON.stringify(parsedMessage, (key, value) => {
return typeof value === `string` ? fromEditorPath(value) : value;
}));
const processedMessageJSON = JSON.stringify(parsedMessage, (key, value) => {
return typeof value === 'string' ? fromEditorPath(value) : value;
});
return originalOnMessage.call(
this,
isStringMessage ? processedMessageJSON : JSON.parse(processedMessageJSON)
);
},
send(/** @type {any} */ msg) {

View File

@ -143,8 +143,9 @@ const moduleWrapper = tsserver => {
let hostInfo = `unknown`;
Object.assign(Session.prototype, {
onMessage(/** @type {string} */ message) {
const parsedMessage = JSON.parse(message)
onMessage(/** @type {string | object} */ message) {
const isStringMessage = typeof message === 'string';
const parsedMessage = isStringMessage ? JSON.parse(message) : message;
if (
parsedMessage != null &&
@ -158,9 +159,14 @@ const moduleWrapper = tsserver => {
}
}
return originalOnMessage.call(this, JSON.stringify(parsedMessage, (key, value) => {
return typeof value === `string` ? fromEditorPath(value) : value;
}));
const processedMessageJSON = JSON.stringify(parsedMessage, (key, value) => {
return typeof value === 'string' ? fromEditorPath(value) : value;
});
return originalOnMessage.call(
this,
isStringMessage ? processedMessageJSON : JSON.parse(processedMessageJSON)
);
},
send(/** @type {any} */ msg) {