Skip to content

Conversation

edify42
Copy link

@edify42 edify42 commented Jul 11, 2024

I see it's a devDependency of the @swc-node packages imported but not sure why it's listed here as a dependency as I wasn't able to see any uses of it in the codebase.

While packaging a lambda we have that uses your library (thank you for this ❤️ ), we came across this breaking as we strip out the devDependencies from our lambda packaging to have a smaller deployment artifact.

Signed-off-by: Ed Kim <edward.kim@lendi.com.au>
@MrRefactoring
Copy link
Owner

Hi @edify42!

Could you please review the importHelpers setting in our tsconfig.json? You can find more details in the TypeScript documentation.

Additionally, could you inspect the output bundle to verify the inclusion of tslib imports?

Thank you!

@MrRefactoring MrRefactoring added the wontfix Indicates that, while acknowledged, the particular issue or request won't be acted upon. label Jul 21, 2024
@edify42
Copy link
Author

edify42 commented Aug 5, 2024

with importHelpers: true, the out/index.js appears to use tslib:

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ServiceDesk = exports.Version3 = exports.Version2 = exports.Agile = void 0;
const tslib_1 = require("tslib");
tslib_1.__exportStar(require("./createClient"), exports);
tslib_1.__exportStar(require("./clients"), exports);
tslib_1.__exportStar(require("./utilityTypes"), exports);
tslib_1.__exportStar(require("./config"), exports);
tslib_1.__exportStar(require("./callback"), exports);
tslib_1.__exportStar(require("./paginated"), exports);
tslib_1.__exportStar(require("./requestConfig"), exports);
exports.Agile = require("./agile");
exports.Version2 = require("./version2");
exports.Version3 = require("./version3");
exports.ServiceDesk = require("./serviceDesk");
//# sourceMappingURL=index.js.map

Setting importHelpers: false, we see the below:

"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 });
exports.ServiceDesk = exports.Version3 = exports.Version2 = exports.Agile = void 0;
__exportStar(require("./createClient"), exports);
__exportStar(require("./clients"), exports);
__exportStar(require("./utilityTypes"), exports);
__exportStar(require("./config"), exports);
__exportStar(require("./callback"), exports);
__exportStar(require("./paginated"), exports);
__exportStar(require("./requestConfig"), exports);
exports.Agile = require("./agile");
exports.Version2 = require("./version2");
exports.Version3 = require("./version3");
exports.ServiceDesk = require("./serviceDesk");
//# sourceMappingURL=index.js.map

Likely not worth removing to keep things DRY but at the same time it shouldn't be marked as a devDependency if the runtime code uses it?

@MrRefactoring
Copy link
Owner

MrRefactoring commented Aug 5, 2024

Could you please double-check this?

Link to the package.json file

It seems here’s a small mistake. The tslib package listed as a dependency, not a devDependency.

@edify42
Copy link
Author

edify42 commented Aug 7, 2024

Sorry I need my brain checked haha

@edify42 edify42 closed this Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix Indicates that, while acknowledged, the particular issue or request won't be acted upon.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants