mirror of
https://github.com/ezolenko/rollup-plugin-typescript2.git
synced 2025-12-08 19:06:16 +00:00
- workaround for object hash not supporting async/await
This commit is contained in:
parent
b2cb064766
commit
4d7552206f
7
dist/rollup-plugin-typescript2.cjs.js
vendored
7
dist/rollup-plugin-typescript2.cjs.js
vendored
@ -19691,6 +19691,7 @@ function convertDiagnostic(type, data) {
|
||||
return entry;
|
||||
});
|
||||
}
|
||||
const hashOptions = { algorithm: "sha1", ignoreUnknown: true };
|
||||
class TsCache {
|
||||
constructor(noCache, host, cache, options, rollupConfig, rootFilenames, context) {
|
||||
this.noCache = noCache;
|
||||
@ -19700,13 +19701,13 @@ class TsCache {
|
||||
this.context = context;
|
||||
this.cacheVersion = "7";
|
||||
this.ambientTypesDirty = false;
|
||||
this.cacheDir = `${cache}/${objectHash_2({
|
||||
this.cacheDir = `${cache}/${objectHash_1({
|
||||
version: this.cacheVersion,
|
||||
rootFilenames,
|
||||
options: this.options,
|
||||
rollupConfig: this.rollupConfig,
|
||||
tsVersion: tsModule.version,
|
||||
})}`;
|
||||
}, hashOptions)}`;
|
||||
this.dependencyTree = new graphlib_1({ directed: true });
|
||||
this.dependencyTree.setDefaultNodeLabel((_node) => ({ dirty: false }));
|
||||
const automaticTypes = lodash_7(tsModule.getAutomaticTypeDirectiveNames(options, tsModule.sys), (entry) => tsModule.resolveTypeReferenceDirective(entry, undefined, options, tsModule.sys))
|
||||
@ -19844,7 +19845,7 @@ class TsCache {
|
||||
}
|
||||
makeName(id, snapshot) {
|
||||
const data = snapshot.getText(0, snapshot.getLength());
|
||||
return objectHash_2({ data, id });
|
||||
return objectHash_1({ data, id }, hashOptions);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
2
dist/rollup-plugin-typescript2.cjs.js.map
vendored
2
dist/rollup-plugin-typescript2.cjs.js.map
vendored
File diff suppressed because one or more lines are too long
7
dist/rollup-plugin-typescript2.es.js
vendored
7
dist/rollup-plugin-typescript2.es.js
vendored
@ -19687,6 +19687,7 @@ function convertDiagnostic(type, data) {
|
||||
return entry;
|
||||
});
|
||||
}
|
||||
const hashOptions = { algorithm: "sha1", ignoreUnknown: true };
|
||||
class TsCache {
|
||||
constructor(noCache, host, cache, options, rollupConfig, rootFilenames, context) {
|
||||
this.noCache = noCache;
|
||||
@ -19696,13 +19697,13 @@ class TsCache {
|
||||
this.context = context;
|
||||
this.cacheVersion = "7";
|
||||
this.ambientTypesDirty = false;
|
||||
this.cacheDir = `${cache}/${objectHash_2({
|
||||
this.cacheDir = `${cache}/${objectHash_1({
|
||||
version: this.cacheVersion,
|
||||
rootFilenames,
|
||||
options: this.options,
|
||||
rollupConfig: this.rollupConfig,
|
||||
tsVersion: tsModule.version,
|
||||
})}`;
|
||||
}, hashOptions)}`;
|
||||
this.dependencyTree = new graphlib_1({ directed: true });
|
||||
this.dependencyTree.setDefaultNodeLabel((_node) => ({ dirty: false }));
|
||||
const automaticTypes = lodash_7(tsModule.getAutomaticTypeDirectiveNames(options, tsModule.sys), (entry) => tsModule.resolveTypeReferenceDirective(entry, undefined, options, tsModule.sys))
|
||||
@ -19840,7 +19841,7 @@ class TsCache {
|
||||
}
|
||||
makeName(id, snapshot) {
|
||||
const data = snapshot.getText(0, snapshot.getLength());
|
||||
return objectHash_2({ data, id });
|
||||
return objectHash_1({ data, id }, hashOptions);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
2
dist/rollup-plugin-typescript2.es.js.map
vendored
2
dist/rollup-plugin-typescript2.es.js.map
vendored
File diff suppressed because one or more lines are too long
2
dist/tscache.d.ts.map
vendored
2
dist/tscache.d.ts.map
vendored
@ -1 +1 @@
|
||||
{"version":3,"file":"tscache.d.ts","sourceRoot":"","sources":["src/tscache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAOrC,OAAO,KAAK,OAAO,MAAM,YAAY,CAAC;AAMtC,MAAM,WAAW,KAAK;IAErB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CA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AC,EAAE,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,GAAG,KAAK,GAAG,IAAI;IAehD,IAAI;IASJ,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAC,eAAe,EAAE,SAAS,EAAE,MAAM,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS;IA4BjH,uBAAuB,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAC,eAAe,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC,UAAU,EAAE,GAAG,YAAY,EAAE;IAKzH,sBAAsB,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAC,eAAe,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC,UAAU,EAAE,GAAG,YAAY,EAAE;IAK/H,OAAO,CAAC,iBAAiB;IAkBzB,OAAO,CAAC,cAAc;IA4BtB,OAAO,CAAC,IAAI;IAkBZ,OAAO,CAAC,WAAW;IAMnB,OAAO,CAAC,OAAO;IA8Bf,OAAO,CAAC,QAAQ;CAKhB"}
|
||||
@ -1,6 +1,6 @@
|
||||
import { IContext } from "./context";
|
||||
import { Graph, alg } from "graphlib";
|
||||
import { sha1 } from "object-hash";
|
||||
import hash from "object-hash";
|
||||
import { RollingCache } from "./rollingcache";
|
||||
import { ICache } from "./icache";
|
||||
import * as _ from "lodash";
|
||||
@ -88,6 +88,8 @@ export function convertDiagnostic(type: string, data: tsTypes.Diagnostic[]): IDi
|
||||
});
|
||||
}
|
||||
|
||||
const hashOptions = { algorithm: "sha1", ignoreUnknown: true };
|
||||
|
||||
export class TsCache
|
||||
{
|
||||
private cacheVersion = "7";
|
||||
@ -99,16 +101,19 @@ export class TsCache
|
||||
private typesCache!: ICache<string>;
|
||||
private semanticDiagnosticsCache!: ICache<IDiagnostics[]>;
|
||||
private syntacticDiagnosticsCache!: ICache<IDiagnostics[]>;
|
||||
|
||||
|
||||
constructor(private noCache: boolean, private host: tsTypes.LanguageServiceHost, cache: string, private options: tsTypes.CompilerOptions, private rollupConfig: any, rootFilenames: string[], private context: IContext)
|
||||
{
|
||||
this.cacheDir = `${cache}/${sha1({
|
||||
version: this.cacheVersion,
|
||||
rootFilenames,
|
||||
options: this.options,
|
||||
rollupConfig: this.rollupConfig,
|
||||
tsVersion: tsModule.version,
|
||||
})}`;
|
||||
this.cacheDir = `${cache}/${hash(
|
||||
{
|
||||
version: this.cacheVersion,
|
||||
rootFilenames,
|
||||
options: this.options,
|
||||
rollupConfig: this.rollupConfig,
|
||||
tsVersion: tsModule.version,
|
||||
},
|
||||
hashOptions
|
||||
)}`;
|
||||
|
||||
this.dependencyTree = new Graph({ directed: true });
|
||||
this.dependencyTree.setDefaultNodeLabel((_node: string) => ({ dirty: false }));
|
||||
@ -310,6 +315,6 @@ export class TsCache
|
||||
private makeName(id: string, snapshot: tsTypes.IScriptSnapshot)
|
||||
{
|
||||
const data = snapshot.getText(0, snapshot.getLength());
|
||||
return sha1({ data, id });
|
||||
return hash({ data, id }, hashOptions);
|
||||
}
|
||||
}
|
||||
|
||||
@ -17,7 +17,8 @@
|
||||
"declaration": true,
|
||||
"declarationMap": true,
|
||||
"strict": true,
|
||||
"outDir": "./build"
|
||||
"outDir": "./build",
|
||||
"allowSyntheticDefaultImports": true
|
||||
},
|
||||
"include": [
|
||||
"src/**/*.ts"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user