@ismartify/utils
Advanced tools
| "use strict"; | ||
| var __defProp = Object.defineProperty; | ||
| var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
| var __getOwnPropNames = Object.getOwnPropertyNames; | ||
| var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
| var __export = (target, all) => { | ||
| for (var name in all) | ||
| __defProp(target, name, { get: all[name], enumerable: true }); | ||
| }; | ||
| var __copyProps = (to, from, except, desc) => { | ||
| if (from && typeof from === "object" || typeof from === "function") { | ||
| for (let key of __getOwnPropNames(from)) | ||
| if (!__hasOwnProp.call(to, key) && key !== except) | ||
| __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
| } | ||
| return to; | ||
| }; | ||
| var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
| // src/index.ts | ||
| var index_exports = {}; | ||
| __export(index_exports, { | ||
| default: () => index_default | ||
| }); | ||
| module.exports = __toCommonJS(index_exports); | ||
| // package.json | ||
| var package_default = { | ||
| name: "@ismartify/utils", | ||
| version: "1.0.9", | ||
| description: "", | ||
| type: "module", | ||
| main: "dist/index.js", | ||
| types: "dist/index.d.ts", | ||
| exports: { | ||
| ".": { | ||
| types: "./dist/index.d.ts", | ||
| import: "./dist/index.js", | ||
| require: "./dist/index.cjs" | ||
| }, | ||
| "./package.json": "./package.json" | ||
| }, | ||
| files: [ | ||
| "dist", | ||
| "package.json" | ||
| ], | ||
| scripts: { | ||
| test: "vitest", | ||
| dev: "tsx src/index.ts", | ||
| build: "tsup", | ||
| "ver+": "npm version patch", | ||
| "npm:publish": "npm publish --registry https://registry.npmjs.org/ --access public --no-git-checks" | ||
| }, | ||
| keywords: [], | ||
| author: "ismartify@keepdb.com", | ||
| license: "ISC", | ||
| dependencies: { | ||
| "@ismartify/common": "^1.0.9" | ||
| }, | ||
| devDependencies: { | ||
| tsup: "^8.5.0", | ||
| typescript: "^5.6.3" | ||
| } | ||
| }; | ||
| // src/index.ts | ||
| var index_default = { | ||
| title: "@ismartify/utils", | ||
| version: package_default.version | ||
| }; | ||
| console.log(package_default.version); |
| declare const _default: { | ||
| title: string; | ||
| version: string; | ||
| }; | ||
| export { _default as default }; |
+6
-1
@@ -1,1 +0,6 @@ | ||
| export declare const sum: (a: number, b: number) => number; | ||
| declare const _default: { | ||
| title: string; | ||
| version: string; | ||
| }; | ||
| export { _default as default }; |
+47
-7
@@ -0,8 +1,48 @@ | ||
| // package.json | ||
| var package_default = { | ||
| name: "@ismartify/utils", | ||
| version: "1.0.9", | ||
| description: "", | ||
| type: "module", | ||
| main: "dist/index.js", | ||
| types: "dist/index.d.ts", | ||
| exports: { | ||
| ".": { | ||
| types: "./dist/index.d.ts", | ||
| import: "./dist/index.js", | ||
| require: "./dist/index.cjs" | ||
| }, | ||
| "./package.json": "./package.json" | ||
| }, | ||
| files: [ | ||
| "dist", | ||
| "package.json" | ||
| ], | ||
| scripts: { | ||
| test: "vitest", | ||
| dev: "tsx src/index.ts", | ||
| build: "tsup", | ||
| "ver+": "npm version patch", | ||
| "npm:publish": "npm publish --registry https://registry.npmjs.org/ --access public --no-git-checks" | ||
| }, | ||
| keywords: [], | ||
| author: "ismartify@keepdb.com", | ||
| license: "ISC", | ||
| dependencies: { | ||
| "@ismartify/common": "^1.0.9" | ||
| }, | ||
| devDependencies: { | ||
| tsup: "^8.5.0", | ||
| typescript: "^5.6.3" | ||
| } | ||
| }; | ||
| 'use strict' | ||
| if (process.env.NODE_ENV === 'production') { | ||
| module.exports = require('./utils.cjs.production.min.js') | ||
| } else { | ||
| module.exports = require('./utils.cjs.development.js') | ||
| } | ||
| // src/index.ts | ||
| var index_default = { | ||
| title: "@ismartify/utils", | ||
| version: package_default.version | ||
| }; | ||
| console.log(package_default.version); | ||
| export { | ||
| index_default as default | ||
| }; |
+34
-56
| { | ||
| "version": "0.1.0", | ||
| "license": "MIT", | ||
| "main": "dist/index.js", | ||
| "typings": "dist/index.d.ts", | ||
| "files": [ | ||
| "dist", | ||
| "src" | ||
| ], | ||
| "engines": { | ||
| "node": ">=10" | ||
| "name": "@ismartify/utils", | ||
| "version": "1.0.9", | ||
| "description": "", | ||
| "type": "module", | ||
| "main": "dist/index.js", | ||
| "types": "dist/index.d.ts", | ||
| "exports": { | ||
| ".": { | ||
| "types": "./dist/index.d.ts", | ||
| "import": "./dist/index.js", | ||
| "require": "./dist/index.cjs" | ||
| }, | ||
| "scripts": { | ||
| "start": "tsdx watch", | ||
| "build": "tsdx build", | ||
| "test": "tsdx test", | ||
| "lint": "tsdx lint", | ||
| "prepare": "tsdx build", | ||
| "size": "size-limit", | ||
| "analyze": "size-limit --why" | ||
| }, | ||
| "husky": { | ||
| "hooks": { | ||
| "pre-commit": "tsdx lint" | ||
| } | ||
| }, | ||
| "prettier": { | ||
| "printWidth": 80, | ||
| "semi": true, | ||
| "singleQuote": true, | ||
| "trailingComma": "es5" | ||
| }, | ||
| "name": "@ismartify/utils", | ||
| "author": "ismartify@keepdb.com", | ||
| "module": "dist/utils.esm.js", | ||
| "size-limit": [ | ||
| { | ||
| "path": "dist/utils.cjs.production.min.js", | ||
| "limit": "10 KB" | ||
| }, | ||
| { | ||
| "path": "dist/utils.esm.js", | ||
| "limit": "10 KB" | ||
| } | ||
| ], | ||
| "devDependencies": { | ||
| "@size-limit/preset-small-lib": "^11.1.6", | ||
| "husky": "^9.1.6", | ||
| "size-limit": "^11.1.6", | ||
| "tsdx": "^0.14.1", | ||
| "tslib": "^2.8.1", | ||
| "typescript": "^3.9.10" | ||
| }, | ||
| "private": false, | ||
| "publishConfig": { | ||
| "access": "public", | ||
| "registry": "https://registry.npmjs.org/" | ||
| "./package.json": "./package.json" | ||
| }, | ||
| "files": [ | ||
| "dist", | ||
| "package.json" | ||
| ], | ||
| "scripts": { | ||
| "test": "vitest", | ||
| "dev": "tsx src/index.ts", | ||
| "build": "tsup", | ||
| "ver+": "npm version patch", | ||
| "npm:publish": "npm publish --registry https://registry.npmjs.org/ --access public --no-git-checks" | ||
| }, | ||
| "keywords": [], | ||
| "author": "ismartify@keepdb.com", | ||
| "license": "ISC", | ||
| "dependencies": { | ||
| "@ismartify/common": "^1.0.9" | ||
| }, | ||
| "devDependencies": { | ||
| "tsup": "^8.5.0", | ||
| "typescript": "^5.6.3" | ||
| } | ||
| } | ||
| } |
| 'use strict'; | ||
| Object.defineProperty(exports, '__esModule', { value: true }); | ||
| var sum = function sum(a, b) { | ||
| { | ||
| console.log('boop'); | ||
| } | ||
| return a + b; | ||
| }; | ||
| exports.sum = sum; | ||
| //# sourceMappingURL=utils.cjs.development.js.map |
| {"version":3,"file":"utils.cjs.development.js","sources":["../src/index.ts"],"sourcesContent":["export const sum = (a: number, b: number) => {\n if ('development' === process.env.NODE_ENV) {\n console.log('boop');\n }\n return a + b;\n};\n"],"names":["sum","a","b","console","log"],"mappings":";;;;IAAaA,GAAG,GAAG,SAANA,GAAGA,CAAIC,CAAS,EAAEC,CAAS;EACM;IAC1CC,OAAO,CAACC,GAAG,CAAC,MAAM,CAAC;;EAErB,OAAOH,CAAC,GAAGC,CAAC;AACd;;;;"} |
| "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.sum=function(e,t){return e+t}; | ||
| //# sourceMappingURL=utils.cjs.production.min.js.map |
| {"version":3,"file":"utils.cjs.production.min.js","sources":["../src/index.ts"],"sourcesContent":["export const sum = (a: number, b: number) => {\n if ('development' === process.env.NODE_ENV) {\n console.log('boop');\n }\n return a + b;\n};\n"],"names":["a","b"],"mappings":"gFAAmB,SAACA,EAAWC,GAI7B,OAAOD,EAAIC"} |
| var sum = function sum(a, b) { | ||
| if ('development' === process.env.NODE_ENV) { | ||
| console.log('boop'); | ||
| } | ||
| return a + b; | ||
| }; | ||
| export { sum }; | ||
| //# sourceMappingURL=utils.esm.js.map |
| {"version":3,"file":"utils.esm.js","sources":["../src/index.ts"],"sourcesContent":["export const sum = (a: number, b: number) => {\n if ('development' === process.env.NODE_ENV) {\n console.log('boop');\n }\n return a + b;\n};\n"],"names":["sum","a","b","process","env","NODE_ENV","console","log"],"mappings":"IAAaA,GAAG,GAAG,SAANA,GAAGA,CAAIC,CAAS,EAAEC,CAAS;EACtC,IAAI,aAAa,KAAKC,OAAO,CAACC,GAAG,CAACC,QAAQ,EAAE;IAC1CC,OAAO,CAACC,GAAG,CAAC,MAAM,CAAC;;EAErB,OAAON,CAAC,GAAGC,CAAC;AACd;;;;"} |
-21
| MIT License | ||
| Copyright (c) 2024 ismartify@keepdb.com | ||
| 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: | ||
| The above copyright notice and this permission notice shall be included in all | ||
| copies or substantial portions of the Software. | ||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| SOFTWARE. |
-103
| # TSDX User Guide | ||
| Congrats! You just saved yourself hours of work by bootstrapping this project with TSDX. Let’s get you oriented with what’s here and how to use it. | ||
| > This TSDX setup is meant for developing libraries (not apps!) that can be published to NPM. If you’re looking to build a Node app, you could use `ts-node-dev`, plain `ts-node`, or simple `tsc`. | ||
| > If you’re new to TypeScript, checkout [this handy cheatsheet](https://devhints.io/typescript) | ||
| ## Commands | ||
| TSDX scaffolds your new library inside `/src`. | ||
| To run TSDX, use: | ||
| ```bash | ||
| npm start # or yarn start | ||
| ``` | ||
| This builds to `/dist` and runs the project in watch mode so any edits you save inside `src` causes a rebuild to `/dist`. | ||
| To do a one-off build, use `npm run build` or `yarn build`. | ||
| To run tests, use `npm test` or `yarn test`. | ||
| ## Configuration | ||
| Code quality is set up for you with `prettier`, `husky`, and `lint-staged`. Adjust the respective fields in `package.json` accordingly. | ||
| ### Jest | ||
| Jest tests are set up to run with `npm test` or `yarn test`. | ||
| ### Bundle Analysis | ||
| [`size-limit`](https://github.com/ai/size-limit) is set up to calculate the real cost of your library with `npm run size` and visualize the bundle with `npm run analyze`. | ||
| #### Setup Files | ||
| This is the folder structure we set up for you: | ||
| ```txt | ||
| /src | ||
| index.tsx # EDIT THIS | ||
| /test | ||
| blah.test.tsx # EDIT THIS | ||
| .gitignore | ||
| package.json | ||
| README.md # EDIT THIS | ||
| tsconfig.json | ||
| ``` | ||
| ### Rollup | ||
| TSDX uses [Rollup](https://rollupjs.org) as a bundler and generates multiple rollup configs for various module formats and build settings. See [Optimizations](#optimizations) for details. | ||
| ### TypeScript | ||
| `tsconfig.json` is set up to interpret `dom` and `esnext` types, as well as `react` for `jsx`. Adjust according to your needs. | ||
| ## Continuous Integration | ||
| ### GitHub Actions | ||
| Two actions are added by default: | ||
| - `main` which installs deps w/ cache, lints, tests, and builds on all pushes against a Node and OS matrix | ||
| - `size` which comments cost comparison of your library on every pull request using [`size-limit`](https://github.com/ai/size-limit) | ||
| ## Optimizations | ||
| Please see the main `tsdx` [optimizations docs](https://github.com/palmerhq/tsdx#optimizations). In particular, know that you can take advantage of development-only optimizations: | ||
| ```js | ||
| // ./types/index.d.ts | ||
| declare var __DEV__: boolean; | ||
| // inside your code... | ||
| if (__DEV__) { | ||
| console.log('foo'); | ||
| } | ||
| ``` | ||
| You can also choose to install and use [invariant](https://github.com/palmerhq/tsdx#invariant) and [warning](https://github.com/palmerhq/tsdx#warning) functions. | ||
| ## Module Formats | ||
| CJS, ESModules, and UMD module formats are supported. | ||
| The appropriate paths are configured in `package.json` and `dist/index.js` accordingly. Please report if any issues are found. | ||
| ## Named Exports | ||
| Per Palmer Group guidelines, [always use named exports.](https://github.com/palmerhq/typescript#exports) Code split inside your React app instead of your React library. | ||
| ## Including Styles | ||
| There are many ways to ship styles, including with CSS-in-JS. TSDX has no opinion on this, configure how you like. | ||
| For vanilla CSS, you can include it at the root directory and add it to the `files` section in your `package.json`, so that it can be imported separately by your users and run through their bundler's loader. | ||
| ## Publishing to NPM | ||
| We recommend using [np](https://github.com/sindresorhus/np). |
| export const sum = (a: number, b: number) => { | ||
| if ('development' === process.env.NODE_ENV) { | ||
| console.log('boop'); | ||
| } | ||
| return a + b; | ||
| }; |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 2 instances
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
2
-66.67%120
263.64%1
-50%3
-25%Yes
NaN3950
-51.1%1
Infinity%5
-58.33%2
100%0
-100%1
Infinity%+ Added
+ Added