Skip to content

Commit

Permalink
internal: Use yarn pnp
Browse files Browse the repository at this point in the history
  • Loading branch information
ntucker committed Jul 28, 2022
1 parent 43a0a79 commit 7fb5615
Show file tree
Hide file tree
Showing 36 changed files with 955 additions and 401 deletions.
8 changes: 4 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
steps:
- attach_workspace:
at: ~/
- run: yarn workspaces foreach run test:ci
- run: yarn workspaces foreach -v run test:ci
# only run coverage if repo token is available (so third parties don't fail the build)
- run:
name: coverage
Expand All @@ -66,21 +66,21 @@ jobs:
steps:
- attach_workspace:
at: ~/
- run: yarn workspaces foreach --include 'example-*' run build
- run: yarn workspaces foreach -v --include 'example-*' run build

build_server:
docker: *docker
steps:
- attach_workspace:
at: ~/
- run: yarn workspaces foreach run build:server
- run: yarn workspaces foreach -v --include 'example-*' run build:server

build_storybook:
docker: *docker
steps:
- attach_workspace:
at: ~/
- run: yarn workspaces foreach run build:storybook
- run: yarn workspace example-typescript run build:storybook


workflows:
Expand Down
7 changes: 7 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"recommendations": [
"arcanis.vscode-zipfs",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode"
]
}
13 changes: 9 additions & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@

