Skip to content

Commit d1073df

Browse files
committed
build: Upgrade to Yarn 3.
1 parent 89576a6 commit d1073df

File tree

10 files changed

+9265
-6004
lines changed

10 files changed

+9265
-6004
lines changed

.config/beemo.ts

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,4 @@ export default {
44
settings: {
55
node: true,
66
},
7-
// babel: {
8-
// sourceType: 'module',
9-
// ignore: ['tests/fixtures/**/*.js'],
10-
// },
11-
// eslint: {
12-
// rules: {
13-
// complexity: 'off',
14-
// 'no-shadow': 'off',
15-
// 'no-param-reassign': 'off',
16-
// 'no-use-before-define': 'off',
17-
// 'react/forbid-foreign-prop-types': 'off',
18-
// 'typescript/no-use-before-define': 'off',
19-
// 'import/no-extraneous-dependencies': 'off',
20-
// },
21-
// ignore: ['tests/fixtures/'],
22-
// overrides: [
23-
// {
24-
// files: ['*.ts'],
25-
// rules: {
26-
// '@typescript-eslint/no-explicit-any': 'off',
27-
// },
28-
// },
29-
// ],
30-
// },
31-
// jest: {
32-
// testPathIgnorePatterns: ['/node_modules/', '/tests/fixtures/'],
33-
// testEnvironment: 'node',
34-
// transformIgnorePatterns: ['/node_modules/', '/tests/fixtures/'],
35-
// modulePathIgnorePatterns: ['/node_modules/', '/tests/fixtures/'],
36-
// },
37-
// typescript: {
38-
// exclude: ['./tests/fixtures/**/*'],
39-
// },
407
};

