Skip to content

Commit 2897ffa

Browse files
author
Cornelius Ludmann
committed
Add npm-tools
1 parent e168a9c commit 2897ffa

File tree

7 files changed

+73
-4
lines changed

7 files changed

+73
-4
lines changed

.devcontainer/Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,15 @@ RUN rm -f /usr/bin/npx /usr/local/bin/npx && \
349349
echo 'exit 1' >> /usr/local/bin/npx && \
350350
chmod +x /usr/local/bin/npx
351351

352+
# Install npm-tools with locked dependencies
353+
COPY dev/npm-tools/package.json dev/npm-tools/package-lock.json /opt/npm-tools/
354+
RUN cd /opt/npm-tools && \
355+
npm ci && \
356+
for bin in /opt/npm-tools/node_modules/.bin/*; do \
357+
ln -sf "$bin" /usr/local/bin/$(basename "$bin"); \
358+
done && \
359+
rm -rf ~/.npm/_cacache
360+
352361
ENV PATH=$PATH:/root/.aws-iam:/root/.terraform:/workspace/bin
353362

354363
### Telepresence ###

components/gitpod-db/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"license": "AGPL-3.0",
44
"version": "0.1.5",
55
"scripts": {
6-
"build": "npx tsc",
6+
"build": "tsc",
77
"build:clean": "yarn clean && yarn lint && yarn build",
88
"lint": "yarn eslint src/*.ts src/**/*.ts",
99
"lint:fix": "yarn eslint src/*.ts src/**/*.ts --fix",

components/server/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
"scripts": {
77
"start": "node ./dist/main.js",
88
"start-inspect": "node --inspect=0.0.0.0:9229 ./dist/main.js",
9-
"generate": "leeway run components/spicedb:generate-ts > src/authorization/definitions.ts && npx prettier --write src/authorization/definitions.ts",
9+
"generate": "leeway run components/spicedb:generate-ts > src/authorization/definitions.ts && prettier --write src/authorization/definitions.ts",
1010
"build:clean": "yarn clean && yarn lint && yarn build",
11-
"build": "yarn generate && npx tsc",
11+
"build": "yarn generate && tsc",
1212
"lint": "yarn eslint src/*.ts src/**/*.ts",
1313
"lint:fix": "yarn eslint src/*.ts src/**/*.ts --fix",
1414
"rebuild": "yarn build:clean",

components/ws-manager-bridge/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"test": "mocha './**/*.spec.ts' --exclude './node_modules/**' --exit",
99
"lint": "yarn eslint src/*.ts src/**/*.ts",
1010
"lint:fix": "yarn eslint src/*.ts src/**/*.ts --fix",
11-
"build": "yarn lint && npx tsc",
11+
"build": "yarn lint && tsc",
1212
"build:clean": "yarn clean && yarn build",
1313
"rebuild": "yarn build:clean",
1414
"build:watch": "watch 'yarn build' .",

dev/image/Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,15 @@ RUN bash -c ". .nvm/nvm.sh \
130130
&& npm install -g typescript yarn @anthropic-ai/claude-code"
131131
ENV PATH=/home/gitpod/.nvm/versions/node/v${GITPOD_NODE_VERSION}/bin:$PATH
132132

133+
# Install npm-tools with locked dependencies
134+
COPY dev/npm-tools/package.json dev/npm-tools/package-lock.json /opt/npm-tools/
135+
RUN cd /opt/npm-tools && \
136+
npm ci && \
137+
for bin in /opt/npm-tools/node_modules/.bin/*; do \
138+
sudo ln -sf "$bin" /usr/local/bin/$(basename "$bin"); \
139+
done && \
140+
rm -rf ~/.npm/_cacache
141+
133142
## Register leeway autocompletion in bashrc
134143
RUN bash -c "echo . \<\(leeway bash-completion\) >> ~/.bashrc"
135144

dev/npm-tools/package-lock.json

Lines changed: 42 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dev/npm-tools/package.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"name": "npm-tools",
3+
"private": true,
4+
"description": "CLI tools used across the monorepo",
5+
"dependencies": {
6+
"typescript": "^5.7.3",
7+
"prettier": "^3.0.0"
8+
}
9+
}

0 commit comments

Comments
 (0)