{
"eslint.nodePath": "node_modules",
"eslint.nodePath": ".yarn/sdks",
"eslint.runtime": "node",
"typescript.format.enable": true,
"typescript.validate.enable": true,
"typescript.tsdk": "node_modules/typescript/lib",
"typescript.tsdk": ".yarn/sdks/typescript/lib",
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[javascript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
Expand All @@ -23,5 +22,11 @@
],
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
},
"search.exclude": {
"**/.yarn": true,
"**/.pnp.*": true
},
"prettier.prettierPath": ".yarn/sdks/prettier/index.js",
"typescript.enablePromptUseWorkspaceTsdk": true
}
20 changes: 20 additions & 0 deletions .yarn/sdks/eslint/bin/eslint.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} = 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 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`);
6 changes: 6 additions & 0 deletions .yarn/sdks/eslint/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "eslint",
"version": "8.19.0-sdk",
"main": "./lib/api.js",
"type": "commonjs"
}
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 @yarnpkg/sdks.
# Manual changes might be lost!

integrations:
- vscode
20 changes: 20 additions & 0 deletions .yarn/sdks/prettier/index.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} = 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 prettier/index.js
require(absPnpApiPath).setup();
}
}

// Defer to the real prettier/index.js your application uses
module.exports = absRequire(`prettier/index.js`);
6 changes: 6 additions & 0 deletions .yarn/sdks/prettier/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "prettier",
"version": "2.7.1-sdk",
"main": "./index.js",
"type": "commonjs"
}
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} = 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 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} = 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 typescript/bin/tsserver
require(absPnpApiPath).setup();
}
}

// Defer to the real typescript/bin/tsserver your application uses
module.exports = absRequire(`typescript/bin/tsserver`);
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": "4.7.4-sdk",
"main": "./lib/typescript.js",
"type": "commonjs"
}
3 changes: 2 additions & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ changesetIgnorePatterns:
- "**/__tests__/**"
- "**/*.md"

nodeLinker: node-modules
nodeLinker: pnp
pnpEnableEsmLoader: true

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
Expand Down
2 changes: 1 addition & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ module.exports = function (api) {
pureGetters: true,
},
// allows us to load .babelrc in addition to this
babelrcRoots: ['packages/*', 'examples/*'],
//babelrcRoots: ['packages/*', 'examples/*'],
};
};
9 changes: 8 additions & 1 deletion examples/concurrent/.babelrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
module.exports = {
presets: [['@anansi', { typing: 'typescript' }]],
presets: [['@anansi', { typing: 'typescript', loose: true }]],
assumptions: {
noDocumentAll: true,
noClassCalls: true,
constantReexports: true,
objectRestNoSymbols: true,
pureGetters: true,
},
};
9 changes: 7 additions & 2 deletions examples/concurrent/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
"build:analyze": "webpack --mode=production --env analyze",
"build:profile": "webpack --mode=production --env profile",
"pkgcheck": "webpack --env check=nobuild",
"test": "echo \"Error: no test specified\" && exit 1",
"test:ci": "echo \"Error: no test specified\"",
"test:type": "tsc --noEmit",
"postinstall": "rm -rf node_modules/.cache"
},
Expand All @@ -22,7 +24,7 @@
"@anansi/jest-preset": "^0.7.16",
"@anansi/webpack-config": "^12.0.3",
"@babel/core": "^7.18.9",
"@rest-hooks/test": "7.3.4",
"@rest-hooks/test": "7.3.5",
"@types/babel__core": "^7",
"@types/classnames": "^2.2.9",
"@types/eslint": "^8",
Expand All @@ -34,6 +36,7 @@
"@typescript-eslint/eslint-plugin": "^5.30.7",
"@typescript-eslint/parser": "^5.30.7",
"eslint": "^8.20.0",
"eslint-plugin-babel": "^5.3.1",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.30.1",
Expand All @@ -45,11 +48,13 @@
"typescript": "^4.7.4",
"webpack": "5.74.0",
"webpack-cli": "4.10.0",
"webpack-dev-server": "4.9.3"
"webpack-dev-server": "4.9.3",
"webpack-node-externals": "^3.0.0"
},
"dependencies": {
"@anansi/core": "^0.14.8",
"@anansi/router": "^0.6.10",
"@ant-design/icons": "^4.7.0",
"@babel/runtime": "^7.17.2",
"@linaria/core": "3.0.0-beta.22",
"@linaria/react": "3.0.0-beta.22",
Expand Down
2 changes: 1 addition & 1 deletion examples/concurrent/src/routing/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { RouteController } from '@pojo-router/core';
import { RouteController } from '@anansi/router';
import type { History } from 'history';

import NotFound from 'components/NotFound';
Expand Down
11 changes: 8 additions & 3 deletions examples/linaria/.babelrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
module.exports = {
presets: [
['@anansi', { typing: 'typescript' }],
],
presets: [['@anansi', { typing: 'typescript', loose: true }]],
assumptions: {
noDocumentAll: true,
noClassCalls: true,
constantReexports: true,
objectRestNoSymbols: true,
pureGetters: true,
},
};
30 changes: 28 additions & 2 deletions examples/linaria/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,38 @@
"build:analyze": "webpack --mode=production --env analyze",
"build:profile": "webpack --mode=production --env profile",
"pkgcheck": "webpack --env check=nobuild",
"test": "echo \"Error: no test specified\" && exit 1",
"test:ci": "echo \"Error: no test specified\"",
"test:type": "tsc --noEmit"
},
"devDependencies": {
"@anansi/babel-preset": "^3.2.12",
"@anansi/browserslist-config": "^1.3.3",
"@anansi/eslint-plugin": "^0.14.2",
"@anansi/webpack-config": "^12.0.3",
"@babel/core": "^7.18.9",
"@types/babel__core": "^7",
"@types/classnames": "^2.2.9",
"@types/eslint": "^8",
"@types/prettier": "^2",
"@types/react": "^18.0.15",
"@types/react-dom": "^18.0.6",
"@types/react-router-dom": "^5.3.3",
"@typescript-eslint/eslint-plugin": "^5.31.0",
"@typescript-eslint/parser": "^5.31.0",
"babel-loader": "8.2.5",
"eslint": "^8.20.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.30.1",
"eslint-plugin-react-hooks": "^4.6.0",
"prettier": "^2.7.1",
"react-refresh": "0.14.0",
"serve": "14.0.1",
"webpack": "5.74.0"
"webpack": "5.74.0",
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.9.3",
"webpack-node-externals": "^3.0.0"
},
"dependencies": {
"@babel/plugin-transform-modules-commonjs": "7.18.6",
Expand All @@ -32,9 +52,15 @@
"@linaria/shaker": "3.0.0-beta.22",
"classnames": "^2.2.6",
"core-js": "3.24.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"redbox-react": "^1.6.0"
},
"browserslist": [
"extends @anansi/browserslist-config"
]
],
"peerDependencies": {
"@types/react": "^17.0.40 || ^18.0.0-0",
"@types/react-dom": "^17.0.40 || ^18.0.0-0"
}
}
9 changes: 8 additions & 1 deletion examples/typescript/.babelrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
module.exports = {
presets: [['@anansi', { typing: 'typescript' }]],
presets: [['@anansi', { typing: 'typescript', loose: true }]],
assumptions: {
noDocumentAll: true,
noClassCalls: true,
constantReexports: true,
objectRestNoSymbols: true,
pureGetters: true,
},
};
Loading

0 comments on commit 7fb5615

Please sign in to comment.