Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Experiment: Replace lerna with yarn2 workspaces #4804

Closed
wants to merge 43 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
d73745c
extending configs no longer need plugins to be deps
tylerbutler Nov 18, 2020
af9ca1a
yarn2 init
tylerbutler Nov 17, 2020
65ed72a
yarn dlx @yarnpkg/pnpify --sdk vscode
tylerbutler Nov 17, 2020
891f96b
package.json normalization
tylerbutler Nov 17, 2020
6899082
resolve the ts-loader properly (?)
tylerbutler Nov 17, 2020
f7365fa
pnp webpack config example
tylerbutler Nov 18, 2020
625f202
include eslint config as a workspace
tylerbutler Nov 18, 2020
a7e30fd
missing deps
tylerbutler Nov 24, 2020
ec15a8f
yarn install works with warnings
tylerbutler Dec 15, 2020
78921ee
add lage
tylerbutler Dec 16, 2020
32c7dab
wip
tylerbutler Dec 16, 2020
f9dc24e
ts-jest and ts-mocha compat versions
tylerbutler Dec 16, 2020
8978478
musica missing deps
tylerbutler Dec 17, 2020
de2785b
routerlicious missing deps
tylerbutler Dec 17, 2020
bcd3682
spaces missing deps
tylerbutler Dec 18, 2020
11ab9e8
more missing deps
tylerbutler Dec 18, 2020
9555ecf
lage config
tylerbutler Dec 18, 2020
fdfcc8d
lockfile cleanup
tylerbutler Dec 18, 2020
97dcc06
yarn config
tylerbutler Dec 18, 2020
8c2835a
dockerfile for testing
tylerbutler Dec 18, 2020
319fd23
yarn config
tylerbutler Dec 18, 2020
924eabb
Revert "lockfile cleanup"
tylerbutler Dec 18, 2020
74cded2
upgrade yarn
tylerbutler Jan 5, 2021
4d35553
wip
tylerbutler Jan 5, 2021
5ddeaaa
lockfiles
tylerbutler Jan 5, 2021
886341a
deps
tylerbutler Jan 5, 2021
a488d10
fix configs that are missing node types
tylerbutler Jan 5, 2021
901b9b2
code workaround
tylerbutler Jan 5, 2021
b0e6874
deps and workarounds
tylerbutler Jan 6, 2021
a03a078
fixes
tylerbutler Jan 6, 2021
fde8666
npm run --> yarn run
tylerbutler Jan 7, 2021
1e5990a
change concurrently npm tasks to yarn
tylerbutler Jan 7, 2021
2a082ee
fix historian lerna config
tylerbutler Jan 7, 2021
d6a1f58
missing dep + @types/assert upgrade
tylerbutler Jan 7, 2021
245c2d7
Missing deps and invalid tsconfig fixes
tylerbutler Jan 8, 2021
463b285
lage config
tylerbutler Jan 8, 2021
95dc617
lockfile
tylerbutler Jan 8, 2021
27e07a3
updates
tylerbutler Jan 11, 2021
26e12b4
docs
tylerbutler Jan 11, 2021
7128a90
readme
tylerbutler Jan 13, 2021
4fbba15
updates
tylerbutler Jan 13, 2021
c4ade3a
readme
tylerbutler Jan 13, 2021
0ddd29b
updates
tylerbutler Jan 21, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,7 @@ yarn.lock merge=binary
# Set the language for these files to json5 to ensure GitHub doesn't show the comments as errors
/.vscode/*.json linguist-language=JSON5

# Hide docs from GitHub's language detection
# Hide docs and yarn from GitHub's language detection
/docs/** linguist-documentation
.yarn/* linguist-vendored
.pnp.js linguist-vendored
17 changes: 17 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.cache
.cache-loader
node_modules
dist
Expand All @@ -21,3 +22,19 @@ bundleAnalysis

# Misc pipeline artifacts
artifacts

# Windows ADS files in docs.
docs/**/*:Zone.Identifier

docs/static/playground/

# Images in this folder are autogenerated at docs build time
docs/content/docs/concepts/images/**/*.png

