Skip to content

Commit

Permalink
fix: fixed issue with env on npm registry
Browse files Browse the repository at this point in the history
  • Loading branch information
dominickolbe committed Aug 17, 2021
1 parent 9917ff0 commit deede2b
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 20 deletions.
5 changes: 4 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# production
src/
.github/
.nvmrc
.versionrc.json
tsconfig.json
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"whats-the-weather": "./lib/index.js"
},
"scripts": {
"start": "ts-node -r dotenv/config ./src/index.ts",
"start": "ts-node ./src/index.ts",
"prebuild": "yarn test && rm -rf ./lib",
"build": "tsc",
"postbuild": "chmod +x ./lib/index.js",
Expand Down
4 changes: 3 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env node

import "./lib/env";
const resolve = require("path").resolve;
require("dotenv").config({ path: resolve(__dirname, "../.env") });

import chalk from "chalk";
import { APP_VERSION } from "./config";
import { Api } from "./services/Api";
Expand Down
4 changes: 0 additions & 4 deletions src/lib/env.ts

This file was deleted.

1 change: 1 addition & 0 deletions src/services/Api/config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export const API_HOST = `${process.env.API_HOST}`;
export const API_KEY = `${process.env.API_KEY}`;

export const DEFAULT_UNIT = "metric";
export const DEFAULT_TIMEOUT = 1000 * 10;
23 changes: 10 additions & 13 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
{
"compilerOptions": {
"allowJs": true,
"baseUrl": ".",
"esModuleInterop": true,
"lib": ["ESNext", "DOM"],
"module": "commonjs",
"target": "ESNext",
"allowJs": true,
"outDir": "./lib",
"strict": true,
"noImplicitAny": true,
"esModuleInterop": true,
"resolveJsonModule": true,
"moduleResolution": "node",
"sourceMap": true,
"baseUrl": ".",
"outDir": "./lib",
"paths": {
"*": ["node_modules/*", "src/types/*"]
"*": ["./node_modules/@types"]
},
"typeRoots": ["./node_modules/@types"]
},
"include": ["src/**/*"]
"resolveJsonModule": true,
"rootDir": "./src",
"strict": true,
"target": "ESNext"
}
}

0 comments on commit deede2b

Please sign in to comment.