Skip to content

Commit

Permalink
Merge pull request #2 from cabinetoffice/NTRNL-239-update-configurati…
Browse files Browse the repository at this point in the history
…on-for-npm-packaging

Ntrnl 239 update configuration for npm packaging
  • Loading branch information
harley-harris authored Nov 22, 2023
2 parents f9be376 + facbc7d commit c6a1529
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 11 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
lib

# Logs
**.log
logs
Expand Down
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
dist
lib
*.json
*.md
*.yml
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ NODE_VERSION_SUPPORTED := >=20.8.0
NODE_VERSION=$(shell node -v)

clean:
rm -rf ./dist ./coverage
rm -rf ./lib ./coverage

build:
$(info Node version supported: $(NODE_VERSION_SUPPORTED))
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ To integrate the module for testing purposes into your Node.js project, use the

```typescript
// logger.ts
import { ApplicationLogger } from "logging/dist/ApplicationLogger";
import { ApplicationLogger } from "logging/lib/ApplicationLogger";
import { createLogger } from "logging";

import { APPLICATION_NAME } from "../config";
Expand Down
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
roots: ['<rootDir>/src', '<rootDir>/test'],
testPathIgnorePatterns: ['/node_modules/', '/dist/'],
testPathIgnorePatterns: ['/node_modules/', '/lib/'],
collectCoverageFrom: ['./src/**/*.ts'],
preset: 'ts-jest',
testEnvironment: 'node',
Expand Down
23 changes: 17 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
{
"name": "poc_node_logging_tool",
"name": "@co-digital/node-logging",
"version": "1.0.0",
"description": "node logging tool",
"main": "dist/index.js",
"description": "A logging library for Node.JS applications in CO Digital.",
"homepage": "https://github.com/cabinetoffice/node-logging#README.md",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
"scripts": {
"build": "tsc",
"start": "node dist/index.js",
"start": "node lib/index.js",
"lint": "eslint '{src,test}/**/*.ts'",
"lint:fix": "eslint '{src,test}/**/*.ts' --fix",
"prettier": "prettier --check .",
"prettier:fix": "prettier --write .",
"test": "jest",
"coverage": "jest --coverage",
"prepare": "husky install"
"prepare": "husky install",
"prepublish": "[ ! -d node_modules ] && npm ci; tsc",
"postpublish": "rm -rf lib"
},
"repository": {
"type": "git",
"url": "https://github.com/cabinetoffice/node-logging.git"
},
"engines": {
"npm": ">=10.0.0",
Expand All @@ -37,5 +45,8 @@
"dependencies": {
"luxon": "^3.4.3",
"winston": "^3.11.0"
}
},
"files": [
"./lib/**/*"
]
}
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@

/* Emit */
"sourceMap": true, /* Create source map files for emitted JavaScript files. */
"outDir": "./dist", /* Specify an output folder for all emitted files. */
"outDir": "./lib", /* Specify an output folder for all emitted files. */
"declaration": true,

/* Interop Constraints */
"esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
Expand Down

0 comments on commit c6a1529

Please sign in to comment.