Skip to content

Commit

Permalink
Merge branch 'master' into markm-rank-strings-by-codepoint
Browse files Browse the repository at this point in the history
  • Loading branch information
erights committed May 11, 2024
2 parents 01394d3 + b02f0e2 commit 44b1665
Show file tree
Hide file tree
Showing 319 changed files with 474 additions and 104 deletions.
3 changes: 2 additions & 1 deletion packages/base64/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@
},
"ava": {
"files": [
"test/**/test-*.js"
"test/**/test-*.*",
"test/**/*.test.*"
],
"timeout": "2m"
},
Expand Down
File renamed without changes.
3 changes: 2 additions & 1 deletion packages/bundle-source/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@
},
"ava": {
"files": [
"test/**/test-*.js"
"test/**/test-*.*",
"test/**/*.test.*"
]
},
"eslintConfig": {
Expand Down
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion packages/captp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@
},
"ava": {
"files": [
"test/**/test-*.js"
"test/**/test-*.*",
"test/**/*.test.*"
],
"timeout": "2m"
},
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion packages/check-bundle/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@
},
"ava": {
"files": [
"test/**/test-*.js"
"test/**/test-*.*",
"test/**/*.test.*"
],
"timeout": "2m"
},
Expand Down
3 changes: 2 additions & 1 deletion packages/cjs-module-analyzer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@
},
"ava": {
"files": [
"test/**/test-*.js"
"test/**/test-*.*",
"test/**/*.test.*"
],
"timeout": "2m"
},
Expand Down
3 changes: 2 additions & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@
},
"ava": {
"files": [
"test/**/test-*.js"
"test/**/test-*.*",
"test/**/*.test.*"
],
"timeout": "2m"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
import os from 'os';
import { E } from '@endo/far';
import { withEndoAgent } from '../context.js';
import { parsePetNamePath } from '../pet-name.js';

export const rename = async ({ fromName, toName, agentNames }) =>
export const move = async ({ fromPath, toPath, agentNames }) =>
withEndoAgent(agentNames, { os, process }, async ({ agent }) => {
await E(agent).rename(fromName, toName);
await E(agent).move(parsePetNamePath(fromPath), parsePetNamePath(toPath));
});
9 changes: 5 additions & 4 deletions packages/cli/src/endo.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,13 +297,14 @@ export const main = async rawArgs => {
});

program
.command('rename <from> <to>')
.command('move <from> <to>')
.alias('mv')
.description('change the name for a value')
.option(...commonOptions.as)
.action(async (fromName, toName, cmd) => {
.action(async (fromPath, toPath, cmd) => {
const { as: agentNames } = cmd.opts();
const { rename } = await import('./commands/rename.js');
return rename({ fromName, toName, agentNames });
const { move } = await import('./commands/move.js');
return move({ fromPath, toPath, agentNames });
});

program
Expand Down
File renamed without changes.
3 changes: 2 additions & 1 deletion packages/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@
},
"ava": {
"files": [
"test/**/test-*.js"
"test/**/test-*.*",
"test/**/*.test.*"
],
"timeout": "2m"
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion packages/compartment-mapper/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@
},
"ava": {
"files": [
"test/**/test-*.js"
"test/**/test-*.*",
"test/**/*.test.*"
],
"timeout": "2m"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Snapshot report for `test/test-error-handling.js`
# Snapshot report for `test/error-handling.test.js`

The actual snapshot is saved in `test-error-handling.js.snap`.
The actual snapshot is saved in `error-handling.test.js.snap`.

Generated by [AVA](https://avajs.dev).

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Snapshot report for `test/test-infer-exports.js`
# Snapshot report for `test/infer-exports.test.js`

The actual snapshot is saved in `test-infer-exports.js.snap`.
The actual snapshot is saved in `infer-exports.test.js.snap`.

Generated by [AVA](https://avajs.dev).

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Snapshot report for `test/test-policy-format.js`
# Snapshot report for `test/policy-format.test.js`

The actual snapshot is saved in `test-policy-format.js.snap`.
The actual snapshot is saved in `policy-format.test.js.snap`.

Generated by [AVA](https://avajs.dev).

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Snapshot report for `test/test-policy.js`
# Snapshot report for `test/policy.test.js`

The actual snapshot is saved in `test-policy.js.snap`.
The actual snapshot is saved in `policy.test.js.snap`.

Generated by [AVA](https://avajs.dev).

Expand Down
3 changes: 2 additions & 1 deletion packages/daemon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@
},
"ava": {
"files": [
"test/**/test-*.js"
"test/**/test-*.*",
"test/**/*.test.*"
],
"timeout": "2m"
},
Expand Down
13 changes: 8 additions & 5 deletions packages/daemon/src/directory.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,22 +174,25 @@ export const makeDirectoryMaker = ({
const { hub: fromHub, name: fromName } =
await lookupTailNameHub(fromPath);
const { hub: toHub, name: toName } = await lookupTailNameHub(toPath);

if (fromHub === toHub) {
// eslint-disable-next-line no-use-before-define
if (fromHub === directory) {
await petStore.rename(fromName, toName);
} else {
await fromHub.move([fromName], [toName]);
await E(fromHub).move([fromName], [toName]);
}
return;
}
const id = await fromHub.identify(fromName);

const id = await E(fromHub).identify(fromName);
if (id === undefined) {
throw new Error(`Unknown name: ${q(fromPath)}`);
}
const removeP = fromHub.remove(fromName);
const addP = toHub.write([toName], id);
await Promise.all([addP, removeP]);
// First write to the "to" hub so that the original name is preserved on the
// "from" hub in case of failure.
await E(toHub).write([toName], id);
await E(fromHub).remove(fromName);
};

/** @type {EndoDirectory['copy']} */
Expand Down
2 changes: 2 additions & 0 deletions packages/daemon/src/pet-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ export const makePetStoreMaker = (filePowers, config) => {
}
assertValidId(formulaIdentifier, fromName);

// Updated persisted name mapping
const fromPath = filePowers.joinPath(petNameDirectoryPath, fromName);
const toPath = filePowers.joinPath(petNameDirectoryPath, toName);
await filePowers.renamePath(fromPath, toPath);
Expand All @@ -206,6 +207,7 @@ export const makePetStoreMaker = (filePowers, config) => {
}

// Update the mapping for the pet name.
idsToPetNames.delete(formulaIdentifier, fromName);
idsToPetNames.add(formulaIdentifier, toName);

publishNameRemoval(formulaIdentifier, fromName);
Expand Down
File renamed without changes.
Loading

0 comments on commit 44b1665

Please sign in to comment.