# Yarn 2
.yarn/*
!.yarn/releases
!.yarn/plugins
!.yarn/sdks
!.yarn/versions
.pnp.*
19 changes: 10 additions & 9 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
// List of extensions which should be recommended for users of this workspace.
"recommendations": [
"dbaeumer.vscode-eslint",
"editorconfig.editorconfig"
],
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
"unwantedRecommendations": []
// See http://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
// List of extensions which should be recommended for users of this workspace.
"recommendations": [
"dbaeumer.vscode-eslint",
"editorconfig.editorconfig",
"arcanis.vscode-zipfs"
],
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
"unwantedRecommendations": []
}
50 changes: 28 additions & 22 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,30 @@
{
"eslint.workingDirectories": [
{
"mode": "auto"
}
],
"typescript.format.enable": true,
"typescript.format.insertSpaceAfterCommaDelimiter": true,
"typescript.format.insertSpaceAfterSemicolonInForStatements": true,
"typescript.format.insertSpaceBeforeAndAfterBinaryOperators": true,
"typescript.format.insertSpaceAfterKeywordsInControlFlowStatements": true,
"typescript.format.insertSpaceAfterFunctionKeywordForAnonymousFunctions": false,
"typescript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false,
"typescript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false,
"typescript.format.insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false,
"typescript.format.insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces": false,
"typescript.format.placeOpenBraceOnNewLineForFunctions": false,
"typescript.format.placeOpenBraceOnNewLineForControlBlocks": false,
"typescript.tsdk": "node_modules/typescript/lib",
"files.associations": {
"tools/pipelines/*.yml": "azure-pipelines"
},
"[azure-pipelines].customSchemaFile": "",
"eslint.workingDirectories": [
{
"mode": "auto"
}
],
"eslint.packageManager": "yarn",
"typescript.format.enable": true,
"typescript.format.insertSpaceAfterCommaDelimiter": true,
"typescript.format.insertSpaceAfterSemicolonInForStatements": true,
"typescript.format.insertSpaceBeforeAndAfterBinaryOperators": true,
"typescript.format.insertSpaceAfterKeywordsInControlFlowStatements": true,
"typescript.format.insertSpaceAfterFunctionKeywordForAnonymousFunctions": false,
"typescript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false,
"typescript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false,
"typescript.format.insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false,
"typescript.format.insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces": false,
"typescript.format.placeOpenBraceOnNewLineForFunctions": false,
"typescript.format.placeOpenBraceOnNewLineForControlBlocks": false,
"typescript.tsdk": ".yarn/sdks/typescript/lib",
"files.associations": {
"tools/pipelines/*.yml": "azure-pipelines"
},
"[azure-pipelines].customSchemaFile": "",
"search.exclude": {
"**/.yarn": true,
"**/.pnp.*": true
},
"typescript.enablePromptUseWorkspaceTsdk": true
}
38 changes: 38 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-typescript.cjs

Large diffs are not rendered by default.

29 changes: 29 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

Large diffs are not rendered by default.

55 changes: 55 additions & 0 deletions .yarn/releases/yarn-2.4.0.cjs

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions .yarn/sdks/integrations.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# This file is automatically generated by PnPify.
# Manual changes will be lost!

integrations:
- vscode
20 changes: 20 additions & 0 deletions .yarn/sdks/typescript/bin/tsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env node

const {existsSync} = require(`fs`);
const {createRequire, createRequireFromPath} = require(`module`);
const {resolve, dirname} = 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 typescript/bin/tsc
require(absPnpApiPath).setup();
}
}

// Defer to the real typescript/bin/tsc your application uses
module.exports = absRequire(`typescript/bin/tsc`);
20 changes: 20 additions & 0 deletions .yarn/sdks/typescript/bin/tsserver
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env node

const {existsSync} = require(`fs`);
const {createRequire, createRequireFromPath} = require(`module`);
const {resolve, dirname} = 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 typescript/bin/tsserver
require(absPnpApiPath).setup();
}
}

// Defer to the real typescript/bin/tsserver your application uses
module.exports = absRequire(`typescript/bin/tsserver`);
20 changes: 20 additions & 0 deletions .yarn/sdks/typescript/lib/tsc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env node

const {existsSync} = require(`fs`);
const {createRequire, createRequireFromPath} = require(`module`);
const {resolve, dirname} = 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 typescript/lib/tsc.js
require(absPnpApiPath).setup();
}
}

// Defer to the real typescript/lib/tsc.js your application uses
module.exports = absRequire(`typescript/lib/tsc.js`);
77 changes: 77 additions & 0 deletions .yarn/sdks/typescript/lib/tsserver.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
#!/usr/bin/env node

const {existsSync} = require(`fs`);
const {createRequire, createRequireFromPath} = require(`module`);
const {resolve, dirname} = require(`path`);

const relPnpApiPath = "../../../../.pnp.js";

const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath);

