Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
strategy:
matrix:
node-version:
- 16.14.0-buster
- 24.2.0-bookworm

container:
image: node:${{ matrix.node-version }}
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.14
24
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
nodejs 16.14.2
nodejs 24.2.0
yarn 1.22.19
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
### Dependency Cacher
### -------------------------
FROM endeveit/docker-jq:latest as deps

Check warning on line 3 in Dockerfile

View workflow job for this annotation

GitHub Actions / Hadolint

Using latest is prone to errors if the image will ever update. Pin the version explicitly to a release tag

# To prevent cache invalidation from changes in fields other than dependencies
# https://stackoverflow.com/a/59606373
Expand All @@ -10,7 +10,7 @@

### Fat Build
### -------------------------
FROM node:16.14.0-alpine AS builder
FROM node:24.2.0-alpine AS builder

WORKDIR /usr/numbers

Expand All @@ -26,14 +26,14 @@

### Slim Deploy
### -------------------------
FROM node:16.14.0-alpine
FROM node:24.2.0-alpine

WORKDIR /usr/numbers

# Install and cache production dependencies
COPY --from=deps /tmp/deps.json ./package.json
COPY yarn.lock ./
RUN yarn install --production

Check notice on line 36 in Dockerfile

View workflow job for this annotation

GitHub Actions / Hadolint

`yarn cache clean` missing after `yarn install` was run.

# Copy only the built source
COPY --from=builder /usr/numbers/dist ./dist
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ vi .env
### Install dependencies

```
# With Node 16.14
# With Node 24.2
yarn install
```

Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"prepare-release": "One-step: clean, build, test, publish docs, and prep a release"
},
"engines": {
"node": ">=16"
"node": ">=24"
},
"dependencies": {
"@bandwidth/messaging": "^4.0.3",
Expand Down Expand Up @@ -129,11 +129,11 @@
"@types/google-libphonenumber": "^7.4.23",
"@types/ioredis": "^4.28.10",
"@types/ioredis-mock": "^8.2.2",
"@types/jest": "^25.2.1",
"@types/jest": "^29.5.14",
"@types/lodash": "^4.14.135",
"@types/memoizee": "^0.4.8",
"@types/nock": "^11.1.0",
"@types/node": "^16.14",
"@types/node": "^24",
"@types/pg": "^8.6.4",
"@types/promise-retry": "^1.1.3",
"@types/slonik": "^18.6.1",
Expand All @@ -146,7 +146,7 @@
"danger": "^10.6.6",
"dotenv-cli": "^3.2.0",
"husky": "^4.2.3",
"jest": "^25.5.4",
"jest": "^29.7.0",
"lint-staged": "^10.1.2",
"nock": "^11.3.5",
"nodemon": "^2.0.15",
Expand All @@ -155,13 +155,13 @@
"prettier": "^2.3.2",
"standard-version": "^7.1.0",
"superagent-graphql": "^0.1.2",
"ts-jest": "^25.5.1",
"ts-jest": "^29.4.11",
"ts-node": "^10.9.1",
"tslint": "^5.20.0",
"tslint-config-airbnb": "^5.11.1",
"tslint-config-prettier": "^1.18.0",
"typedoc": "^0.15.0",
"typescript": "^4.6.2"
"typescript": "^6.0.3"
},
"resolutions": {
"ioredis": "^5.2.3"
Expand Down
14 changes: 7 additions & 7 deletions src/jobs/find-suitable-area-codes.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ describe('find suitable area codes', () => {
});

test('should warn if not enough', async () => {
const spiedLog = spyOn(logger, 'warn');
const spiedLog = jest.spyOn(logger, 'warn');

await withPgMiddlewares(pool, [autoRollbackMiddleware], async (client) => {
const { sendingLocationId } = await setUpFindSuitableAreaCodes(client);
Expand All @@ -127,8 +127,8 @@ describe('find suitable area codes', () => {
);

// set up nocks
// nock responses so that it doesn't find enough
TwilioNock.getNumberAvailability(10, 0);
// nock responses so that it doesn't find enough (8 NY + 1 NJ = 9 total)
TwilioNock.getNumberAvailability(9, 0);

await findSuitableAreaCodes(
client,
Expand All @@ -153,9 +153,9 @@ describe('find suitable area codes', () => {
sendingLocationId
);

// we have 7 NY area codes, 1 NJ one
// we have 8 NY area codes (212,516,518,646,718,917 at dist 0, then 347,914 via zip 10012), 1 NJ one
// nock responses so that it doesn't find enough in NY
TwilioNock.getNumberAvailability(7, 0);
TwilioNock.getNumberAvailability(8, 0);
// and finds enough in NJ
TwilioNock.getNumberAvailability(1, 100);

Expand All @@ -175,9 +175,9 @@ describe('find suitable area codes', () => {
}
);

// expect the sending locaton to use the one area code
// expect the sending location to use the one area code
// in NJ despite having an NY center, because we've mocked
// the NY ones to be empty
expect(modifiedSendingLocation.area_codes).toEqual('{609}'); // skipping 516
expect(modifiedSendingLocation.area_codes).toEqual('{609}'); // only NJ code in dev seed (08540/Princeton)
});
});
4 changes: 3 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@

/* Completeness */
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
"skipLibCheck": true /* Skip type checking all .d.ts files. */
"skipLibCheck": true /* Skip type checking all .d.ts files. */,

"types": ["jest", "node"]
},
"include": ["src/**/*.ts", "scripts/**/*.ts", "typings/**/*.d.ts"],
"exclude": ["node_modules", ".vscode"]
Expand Down
Loading
Loading