@baadal-sdk/dapi 0.11.0 → 0.15.0

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 CHANGED
@@ -1,7 +1,2 @@
1
1
  # dapi
2
2
  Dead-simple API wrappers
3
-
4
- # References:
5
- * https://www.typescriptlang.org/docs/handbook/babel-with-typescript.html
6
- * https://dev.to/iggredible/what-the-heck-are-cjs-amd-umd-and-esm-ikm
7
- * https://marcobotto.com/blog/compiling-and-bundling-typescript-libraries-with-webpack/
Binary file
@@ -0,0 +1,2 @@
1
+ var e={d:function(o,n){for(var r in n)e.o(n,r)&&!e.o(o,r)&&Object.defineProperty(o,r,{enumerable:!0,get:n[r]})},o:function(e,o){return Object.prototype.hasOwnProperty.call(e,o)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},o={};e.r(o),e.d(o,{default:function(){return u},foo:function(){return r},fs:function(){return n},num:function(){return t}});var n={log:function(){console.log("fs/log")}},r=function(){return"bar"},t=5,u=n,f=exports;for(var i in o)f[i]=o[i];o.__esModule&&Object.defineProperty(f,"__esModule",{value:!0});
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","mappings":"AACA,IAAIA,EAAsB,CCA1BA,EAAwB,SAASC,EAASC,GACzC,IAAI,IAAIC,KAAOD,EACXF,EAAoBI,EAAEF,EAAYC,KAASH,EAAoBI,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,MCJ3EH,EAAwB,SAASS,EAAKC,GAAQ,OAAOL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,ICC/FV,EAAwB,SAASC,GACX,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,M,4HCLvD,IAIA,GAAiBC,IAJL,WACVC,QAAQD,IAAI,YCCRE,EAAM,WACV,MAAO,OAIIC,EAAM,EACnB,I","sources":["webpack://@baadal-sdk/dapi/webpack/bootstrap","webpack://@baadal-sdk/dapi/webpack/runtime/define property getters","webpack://@baadal-sdk/dapi/webpack/runtime/hasOwnProperty shorthand","webpack://@baadal-sdk/dapi/webpack/runtime/make namespace object","webpack://@baadal-sdk/dapi/./src/fs/index.ts","webpack://@baadal-sdk/dapi/./src/index.ts"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const log = () => {\n console.log('fs/log');\n};\n\nexport default { log };\n","import fs from './fs';\n\nconst foo = () => {\n return 'bar';\n};\n\nexport { fs, foo };\nexport const num = 5;\nexport default fs;\n"],"names":["__webpack_require__","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","log","console","foo","num"],"sourceRoot":""}
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "commonjs"
3
+ }
@@ -0,0 +1,2 @@
1
+ var n={d:function(o,r){for(var t in r)n.o(r,t)&&!n.o(o,t)&&Object.defineProperty(o,t,{enumerable:!0,get:r[t]})},o:function(n,o){return Object.prototype.hasOwnProperty.call(n,o)}},o={};n.d(o,{ZP:function(){return u},RN:function(){return t},fs:function(){return r},OK:function(){return e}});var r={log:function(){console.log("fs/log")}},t=function(){return"bar"},e=5,u=r,f=o.ZP,a=o.RN,c=o.fs,i=o.OK;export{f as default,a as foo,c as fs,i as num};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","mappings":"AACA,IAAIA,EAAsB,CCA1BA,EAAwB,SAASC,EAASC,GACzC,IAAI,IAAIC,KAAOD,EACXF,EAAoBI,EAAEF,EAAYC,KAASH,EAAoBI,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,MCJ3EH,EAAwB,SAASS,EAAKC,GAAQ,OAAOL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,K,8GCA/F,IAIA,GAAiBI,IAJL,WACVC,QAAQD,IAAI,YCCRE,EAAM,WACV,MAAO,OAIIC,EAAM,EACnB,I","sources":["webpack://@baadal-sdk/dapi/webpack/bootstrap","webpack://@baadal-sdk/dapi/webpack/runtime/define property getters","webpack://@baadal-sdk/dapi/webpack/runtime/hasOwnProperty shorthand","webpack://@baadal-sdk/dapi/./src/fs/index.ts","webpack://@baadal-sdk/dapi/./src/index.ts"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","const log = () => {\n console.log('fs/log');\n};\n\nexport default { log };\n","import fs from './fs';\n\nconst foo = () => {\n return 'bar';\n};\n\nexport { fs, foo };\nexport const num = 5;\nexport default fs;\n"],"names":["__webpack_require__","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","log","console","foo","num"],"sourceRoot":""}
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "module"
3
+ }
@@ -2,3 +2,4 @@ declare const _default: {
2
2
  log: () => void;
3
3
  };
