@ttoss/config 0.8.3 → 0.9.1
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/README.md +59 -0
- package/dist/index.js +46 -8
- package/package.json +3 -3
package/README.md
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# @ttoss/config
|
|
2
|
+
|
|
3
|
+
## 📚 About
|
|
4
|
+
|
|
5
|
+
<strong> @ttoss/config</strong> is a easiest way to use Configs in your React application.
|
|
6
|
+
|
|
7
|
+
## 🚀 Get Started
|
|
8
|
+
|
|
9
|
+
### Install
|
|
10
|
+
|
|
11
|
+
```shell
|
|
12
|
+
$ yarn add @ttoss/config
|
|
13
|
+
# or
|
|
14
|
+
$ npm install @ttoss/config
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## 📄 Examples of use
|
|
18
|
+
|
|
19
|
+
### Babel
|
|
20
|
+
|
|
21
|
+
```js title="babel.config.js"
|
|
22
|
+
const { babelConfig } = require('@ttoss/config');
|
|
23
|
+
|
|
24
|
+
module.exports = babelConfig();
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Jest
|
|
28
|
+
|
|
29
|
+
```js title="jest.config.js"
|
|
30
|
+
import { jestConfig } from '@ttoss/config';
|
|
31
|
+
|
|
32
|
+
const config = jestConfig({
|
|
33
|
+
moduleNameMapper: {
|
|
34
|
+
'\\.(css)$': 'identity-obj-proxy',
|
|
35
|
+
},
|
|
36
|
+
setupFilesAfterEnv: ['./jest.setup.tsx'],
|
|
37
|
+
testEnvironment: 'jsdom',
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
export default config;
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Tsup
|
|
44
|
+
|
|
45
|
+
```js title="tsup.config.js"
|
|
46
|
+
import { tsupConfig } from '@ttoss/config';
|
|
47
|
+
|
|
48
|
+
export const tsup = tsupConfig();
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## 📘 Types
|
|
52
|
+
|
|
53
|
+
```ts
|
|
54
|
+
const babelConfig: () => any;
|
|
55
|
+
|
|
56
|
+
const jestConfig: () => any;
|
|
57
|
+
|
|
58
|
+
const tsupConfig: () => any;
|
|
59
|
+
```
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,43 @@
|
|
|
1
|
-
|
|
2
|
-
var
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(module2))
|
|
15
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return target;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (module2, isNodeMode) => {
|
|
21
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
+
return (module2, temp) => {
|
|
25
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
+
};
|
|
27
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
+
|
|
29
|
+
// src/index.ts
|
|
30
|
+
var src_exports = {};
|
|
31
|
+
__export(src_exports, {
|
|
32
|
+
babelConfig: () => babelConfig,
|
|
33
|
+
jestConfig: () => jestConfig,
|
|
34
|
+
tsupConfig: () => tsupConfig
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
// src/configCreator.ts
|
|
38
|
+
var import_deepmerge = __toESM(require("deepmerge"));
|
|
3
39
|
var overwriteMerge = (_, sourceArray) => sourceArray;
|
|
4
|
-
var configCreator = (defaultConfig4 = {}) => (config = {}) =>
|
|
40
|
+
var configCreator = (defaultConfig4 = {}) => (config = {}) => (0, import_deepmerge.default)(defaultConfig4, config, { arrayMerge: overwriteMerge });
|
|
5
41
|
|
|
6
42
|
// src/babel.ts
|
|
7
43
|
var defaultConfig = {
|
|
@@ -33,8 +69,10 @@ var defaultConfig3 = {
|
|
|
33
69
|
minify: false
|
|
34
70
|
};
|
|
35
71
|
var tsupConfig = configCreator(defaultConfig3);
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
72
|
+
module.exports = __toCommonJS(src_exports);
|
|
73
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
74
|
+
0 && (module.exports = {
|
|
75
|
+
babelConfig,
|
|
76
|
+
jestConfig,
|
|
77
|
+
tsupConfig
|
|
78
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ttoss/config",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"description": "Default configuration for packages.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"publishConfig": {
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
"@babel/preset-typescript": "^7.15.0",
|
|
33
33
|
"@emotion/jest": "^11.3.0",
|
|
34
34
|
"deepmerge": "^4.2.2",
|
|
35
|
-
"tsup": "^
|
|
35
|
+
"tsup": "^5.11.11"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "22b5b5069d316cf219a95635bb05c21b8e3367a4",
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@jest/types": "^27.1.0"
|
|
40
40
|
}
|