whoami1337 1 anno fa
parent
commit
a286e3ce90

+ 1 - 0
lib/cjs/index.d.ts

@@ -0,0 +1 @@
+export * from './interfaces/IUsers';

+ 17 - 0
lib/cjs/index.js

@@ -0,0 +1,17 @@
+"use strict";
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    var desc = Object.getOwnPropertyDescriptor(m, k);
+    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
+      desc = { enumerable: true, get: function() { return m[k]; } };
+    }
+    Object.defineProperty(o, k2, desc);
+}) : (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    o[k2] = m[k];
+}));
+var __exportStar = (this && this.__exportStar) || function(m, exports) {
+    for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+__exportStar(require("./interfaces/IUsers"), exports);

+ 6 - 0
lib/cjs/interfaces/IUsers.d.ts

@@ -0,0 +1,6 @@
+export interface IQFUser {
+    id: number;
+    name: string;
+    email: string;
+}
+export type UserRole = 'admin' | 'user';

+ 3 - 0
lib/cjs/interfaces/IUsers.js

@@ -0,0 +1,3 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+// Export any other interfaces or types you need

+ 1 - 0
lib/esm/index.d.ts

@@ -0,0 +1 @@
+export * from './interfaces/IUsers';

+ 1 - 0
lib/esm/index.js

@@ -0,0 +1 @@
+export * from './interfaces/IUsers';

+ 6 - 0
lib/esm/interfaces/IUsers.d.ts

@@ -0,0 +1,6 @@
+export interface IQFUser {
+    id: number;
+    name: string;
+    email: string;
+}
+export type UserRole = 'admin' | 'user';

+ 2 - 0
lib/esm/interfaces/IUsers.js

@@ -0,0 +1,2 @@
+export {};
+// Export any other interfaces or types you need

+ 7 - 8
package.json

@@ -2,14 +2,13 @@
   "name": "qf-types",
   "version": "1.0.0",
   "description": "Global package for about interfaces, types.",
-  "files": ["dist"],
-  "main": "./dist/index.js",
-  "module": "./dist/index.js",
-  "types": "./dist/index.d.ts",
-  "exports":{
-    ".": {
-      "import": "./dist/index.js"
-    }
+  "main": "./lib/cjs/index.js",
+  "module": "./lib/esm/index.js",
+  "types": "./lib/esm/index.d.ts",
+  "scripts": {
+    "build": "yarn build:esm && yarn build:cjs",
+    "build:esm": "tsc",
+    "build:cjs": "tsc --module commonjs --outDir lib/cjs"
   },
   "repository": "https://git.ali33.ru/s4z/qf-types.git",
   "author": "0xJS",

+ 16 - 8
tsconfig.json

@@ -1,13 +1,21 @@
 {
   "compilerOptions": {
-    "outDir": "./dist",
+    "outDir": "lib/esm",
+    "module": "esnext",
+    "target": "es5",
+    "lib": ["es6", "dom", "es2016", "es2017"],
+    "jsx": "react",
     "declaration": true,
-    "declarationMap": true,
-    "sourceMap": true,
-    "target": "es6",
-    "module": "commonjs",
-    "strict": true,
-    "esModuleInterop": true
+    "moduleResolution": "node",
+    "noUnusedLocals": true,
+    "noUnusedParameters": true,
+    "esModuleInterop": true,
+    "noImplicitReturns": true,
+    "noImplicitThis": true,
+    "noImplicitAny": true,
+    "strictNullChecks": true,
+    "allowSyntheticDefaultImports": true
   },
-  "include": ["src/**/*"]
+  "include": ["src"],
+  "exclude": ["node_modules", "lib"]
 }