File tree Expand file tree Collapse file tree 22 files changed +1392
-1237
lines changed Expand file tree Collapse file tree 22 files changed +1392
-1237
lines changed Load Diff This file was deleted.
Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change 11#!/usr/bin/env node
22
33const { existsSync} = require ( `fs` ) ;
4- const { createRequire} = require ( `module` ) ;
4+ const { createRequire, register } = require ( `module` ) ;
55const { resolve} = require ( `path` ) ;
6+ const { pathToFileURL} = require ( `url` ) ;
67
78const relPnpApiPath = "../../../../.pnp.cjs" ;
89
910const absPnpApiPath = resolve ( __dirname , relPnpApiPath ) ;
1011const absRequire = createRequire ( absPnpApiPath ) ;
1112
13+ const absPnpLoaderPath = resolve ( absPnpApiPath , `../.pnp.loader.mjs` ) ;
14+ const isPnpLoaderEnabled = existsSync ( absPnpLoaderPath ) ;
15+
1216if ( existsSync ( absPnpApiPath ) ) {
1317 if ( ! process . versions . pnp ) {
1418 // Setup the environment to be able to require eslint/bin/eslint.js
1519 require ( absPnpApiPath ) . setup ( ) ;
20+ if ( isPnpLoaderEnabled && register ) {
21+ register ( pathToFileURL ( absPnpLoaderPath ) ) ;
22+ }
1623 }
1724}
1825
Original file line number Diff line number Diff line change 11#!/usr/bin/env node
22
33const { existsSync} = require ( `fs` ) ;
4- const { createRequire} = require ( `module` ) ;
4+ const { createRequire, register } = require ( `module` ) ;
55const { resolve} = require ( `path` ) ;
6+ const { pathToFileURL} = require ( `url` ) ;
67
78const relPnpApiPath = "../../../../.pnp.cjs" ;
89
910const absPnpApiPath = resolve ( __dirname , relPnpApiPath ) ;
1011const absRequire = createRequire ( absPnpApiPath ) ;
1112
13+ const absPnpLoaderPath = resolve ( absPnpApiPath , `../.pnp.loader.mjs` ) ;
14+ const isPnpLoaderEnabled = existsSync ( absPnpLoaderPath ) ;
15+
1216if ( existsSync ( absPnpApiPath ) ) {
1317 if ( ! process . versions . pnp ) {
1418 // Setup the environment to be able to require eslint
1519 require ( absPnpApiPath ) . setup ( ) ;
20+ if ( isPnpLoaderEnabled && register ) {
21+ register ( pathToFileURL ( absPnpLoaderPath ) ) ;
22+ }
1623 }
1724}
1825
Original file line number Diff line number Diff line change 11#!/usr/bin/env node
22
33const { existsSync} = require ( `fs` ) ;
4- const { createRequire} = require ( `module` ) ;
4+ const { createRequire, register } = require ( `module` ) ;
55const { resolve} = require ( `path` ) ;
6+ const { pathToFileURL} = require ( `url` ) ;
67
78const relPnpApiPath = "../../../../.pnp.cjs" ;
89
910const absPnpApiPath = resolve ( __dirname , relPnpApiPath ) ;
1011const absRequire = createRequire ( absPnpApiPath ) ;
1112
13+ const absPnpLoaderPath = resolve ( absPnpApiPath , `../.pnp.loader.mjs` ) ;
14+ const isPnpLoaderEnabled = existsSync ( absPnpLoaderPath ) ;
15+
1216if ( existsSync ( absPnpApiPath ) ) {
1317 if ( ! process . versions . pnp ) {
1418 // Setup the environment to be able to require eslint/use-at-your-own-risk
1519 require ( absPnpApiPath ) . setup ( ) ;
20+ if ( isPnpLoaderEnabled && register ) {
21+ register ( pathToFileURL ( absPnpLoaderPath ) ) ;
22+ }
1623 }
1724}
1825
Original file line number Diff line number Diff line change 11#!/usr/bin/env node
22
33const { existsSync} = require ( `fs` ) ;
4- const { createRequire} = require ( `module` ) ;
4+ const { createRequire, register } = require ( `module` ) ;
55const { resolve} = require ( `path` ) ;
6+ const { pathToFileURL} = require ( `url` ) ;
67
78const relPnpApiPath = "../../../../.pnp.cjs" ;
89
910const absPnpApiPath = resolve ( __dirname , relPnpApiPath ) ;
1011const absRequire = createRequire ( absPnpApiPath ) ;
1112
13+ const absPnpLoaderPath = resolve ( absPnpApiPath , `../.pnp.loader.mjs` ) ;
14+ const isPnpLoaderEnabled = existsSync ( absPnpLoaderPath ) ;
15+
1216if ( existsSync ( absPnpApiPath ) ) {
1317 if ( ! process . versions . pnp ) {
1418 // Setup the environment to be able to require prettier/bin/prettier.cjs
1519 require ( absPnpApiPath ) . setup ( ) ;
20+ if ( isPnpLoaderEnabled && register ) {
21+ register ( pathToFileURL ( absPnpLoaderPath ) ) ;
22+ }
1623 }
1724}
1825
Original file line number Diff line number Diff line change 11#!/usr/bin/env node
22
33const { existsSync} = require ( `fs` ) ;
4- const { createRequire} = require ( `module` ) ;
4+ const { createRequire, register } = require ( `module` ) ;
55const { resolve} = require ( `path` ) ;
6+ const { pathToFileURL} = require ( `url` ) ;
67
78const relPnpApiPath = "../../../.pnp.cjs" ;
89
910const absPnpApiPath = resolve ( __dirname , relPnpApiPath ) ;
1011const absRequire = createRequire ( absPnpApiPath ) ;
1112
13+ const absPnpLoaderPath = resolve ( absPnpApiPath , `../.pnp.loader.mjs` ) ;
14+ const isPnpLoaderEnabled = existsSync ( absPnpLoaderPath ) ;
15+
1216if ( existsSync ( absPnpApiPath ) ) {
1317 if ( ! process . versions . pnp ) {
1418 // Setup the environment to be able to require prettier
1519 require ( absPnpApiPath ) . setup ( ) ;
20+ if ( isPnpLoaderEnabled && register ) {
21+ register ( pathToFileURL ( absPnpLoaderPath ) ) ;
22+ }
1623 }
1724}
1825
Original file line number Diff line number Diff line change 11{
22 "name" : " prettier" ,
3- "version" : " 3.2.5 -sdk" ,
3+ "version" : " 3.3.3 -sdk" ,
44 "main" : " ./index.cjs" ,
55 "type" : " commonjs" ,
66 "bin" : " ./bin/prettier.cjs"
Original file line number Diff line number Diff line change 11#!/usr/bin/env node
22
33const { existsSync} = require ( `fs` ) ;
4- const { createRequire} = require ( `module` ) ;
4+ const { createRequire, register } = require ( `module` ) ;
55const { resolve} = require ( `path` ) ;
6+ const { pathToFileURL} = require ( `url` ) ;
67
78const relPnpApiPath = "../../../../.pnp.cjs" ;
89
910const absPnpApiPath = resolve ( __dirname , relPnpApiPath ) ;
1011const absRequire = createRequire ( absPnpApiPath ) ;
1112
13+ const absPnpLoaderPath = resolve ( absPnpApiPath , `../.pnp.loader.mjs` ) ;
14+ const isPnpLoaderEnabled = existsSync ( absPnpLoaderPath ) ;
15+
1216if ( existsSync ( absPnpApiPath ) ) {
1317 if ( ! process . versions . pnp ) {
1418 // Setup the environment to be able to require typescript/bin/tsc
1519 require ( absPnpApiPath ) . setup ( ) ;
20+ if ( isPnpLoaderEnabled && register ) {
21+ register ( pathToFileURL ( absPnpLoaderPath ) ) ;
22+ }
1623 }
1724}
1825
Original file line number Diff line number Diff line change 11#!/usr/bin/env node
22
33const { existsSync} = require ( `fs` ) ;
4- const { createRequire} = require ( `module` ) ;
4+ const { createRequire, register } = require ( `module` ) ;
55const { resolve} = require ( `path` ) ;
6+ const { pathToFileURL} = require ( `url` ) ;
67
78const relPnpApiPath = "../../../../.pnp.cjs" ;
89
910const absPnpApiPath = resolve ( __dirname , relPnpApiPath ) ;
1011const absRequire = createRequire ( absPnpApiPath ) ;
1112
13+ const absPnpLoaderPath = resolve ( absPnpApiPath , `../.pnp.loader.mjs` ) ;
14+ const isPnpLoaderEnabled = existsSync ( absPnpLoaderPath ) ;
15+
1216if ( existsSync ( absPnpApiPath ) ) {
1317 if ( ! process . versions . pnp ) {
1418 // Setup the environment to be able to require typescript/bin/tsserver
1519 require ( absPnpApiPath ) . setup ( ) ;
20+ if ( isPnpLoaderEnabled && register ) {
21+ register ( pathToFileURL ( absPnpLoaderPath ) ) ;
22+ }
1623 }
1724}
1825
You can’t perform that action at this time.
0 commit comments