New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@rushstack/typings-generator

Package Overview
Dependencies
Maintainers
3
Versions
316
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rushstack/typings-generator - npm Package Compare versions

Comparing version 0.8.11 to 0.8.12

5

dist/typings-generator.d.ts

@@ -95,6 +95,6 @@ import { ITerminal } from '@rushstack/node-core-library';

*
* @param filePaths - The input files to process, relative to the source folder. If not provided,
* @param relativeFilePaths - The input files to process, relative to the source folder. If not provided,
* all input files will be processed.
*/
generateTypingsAsync(filePaths?: string[]): Promise<void>;
generateTypingsAsync(relativeFilePaths?: string[]): Promise<void>;
runWatcherAsync(): Promise<void>;

@@ -109,2 +109,3 @@ /**

getOutputFilePaths(relativePath: string): string[];
private _getOutputFilePathsWithoutCheck;
private _reprocessFiles;

@@ -111,0 +112,0 @@ private _parseFileAndGenerateTypingsAsync;

@@ -52,6 +52,6 @@ import { ITerminal } from '@rushstack/node-core-library';

*
* @param filePaths - The input files to process, relative to the source folder. If not provided,
* @param relativeFilePaths - The input files to process, relative to the source folder. If not provided,
* all input files will be processed.
*/
generateTypingsAsync(filePaths?: string[]): Promise<void>;
generateTypingsAsync(relativeFilePaths?: string[]): Promise<void>;
runWatcherAsync(): Promise<void>;

@@ -66,2 +66,3 @@ /**

getOutputFilePaths(relativePath: string): string[];
private _getOutputFilePathsWithoutCheck;
private _reprocessFiles;

@@ -68,0 +69,0 @@ private _parseFileAndGenerateTypingsAsync;

27

lib/TypingsGenerator.js

@@ -77,8 +77,10 @@ "use strict";

*
* @param filePaths - The input files to process, relative to the source folder. If not provided,
* @param relativeFilePaths - The input files to process, relative to the source folder. If not provided,
* all input files will be processed.
*/
async generateTypingsAsync(filePaths) {
if (!(filePaths === null || filePaths === void 0 ? void 0 : filePaths.length)) {
filePaths = await node_core_library_1.LegacyAdapters.convertCallbackToPromise(glob_1.default, this.inputFileGlob, {
async generateTypingsAsync(relativeFilePaths) {
let checkFilePaths = true;
if (!(relativeFilePaths === null || relativeFilePaths === void 0 ? void 0 : relativeFilePaths.length)) {
checkFilePaths = false; // Don't check file paths if we generate them
relativeFilePaths = await node_core_library_1.LegacyAdapters.convertCallbackToPromise(glob_1.default, this.inputFileGlob, {
cwd: this.sourceFolderPath,

@@ -90,3 +92,3 @@ ignore: this.ignoredFileGlobs,

}
await this._reprocessFiles(filePaths);
await this._reprocessFiles(relativeFilePaths, checkFilePaths);
}

@@ -108,3 +110,3 @@ async runWatcherAsync() {

queue.clear();
this._reprocessFiles(toProcess)
this._reprocessFiles(toProcess, false)
.then(() => {

@@ -140,3 +142,3 @@ processing = false;

watcher.on('unlink', async (relativePath) => {
await Promise.all(this.getOutputFilePaths(relativePath).map(async (outputFile) => {
await Promise.all(this._getOutputFilePathsWithoutCheck(relativePath).map(async (outputFile) => {
await node_core_library_1.FileSystem.deleteFileAsync(outputFile);

@@ -171,2 +173,8 @@ }));

getOutputFilePaths(relativePath) {
if (path.isAbsolute(relativePath)) {
throw new Error(`"${relativePath}" must be relative`);
}
return this._getOutputFilePathsWithoutCheck(relativePath);
}
_getOutputFilePathsWithoutCheck(relativePath) {
var _a, _b;

@@ -177,6 +185,9 @@ const typingsFilePaths = this._getTypingsFilePaths(relativePath);

}
async _reprocessFiles(relativePaths) {
async _reprocessFiles(relativePaths, checkFilePaths) {
// Build a queue of resolved paths
const toProcess = new Set();
for (const rawPath of relativePaths) {
if (checkFilePaths && path.isAbsolute(rawPath)) {
throw new Error(`"${rawPath}" must be relative`);
}
const relativePath = node_core_library_1.Path.convertToSlashes(rawPath);

@@ -183,0 +194,0 @@ const resolvedPath = path.resolve(this._options.srcFolder, rawPath);

{
"name": "@rushstack/typings-generator",
"version": "0.8.11",
"version": "0.8.12",
"description": "This library provides functionality for automatically generating typings for non-TS files.",

@@ -5,0 +5,0 @@ "keywords": [

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc