Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
use named exports for Parser and Profiler
Browse files Browse the repository at this point in the history
  • Loading branch information
eggplantzzz committed Aug 15, 2022
1 parent 179ee3a commit a2df72b
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion packages/compile-solidity/src/compileWithPragmaAnalysis.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { CompilerSupplier } from "./compilerSupplier";
import Config from "@truffle/config";
import semver from "semver";
import Profiler from "./profiler";
import { Profiler } from "./profiler";
import { run } from "./run";
import { reportSources } from "./reportSources";
import OS from "os";
Expand Down
2 changes: 1 addition & 1 deletion packages/compile-solidity/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import debugModule from "debug";
const debug = debugModule("compile");
import findContracts from "@truffle/contract-sources";
import Config from "@truffle/config";
import Profiler from "./profiler";
import { Profiler } from "./profiler";
import { CompilerSupplier } from "./compilerSupplier";
import { run } from "./run";
import { normalizeOptions } from "./normalizeOptions";
Expand Down
2 changes: 1 addition & 1 deletion packages/compile-solidity/src/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const debug = debugModule("compile:parser");
const preReleaseCompilerWarning =
"This is a pre-release compiler version, please do not use it in production.";

export default {
export const Parser = {
// This needs to be fast! It is fast (as of this writing). Keep it fast!
parseImports(body, solc) {
// WARNING: Kind of a hack (an expedient one).
Expand Down
10 changes: 5 additions & 5 deletions packages/compile-solidity/src/profiler/index.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// Compares .sol files to their .sol.js counterparts,
// determines which .sol files have been updated.
import { Profiler } from "@truffle/profiler";
import { Profiler as TruffleProfiler } from "@truffle/profiler";
import { loadParser } from "./loadParser";
import { shouldIncludePath } from "./shouldIncludePath";
import type Config from "@truffle/config";

export default {
export const Profiler = {
updated: async (options: Config) => {
const profiler = new Profiler({});
const profiler = new TruffleProfiler({});
return await profiler.updated(options);
},

Expand All @@ -18,7 +18,7 @@ export default {
const parseImports = await loadParser(options);

// generate profiler
const profiler = new Profiler({
const profiler = new TruffleProfiler({
parseImports,
shouldIncludePath
});
Expand All @@ -30,7 +30,7 @@ export default {
requiredSourcesForSingleFile: async (options: Config) => {
const parseImports = await loadParser(options);

const profiler = new Profiler({
const profiler = new TruffleProfiler({
parseImports,
shouldIncludePath
});
Expand Down
2 changes: 1 addition & 1 deletion packages/compile-solidity/src/profiler/loadParser.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CompilerSupplier } from "../compilerSupplier";
import Parser from "../parser";
import { Parser } from "../parser";
import semver, { SemVer } from "semver";
import type Config from "@truffle/config";

Expand Down
2 changes: 1 addition & 1 deletion packages/compile-solidity/test/profiler/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const { assert } = require("chai");
const fs = require("fs-extra");
const path = require("path");
const tmp = require("tmp");
const Profiler = require("../../dist/profiler").default;
const { Profiler } = require("../../dist/profiler");
const { Resolver } = require("@truffle/resolver");
const Artifactor = require("@truffle/artifactor");
const TruffleConfig = require("@truffle/config");
Expand Down
2 changes: 1 addition & 1 deletion packages/compile-solidity/test/test_parser.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const fs = require("fs");
const path = require("path");
const Parser = require("../dist/parser").default;
const { Parser } = require("../dist/parser");
const { CompilerSupplier } = require("../dist/compilerSupplier");
const { assert } = require("chai");

Expand Down
2 changes: 1 addition & 1 deletion packages/core/lib/testing/Test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const SolidityTest = require("./SolidityTest");
const RangeUtils = require("@truffle/compile-solidity/dist/compilerSupplier/rangeUtils");
const expect = require("@truffle/expect");
const Migrate = require("@truffle/migrate");
const Profiler = require("@truffle/compile-solidity/dist/profiler");
const { Profiler } = require("@truffle/compile-solidity/dist/profiler");
const originalrequire = require("original-require");
const Codec = require("@truffle/codec");
const debug = require("debug")("lib:test");
Expand Down

0 comments on commit a2df72b

Please sign in to comment.