Skip to content

Commit 9825f6d

Browse files
authored
normalize package privacy (#11137)
refs: #10811 ## Description #10811 introduces a new private package. I wanted to make clear in the naming that it's private and I arrived at this rule: - ~the package is published if and only if it starts with `@agoric` or `agoric`~ - a new org called `@aglocal` for packages that shouldn't be published This adds a lint rule to enforce that, then it renames a few packages to comply. ~It also removes `@agoric/benchmark` because I believe that's no longer being used. @gibson042 please confirm. If it is needed I'll just rename it.~ ### Security Considerations Makes more clear what gets published to NPM ### Scaling Considerations n/a ### Documentation Considerations Documentation in the script ### Testing Considerations CI ### Upgrade Considerations n/a
2 parents 0e6a9f4 + fba4937 commit 9825f6d

File tree

14 files changed

+82
-24
lines changed

14 files changed

+82
-24
lines changed

.github/workflows/test-all-packages.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ jobs:
9393

9494
- name: lint repo format
9595
run: yarn lint:format
96+
- run: yarn lint:package-names
9697
# eslint and tsc
9798
- run: yarn lint:packages
9899

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
"lint-fix": "yarn lerna run --no-bail lint-fix",
6464
"lint": "run-s --continue-on-error lint:*",
6565
"lint:packages": "yarn lerna run --no-bail lint",
66+
"lint:package-names": "./scripts/verify-package-names.js",
6667
"test": "yarn lerna run --no-bail test",
6768
"test:xs": "yarn workspaces run test:xs",
6869
"build": "yarn workspaces run build && scripts/agd-builder.sh stamp yarn-built",

packages/agoric-cli/src/sdk-package-names.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
// DO NOT EDIT - automatically generated by get-sdk-package-names.js
22
// prettier-ignore
33
export default [
4+
"@aglocal/benchmark",
5+
"@aglocal/boot",
6+
"@aglocal/deployment",
7+
"@aglocal/swingset-runner",
48
"@agoric/access-token",
59
"@agoric/async-flow",
610
"@agoric/base-zone",
7-
"@agoric/benchmark",
8-
"@agoric/boot",
911
"@agoric/builders",
1012
"@agoric/cache",
1113
"@agoric/casting",
@@ -15,7 +17,6 @@ export default [
1517
"@agoric/cosmos",
1618
"@agoric/create-dapp",
1719
"@agoric/deploy-script-support",
18-
"@agoric/deployment",
1920
"@agoric/ertp",
2021
"@agoric/eslint-config",
2122
"@agoric/fast-usdc",
@@ -36,7 +37,6 @@ export default [
3637
"@agoric/store",
3738
"@agoric/swing-store",
3839
"@agoric/swingset-liveslots",
39-
"@agoric/swingset-runner",
4040
"@agoric/swingset-vat",
4141
"@agoric/swingset-xsnap-supervisor",
4242
"@agoric/telemetry",

packages/benchmark/benchmark/benchmark-liquidation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { bench } from '../src/benchmarkerator.js';
33

44
import { Offers } from '@agoric/inter-protocol/src/clientSupport.js';
5-
import { scale6 } from '@agoric/boot/tools/liquidation.js';
5+
import { scale6 } from '@aglocal/boot/tools/liquidation.js';
66

77
const setupData = {
88
vaults: [

packages/benchmark/doc/benchmarkerator.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ yourself).[^2]
4141

4242
The first thing a benchmark should do is import The Benchmarkerator:
4343
```
44-
import { bench } from '@agoric/benchmark';
44+
import { bench } from '@aglocal/benchmark';
4545
```
4646

4747
Note that this importation usually should be the very first thing you do, much

packages/benchmark/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@agoric/benchmark",
2+
"name": "@aglocal/benchmark",
33
"version": "0.1.0",
44
"private": true,
55
"description": "Benchmark support",
@@ -22,13 +22,13 @@
2222
"author": "Agoric",
2323
"license": "Apache-2.0",
2424
"dependencies": {
25-
"@endo/errors": "^1.2.9",
26-
"@agoric/boot": "^0.1.0",
25+
"@aglocal/boot": "^0.1.0",
2726
"@agoric/cosmic-swingset": "^0.41.3",
28-
"@agoric/internal": "^0.3.2",
2927
"@agoric/inter-protocol": "^0.16.1",
28+
"@agoric/internal": "^0.3.2",
3029
"@agoric/vats": "^0.15.1",
3130
"@agoric/zoe": "^0.26.2",
31+
"@endo/errors": "^1.2.9",
3232
"@endo/init": "^1.1.8"
3333
},
3434
"devDependencies": {},

packages/benchmark/src/benchmarkerator.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ import '@agoric/cosmic-swingset/src/launch-chain.js';
99
import { Fail } from '@endo/errors';
1010
import { eventLoopIteration } from '@agoric/internal/src/testing-utils.js';
1111
import { makeAgoricNamesRemotesFromFakeStorage } from '@agoric/vats/tools/board-utils.js';
12-
import { makeSwingsetTestKit } from '@agoric/boot/tools/supports.js';
12+
import { makeSwingsetTestKit } from '@aglocal/boot/tools/supports.js';
1313
import {
1414
makeWalletFactoryDriver,
1515
makeGovernanceDriver,
16-
} from '@agoric/boot/tools/drivers.js';
17-
import { makeLiquidationTestKit } from '@agoric/boot/tools/liquidation.js';
16+
} from '@aglocal/boot/tools/drivers.js';
17+
import { makeLiquidationTestKit } from '@aglocal/boot/tools/liquidation.js';
1818

1919
// When I was a child my family took a lot of roadtrips around California to go
2020
// camping and backpacking and so on. It was not uncommon in those days (nor is
@@ -44,7 +44,7 @@ import { makeLiquidationTestKit } from '@agoric/boot/tools/liquidation.js';
4444
* @typedef {{
4545
* options: Record<string, string>,
4646
* argv: string[],
47-
* actors: Record<string, import('@agoric/boot/tools/drivers.ts').SmartWalletDriver>,
47+
* actors: Record<string, import('@aglocal/boot/tools/drivers.ts').SmartWalletDriver>,
4848
* tools: Record<string, unknown>,
4949
* title?: string,
5050
* rounds?: number,

packages/boot/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@agoric/boot",
2+
"name": "@aglocal/boot",
33
"version": "0.1.0",
44
"private": true,
55
"description": "Config and utilities to bootstrap an Agoric chain",

packages/deployment/package.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@agoric/deployment",
2+
"name": "@aglocal/deployment",
33
"version": "3.0.0",
44
"description": "Set up Agoric public chain nodes",
55
"type": "module",
@@ -29,9 +29,6 @@
2929
"minimist": "^1.2.0",
3030
"temp": "^0.9.0"
3131
},
32-
"publishConfig": {
33-
"access": "public"
34-
},
3532
"devDependencies": {
3633
"readline-transform": "^1.0.0"
3734
},

packages/fast-usdc/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ This package is meant to contain all the code for the Fast USDC product. However
99

1010
- a3p integration tests are in the `a3p-integration` top-level package, separate from this workspace
1111
- the proposal builders are in `@agoric/builders` to work with the a3p-integration `build:submissions` script
12-
- the RunUtils tests are in `@agoric/boot` to test running them atop a fresh bootstrapped environment
12+
- the RunUtils tests are in `@aglocal/boot` to test running them atop a fresh bootstrapped environment
1313

1414
Over time we can update our tooling to decouple this more from the `packages` directory.
1515

1616
1. Make a3p-integration `build:submissions` script work with arbitrary builder paths, allowing this to be above `@agoric/builders` in the package graph
17-
2. Export bootstrap testing utilities from `@agoric/boot`, allowing this to be above `@agoric/boot` in the package graph
17+
2. Export bootstrap testing utilities from `@aglocal/boot`, allowing this to be above `@aglocal/boot` in the package graph
1818
3. Update CI to support packages that aren't under `packages/`, eg. a top-level `dapps` directory
1919
4. Move this package out of agoric-sdk
2020

0 commit comments

Comments
 (0)