Skip to content

Commit

Permalink
mk: adapt scripts for /pkg rename
Browse files Browse the repository at this point in the history
  • Loading branch information
yoursunny committed Feb 3, 2024
1 parent 3e97c0e commit 31d9d20
Show file tree
Hide file tree
Showing 48 changed files with 63 additions and 63 deletions.
12 changes: 6 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
*.tsbuildinfo
.env
.netlify
/*.out
*.tsbuildinfo
/.vscode/
/*.out
/coverage/
/docs/typedoc/
/npm-debug.log
/packages/*/README.md.ts
/packages/*/lib/
/packages/*/test-fixture/tsconfig.json
/packages/*/tsconfig.json
/pkg/*/lib/
/pkg/*/README.md.ts
/pkg/*/test-fixture/tsconfig.json
/pkg/*/tsconfig.json
/pnpm-debug.log
/pnpm-lock.yaml
node_modules/
2 changes: 1 addition & 1 deletion integ/ndncert-interop/client-pin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msg() {
echo -e "\e[0m"
}

KCCLI="bash $(pwd)/packages/keychain-cli/ndnts-keychain.sh"
KCCLI="bash $(pwd)/pkg/keychain-cli/ndnts-keychain.sh"

DIR=/tmp/$(openssl rand -hex 8)
[[ -d $DIR ]] && rm -rf $DIR
Expand Down
2 changes: 1 addition & 1 deletion mk/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -euo pipefail
cd "$(dirname "${BASH_SOURCE[0]}")"/..
ROOTDIR=$(pwd)

corepack pnpm -r --filter='./packages/**' exec -- bash -c "node ${ROOTDIR}/mk/make-pkg-tsconfig.mjs"
corepack pnpm -r --filter='./pkg/**' exec -- bash -c "node ${ROOTDIR}/mk/make-pkg-tsconfig.mjs"
node mk/make-solution-tsconfig.mjs

(
Expand Down
2 changes: 1 addition & 1 deletion mk/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ if [[ $ACT == cover ]]; then
fi

if [[ $ACT == clean ]]; then
exec rm -rf packages/*/lib/ packages/*/tsconfig.tsbuildinfo
exec rm -rf pkg/*/lib/ pkg/*/tsconfig.tsbuildinfo
fi

TSCFLAG=
Expand Down
2 changes: 1 addition & 1 deletion mk/check-dep.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ if (!satisfies(doc.lockfileVersion, "^6.0.0")) {

let nWarnings = 0;
for (const [folder, { dependencies = {}, devDependencies = {} }] of Object.entries(doc.importers)) {
if (!folder.startsWith("packages/")) {
if (!folder.startsWith("pkg/")) {
continue;
}
const unusedP = new Set(Object.keys(dependencies).filter((dep) => !ignoredUnused.has(dep)));
Expand Down
6 changes: 3 additions & 3 deletions mk/literate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ literate_run() {
if [[ ${1:-} == lint ]]; then
trap "sed -i '/README.md.ts/ s/^#*\s*//' .gitignore" EXIT
sed -i '/README.md.ts/ s/^/# /' .gitignore
for F in $(grep -l '```ts' packages/*/README.md); do
for F in $(grep -l '```ts' pkg/*/README.md); do
codedown ts <$F >$F.ts
done
xo-yoursunny packages/*/README.md.ts
xo-yoursunny pkg/*/README.md.ts
exit
fi

Expand All @@ -32,6 +32,6 @@ if [[ -n ${1:-} ]]; then
exit
fi

