1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-18 05:01:17 +02:00
Files
slate/.yarn/sdks/prettier/index.cjs
Ty Mick 3861cc1a97 Update VS Code SDKs (#5718)
All changes were generated by the following command:

```
$ yarn dlx @yarnpkg/sdks vscode
➤ YN0000: · Yarn 4.0.2
➤ YN0000: ┌ Resolution step
➤ YN0085: │ + @yarnpkg/sdks@npm:3.2.0, @arcanis/slice-ansi@npm:1.1.1, and 102 more.
➤ YN0000: └ Completed in 0s 540ms
➤ YN0000: ┌ Fetch step
➤ YN0013: │ 104 packages were added to the project (+ 2.89 MiB).
➤ YN0000: └ Completed in 0s 293ms
➤ YN0000: ┌ Link step
➤ YN0000: └ Completed in 1s 72ms
➤ YN0000: · Done in 1s 942ms

➤ YN0000: Cleaning up the existing SDK files...
➤ YN0000: ┌ Generating SDKs inside .yarn/sdks
➤ YN0000: │ ✓ Eslint
➤ YN0000: │ ✓ Prettier
➤ YN0000: │ ✓ Typescript
➤ YN0000: │ • 5 SDKs were skipped based on your root dependencies
➤ YN0000: └ Completed
➤ YN0000: ┌ Generating settings
➤ YN0000: │ ✓ Vscode (updated 🔼)
➤ YN0000: └ Completed
```
2024-09-12 14:36:02 -07:00

33 lines
1.0 KiB
JavaScript

#!/usr/bin/env node
const {existsSync} = require(`fs`);
const {createRequire, register} = require(`module`);
const {resolve} = require(`path`);
const {pathToFileURL} = require(`url`);
const relPnpApiPath = "../../../.pnp.cjs";
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
const absRequire = createRequire(absPnpApiPath);
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
// Setup the environment to be able to require prettier
require(absPnpApiPath).setup();
if (isPnpLoaderEnabled && register) {
register(pathToFileURL(absPnpLoaderPath));
}
}
}
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
? exports => absRequire(absUserWrapperPath)(exports)
: exports => exports;
// Defer to the real prettier your application uses
module.exports = wrapWithUserWrapper(absRequire(`prettier`));