Skip to content

Commit

Permalink
fixed index d ts and removed unnecessary
Browse files Browse the repository at this point in the history
  • Loading branch information
ngrujic committed Nov 27, 2023
1 parent 6ef1795 commit bc28311
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 9 deletions.
9 changes: 8 additions & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export default class SourceMap {
static generateEmptyMap(opts: GenerateEmptyMapOptions): SourceMap;
addEmptyMap(sourceName: string, sourceContent: string, lineOffset?: number): SourceMap;
addVLQMap(map: VLQMap, lineOffset?: number, columnOffset?: number): SourceMap;
addSourceMap(sourcemap: SourceMap, lineOffset: number): SourceMap;
addBuffer(buffer: Buffer, lineOffset?: number): SourceMap;
addIndexedMapping(mapping: IndexedMapping<string>, lineOffset?: number, columnOffset?: number): void;
addIndexedMappings(mappings: Array<IndexedMapping<string>>, lineOffset?: number, columnOffset?: number): void;
Expand All @@ -80,11 +81,17 @@ export default class SourceMap {
addSources(sources: string[]): number[];
getSourceIndex(source: string): number;
getSource(index: number): string;
getSources(): string[];
setSourceContent(sourceName: string, sourceContent: string): void;
getSourceContent(sourceName: string): string;
getSourcesContent(): (string | null)[];
getSourcesContentMap(): { [key: string]: string | null };
getNameIndex(name: string): number;
getName(index: number): string;
extends(buffer: Buffer): SourceMap;
getNames(): string[];
getMappings(): IndexedMapping<number>[];
indexedMappingToStringMapping(mapping: IndexedMapping<number> | null | undefined): IndexedMapping<string> | null | undefined;
extends(buffer: Buffer | SourceMap): SourceMap;
getMap(): ParsedMap;
findClosestMapping(line: number, column: number): IndexedMapping<string> | undefined;
offsetLines(line: number, lineOffset: number): IndexedMapping<string> | undefined;
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@parcel/source-map",
"version": "2.1.1",
"version": "2.1.2",
"main": "./dist/node.js",
"types": "index.d.ts",
"license": "MIT",
Expand Down Expand Up @@ -77,7 +77,8 @@
"prettier": "^2.3.0",
"shx": "^0.3.3",
"source-map": "^0.7.3",
"tiny-benchy": "^2.1.0"
"tiny-benchy": "^2.1.0",
"@khanacademy/flow-to-ts": "0.5.2"
},
"browser": {
"./dist/node.js": "./dist/wasm.js",
Expand Down
3 changes: 1 addition & 2 deletions src/SourceMap.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// @flow
import type { ParsedMap, VLQMap, SourceMapStringifyOptions, IndexedMapping, GenerateEmptyMapOptions } from './types';

import path from 'path';
import { generateInlineMap, partialVlqMapToSourceMap } from './utils';
import { partialVlqMapToSourceMap } from './utils';
import { version } from '../package.json';

export default class SourceMap {
Expand Down
3 changes: 1 addition & 2 deletions src/node.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// @flow
import type { ParsedMap, VLQMap, SourceMapStringifyOptions, IndexedMapping, GenerateEmptyMapOptions } from './types';
import path from 'path';
import type { VLQMap, GenerateEmptyMapOptions } from './types';
import SourceMap from './SourceMap';

const bindings = require('../parcel_sourcemap_node/artifacts/index');
Expand Down
3 changes: 1 addition & 2 deletions src/wasm.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// @flow
import type { ParsedMap, VLQMap, SourceMapStringifyOptions, IndexedMapping, GenerateEmptyMapOptions } from './types';
import path from 'path';
import type { VLQMap, GenerateEmptyMapOptions } from './types';
import SourceMap from './SourceMap';

import * as bindings from './wasm-bindings';
Expand Down
44 changes: 44 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -919,6 +919,16 @@
"@babel/helper-validator-identifier" "^7.14.5"
to-fast-properties "^2.0.0"

"@khanacademy/flow-to-ts@0.5.2":
version "0.5.2"
resolved "https://packages.atlassian.com/api/npm/npm-remote/@khanacademy/flow-to-ts/-/flow-to-ts-0.5.2.tgz#d72f6136e4e6cb5bb52c89b4dc29993428eea90e"
integrity sha512-6i8Q0pE9xuc58QVXLof3M3W88BVcVALZfE5yj5uHDcpmfC0ijjYaciKzMKhPfgZezXudmlgCt52mTcX0IHt4Fg==
dependencies:
commander "^2.19.0"
glob "^7.1.6"
prettier "2.2.1"
trim-right "^1.0.1"

"@napi-rs/cli@^2.14.8":
version "2.14.8"
resolved "https://registry.yarnpkg.com/@napi-rs/cli/-/cli-2.14.8.tgz#06cca37e149ba4ffb3c3a01617d0f104b27e11c0"
Expand Down Expand Up @@ -1377,6 +1387,11 @@ colorette@^1.2.2:
resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.2.2.tgz#cbcc79d5e99caea2dbf10eb3a26fd8b3e6acfa94"
integrity sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w==

commander@^2.19.0:
version "2.20.3"
resolved "https://packages.atlassian.com/api/npm/npm-remote/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33"
integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==

commander@^4.0.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/commander/-/commander-4.1.1.tgz#9fd602bd936294e9e9ef46a3f4d6964044b18068"
Expand Down Expand Up @@ -1840,6 +1855,18 @@ glob@^7.0.0:
once "^1.3.0"
path-is-absolute "^1.0.0"

glob@^7.1.6:
version "7.2.3"
resolved "https://packages.atlassian.com/api/npm/npm-remote/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b"
integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==
dependencies:
fs.realpath "^1.0.0"
inflight "^1.0.4"
inherits "2"
minimatch "^3.1.1"
once "^1.3.0"
path-is-absolute "^1.0.0"

globals@^11.1.0:
version "11.12.0"
resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e"
Expand Down Expand Up @@ -2399,6 +2426,13 @@ minimatch@3.0.4, minimatch@^3.0.4:
dependencies:
brace-expansion "^1.1.7"

minimatch@^3.1.1:
version "3.1.2"
resolved "https://packages.atlassian.com/api/npm/npm-remote/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b"
integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==
dependencies:
brace-expansion "^1.1.7"

minimist@^1.2.3, minimist@^1.2.5:
version "1.2.5"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602"
Expand Down Expand Up @@ -2696,6 +2730,11 @@ posix-character-classes@^0.1.0:
resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab"
integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=

prettier@2.2.1:
version "2.2.1"
resolved "https://packages.atlassian.com/api/npm/npm-remote/prettier/-/prettier-2.2.1.tgz#795a1a78dd52f073da0cd42b21f9c91381923ff5"
integrity sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q==

prettier@^2.3.0:
version "2.3.2"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.3.2.tgz#ef280a05ec253712e486233db5c6f23441e7342d"
Expand Down Expand Up @@ -3248,6 +3287,11 @@ to-regex@^3.0.1, to-regex@^3.0.2:
regex-not "^1.0.2"
safe-regex "^1.1.0"

trim-right@^1.0.1:
version "1.0.1"
resolved "https://packages.atlassian.com/api/npm/npm-remote/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003"
integrity sha512-WZGXGstmCWgeevgTL54hrCuw1dyMQIzWy7ZfqRJfSmJZBwklI15egmQytFP6bPidmw3M8d5yEowl1niq4vmqZw==

tslib@^1.9.0:
version "1.14.1"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00"
Expand Down

0 comments on commit bc28311

Please sign in to comment.