From ca00e01434b9ea5f6f51cbfca4feae142de21b08 Mon Sep 17 00:00:00 2001 From: ylemkimon Date: Mon, 31 Aug 2020 17:38:48 +0900 Subject: [PATCH] build: make vscode work with PnP (#2444) * Make vscode work with PnP * Add vscode extension recommendations * Add newlines to the end of generated manifests --- .gitpod.yml | 3 ++- .vscode/extensions.json | 7 +++++++ .vscode/settings.json | 5 ++++- .yarn/sdks/eslint/bin/eslint.js | 20 ++++++++++++++++++++ .yarn/sdks/eslint/lib/api.js | 20 ++++++++++++++++++++ .yarn/sdks/eslint/package.json | 6 ++++++ .yarn/sdks/flow-bin/cli.js | 20 ++++++++++++++++++++ .yarn/sdks/flow-bin/package.json | 5 +++++ .yarn/sdks/integrations.yml | 5 +++++ .yarn/sdks/stylelint/bin/stylelint.js | 20 ++++++++++++++++++++ .yarn/sdks/stylelint/lib/index.js | 20 ++++++++++++++++++++ .yarn/sdks/stylelint/package.json | 6 ++++++ 12 files changed, 135 insertions(+), 2 deletions(-) create mode 100644 .vscode/extensions.json create mode 100755 .yarn/sdks/eslint/bin/eslint.js create mode 100644 .yarn/sdks/eslint/lib/api.js create mode 100644 .yarn/sdks/eslint/package.json create mode 100755 .yarn/sdks/flow-bin/cli.js create mode 100644 .yarn/sdks/flow-bin/package.json create mode 100644 .yarn/sdks/integrations.yml create mode 100755 .yarn/sdks/stylelint/bin/stylelint.js create mode 100644 .yarn/sdks/stylelint/lib/index.js create mode 100644 .yarn/sdks/stylelint/package.json diff --git a/.gitpod.yml b/.gitpod.yml index b949c1e2..369beb8c 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -15,5 +15,6 @@ github: vscode: extensions: - - dbaeumer.vscode-eslint@2.1.5:9Wg0Glx/TwD8ElFBg+FKcQ== + - dbaeumer.vscode-eslint@2.1.8:02aHhbJ0Q4aGdjHXlTdVKg== - flowtype.flow-for-vscode@1.5.0:AwOT6wgHTF43loZQCAUMLA== + - stylelint.vscode-stylelint@0.85.0:GjHxVXEBqt1ud+yaj0V9KQ== diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 00000000..765189b1 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,7 @@ +{ + "recommendations": [ + "dbaeumer.vscode-eslint", + "flowtype.flow-for-vscode", + "stylelint.vscode-stylelint" + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json index 01b6482d..baf543ad 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,6 @@ { - "javascript.validate.enable": false + "javascript.validate.enable": false, + "eslint.nodePath": ".yarn/sdks", + "stylelint.stylelintPath": ".yarn/sdks/stylelint/lib/index.js", + "flow.pathToFlow": "${workspaceFolder}/.yarn/sdks/flow-bin/cli.js" } diff --git a/.yarn/sdks/eslint/bin/eslint.js b/.yarn/sdks/eslint/bin/eslint.js new file mode 100755 index 00000000..4e7554dc --- /dev/null +++ b/.yarn/sdks/eslint/bin/eslint.js @@ -0,0 +1,20 @@ +#!/usr/bin/env node + +const {existsSync} = require(`fs`); +const {createRequire, createRequireFromPath} = require(`module`); +const {resolve} = require(`path`); + +const relPnpApiPath = "../../../../.pnp.js"; + +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 eslint/bin/eslint.js + require(absPnpApiPath).setup(); + } +} + +// Defer to the real eslint/bin/eslint.js your application uses +module.exports = absRequire(`eslint/bin/eslint.js`); diff --git a/.yarn/sdks/eslint/lib/api.js b/.yarn/sdks/eslint/lib/api.js new file mode 100644 index 00000000..ac3c9fc0 --- /dev/null +++ b/.yarn/sdks/eslint/lib/api.js @@ -0,0 +1,20 @@ +#!/usr/bin/env node + +const {existsSync} = require(`fs`); +const {createRequire, createRequireFromPath} = require(`module`); +const {resolve} = require(`path`); + +const relPnpApiPath = "../../../../.pnp.js"; + +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 eslint/lib/api.js + require(absPnpApiPath).setup(); + } +} + +// Defer to the real eslint/lib/api.js your application uses +module.exports = absRequire(`eslint/lib/api.js`); diff --git a/.yarn/sdks/eslint/package.json b/.yarn/sdks/eslint/package.json new file mode 100644 index 00000000..424cfd59 --- /dev/null +++ b/.yarn/sdks/eslint/package.json @@ -0,0 +1,6 @@ +{ + "name": "eslint", + "version": "7.7.0-pnpify", + "main": "./lib/api.js", + "type": "commonjs" +} diff --git a/.yarn/sdks/flow-bin/cli.js b/.yarn/sdks/flow-bin/cli.js new file mode 100755 index 00000000..f098c812 --- /dev/null +++ b/.yarn/sdks/flow-bin/cli.js @@ -0,0 +1,20 @@ +#!/usr/bin/env node + +const {existsSync} = require(`fs`); +const {createRequire, createRequireFromPath} = require(`module`); +const {resolve} = require(`path`); + +const relPnpApiPath = "../../../.pnp.js"; + +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 flow-bin/cli.js + require(absPnpApiPath).setup(); + } +} + +// Defer to the real flow-bin/cli.js your application uses +module.exports = absRequire(`flow-bin/cli.js`); diff --git a/.yarn/sdks/flow-bin/package.json b/.yarn/sdks/flow-bin/package.json new file mode 100644 index 00000000..381f3daa --- /dev/null +++ b/.yarn/sdks/flow-bin/package.json @@ -0,0 +1,5 @@ +{ + "name": "flow-bin", + "version": "0.131.0-pnpify", + "type": "commonjs" +} diff --git a/.yarn/sdks/integrations.yml b/.yarn/sdks/integrations.yml new file mode 100644 index 00000000..76ed42ba --- /dev/null +++ b/.yarn/sdks/integrations.yml @@ -0,0 +1,5 @@ +# This file is automatically generated by PnPify. +# Manual changes will be lost! + +integrations: + - vscode diff --git a/.yarn/sdks/stylelint/bin/stylelint.js b/.yarn/sdks/stylelint/bin/stylelint.js new file mode 100755 index 00000000..672b12dd --- /dev/null +++ b/.yarn/sdks/stylelint/bin/stylelint.js @@ -0,0 +1,20 @@ +#!/usr/bin/env node + +const {existsSync} = require(`fs`); +const {createRequire, createRequireFromPath} = require(`module`); +const {resolve} = require(`path`); + +const relPnpApiPath = "../../../../.pnp.js"; + +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`); diff --git a/.yarn/sdks/stylelint/lib/index.js b/.yarn/sdks/stylelint/lib/index.js new file mode 100644 index 00000000..279c8769 --- /dev/null +++ b/.yarn/sdks/stylelint/lib/index.js @@ -0,0 +1,20 @@ +#!/usr/bin/env node + +const {existsSync} = require(`fs`); +const {createRequire, createRequireFromPath} = require(`module`); +const {resolve} = require(`path`); + +const relPnpApiPath = "../../../../.pnp.js"; + +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`); diff --git a/.yarn/sdks/stylelint/package.json b/.yarn/sdks/stylelint/package.json new file mode 100644 index 00000000..6f91fbfd --- /dev/null +++ b/.yarn/sdks/stylelint/package.json @@ -0,0 +1,6 @@ +{ + "name": "stylelint", + "version": "13.6.1-pnpify", + "main": "lib/index.js", + "type": "commonjs" +}