Skip to content

Commit

Permalink
minor refactor project structure (#129)
Browse files Browse the repository at this point in the history
* disable package-lock generation

* move types and typings tests into types folder

* restructure npm scripts, activate linting in workflow

* Update package.json
  • Loading branch information
Uzlopak authored Aug 24, 2022
1 parent 2ecc291 commit ca741ca
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 13 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ jobs:
uses: fastify/workflows/.github/workflows/plugins-ci.yml@v3
with:
license-check: true
lint: true
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
2 changes: 2 additions & 0 deletions .taprc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
files:
- test/**/*.test.js
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# env-schema

![CI](https://github.com/fastify/env-schema/workflows/CI/badge.svg)
[![CI](https://github.com/fastify/env-schema/workflows/CI/badge.svg)](https://github.com/fastify/env-schema/actions/workflows/ci.yml)
[![NPM version](https://img.shields.io/npm/v/env-schema.svg?style=flat)](https://www.npmjs.com/package/env-schema)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://standardjs.com/)

Expand Down
25 changes: 14 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
"version": "4.0.0",
"description": "Validate your env variable using Ajv and dotenv",
"main": "index.js",
"types": "types/index.d.ts",
"scripts": {
"test": "standard | snazzy && tap test/*.test.js && npm run typescript",
"test:ci": "standard | snazzy && tap test/*.test.js --coverage-report=lcovonly && npm run typescript",
"typescript": "tsd"
"lint": "standard | snazzy",
"test": "npm run test:unit && npm run test:typescript",
"test:unit": "tap",
"test:typescript": "tsd"
},
"repository": {
"type": "git",
Expand All @@ -27,6 +29,11 @@
"url": "https://github.com/fastify/env-schema/issues"
},
"homepage": "https://github.com/fastify/env-schema#readme",
"dependencies": {
"ajv": "^8.0.0",
"dotenv": "^16.0.0",
"dotenv-expand": "^8.0.3"
},
"devDependencies": {
"@fastify/pre-commit": "^2.0.2",
"ajv-formats": "^2.1.1",
Expand All @@ -36,12 +43,8 @@
"tap": "^16.0.0",
"tsd": "^0.22.0"
},
"dependencies": {
"ajv": "^8.0.0",
"dotenv": "^16.0.0",
"dotenv-expand": "^8.0.3"
},
"tsd": {
"directory": "test/types"
}
"pre-commit": [
"lint",
"test"
]
}
File renamed without changes.
2 changes: 1 addition & 1 deletion test/types/types.test.ts → types/index.test-d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expectError, expectType } from "tsd";
import envSchema, { EnvSchemaData, EnvSchemaOpt, envSchema as envSchemaNamed, default as envSchemaDefault } from "../..";
import envSchema, { EnvSchemaData, EnvSchemaOpt, envSchema as envSchemaNamed, default as envSchemaDefault } from "..";
import Ajv, { KeywordDefinition } from 'ajv'

const schema = {
Expand Down

0 comments on commit ca741ca

Please sign in to comment.