.config/beemo/jest.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export default {
2+
testPathIgnorePatterns: ['/node_modules/', '/tests/fixtures/'],
3+
transformIgnorePatterns: ['/node_modules/', '/tests/fixtures/'],
4+
modulePathIgnorePatterns: ['/node_modules/', '/tests/fixtures/'],
5+
};

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ jobs:
1717
- uses: actions/setup-node@v2
1818
with:
1919
node-version: ${{ matrix.node-version }}
20-
- run: yarn install --ignore-engines --frozen-lockfile
20+
- run: yarn install --immutable
2121
- run: yarn test

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,13 @@ jest.config.js
3131
prettier.config.js
3232
tsconfig.json
3333
webpack.config.js
34+
35+
# Yarn
36+
.yarn/*
37+
!.yarn/patches
38+
!.yarn/releases
39+
!.yarn/plugins
40+
!.yarn/sdks
41+
!.yarn/versions
42+
.pnp.*
43+

.yarn/releases/yarn-3.0.2.cjs

Lines changed: 631 additions & 0 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
enableGlobalCache: true
2+
3+
enableTelemetry: false
4+
5+
nodeLinker: node-modules
6+
7+
yarnPath: .yarn/releases/yarn-3.0.2.cjs

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,8 @@
2020
"lint": "beemo eslint",
2121
"test": "beemo jest",
2222
"format": "beemo prettier",
23-
"release": "npx np --yolo --no-yarn",
24-
"type": "beemo typescript --noEmit",
25-
"prerelease": "yarn test && yarn run build"
23+
"release": "yarn run build && yarn run check && npx np --yolo --no-yarn",
24+
"type": "beemo typescript --noEmit"
2625
},
2726
"engines": {
2827
"node": ">=10.10.0"
@@ -54,5 +53,6 @@
5453
"fast-glob": "^3.2.4",
5554
"prop-types": "^15.7.2",
5655
"typescript": "^4.0.5"
57-
}
56+
},
57+
"packageManager": "[email protected]"
5858
}

tests/__snapshots__/index.test.ts.snap

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2819,22 +2819,24 @@ var _react = _interopRequireDefault(require('react'));
28192819
28202820
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
28212821
2822+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2823+
28222824
interface Props {
28232825
name: string;
28242826
}
28252827
28262828
class ESTarget extends _react.default.Component<Props> {
2827-
static propTypes = {
2828-
name: _propTypes.default.string.isRequired
2829-
};
2830-
28312829
render() {
28322830
return null;
28332831
}
28342832
28352833
}
28362834
2837-
exports.default = ESTarget;"
2835+
exports.default = ESTarget;
2836+
2837+
_defineProperty(ESTarget, 'propTypes', {
2838+
name: _propTypes.default.string.isRequired
2839+
});"
28382840
`;
28392841
28402842
exports[`babel-plugin-typescript-to-proptypes works correctly when transpiling to CJS modules 2`] = `
@@ -2854,35 +2856,37 @@ interface Props {
28542856
}
28552857
28562858
class ESTarget extends _react.default.Component<Props> {
2857-
static propTypes = {
2858-
name: _propTypes.default.string.isRequired
2859-
};
2860-
28612859
render() {
28622860
return null;
28632861
}
28642862
28652863
}
28662864
2867-
exports.default = ESTarget;"
2865+
exports.default = ESTarget;
2866+
ESTarget.propTypes = {
2867+
name: _propTypes.default.string.isRequired
2868+
};"
28682869
`;
28692870
28702871
exports[`babel-plugin-typescript-to-proptypes works correctly when transpiling to ESM modules 1`] = `
28712872
"import _pt from 'prop-types';
2873+
2874+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2875+
28722876
import React from 'react';
28732877
interface Props {
28742878
name: string;
28752879
}
28762880
export default class ESTarget extends React.Component<Props> {
2877-
static propTypes = {
2878-
name: _pt.string.isRequired
2879-
};
2880-
28812881
render() {
28822882
return null;
28832883
}
28842884
2885-
}"
2885+
}
2886+
2887+
_defineProperty(ESTarget, 'propTypes', {
2888+
name: _pt.string.isRequired
2889+
});"
28862890
`;
28872891
28882892
exports[`babel-plugin-typescript-to-proptypes works correctly when transpiling to ESM modules 2`] = `
@@ -2892,15 +2896,14 @@ interface Props {
28922896
name: string;
28932897
}
28942898
export default class ESTarget extends React.Component<Props> {
2895-
static propTypes = {
2896-
name: _pt.string.isRequired
2897-
};
2898-
28992899
render() {
29002900
return null;
29012901
}
29022902
2903-
}"
2903+
}
2904+
ESTarget.propTypes = {
2905+
name: _pt.string.isRequired
2906+
};"
29042907
`;
29052908
29062909
exports[`babel-plugin-typescript-to-proptypes works correctly when using ALL the things 1`] = `

tests/index.test.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ function transform(
1616
configFile: false,
1717
filename: filePath,
1818
plugins: [[plugin, pluginOptions]],
19+
presets: [],
1920
generatorOpts: {
2021
jsescOption: { quotes: 'single' },
2122
},
@@ -99,32 +100,30 @@ describe('babel-plugin-typescript-to-proptypes', () => {
99100
it('works correctly when transpiling to ESM modules', () => {
100101
expect(
101102
transform(path.join(__dirname, './fixtures/special/es-target.ts'), {
102-
presets: [['@babel/preset-env', { targets: { node: 'current' }, modules: false }]],
103+
presets: [['@babel/preset-env', { targets: { node: 12 }, modules: false }]],
103104
}),
104105
).toMatchSnapshot();
105106

106107
// loose
107108
expect(
108109
transform(path.join(__dirname, './fixtures/special/es-target.ts'), {
109-
presets: [
110-
['@babel/preset-env', { targets: { node: 'current' }, modules: false, loose: true }],
111-
],
110+
presets: [['@babel/preset-env', { targets: { node: 12 }, modules: false, loose: true }]],
112111
}),
113112
).toMatchSnapshot();
114113
});
115114

116115
it('works correctly when transpiling to CJS modules', () => {
117116
expect(
118117
transform(path.join(__dirname, './fixtures/special/es-target.ts'), {
119-
presets: [['@babel/preset-env', { targets: { node: 'current' }, modules: 'commonjs' }]],
118+
presets: [['@babel/preset-env', { targets: { node: 12 }, modules: 'commonjs' }]],
120119
}),
121120
).toMatchSnapshot();
122121

123122
// loose
124123
expect(
125124
transform(path.join(__dirname, './fixtures/special/es-target.ts'), {
126125
presets: [
127-
['@babel/preset-env', { targets: { node: 'current' }, modules: 'commonjs', loose: true }],
126+
['@babel/preset-env', { targets: { node: 12 }, modules: 'commonjs', loose: true }],
128127
],
129128
}),
130129
).toMatchSnapshot();

0 commit comments

Comments
 (0)