Skip to content

Commit

Permalink
refactor(types): normalize types-ambient.js
Browse files Browse the repository at this point in the history
  • Loading branch information
turadg committed May 2, 2024
1 parent a44cc74 commit a866f98
Show file tree
Hide file tree
Showing 28 changed files with 26 additions and 23 deletions.
2 changes: 1 addition & 1 deletion packages/assert/exported.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
import './src/types.js';
import './src/types-ambient.js';
2 changes: 1 addition & 1 deletion packages/assert/src/assert.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
// is a record of a failed attempt to remove '.types'.
// To satisfy CI, not only do we need to keep the file,
// but we need to import it here as well.
/// <reference path="./types.js" />
/// <reference path="./types-ambient.js" />

const { freeze } = Object;

Expand Down
File renamed without changes.
3 changes: 3 additions & 0 deletions packages/base-zone/src/types.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
// eslint-disable-next-line no-unused-vars
import { makeExo, defineExoClass, defineExoClassKit } from '@endo/exo';

// Ensure this is a module.
export {};

/** @typedef {'exoClass' | 'exoClassKit' | 'exo' | 'store' | 'zone'} KeyCategories */
/** @typedef {Record<KeyCategories, (label: string) => string[]>} KeyMakers */

Expand Down
4 changes: 2 additions & 2 deletions packages/inter-protocol/exported.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
import './src/psm/types.js';
import './src/vaultFactory/types.js';
import './src/psm/types-ambient.js';
import './src/vaultFactory/types-ambient.js';
File renamed without changes.
2 changes: 1 addition & 1 deletion packages/inter-protocol/src/vaultFactory/params.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// @jessie-check

/// <reference path="./types.js" />
/// <reference path="./types-ambient.js" />

import {
CONTRACT_ELECTORATE,
Expand Down
2 changes: 1 addition & 1 deletion packages/inter-protocol/test/psm/test-psm.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { test as anyTest } from '@agoric/zoe/tools/prepare-test-env-ava.js';

import '@agoric/zoe/exported.js';
import '../../src/vaultFactory/types.js';
import '../../src/vaultFactory/types-ambient.js';

import { AmountMath, makeIssuerKit } from '@agoric/ertp';
import { split } from '@agoric/ertp/src/legacy-payment-helpers.js';
Expand Down
2 changes: 1 addition & 1 deletion packages/inter-protocol/test/vaultFactory/driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
startVaultFactory,
} from '../../src/proposals/econ-behaviors.js';
import { startEconomicCommittee } from '../../src/proposals/startEconCommittee.js';
import '../../src/vaultFactory/types.js';
import '../../src/vaultFactory/types-ambient.js';
import {
installPuppetGovernance,
setupBootstrap,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import {
startVaultFactory,
} from '../../src/proposals/econ-behaviors.js';

import '../../src/vaultFactory/types.js';
import '../../src/vaultFactory/types-ambient.js';
import { defaultParamValues } from './vaultFactoryUtils.js';

/** @import {VaultFactoryContract as VFC} from '../../src/vaultFactory/vaultFactory.js' */
Expand Down
2 changes: 1 addition & 1 deletion packages/inter-protocol/test/vaultFactory/test-storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { E } from '@endo/eventual-send';
import { assertTopicPathData, subscriptionKey } from '../supports.js';
import { makeDriverContext, makeManagerDriver } from './driver.js';

import '../../src/vaultFactory/types.js';
import '../../src/vaultFactory/types-ambient.js';

/** @typedef {import('./driver.js').DriverContext & {}} Context */
/** @type {import('ava').TestFn<Context>} */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { deeplyFulfilled } from '@endo/marshal';
import { calculateCurrentDebt } from '../../src/interest-math.js';
import { SECONDS_PER_YEAR } from '../../src/interest.js';
import { startVaultFactory } from '../../src/proposals/econ-behaviors.js';
import '../../src/vaultFactory/types.js';
import '../../src/vaultFactory/types-ambient.js';
import {
metricsTracker,
reserveInitialState,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
SECONDS_PER_WEEK as ONE_WEEK,
startVaultFactory,
} from '../../src/proposals/econ-behaviors.js';
import '../../src/vaultFactory/types.js';
import '../../src/vaultFactory/types-ambient.js';
import {
reserveInitialState,
subscriptionTracker,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
setupReserve,
startAuctioneer,
} from '../../src/proposals/econ-behaviors.js';
import '../../src/vaultFactory/types.js';
import '../../src/vaultFactory/types-ambient.js';
import {
installPuppetGovernance,
produceInstallations,
Expand Down
2 changes: 1 addition & 1 deletion packages/wallet/api/exported.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
import './src/types.js';
import './src/types-ambient.js';
File renamed without changes.
2 changes: 1 addition & 1 deletion packages/wallet/api/test/test-getPursesNotifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
} from '@agoric/vats/src/nameHub.js';
import { makeWalletRoot } from '../src/lib-wallet.js';

import '../src/types.js';
import '../src/types-ambient.js';

const mixinMyAddress = prepareMixinMyAddress(makeHeapZone());

Expand Down
2 changes: 1 addition & 1 deletion packages/wallet/api/test/test-lib-wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { resolve as importMetaResolve } from 'import-meta-resolve';
import { makeHeapZone } from '@agoric/zone';
import { makeWalletRoot } from '../src/lib-wallet.js';

import '../src/types.js';
import '../src/types-ambient.js';

const ZOE_INVITE_PURSE_PETNAME = 'Default Zoe invite purse';

Expand Down
2 changes: 1 addition & 1 deletion packages/zoe/src/contracts/callSpread/calculateShares.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// <reference path="./types.js" />
/// <reference path="./types-ambient.js" />

import { AmountMath, isNatValue } from '@agoric/ertp';
import { assert } from '@agoric/assert';
Expand Down
2 changes: 1 addition & 1 deletion packages/zoe/src/contracts/callSpread/fundedCallSpread.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// <reference path="./types.js" />
/// <reference path="./types-ambient.js" />

import { makePromiseKit } from '@endo/promise-kit';
import { E } from '@endo/eventual-send';
Expand Down
2 changes: 1 addition & 1 deletion packages/zoe/src/contracts/callSpread/payoffHandler.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint @typescript-eslint/no-floating-promises: "warn" */
/// <reference path="./types.js" />
/// <reference path="./types-ambient.js" />

import { E } from '@endo/eventual-send';
import { AmountMath } from '@agoric/ertp';
Expand Down
2 changes: 1 addition & 1 deletion packages/zoe/src/contracts/callSpread/pricedCallSpread.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint @typescript-eslint/no-floating-promises: "warn" */
/// <reference path="./types.js" />
/// <reference path="./types-ambient.js" />

import { makePromiseKit } from '@endo/promise-kit';
import { E } from '@endo/eventual-send';
Expand Down
6 changes: 3 additions & 3 deletions packages/zoe/src/contracts/exported.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// <reference path="./types.js" />
/// <reference path="./types-ambient.js" />
// eslint-disable-next-line no-restricted-syntax
import './loan/types.js';
import './callSpread/types.js';
import './loan/types-ambient.js';
import './callSpread/types-ambient.js';
2 changes: 1 addition & 1 deletion packages/zoe/src/contracts/loan/close.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// <reference path="./types.js" />
/// <reference path="./types-ambient.js" />

import { Fail } from '@agoric/assert';
import { AmountMath } from '@agoric/ertp';
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit a866f98

Please sign in to comment.