for F in $(grep -l '```ts' packages/*/README.md); do
for F in $(grep -l '```ts' pkg/*/README.md); do
literate_run $(dirname $F)
done
2 changes: 1 addition & 1 deletion mk/make-pkg-tsconfig.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const pkg = JSON.parse(await fs.readFile("package.json"));
for (const [dep, specifier] of Object.entries(pkg.dependencies)) {
if (specifier.startsWith("workspace:")) {
tsconfig.references.push({
path: path.relative(process.cwd(), path.resolve(rootdir, "packages", path.basename(dep)))
path: path.relative(process.cwd(), path.resolve(rootdir, "pkg", path.basename(dep)))
.split(path.sep).join(path.posix.sep),
});
}
Expand Down
4 changes: 2 additions & 2 deletions mk/make-solution-tsconfig.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ const tsconfig = {
references: [],
};

const dir = await fs.readdir("packages", { withFileTypes: true });
const dir = await fs.readdir("pkg", { withFileTypes: true });
for (const direct of dir) {
if (!direct.isDirectory()) {
continue;
}
tsconfig.references.push({ path: `../packages/${direct.name}` });
tsconfig.references.push({ path: `../pkg/${direct.name}` });
}

await fs.writeFile("mk/tsconfig-solution.json", JSON.stringify(tsconfig, undefined, 2));
2 changes: 1 addition & 1 deletion mk/publish-nightly.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ mkdir -p mk/nightly-output/

git add .
VERSION=$(git show -s --format='%ct %H' | gawk '{ printf "0.0.%s-nightly-%s", strftime("%Y%m%d", $1, 1), substr($2, 1, 7) }')
corepack pnpm m --filter='./packages/**' --workspace-concurrency=1 exec \
corepack pnpm m --filter='./pkg/**' --workspace-concurrency=1 exec \
bash -c 'node '$ROOTDIR'/mk/edit-packagejson.mjs VCDN '$VERSION' &&
mv $(corepack pnpm pack .) '$ROOTDIR'/mk/nightly-output/$(basename $(pwd)).tgz'
git checkout -- .
Expand Down
2 changes: 1 addition & 1 deletion mk/publish-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if [[ ${NDNTS_SKIP_BUILD:-0} -ne 1 ]]; then
corepack pnpm test
fi

RECURSE='corepack pnpm m --filter='./packages/**' --workspace-concurrency=1 exec'
RECURSE='corepack pnpm m --filter='./pkg/**' --workspace-concurrency=1 exec'
$RECURSE bash -c 'node '$ROOTDIR'/mk/edit-packagejson.mjs V '$VERSION
git commit -a -m 'v'$VERSION

Expand Down
4 changes: 2 additions & 2 deletions mk/tsconfig-literate.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"compilerOptions": {
"baseUrl": "..",
"paths": {
"@ndn/*": ["./packages/*/lib/mod_node.js"],
"ndn": ["./packages/ndn/lib/mod_node.js"]
"@ndn/*": ["./pkg/*/lib/mod_node.js"],
"ndn": ["./pkg/ndn/lib/mod_node.js"]
}
}
}
8 changes: 4 additions & 4 deletions mk/tsconfig-typedoc.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"extends": "./tsconfig-base.json",
"compilerOptions": {
"rootDir": "../packages",
"rootDir": "../pkg",
"baseUrl": "..",
"paths": {
"@ndn/*": ["./packages/*"],
"ndn": ["./packages/ndn"]
"@ndn/*": ["./pkg/*"],
"ndn": ["./pkg/ndn"]
}
},
"include": [
"../packages/*/src/**/*"
"../pkg/*/src/**/*"
],
"typedocOptions": {
"entryPointStrategy": "packages",
Expand Down
2 changes: 1 addition & 1 deletion mk/typedoc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if [[ -n ${GTAGID:-} ]]; then
GTAG="--gaID $GTAGID"
fi

ENTRYPOINTS='packages/*'
ENTRYPOINTS='pkg/*'
if [[ $# -gt 0 ]]; then
ENTRYPOINTS=''
fi
Expand Down
2 changes: 1 addition & 1 deletion pkg/autoconfig/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"repository": {
"type": "git",
"url": "https://github.com/yoursunny/NDNts.git",
"directory": "packages/autoconfig"
"directory": "pkg/autoconfig"
},
"publishConfig": {
"main": "lib/mod_node.js",
Expand Down
2 changes: 1 addition & 1 deletion pkg/cat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"repository": {
"type": "git",
"url": "https://github.com/yoursunny/NDNts.git",
"directory": "packages/cat"
"directory": "pkg/cat"
},
"dependencies": {
"@ndn/cli-common": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion pkg/cli-common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"repository": {
"type": "git",
"url": "https://github.com/yoursunny/NDNts.git",
"directory": "packages/cli-common"
"directory": "pkg/cli-common"
},
"publishConfig": {
"main": "lib/mod_node.js",
Expand Down
2 changes: 1 addition & 1 deletion pkg/dpdkmgmt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"repository": {
"type": "git",
"url": "https://github.com/yoursunny/NDNts.git",
"directory": "packages/dpdkmgmt"
"directory": "pkg/dpdkmgmt"
},
"publishConfig": {
"main": "lib/mod_node.js",
Expand Down
2 changes: 1 addition & 1 deletion pkg/endpoint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"repository": {
"type": "git",
"url": "https://github.com/yoursunny/NDNts.git",
"directory": "packages/endpoint"
"directory": "pkg/endpoint"
},
"publishConfig": {
"main": "lib/mod_node.js",
Expand Down
2 changes: 1 addition & 1 deletion pkg/fileserver/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"repository": {
"type": "git",
"url": "https://github.com/yoursunny/NDNts.git",
"directory": "packages/fileserver"
"directory": "pkg/fileserver"
},
"publishConfig": {
"main": "lib/mod_node.js",
Expand Down
2 changes: 1 addition & 1 deletion pkg/fw/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"repository": {
"type": "git",
"url": "https://github.com/yoursunny/NDNts.git",
"directory": "packages/fw"
"directory": "pkg/fw"
},
"publishConfig": {
"main": "lib/mod_node.js",
Expand Down
2 changes: 1 addition & 1 deletion pkg/keychain-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"repository": {
"type": "git",
"url": "https://github.com/yoursunny/NDNts.git",
"directory": "packages/keychain-cli"
"directory": "pkg/keychain-cli"
},
"dependencies": {
"@ndn/cli-common": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion pkg/keychain/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"repository": {
"type": "git",
"url": "https://github.com/yoursunny/NDNts.git",
"directory": "packages/keychain"
"directory": "pkg/keychain"
},
"publishConfig": {
"main": "lib/mod_node.js",
Expand Down
2 changes: 1 addition & 1 deletion pkg/l3face/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"repository": {
"type": "git",
"url": "https://github.com/yoursunny/NDNts.git",
"directory": "packages/l3face"
"directory": "pkg/l3face"
},
"publishConfig": {
"main": "lib/mod_node.js",
Expand Down
2 changes: 1 addition & 1 deletion pkg/lp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"repository": {
"type": "git",
"url": "https://github.com/yoursunny/NDNts.git",
"directory": "packages/lp"
"directory": "pkg/lp"
},
"publishConfig": {
"main": "lib/mod_node.js",
Expand Down
2 changes: 1 addition & 1 deletion pkg/nac/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"repository": {
"type": "git",
"url": "https://github.com/yoursunny/NDNts.git",
"directory": "packages/nac"
"directory": "pkg/nac"
},
"publishConfig": {
"main": "lib/mod_node.js",
Expand Down
2 changes: 1 addition & 1 deletion pkg/naming-convention1/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"repository": {
"type": "git",
"url": "https://github.com/yoursunny/NDNts.git",
"directory": "packages/naming-convention1"
"directory": "pkg/naming-convention1"
},
"publishConfig": {
"main": "lib/mod_node.js",
Expand Down
2 changes: 1 addition & 1 deletion pkg/naming-convention2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"repository": {
"type": "git",
"url": "https://github.com/yoursunny/NDNts.git",
"directory": "packages/naming-convention2"
"directory": "pkg/naming-convention2"
},
"publishConfig": {
"main": "lib/mod_node.js",
Expand Down
2 changes: 1 addition & 1 deletion pkg/ndn/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"repository": {
"type": "git",
"url": "https://github.com/yoursunny/NDNts.git",
"directory": "packages/ndn"
"directory": "pkg/ndn"
},
"publishConfig": {
"main": "lib/mod_node.js",
Expand Down
2 changes: 1 addition & 1 deletion pkg/ndncert/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"repository": {
"type": "git",
"url": "https://github.com/yoursunny/NDNts.git",
"directory": "packages/ndncert"
"directory": "pkg/ndncert"
},
"publishConfig": {
"main": "lib/mod_node.js",
Expand Down
2 changes: 1 addition & 1 deletion pkg/ndnsec/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"repository": {
"type": "git",
"url": "https://github.com/yoursunny/NDNts.git",
"directory": "packages/ndnsec"
"directory": "pkg/ndnsec"
},
"publishConfig": {
"main": "lib/mod_node.js",
Expand Down
2 changes: 1 addition & 1 deletion pkg/nfdmgmt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"repository": {
"type": "git",
"url": "https://github.com/yoursunny/NDNts.git",
"directory": "packages/nfdmgmt"
"directory": "pkg/nfdmgmt"
},
"publishConfig": {
"main": "lib/mod_node.js",
Expand Down
2 changes: 1 addition & 1 deletion pkg/node-transport/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"repository": {
"type": "git",
"url": "https://github.com/yoursunny/NDNts.git",
"directory": "packages/node-transport"
"directory": "pkg/node-transport"
},
"publishConfig": {
"main": "lib/mod_node.js",
Expand Down
2 changes: 1 addition & 1 deletion pkg/packet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"repository": {
"type": "git",
"url": "https://github.com/yoursunny/NDNts.git",
"directory": "packages/packet"
"directory": "pkg/packet"
},
"publishConfig": {
"main": "lib/mod_node.js",
Expand Down
2 changes: 1 addition & 1 deletion pkg/quic-transport/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"repository": {
"type": "git",
"url": "https://github.com/yoursunny/NDNts.git",
"directory": "packages/quic-transport"
"directory": "pkg/quic-transport"
},
"publishConfig": {
"main": "lib/mod_node.js",
Expand Down
2 changes: 1 addition & 1 deletion pkg/rdr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"repository": {
"type": "git",
"url": "https://github.com/yoursunny/NDNts.git",
"directory": "packages/rdr"
"directory": "pkg/rdr"
},
"publishConfig": {
"main": "lib/mod_node.js",
Expand Down
2 changes: 1 addition & 1 deletion pkg/repo-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"repository": {
"type": "git",
"url": "https://github.com/yoursunny/NDNts.git",
"directory": "packages/repo-api"
"directory": "pkg/repo-api"
},
"publishConfig": {
"main": "lib/mod_node.js",
Expand Down
2 changes: 1 addition & 1 deletion pkg/repo-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"repository": {
"type": "git",
"url": "https://github.com/yoursunny/NDNts.git",
"directory": "packages/repo-cli"
"directory": "pkg/repo-cli"
},
"dependencies": {
"@ndn/cli-common": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion pkg/repo-external/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"repository": {
"type": "git",
"url": "https://github.com/yoursunny/NDNts.git",
"directory": "packages/repo-external"
"directory": "pkg/repo-external"
},
"publishConfig": {
"main": "lib/mod_node.js",
Expand Down
2 changes: 1 addition & 1 deletion pkg/repo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"repository": {
"type": "git",
"url": "https://github.com/yoursunny/NDNts.git",
"directory": "packages/repo"
"directory": "pkg/repo"
},
"publishConfig": {
"main": "lib/mod_node.js",
Expand Down
Loading

0 comments on commit 31d9d20

Please sign in to comment.