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

Use swc / ts-node instead of babel #2228

Closed
wants to merge 22 commits into from
Closed
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,6 @@ package.tgz
# We check-in the PnP hook because it would be heavy to regenerate it before each bundle build
!/packages/yarnpkg-pnp/lib/hook.js

/vscode-case-study
/vscode-case-study

/.typescript-cached-transpile
359 changes: 251 additions & 108 deletions .pnp.js

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/cache/resolve-patch-493d9f7c02-3a0acfc6cc.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
30 changes: 30 additions & 0 deletions .yarn/versions/9cc4141b.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
declined:
- "@yarnpkg/plugin-compat"
- "@yarnpkg/plugin-constraints"
- "@yarnpkg/plugin-dlx"
- "@yarnpkg/plugin-essentials"
- "@yarnpkg/plugin-exec"
- "@yarnpkg/plugin-file"
- "@yarnpkg/plugin-git"
- "@yarnpkg/plugin-github"
- "@yarnpkg/plugin-http"
- "@yarnpkg/plugin-interactive-tools"
- "@yarnpkg/plugin-link"
- "@yarnpkg/plugin-node-modules"
- "@yarnpkg/plugin-npm"
- "@yarnpkg/plugin-npm-cli"
- "@yarnpkg/plugin-pack"
- "@yarnpkg/plugin-patch"
- "@yarnpkg/plugin-pnp"
- "@yarnpkg/plugin-stage"
- "@yarnpkg/plugin-typescript"
- "@yarnpkg/plugin-version"
- "@yarnpkg/plugin-workspace-tools"
- "@yarnpkg/builder"
- "@yarnpkg/cli"
- "@yarnpkg/core"
- "@yarnpkg/fslib"
- "@yarnpkg/libui"
- "@yarnpkg/pnp"
- "@yarnpkg/pnpify"
- "@yarnpkg/shell"
6 changes: 6 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ packageExtensions:
optional: true
typedoc-plugin-yarn:
optional: true
"@node-rs/helper@*":
dependencies:
"@swc/core-linux": "*"
"@swc/core-linux-musl": "*"
"@swc/core-darwin": "*"
"@swc/core-win32": "*"

