Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'origin/master' into alpha
Browse files Browse the repository at this point in the history
Merge pull request #462 from tamj0rd2/update-alpha
  • Loading branch information
tamj0rd2 authored Sep 24, 2020
2 parents d658f60 + d5e25e8 commit e6e646a
Show file tree
Hide file tree
Showing 25 changed files with 1,510 additions and 1,039 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
**/node_modules/**/*
**/node_modules
lib
.npmrc
.nyc_output
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
node_modules
**/node_modules/**
yarn.lock
lib
.vscode
Expand Down
14 changes: 11 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,33 @@ FROM node:12.18.4-alpine as base
RUN apk add --no-cache bash
RUN apk add --no-cache curl
RUN apk add --no-cache git
ENV JQ_VERSION='1.6'
RUN apk add --no-cache jq

RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app

ENV HUSKY_SKIP_INSTALL=true
COPY package.json package-lock.json ./

RUN npm ci
COPY . .

FROM base as install
FROM base as compile
RUN npm run compile

FROM compile as black-box
RUN npm ci --prefix ./black-box-tests/shared

#== acceptance tests setup ==#
FROM black-box as acceptance-tests

#== pre-release tests setup ==#
FROM compile as pre-release-tests
FROM black-box as pre-release-tests
RUN mv $(npm pack | tail -n 1) ./black-box-tests/pre-release/ncdc.tgz

WORKDIR /usr/src/app/black-box-tests/pre-release
RUN rm -rf ../../node_modules
RUN npm ci
RUN npm install ./ncdc.tgz
RUN npm run build
RUN npm run typecheck
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@ purposes.
You can find more information about generating schemas and why you might want to
do that [here](#generate)

## Typescript Compatability

- Typescript 3 - Everything below ncdc version 1.0.0
- Typescript 4 - Everything above ncdc version 1.0.0

## CLI usage

```
Expand Down
4 changes: 3 additions & 1 deletion black-box-tests/acceptance/jest-extensions.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import strip from 'strip-ansi'
import { toMatchSnapshot } from 'jest-snapshot'

// eslint-disable-next-line @typescript-eslint/no-unused-vars
declare global {
// eslint-disable-next-line @typescript-eslint/no-namespace
namespace jest {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
interface Matchers<R> {
toMatchStrippedSnapshot(): R
}
Expand All @@ -20,7 +22,7 @@ expect.extend({
})
.join('\n')

// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore do not know how to fix this "this" type mismatch
return toMatchSnapshot.call(this, content, 'toMatchStrippedSnapshot')
},
Expand Down
2 changes: 1 addition & 1 deletion black-box-tests/acceptance/serve.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ describe('ncdc serve', () => {
})

it('logs a message and kills the server when the config file has problems', async () => {
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
configWrapper.editConfig('Books', (c) => ({ ...c, request: {} }))

Expand Down
15 changes: 10 additions & 5 deletions black-box-tests/acceptance/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,17 @@
"compilerOptions": {
"baseUrl": "../../",
"rootDir": "./",
"noEmit": true,
"composite": false,
"typeRoots": ["../../node_modules/@types"],
"noEmit": false,
"emitDeclarationOnly": true,
"outDir": "../out/acceptance",
"composite": true,
"paths": {
"~shared/*": ["./black-box-tests/shared/*"]
"~shared/*": ["./black-box-tests/shared/*"],
"~*": ["src/*"]
}
},
"references": [{ "path": "../shared" }],
"include": ["**/*.ts"]
"references": [{ "path": "../shared/tsconfig.json" }],
"include": ["**/*.ts"],
"files": ["../../src/index.d.ts"]
}
Loading

0 comments on commit e6e646a

Please sign in to comment.