const moduleWrapper = tsserver => {
// VSCode sends the zip paths to TS using the "zip://" prefix, that TS
// doesn't understand. This layer makes sure to remove the protocol
// before forwarding it to TS, and to add it back on all returned paths.

const {isAbsolute} = require(`path`);

const Session = tsserver.server.Session;
const {onMessage: originalOnMessage, send: originalSend} = Session.prototype;
let isVSCode = false;

return Object.assign(Session.prototype, {
onMessage(/** @type {string} */ message) {
const parsedMessage = JSON.parse(message)

if (
parsedMessage != null &&
typeof parsedMessage === 'object' &&
parsedMessage.arguments &&
parsedMessage.arguments.hostInfo === 'vscode'
) {
isVSCode = true;
}

return originalOnMessage.call(this, JSON.stringify(parsedMessage, (key, value) => {
return typeof value === 'string' ? removeZipPrefix(value) : value;
}));
},

send(/** @type {any} */ msg) {
return originalSend.call(this, JSON.parse(JSON.stringify(msg, (key, value) => {
return typeof value === 'string' ? addZipPrefix(value) : value;
})));
}
});

function addZipPrefix(str) {
// We add the `zip:` prefix to both `.zip/` paths and virtual paths
if (isAbsolute(str) && !str.match(/^\^zip:/) && (str.match(/\.zip\//) || str.match(/\$\$virtual\//))) {
// Absolute VSCode `Uri.fsPath`s need to start with a slash.
// VSCode only adds it automatically for supported schemes,
// so we have to do it manually for the `zip` scheme.
// The path needs to start with a caret otherwise VSCode doesn't handle the protocol
// https://github.com/microsoft/vscode/issues/105014#issuecomment-686760910
return `${isVSCode ? '^' : ''}zip:${str.replace(/^\/?/, `/`)}`;
} else {
return str;
}
}

function removeZipPrefix(str) {
return process.platform === 'win32'
? str.replace(/^\^?zip:\//, ``)
: str.replace(/^\^?zip:/, ``);
}
};

if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
// Setup the environment to be able to require typescript/lib/tsserver.js
require(absPnpApiPath).setup();
}
}

// Defer to the real typescript/lib/tsserver.js your application uses
module.exports = moduleWrapper(absRequire(`typescript/lib/tsserver.js`));
20 changes: 20 additions & 0 deletions .yarn/sdks/typescript/lib/typescript.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env node

const {existsSync} = require(`fs`);
const {createRequire, createRequireFromPath} = require(`module`);
const {resolve, dirname} = 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 typescript/lib/typescript.js
require(absPnpApiPath).setup();
}
}

// Defer to the real typescript/lib/typescript.js your application uses
module.exports = absRequire(`typescript/lib/typescript.js`);
6 changes: 6 additions & 0 deletions .yarn/sdks/typescript/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "typescript",
"version": "3.7.5-pnpify",
"main": "./lib/typescript.js",
"type": "commonjs"
}
75 changes: 75 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
enableGlobalCache: true

nmHoistingLimits: workspaces

nodeLinker: pnp
pnpMode: strict
pnpFallbackMode: all

npmRegistryServer: "https://registry.npmjs.org"

preferInteractive: true
enableTelemetry: false

packageExtensions:
"@uifabric/fluent-theme@*":
dependencies:
"@types/react": "^16.8.0"
"@types/react-dom": "^16.8.0"
"react": "^16.8.0"
"react-dom": "^16.8.0"
"@uifabric/styling@7.16.18":
dependencies:
"@types/react": "^16.8.0"
"@types/react-dom": "^16.8.0"
"react": "^16.8.0"
"react-dom": "^16.8.0"
"rc-trigger@2.6.5":
dependencies:
"react": "^16.8.0"
"react-dom": "^16.8.0"
"react-grid-layout@0.18.3":
dependencies:
"react": "^16.8.0"
"react-dom": "^16.8.0"
"@uifabric/variants@7.2.31":
dependencies:
"@types/react": "^16.8.0"
"@types/react-dom": "^16.8.0"
"react": "^16.8.0"
"react-dom": "^16.8.0"

# "graphql-config@2.0.1":
# peerDependencies:
# "graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || 0.14.0"
# "graphql-import@0.4.5":
# peerDependencies:
# "graphql": "^0.14.0"
# "graphql-language-service-interface@1.3.2":
# peerDependencies:
# "graphql": "^0.14.0"
# "graphql-language-service-utils@1.2.2":
# peerDependencies:
# "graphql": "^0.14.0"

"@octokit/rest@*":
dependencies:
"@octokit/core": ">=3"
"webpack@*":
dependencies:
"lodash": "^4.15.0"
peerDependencies:
"webpack-cli": "*"
"winston-transport@4.4.0":
dependencies:
"logform": "2.2.0"

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
spec: "@yarnpkg/plugin-workspace-tools"
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: "@yarnpkg/plugin-interactive-tools"
- path: .yarn/plugins/@yarnpkg/plugin-typescript.cjs
spec: "@yarnpkg/plugin-typescript"

yarnPath: .yarn/releases/yarn-2.4.0.cjs