@adonisjs/env 3.0.5 → 3.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # The MIT License
2
2
 
3
- Copyright 2021 Harminder Virk, contributors
3
+ Copyright 2022 Harminder Virk, contributors
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
6
 
package/README.md CHANGED
@@ -19,7 +19,7 @@
19
19
 
20
20
  <div align="center">
21
21
  <h3>
22
- <a href="https://preview.adonisjs.com">
22
+ <a href="https://adonisjs.com">
23
23
  Website
24
24
  </a>
25
25
  <span> | </span>
@@ -31,7 +31,7 @@ function castToBoolean(key, value, message) {
31
31
  */
32
32
  function boolean(options) {
33
33
  return function validate(key, value) {
34
- helpers_1.ensureValue(key, value, options?.message);
34
+ (0, helpers_1.ensureValue)(key, value, options?.message);
35
35
  return castToBoolean(key, value, options?.message);
36
36
  };
37
37
  }
@@ -29,7 +29,7 @@ exports.castToNumber = castToNumber;
29
29
  */
30
30
  function number(options) {
31
31
  return function validate(key, value) {
32
- helpers_1.ensureValue(key, value, options?.message);
32
+ (0, helpers_1.ensureValue)(key, value, options?.message);
33
33
  return castToNumber(key, value, options?.message);
34
34
  };
35
35
  }
@@ -51,7 +51,7 @@ function ensureOneOf(choices, key, value, message) {
51
51
  */
52
52
  function oneOf(choices, options) {
53
53
  return function validate(key, value) {
54
- helpers_1.ensureValue(key, value, options?.message);
54
+ (0, helpers_1.ensureValue)(key, value, options?.message);
55
55
  return ensureOneOf(choices, key, value, options?.message);
56
56
  };
57
57
  }
@@ -42,7 +42,7 @@ const formats = {
42
42
  */
43
43
  function string(options) {
44
44
  return function validate(key, value) {
45
- helpers_1.ensureValue(key, value, options?.message);
45
+ (0, helpers_1.ensureValue)(key, value, options?.message);
46
46
  if (options?.format) {
47
47
  formats[options.format](key, value, options);
48
48
  }
@@ -18,7 +18,7 @@ const utils_1 = require("@poppinss/utils");
18
18
  */
19
19
  function loadFile(filePath, optional = false) {
20
20
  try {
21
- return fs_1.readFileSync(filePath, 'utf-8');
21
+ return (0, fs_1.readFileSync)(filePath, 'utf-8');
22
22
  }
23
23
  catch (error) {
24
24
  if (error.code !== 'ENOENT') {
@@ -35,14 +35,14 @@ function loadFile(filePath, optional = false) {
35
35
  */
36
36
  function envLoader(appRoot) {
37
37
  const envPath = process.env.ENV_PATH || '.env';
38
- const absPath = path_1.isAbsolute(envPath) ? envPath : path_1.join(appRoot, envPath);
38
+ const absPath = (0, path_1.isAbsolute)(envPath) ? envPath : (0, path_1.join)(appRoot, envPath);
39
39
  const envContents = loadFile(absPath, true);
40
40
  /**
41
41
  * Optionally loading the `.env.testing` file in test environment
42
42
  */
43
43
  let testEnvContent = '';
44
44
  if (process.env.NODE_ENV === 'testing') {
45
- testEnvContent = loadFile(path_1.join(appRoot, '.env.testing'), true);
45
+ testEnvContent = loadFile((0, path_1.join)(appRoot, '.env.testing'), true);
46
46
  }
47
47
  return { testEnvContent, envContents };
48
48
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adonisjs/env",
3
- "version": "3.0.5",
3
+ "version": "3.0.8",
4
4
  "description": "Environment variable manager for Node.js",
5
5
  "main": "build/index.js",
6
6
  "files": [
@@ -12,12 +12,12 @@
12
12
  "scripts": {
13
13
  "mrm": "mrm --preset=@adonisjs/mrm-preset",
14
14
  "pretest": "npm run lint",
15
- "test": "node japaFile.js",
16
- "clean": "del build",
15
+ "test": "node -r @adonisjs/require-ts/build/register bin/test.ts",
16
+ "clean": "del-cli build",
17
17
  "compile": "npm run lint && npm run clean && tsc",
18
18
  "build": "npm run compile",
19
19
  "commit": "git-cz",
20
- "release": "np",
20
+ "release": "np --message=\"chore(release): %s\"",
21
21
  "version": "npm run build",
22
22
  "prepublishOnly": "npm run build",
23
23
  "lint": "eslint . --ext=.ts",
@@ -31,24 +31,27 @@
31
31
  "author": "virk,adonisjs",
32
32
  "license": "MIT",
33
33
  "devDependencies": {
34
- "@adonisjs/mrm-preset": "^4.1.2",
35
- "@adonisjs/require-ts": "^2.0.7",
36
- "@poppinss/dev-utils": "^1.1.5",
37
- "@types/node": "^16.3.3",
34
+ "@adonisjs/mrm-preset": "^5.0.3",
35
+ "@adonisjs/require-ts": "^2.0.10",
36
+ "@japa/assert": "^1.2.3",
37
+ "@japa/run-failed-tests": "^1.0.3",
38
+ "@japa/runner": "^2.0.6",
39
+ "@japa/spec-reporter": "^1.1.7",
40
+ "@poppinss/dev-utils": "^2.0.2",
41
+ "@types/node": "^17.0.23",
38
42
  "commitizen": "^4.2.4",
39
43
  "cz-conventional-changelog": "^3.3.0",
40
44
  "del-cli": "^4.0.1",
41
- "eslint": "^7.31.0",
42
- "eslint-config-prettier": "^8.3.0",
43
- "eslint-plugin-adonis": "^1.3.3",
44
- "eslint-plugin-prettier": "^3.4.0",
45
- "github-label-sync": "^2.0.1",
45
+ "eslint": "^8.12.0",
46
+ "eslint-config-prettier": "^8.5.0",
47
+ "eslint-plugin-adonis": "^2.1.0",
48
+ "eslint-plugin-prettier": "^4.0.0",
49
+ "github-label-sync": "^2.1.1",
46
50
  "husky": "^7.0.1",
47
- "japa": "^3.1.1",
48
- "mrm": "^3.0.2",
49
- "np": "^7.5.0",
50
- "prettier": "^2.3.2",
51
- "typescript": "^4.3.5"
51
+ "mrm": "^4.0.0",
52
+ "np": "^7.6.1",
53
+ "prettier": "^2.6.2",
54
+ "typescript": "^4.6.3"
52
55
  },
53
56
  "nyc": {
54
57
  "exclude": [
@@ -73,9 +76,9 @@
73
76
  "anyBranch": false
74
77
  },
75
78
  "dependencies": {
76
- "@poppinss/utils": "^3.1.4",
77
- "dotenv": "^10.0.0",
78
- "validator": "^13.6.0"
79
+ "@poppinss/utils": "^4.0.2",
80
+ "dotenv": "^16.0.0",
81
+ "validator": "^13.7.0"
79
82
  },
80
83
  "directories": {
81
84
  "doc": "docs",
@@ -92,5 +95,48 @@
92
95
  "publishConfig": {
93
96
  "access": "public",
94
97
  "tag": "latest"
98
+ },
99
+ "mrmConfig": {
100
+ "core": true,
101
+ "license": "MIT",
102
+ "services": [
103
+ "github-actions"
104
+ ],
105
+ "minNodeVersion": "14.15.4",
106
+ "probotApps": [
107
+ "stale",
108
+ "lock"
109
+ ],
110
+ "runGhActionsOnWindows": false
111
+ },
112
+ "eslintConfig": {
113
+ "extends": [
114
+ "plugin:adonis/typescriptPackage",
115
+ "prettier"
116
+ ],
117
+ "plugins": [
118
+ "prettier"
119
+ ],
120
+ "rules": {
121
+ "prettier/prettier": [
122
+ "error",
123
+ {
124
+ "endOfLine": "auto"
125
+ }
126
+ ]
127
+ }
128
+ },
129
+ "eslintIgnore": [
130
+ "build"
131
+ ],
132
+ "prettier": {
133
+ "trailingComma": "es5",
134
+ "semi": false,
135
+ "singleQuote": true,
136
+ "useTabs": false,
137
+ "quoteProps": "consistent",
138
+ "bracketSpacing": true,
139
+ "arrowParens": "always",
140
+ "printWidth": 100
95
141
  }
96
142
  }