Skip to content

Commit

Permalink
Update on top of new type checking infrastructure
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolo-ribaudo committed Apr 24, 2024
1 parent 1961fe0 commit dd18f68
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 107 deletions.
37 changes: 1 addition & 36 deletions Gulpfile.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { fileURLToPath } from "url";
import plumber from "gulp-plumber";
import through from "through2";
import colors from "picocolors";
import filter from "gulp-filter";
import gulp from "gulp";
import { rollup } from "rollup";
import {
Expand Down Expand Up @@ -100,13 +99,6 @@ function errorsLogger() {
});
}

function rename(fn) {
return through.obj(function (file, enc, callback) {
file.path = fn(file);
callback(null, file);
});
}

/**
* @param {string} generator
* @param {string} pkg
Expand Down Expand Up @@ -233,22 +225,6 @@ function finish(stream) {
});
}

function getFiles(glob, { include, exclude }) {
let stream = gulp.src(glob, { base: monorepoRoot });

if (exclude) {
const filters = exclude.map(p => `!**/${p}/**`);
filters.unshift("**");
stream = stream.pipe(filter(filters));
}
if (include) {
const filters = include.map(p => `**/${p}/**`);
stream = stream.pipe(filter(filters));
}

return stream;
}

function createWorker(useWorker) {
const numWorkers = Math.ceil(Math.max(cpus().length, 1) / 2) - 1;
if (
Expand Down Expand Up @@ -664,13 +640,6 @@ function buildRollupDts(packages) {
return Promise.all(tasks);
}

// Copies manually-written .d.ts files from `src` to /dts
function copyDts(packages) {
return getFiles(`${defaultPackagesGlob}/src/**/*.d.ts`, { include: packages })
.pipe(rename(file => path.resolve(file.base, mapToDts(file.relative))))
.pipe(gulp.dest(monorepoRoot));
}

function* packagesIterator(exclude) {
for (const packageDir of ["packages", "codemods"]) {
for (const dir of fs.readdirSync(new URL(packageDir, import.meta.url))) {
Expand Down Expand Up @@ -833,11 +802,7 @@ gulp.task(
gulp.series("generate-standalone", "rollup-babel-standalone")
);

gulp.task("copy-dts", () => copyDts(dtsBundles));
gulp.task(
"bundle-dts",
gulp.series("copy-dts", () => buildRollupDts(dtsBundles))
);
gulp.task("bundle-dts", () => buildRollupDts(dtsBundles));

gulp.task("build-babel", () => buildBabel(true, /* exclude */ libBundles));

Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
"execa": "^8.0.1",
"glob": "^10.3.10",
"gulp": "^4.0.2",
"gulp-filter": "^7.0.0",
"gulp-plumber": "^1.2.1",
"husky": "^8.0.3",
"import-meta-resolve": "^4.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-parser/typings/babel-parser.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,4 +248,4 @@ type ParseResult<Result> = Result & {
errors: ParseError[];
};

export { DecoratorsPluginOptions, FlowPluginOptions, ParseError, ParseResult, ParserOptions, ParserPlugin, ParserPluginWithOptions, PipelineOperatorPluginOptions, RecordAndTuplePluginOptions, TypeScriptPluginOptions, parse, parseExpression, tokTypes };
export { type DecoratorsPluginOptions, type FlowPluginOptions, type ParseError, type ParseResult, type ParserOptions, type ParserPlugin, type ParserPluginWithOptions, type PipelineOperatorPluginOptions, type RecordAndTuplePluginOptions, type TypeScriptPluginOptions, parse, parseExpression, tokTypes };
72 changes: 3 additions & 69 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5454,7 +5454,7 @@ __metadata:
languageName: node
linkType: hard

"@types/minimatch@npm:*, @types/minimatch@npm:^3.0.3":
"@types/minimatch@npm:*":
version: 3.0.5
resolution: "@types/minimatch@npm:3.0.5"
checksum: 10/c41d136f67231c3131cf1d4ca0b06687f4a322918a3a5adddc87ce90ed9dbd175a3610adee36b106ae68c0b92c637c35e02b58c8a56c424f71d30993ea220b92
Expand Down Expand Up @@ -6580,13 +6580,6 @@ __metadata:
languageName: node
linkType: hard

"array-differ@npm:^3.0.0":
version: 3.0.0
resolution: "array-differ@npm:3.0.0"
checksum: 10/117edd9df5c1530bd116c6e8eea891d4bd02850fd89b1b36e532b6540e47ca620a373b81feca1c62d1395d9ae601516ba538abe5e8172d41091da2c546b05fb7
languageName: node
linkType: hard

"array-each@npm:^1.0.0, array-each@npm:^1.0.1":
version: 1.0.1
resolution: "array-each@npm:1.0.1"
Expand Down Expand Up @@ -6757,13 +6750,6 @@ __metadata:
languageName: node
linkType: hard

"arrify@npm:^2.0.1":
version: 2.0.1
resolution: "arrify@npm:2.0.1"
checksum: 10/067c4c1afd182806a82e4c1cb8acee16ab8b5284fbca1ce29408e6e91281c36bb5b612f6ddfbd40a0f7a7e0c75bf2696eb94c027f6e328d6e9c52465c98e4209
languageName: node
linkType: hard

"asn1.js@npm:^4.0.0":
version: 4.10.1
resolution: "asn1.js@npm:4.10.1"
Expand Down Expand Up @@ -7117,7 +7103,6 @@ __metadata:
execa: "npm:^8.0.1"
glob: "npm:^10.3.10"
gulp: "npm:^4.0.2"
gulp-filter: "npm:^7.0.0"
gulp-plumber: "npm:^1.2.1"
husky: "npm:^8.0.3"
import-meta-resolve: "npm:^4.0.0"
Expand Down Expand Up @@ -10577,23 +10562,6 @@ __metadata:
languageName: node
linkType: hard

"gulp-filter@npm:^7.0.0":
version: 7.0.0
resolution: "gulp-filter@npm:7.0.0"
dependencies:
multimatch: "npm:^5.0.0"
plugin-error: "npm:^1.0.1"
streamfilter: "npm:^3.0.0"
to-absolute-glob: "npm:^2.0.2"
peerDependencies:
gulp: ">=4"
peerDependenciesMeta:
gulp:
optional: true
checksum: 10/e9f8657cea5ed42538282331b7ac08206cb2d6bae9a019c557072fe685db3f05d8a1a5850417d686e59cb3acfbef642c6fac58e189f4e00eb82ff8162dd4fd37
languageName: node
linkType: hard

"gulp-plumber@npm:^1.2.1":
version: 1.2.1
resolution: "gulp-plumber@npm:1.2.1"
Expand Down Expand Up @@ -13297,19 +13265,6 @@ __metadata:
languageName: node
linkType: hard

"multimatch@npm:^5.0.0":
version: 5.0.0
resolution: "multimatch@npm:5.0.0"
dependencies:
"@types/minimatch": "npm:^3.0.3"
array-differ: "npm:^3.0.0"
array-union: "npm:^2.1.0"
arrify: "npm:^2.0.1"
minimatch: "npm:^3.0.4"
checksum: 10/82c8030a53af965cab48da22f1b0f894ef99e16ee680dabdfbd38d2dfacc3c8208c475203d747afd9e26db44118ed0221d5a0d65268c864f06d6efc7ac6df812
languageName: node
linkType: hard

"mute-stdout@npm:^1.0.0":
version: 1.0.1
resolution: "mute-stdout@npm:1.0.1"
Expand Down Expand Up @@ -14264,18 +14219,6 @@ __metadata:
languageName: node
linkType: hard

"plugin-error@npm:^1.0.1":
version: 1.0.1
resolution: "plugin-error@npm:1.0.1"
dependencies:
ansi-colors: "npm:^1.0.1"
arr-diff: "npm:^4.0.0"
arr-union: "npm:^3.1.0"
extend-shallow: "npm:^3.0.2"
checksum: 10/5cacd34372b909f07125829c2876707f4add64dcdf0dd8bd23d7ceac70eeb961c038a9707a998cc498bf8d478cc81f8d85b82584313926fe61a8fa294f79f3e4
languageName: node
linkType: hard

"posix-character-classes@npm:^0.1.0":
version: 0.1.1
resolution: "posix-character-classes@npm:0.1.1"
Expand Down Expand Up @@ -14581,7 +14524,7 @@ __metadata:
languageName: node
linkType: hard

"readable-stream@npm:3, readable-stream@npm:^3.0.6, readable-stream@npm:^3.6.0":
"readable-stream@npm:3, readable-stream@npm:^3.6.0":
version: 3.6.2
resolution: "readable-stream@npm:3.6.2"
dependencies:
Expand Down Expand Up @@ -15821,15 +15764,6 @@ __metadata:
languageName: node
linkType: hard

"streamfilter@npm:^3.0.0":
version: 3.0.0
resolution: "streamfilter@npm:3.0.0"
dependencies:
readable-stream: "npm:^3.0.6"
checksum: 10/7554c996a807276e1a6f50452a108d3923c16e09c5ee1d60abe40e4e13aa8aac51a4aa6ad211179174ac4f12c60c9e8f2281a5431bd11a9d945f290f770c223c
languageName: node
linkType: hard

"string-argv@npm:0.3.2":
version: 0.3.2
resolution: "string-argv@npm:0.3.2"
Expand Down Expand Up @@ -16347,7 +16281,7 @@ __metadata:
languageName: node
linkType: hard

"to-absolute-glob@npm:^2.0.0, to-absolute-glob@npm:^2.0.2":
"to-absolute-glob@npm:^2.0.0":
version: 2.0.2
resolution: "to-absolute-glob@npm:2.0.2"
dependencies:
Expand Down

0 comments on commit dd18f68

Please sign in to comment.