preferInteractive: true

Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"@babel/preset-react": "^7.10.1",
"@babel/preset-typescript": "^7.10.1",
"@babel/register": "^7.10.1",
"@swc/core": "^1.2.40",
"@types/emscripten": "^1.38.0",
"@types/jest": "^24.0.25",
"@types/node": "^13.7.0",
Expand All @@ -38,8 +39,10 @@
"jest-environment-node": "^26.0.1",
"jest-junit": "^10.0.0",
"micromatch": "^4.0.2",
"ts-node": "github:TypeStrong/ts-node#ab/swc-compiler",
"tslib": "^1.13.0",
"typescript": "4.1.0-beta"
"typescript": "4.1.0-beta",
"typescript-cached-transpile": "^0.0.6"
},
"resolutions": {
"yoga-layout-prebuilt": "patch:yoga-layout-prebuilt@1.10.0#./.yarn/patches/yoga-layout-prebuilt.patch"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {stringifySyml, parseSyml} from '@yarnpkg/parsers';
import klaw from 'klaw';
import tarFs from 'tar-fs';
import zlib from 'zlib';
import {Gzip} from 'zlib';
import type {Gzip} from 'zlib';

import * as miscUtils from './misc';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {PortablePath, ppath, Filename} from '@yarnpkg/fslib';

import * as fsUtils from './fs';
import {RunFunction} from './tests';
import type {RunFunction} from './tests';

const deepResolve = require(`super-resolve`);

Expand Down
32 changes: 16 additions & 16 deletions packages/acceptance-tests/pkg-tests-core/sources/utils/tests.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
import {PortablePath, npath, toFilename} from '@yarnpkg/fslib';
import crypto from 'crypto';
import finalhandler from 'finalhandler';
import https from 'https';
import http from 'http';

import {IncomingMessage, ServerResponse} from 'http';
import invariant from 'invariant';
import {AddressInfo} from 'net';
import pem from 'pem';
import semver from 'semver';
import serveStatic from 'serve-static';
import {promisify} from 'util';
import {PortablePath, npath, toFilename} from '@yarnpkg/fslib';
import crypto from 'crypto';
import finalhandler from 'finalhandler';
import https from 'https';
import http from 'http';

import type {IncomingMessage, ServerResponse} from 'http';
import invariant from 'invariant';
import type {AddressInfo} from 'net';
import pem from 'pem';
import semver from 'semver';
import serveStatic from 'serve-static';
import {promisify} from 'util';

const deepResolve = require(`super-resolve`);

const staticServer = serveStatic(npath.fromPortablePath(require(`pkg-tests-fixtures`)));

import {Gzip} from 'zlib';
import type {Gzip} from 'zlib';

import {ExecResult} from './exec';
import * as fsUtils from './fs';
import type {ExecResult} from './exec';
import * as fsUtils from './fs';

export type PackageEntry = Map<string, {path: string, packageJson: Object}>;
export type PackageRegistry = Map<string, PackageEntry>;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {Manifest} from '@yarnpkg/core';
import {PortablePath} from '@yarnpkg/fslib';
import {merge} from 'lodash';
import {fs, yarn} from 'pkg-tests-core';
import {Manifest} from '@yarnpkg/core';
import type {PortablePath} from '@yarnpkg/fslib';
import {merge} from 'lodash';
import {fs, yarn} from 'pkg-tests-core';

const {unpackToDirectory} = fs;
const {writeConfiguration, readManifest} = yarn;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {PortablePath} from '@yarnpkg/fslib';
import {fs} from 'pkg-tests-core';
import type {PortablePath} from '@yarnpkg/fslib';
import {fs} from 'pkg-tests-core';

const {writeJson} = fs;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {PortablePath} from '@yarnpkg/fslib';
import {exec} from 'pkg-tests-core';
import {fs} from 'pkg-tests-core';
import type {PortablePath} from '@yarnpkg/fslib';
import type {exec} from 'pkg-tests-core';
import {fs} from 'pkg-tests-core';

const {readFile, writeFile, writeJson} = fs;

Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby/src/components/seo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Helmet from 'react-helmet';
import React from 'react';

import yarnKittenFull from '../images/yarn-kitten-full.svg';
import {Query} from '../types/queries';
import type {Query} from '../types/queries';

export const defaultKeywords = [`package manager`, `yarn`, `yarnpkg`, `configuration`, `yarnrc`];

Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-compat/sources/extensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// the same fields as you add here and prefix your changes with the relevant
// PR url.

import {PackageExtensionData} from '@yarnpkg/core';
import type {PackageExtensionData} from '@yarnpkg/core';

const optionalPeerDep = {
optional: true,
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-compat/sources/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Hooks as CoreHooks, Plugin, structUtils} from '@yarnpkg/core';
import {Hooks as PatchHooks} from '@yarnpkg/plugin-patch';
import type {Hooks as PatchHooks} from '@yarnpkg/plugin-patch';

import {packageExtensions} from './extensions';
import {getPatch as getFseventsPatch} from './patches/fsevents.patch';
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-constraints/sources/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Plugin, SettingsType} from '@yarnpkg/core';
import {PortablePath} from '@yarnpkg/fslib';
import type {PortablePath} from '@yarnpkg/fslib';

import queryConstraints from './commands/constraints/query';
import sourceConstraints from './commands/constraints/source';
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-constraints/sources/tauModule.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/// <reference path="./tauProlog.d.ts"/>

import {Project, structUtils} from '@yarnpkg/core';
import {PortablePath} from '@yarnpkg/fslib';
import type {PortablePath} from '@yarnpkg/fslib';
import getPath from 'lodash/get';
import pl from 'tau-prolog';
import vm from 'vm';
Expand Down
6 changes: 3 additions & 3 deletions packages/plugin-dlx/sources/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {Plugin} from '@yarnpkg/core';
import type {Plugin} from '@yarnpkg/core';

import create from './commands/create';
import dlx from './commands/dlx';
import create from './commands/create';
import dlx from './commands/dlx';

const plugin: Plugin = {
commands: [
Expand Down
Loading