4
4
  export default _default;
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fs/index.ts"],"names":[],"mappings":";;;AAIA,wBAAuB"}
@@ -3,3 +3,4 @@ declare const foo: () => string;
3
3
  export { fs, foo };
4
4
  export declare const num = 5;
5
5
  export default fs;
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,MAAM,CAAC;AAEtB,QAAA,MAAM,GAAG,cAER,CAAC;AAEF,OAAO,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC;AACnB,eAAO,MAAM,GAAG,IAAI,CAAC;AACrB,eAAe,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,32 +1,63 @@
1
1
  {
2
2
  "name": "@baadal-sdk/dapi",
3
- "version": "0.11.0",
3
+ "version": "0.15.0",
4
4
  "description": "Dead-simple API wrappers",
5
- "main": "dist/index.js",
6
- "typings": "dist/index.d.ts",
5
+ "main": "dist/cjs/index.js",
6
+ "module": "dist/esm/index.js",
7
+ "typings": "dist/types/index.d.ts",
7
8
  "source": "src/index.ts",
9
+ "exports": {
10
+ ".": {
11
+ "import": "./dist/esm/index.js",
12
+ "require": "./dist/cjs/index.js"
13
+ }
14
+ },
8
15
  "files": [
9
- "dist"
16
+ "dist",
17
+ "src"
10
18
  ],
11
19
  "author": "Abhishek Raj <abhi@raj.me>",
12
20
  "license": "MIT",
13
21
  "scripts": {
14
- "build": "webpack",
15
- "build:cjs": "tsc",
16
- "build:esm": "tsc --module es6",
17
- "build:types": "tsc --emitDeclarationOnly",
22
+ "build": "npm run verify && bash tasks/build.sh",
18
23
  "clean": "shx rm -rf dist",
19
- "prepublishOnly": "run-s --silent clean && run-p --silent build build:types",
20
- "pub": "npm publish",
21
- "pub:test": "npm publish --dry-run"
24
+ "lint": "eslint '**/*.{js,jsx,ts,tsx}'",
25
+ "lint:fix": "npm run lint -- --fix",
26
+ "prepub": "run-s --silent clean build",
27
+ "pub": "npm run prepub && npm publish",
28
+ "pub:test": "npm run prepub && npm publish --dry-run",
29
+ "verify": "jsonlint -q tsconfig.json",
30
+ "blame": "git log -S",
31
+ "hist": "git log --oneline | grep -i",
32
+ "follow": "git log --follow --oneline",
33
+ "ncu": "ncu",
34
+ "ncuu": "ncu -u"
22
35
  },
23
36
  "devDependencies": {
24
37
  "@babel/core": "7.15.5",
25
38
  "@babel/preset-env": "7.15.6",
39
+ "@babel/preset-react": "^7.14.5",
26
40
  "@babel/preset-typescript": "7.15.0",
27
41
  "@types/node": "16.9.6",
42
+ "@types/react": "^16.0.0",
43
+ "@types/react-dom": "^16.0.0",
44
+ "@typescript-eslint/eslint-plugin": "4.31.2",
45
+ "@typescript-eslint/parser": "4.31.2",
28
46
  "babel-loader": "8.2.2",
47
+ "eslint": "7.32.0",
48
+ "eslint-config-airbnb": "18.2.1",
49
+ "eslint-config-airbnb-typescript": "14.0.0",
50
+ "eslint-config-prettier": "8.3.0",
51
+ "eslint-plugin-import": "2.24.2",
52
+ "eslint-plugin-jsx-a11y": "6.4.1",
53
+ "eslint-plugin-prettier": "4.0.0",
54
+ "eslint-plugin-react": "7.26.0",
55
+ "eslint-plugin-react-hooks": "4.2.0",
56
+ "husky": "4.3.8",
57
+ "jsonlint": "1.6.3",
58
+ "lint-staged": "11.1.2",
29
59
  "npm-run-all": "4.1.5",
60
+ "prettier": "2.4.1",
30
61
  "shx": "0.3.3",
31
62
  "typescript": "4.4.3",
32
63
  "webpack": "5.53.0",
@@ -35,9 +66,29 @@
35
66
  "dependencies": {
36
67
  "core-js": "3.18.0"
37
68
  },
69
+ "peerDependencies": {
70
+ "react": "^16.0.0",
71
+ "react-dom": "^16.0.0"
72
+ },
73
+ "peerDependenciesMeta": {
74
+ "react": {
75
+ "optional": true
76
+ },
77
+ "react-dom": {
78
+ "optional": true
79
+ }
80
+ },
38
81
  "browserslist": [
39
82
  "chrome >= 23"
40
83
  ],
84
+ "lint-staged": {
85
+ "*.{js,jsx,ts,tsx}": "eslint --fix"
86
+ },
87
+ "husky": {
88
+ "hooks": {
89
+ "pre-commit": "lint-staged"
90
+ }
91
+ },
41
92
  "repository": {
42
93
  "type": "git",
43
94
  "url": "git+https://github.com/baadal/dapi.git"
@@ -0,0 +1,5 @@
1
+ const log = () => {
2
+ console.log('fs/log');
3
+ };
4
+
5
+ export default { log };
package/src/index.ts ADDED
@@ -0,0 +1,9 @@
1
+ import fs from './fs';
2
+
3
+ const foo = () => {
4
+ return 'bar';
5
+ };
6
+
7
+ export { fs, foo };
8
+ export const num = 5;
9
+ export default fs;
File without changes
package/dist/index.js DELETED
@@ -1,2 +0,0 @@
1
- var e={d:function(n,o){for(var r in o)e.o(o,r)&&!e.o(n,r)&&Object.defineProperty(n,r,{enumerable:!0,get:o[r]})},o:function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},n={};e.r(n),e.d(n,{default:function(){return u},foo:function(){return r},fs:function(){return o},num:function(){return t}});var o={log:function(){console.log("dapi/fs")}},r=function(){return"bar"},t=5,u=o,f=exports;for(var i in n)f[i]=n[i];n.__esModule&&Object.defineProperty(f,"__esModule",{value:!0});
2
- //# sourceMappingURL=index.js.map
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","mappings":"AACA,IAAIA,EAAsB,CCA1BA,EAAwB,SAASC,EAASC,GACzC,IAAI,IAAIC,KAAOD,EACXF,EAAoBI,EAAEF,EAAYC,KAASH,EAAoBI,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,MCJ3EH,EAAwB,SAASS,EAAKC,GAAQ,OAAOL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,ICC/FV,EAAwB,SAASC,GACX,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,M,4HCUvD,IAIA,GACEC,IALU,WACVC,QAAQD,IAAI,aCdRE,EAAM,WACV,MAAO,OAIIC,EAAM,EACnB,I","sources":["webpack://@baadal-sdk/dapi/webpack/bootstrap","webpack://@baadal-sdk/dapi/webpack/runtime/define property getters","webpack://@baadal-sdk/dapi/webpack/runtime/hasOwnProperty shorthand","webpack://@baadal-sdk/dapi/webpack/runtime/make namespace object","webpack://@baadal-sdk/dapi/./src/fs/index.ts","webpack://@baadal-sdk/dapi/./src/index.ts"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// import uniqueRandomArray from 'unique-random-array';\n\n// const greetList = [\n// 'Hello',\n// 'Hola',\n// 'Ola',\n// 'Bonjour',\n// 'Salut',\n// 'Salve',\n// 'Ciao',\n// 'Halo',\n// 'Namaste',\n// 'Merhaba'\n// ];\n\nconst log = () => {\n console.log('dapi/fs');\n};\n\nexport default {\n log,\n // greet: uniqueRandomArray(greetList)\n};\n","import fs from './fs';\n\nconst foo = () => {\n return 'bar';\n};\n\nexport { fs, foo };\nexport const num = 5;\nexport default fs;\n"],"names":["__webpack_require__","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","log","console","foo","num"],"sourceRoot":""}