Skip to content

Commit

Permalink
use AltUri from @ndn/naming-convention2
Browse files Browse the repository at this point in the history
  • Loading branch information
yoursunny committed Jul 5, 2020
1 parent d01c753 commit 8b4c128
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 10 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
/package-lock.json
/public
node_modules
pnpm-lock.yaml
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ script:

deploy:
- provider: pages
skip_cleanup: true
github_token: $GITHUB_TOKEN
edge: true
token: $GITHUB_TOKEN
keep_history: false
commit_message: $TRAVIS_COMMIT $TRAVIS_BUILD_WEB_URL
local_dir: public/
fqdn: nfd-status-page.ndn.today
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@
},
"dependencies": {
"@ndn/naming-convention1": "https://ndnts-nightly.ndn.today/naming-convention1.tgz",
"@ndn/naming-convention2": "https://ndnts-nightly.ndn.today/naming-convention2.tgz",
"@ndn/packet": "https://ndnts-nightly.ndn.today/packet.tgz",
"@ndn/tlv": "https://ndnts-nightly.ndn.today/tlv.tgz",
"classnames": "^2.2.6",
"hashquery": "^1.0.0",
"js-cookie": "^2.2.1",
"mnemonist": "^0.36.1",
"preact": "^10.4.4",
"mnemonist": "^0.38.0",
"preact": "^10.4.5",
"pretty-ms": "^7.0.0",
"purecss": "^2.0.3",
"qs": "^6.9.4",
Expand All @@ -25,15 +26,15 @@
"@kenpb/parcel-plugin-ifdef": "^1.1.2",
"@types/classnames": "^2.2.10",
"@types/js-cookie": "^2.2.6",
"@types/node": "^14.0.13",
"@types/node": "^14.0.14",
"@types/qs": "^6.9.3",
"eslint-config-xo-preact": "^1.0.0",
"eslint-plugin-react": "^7.20.0",
"eslint-plugin-react": "^7.20.3",
"eslint-plugin-simple-import-sort": "^5.0.3",
"execa": "^4.0.2",
"parcel-bundler": "^1.12.4",
"typescript": "^3.9.5",
"xo": "^0.32.0"
"typescript": "^3.9.6",
"xo": "^0.32.1"
},
"browserslist": [
"since 2017-06"
Expand Down
3 changes: 2 additions & 1 deletion src/model/nfd-status/base.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Version } from "@ndn/naming-convention1";
import { AltUri as AltUri2 } from "@ndn/naming-convention2";
import { AltUri, Component, Name } from "@ndn/packet";
import { fromHex, toHex } from "@ndn/tlv";
import DefaultMap from "mnemonist/default-map";
Expand Down Expand Up @@ -182,7 +183,7 @@ function describeFaceRoute({ prefix }: Route, face: Face): void {
const LOCALHOST_NFD_STRATEGY = new Name("/localhost/nfd/strategy");

function describeStrategy(sc: StrategyChoice): void {
const name = AltUri.parseName(sc.strategy);
const name = AltUri2.parseName(sc.strategy);
if (LOCALHOST_NFD_STRATEGY.isPrefixOf(name) &&
name.length >= 5 && name.get(4)!.is(Version)) {
sc.strategy = `${AltUri.ofComponent(name.get(3)!)} v${name.get(4)!.as(Version)} ${AltUri.ofName(name.slice(5)).slice(1)}`;
Expand Down
2 changes: 1 addition & 1 deletion src/model/nfd-status/xml.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AltUri } from "@ndn/packet";
import { AltUri } from "@ndn/naming-convention2";

import { NfdStatusBase } from "./base";
import { Face, FaceFlags, NfdStatus, PacketCounters, Route, StrategyChoice } from "./types";
Expand Down

0 comments on commit 8b4c128

Please sign in to comment.