@arox/framework 0.1.1 → 0.1.2-beta.2

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.
Files changed (44) hide show
  1. package/dist/constants/messages.d.ts +2 -0
  2. package/dist/events/interaction.d.ts +4 -1
  3. package/dist/events/message.d.ts +4 -1
  4. package/dist/events/ready.d.ts +4 -1
  5. package/dist/index.cjs +3 -0
  6. package/dist/index.d.cts +2 -0
  7. package/dist/index.d.ts +3 -3
  8. package/dist/index.js +3 -15
  9. package/dist/structures/builder/Builder.d.ts +18 -0
  10. package/dist/structures/builder/Command.d.ts +23 -24
  11. package/dist/structures/builder/Context.d.ts +24 -18
  12. package/dist/structures/builder/Event.d.ts +7 -9
  13. package/dist/structures/builder/index.d.ts +4 -4
  14. package/dist/structures/core/Client.d.ts +6 -7
  15. package/dist/structures/core/index.d.ts +1 -1
  16. package/dist/structures/index.d.ts +2 -2
  17. package/dist/utils/index.d.ts +3 -3
  18. package/dist/utils/logger/ILogger.d.ts +1 -43
  19. package/dist/utils/logger/Logger.d.ts +6 -41
  20. package/dist/utils/normalizeArray.d.ts +15 -0
  21. package/dist/utils/util.d.ts +5 -3
  22. package/package.json +1 -62
  23. package/types/client.d.ts +14 -13
  24. package/types/logger.d.ts +63 -0
  25. package/cliff.toml +0 -48
  26. package/dist/context.d.ts +0 -4
  27. package/dist/context.js +0 -28
  28. package/dist/events/interaction.js +0 -38
  29. package/dist/events/message.js +0 -36
  30. package/dist/events/ready.js +0 -11
  31. package/dist/structures/builder/Argument.d.ts +0 -22
  32. package/dist/structures/builder/Argument.js +0 -42
  33. package/dist/structures/builder/Command.js +0 -74
  34. package/dist/structures/builder/Context.js +0 -67
  35. package/dist/structures/builder/Event.js +0 -53
  36. package/dist/structures/builder/index.js +0 -9
  37. package/dist/structures/core/Client.js +0 -111
  38. package/dist/structures/core/index.js +0 -6
  39. package/dist/structures/index.js +0 -7
  40. package/dist/utils/Files.js +0 -47
  41. package/dist/utils/index.js +0 -8
  42. package/dist/utils/logger/ILogger.js +0 -37
  43. package/dist/utils/logger/Logger.js +0 -380
  44. package/dist/utils/util.js +0 -35
@@ -0,0 +1,63 @@
1
+ import type { Color } from "colorette";
2
+ import type { LogLevel } from "../src/utils/logger/ILogger.js";
3
+ import type {
4
+ LoggerStyleBackground,
5
+ LoggerStyleEffect,
6
+ LoggerStyleText,
7
+ } from "../src/utils/logger/Logger.js";
8
+
9
+ export interface ILogger {
10
+ has(level: LogLevel): boolean;
11
+ trace(...values: readonly unknown[]): void;
12
+ debug(...values: readonly unknown[]): void;
13
+ info(...values: readonly unknown[]): void;
14
+ warn(...values: readonly unknown[]): void;
15
+ error(...values: readonly unknown[]): void;
16
+ fatal(...values: readonly unknown[]): void;
17
+ write(level: LogLevel, ...values: readonly unknown[]): void;
18
+ }
19
+
20
+ export interface LoggerOptions {
21
+ stdout?: NodeJS.WritableStream;
22
+ stderr?: NodeJS.WritableStream;
23
+ defaultFormat?: LoggerLevelOptions;
24
+ format?: LoggerFormatOptions;
25
+ level?: LogLevel;
26
+ join?: string;
27
+ depth?: number;
28
+ }
29
+
30
+ export interface LoggerFormatOptions {
31
+ trace?: LoggerLevelOptions;
32
+ debug?: LoggerLevelOptions;
33
+ info?: LoggerLevelOptions;
34
+ warn?: LoggerLevelOptions;
35
+ error?: LoggerLevelOptions;
36
+ fatal?: LoggerLevelOptions;
37
+ none?: LoggerLevelOptions;
38
+ }
39
+
40
+ export interface LoggerLevelOptions {
41
+ timestamp?: LoggerTimestampOptions | null;
42
+ infix?: string;
43
+ message?: LoggerStyleResolvable | null;
44
+ }
45
+
46
+ export interface LoggerTimestampOptions {
47
+ pattern?: string;
48
+ utc?: boolean;
49
+ color?: LoggerStyleResolvable | null;
50
+ formatter?: LoggerTimestampFormatter;
51
+ }
52
+
53
+ export interface LoggerTimestampFormatter {
54
+ (timestamp: string): string;
55
+ }
56
+
57
+ export interface LoggerStyleOptions {
58
+ effects?: LoggerStyleEffect[];
59
+ text?: LoggerStyleText;
60
+ background?: LoggerStyleBackground;
61
+ }
62
+
63
+ export type LoggerStyleResolvable = Color | LoggerStyleOptions;
package/cliff.toml DELETED
@@ -1,48 +0,0 @@
1
- [changelog]
2
- header = """
3
- # Changelog\n
4
- All notable changes to this project will be documented in this file.\n
5
- """
6
- body = """
7
- {% if version %}
8
- ## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}\
9
- {% else %}\
10
- ## Unreleased\
11
- {% endif %}
12
-
13
- {% for group, commits in commits | group_by(attribute="group") %}\
14
- ### {{ group | upper_first }}
15
- {% for commit in commits %}
16
- - {% if commit.breaking %}[**breaking**] {% endif %}{{ commit.message | upper_first }} {% if commit.author.username %}by [@{{ commit.author.username }}](https://github.com/{{ commit.author.username }}){% else %}by {{ commit.author.name }}{% endif %} {% if commit.url %}([{{ commit.id | truncate(length=7, end="") }}]({{ commit.url }})){% else %}({{ commit.id | truncate(length=7, end="") }}){% endif %}\
17
- {% endfor %}\n
18
- {% endfor %}
19
- """
20
- trim = true
21
- footer = """
22
- <!-- generated by git-cliff -->
23
- """
24
-
25
- [git]
26
- conventional_commits = true
27
- filter_unconventional = true
28
- split_commits = false
29
- commit_preprocessors = [
30
- { pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](https://github.com/vrdons/zKitap2Pdf/pull/${2}))" },
31
- ]
32
- commit_parsers = [
33
- { message = "^feat", group = "Features" },
34
- { message = "^fix", group = "Bug Fixes" },
35
- { message = "^doc", group = "Documentation" },
36
- { message = "^perf", group = "Performance" },
37
- { message = "^refactor", group = "Refactor" },
38
- { message = "^style", group = "Styling" },
39
- { message = "^test", group = "Testing" },
40
- { message = "^chore\\(release\\): prepare for", skip = true },
41
- { message = "^chore", group = "Miscellaneous Tasks" },
42
- { body = ".*security", group = "Security" },
43
-
44
- { message = "^deps|^build", group = "Dependencies" },
45
- { message = "^Merge pull request", group = "Pull Requests" },
46
- { message = "^Merge branch", group = "Merges" },
47
- { message = "^Revert", group = "Reverts" },
48
- ]
package/dist/context.d.ts DELETED
@@ -1,4 +0,0 @@
1
- import { Client } from "#structures";
2
- export declare let currentClient: Client | null;
3
- export declare function setClient(client: Client): void;
4
- export declare function clearClient(): void;
package/dist/context.js DELETED
@@ -1,28 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- function _export(target, all) {
6
- for(var name in all)Object.defineProperty(target, name, {
7
- enumerable: true,
8
- get: Object.getOwnPropertyDescriptor(all, name).get
9
- });
10
- }
11
- _export(exports, {
12
- get clearClient () {
13
- return clearClient;
14
- },
15
- get currentClient () {
16
- return currentClient;
17
- },
18
- get setClient () {
19
- return setClient;
20
- }
21
- });
22
- let currentClient = null;
23
- function setClient(client) {
24
- currentClient = client;
25
- }
26
- function clearClient() {
27
- currentClient = null;
28
- }
@@ -1,38 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- const _discord = require("discord.js");
6
- const _structures = require("#structures");
7
- new _structures.EventBuilder(_discord.Events.InteractionCreate, false).onExecute(async function(context, interaction) {
8
- if (!interaction.isChatInputCommand()) return;
9
- const command = context.client.commands.get(interaction.commandName);
10
- if (!command || !command.supportsSlash) {
11
- await interaction.reply({
12
- content: "Command not found or disabled.",
13
- flags: _discord.MessageFlags.Ephemeral
14
- });
15
- return;
16
- }
17
- try {
18
- const ctx = new _structures.Context(context.client, {
19
- interaction
20
- });
21
- ctx.locale = interaction.locale;
22
- context.logger.debug(`${ctx.author?.tag ?? "Unknown"} used ${command.name}(interaction)`);
23
- if (command._onInteraction) await command._onInteraction(ctx.toJSON());
24
- } catch (error) {
25
- context.client.logger.error(`Error executing command ${command.name}:`, error);
26
- if (interaction.replied || interaction.deferred) {
27
- await interaction.followUp({
28
- content: "There was an error while executing this command!",
29
- flags: _discord.MessageFlags.Ephemeral
30
- });
31
- } else {
32
- await interaction.reply({
33
- content: "There was an error while executing this command!",
34
- flags: _discord.MessageFlags.Ephemeral
35
- });
36
- }
37
- }
38
- });
@@ -1,36 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- const _discord = require("discord.js");
6
- const _structures = require("#structures");
7
- const _utils = require("#utils");
8
- new _structures.EventBuilder(_discord.Events.MessageCreate, false, async function(context, message) {
9
- if (message.author.bot) return;
10
- const prefix = context.client.prefix;
11
- if (typeof prefix !== "string" || prefix.length === 0 || !message.content.startsWith(prefix)) return;
12
- const args = message.content.slice(prefix.length).trim().split(/ +/);
13
- const commandName = args.shift()?.toLowerCase();
14
- if (!commandName) return;
15
- const commandAlias = context.client.aliases.findKey((cmd)=>cmd.has(commandName));
16
- let command = context.client.commands.get(commandAlias ?? commandName);
17
- if (!command || !command.supportsPrefix) {
18
- await message.reply({
19
- content: "Command not found or disabled.",
20
- allowedMentions: {
21
- repliedUser: false
22
- }
23
- }).then(_utils.deleteMessageAfterSent);
24
- return;
25
- }
26
- try {
27
- const ctx = new _structures.Context(context.client, {
28
- message,
29
- args
30
- });
31
- context.logger.debug(`${ctx.author?.tag ?? "Unknown"} used ${command.name}(message)`);
32
- if (command._onMessage) await command._onMessage(ctx.toJSON());
33
- } catch (error) {
34
- context.client.logger.error(`Error executing command ${command.name}:`, error);
35
- }
36
- });
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- const _discord = require("discord.js");
6
- const _structures = require("#structures");
7
- new _structures.EventBuilder(_discord.Events.ClientReady).onExecute(async function(context) {
8
- if (context.client.options.autoRegisterCommands) {
9
- await context.client.registerCommands();
10
- }
11
- });
@@ -1,22 +0,0 @@
1
- import { ApplicationCommandOptionData, ApplicationCommandOptionType } from "discord.js";
2
- export declare class Argument {
3
- readonly name: string;
4
- readonly description: string;
5
- readonly type: ApplicationCommandOptionType;
6
- readonly required: boolean;
7
- readonly choices?: {
8
- name: string;
9
- value: string | number;
10
- }[];
11
- constructor(data: {
12
- name: string;
13
- description: string;
14
- type: ApplicationCommandOptionType;
15
- required?: boolean;
16
- choices?: {
17
- name: string;
18
- value: string | number;
19
- }[];
20
- });
21
- toJSON(): ApplicationCommandOptionData;
22
- }
@@ -1,42 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "Argument", {
6
- enumerable: true,
7
- get: function() {
8
- return Argument;
9
- }
10
- });
11
- const _discord = require("discord.js");
12
- class Argument {
13
- name;
14
- description;
15
- type;
16
- required;
17
- choices;
18
- constructor(data){
19
- this.name = data.name;
20
- this.description = data.description;
21
- this.type = data.type;
22
- this.required = data.required ?? false;
23
- this.choices = data.choices;
24
- }
25
- toJSON() {
26
- const choicesAllowedTypes = [
27
- _discord.ApplicationCommandOptionType.String,
28
- _discord.ApplicationCommandOptionType.Integer,
29
- _discord.ApplicationCommandOptionType.Number
30
- ];
31
- if (this.choices && !choicesAllowedTypes.includes(this.type)) {
32
- throw new Error(`Choices are not allowed for option type ${_discord.ApplicationCommandOptionType[this.type]} (${this.type})`);
33
- }
34
- return {
35
- name: this.name,
36
- description: this.description,
37
- type: this.type,
38
- required: this.required,
39
- choices: this.choices
40
- };
41
- }
42
- }
@@ -1,74 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "CommandBuilder", {
6
- enumerable: true,
7
- get: function() {
8
- return CommandBuilder;
9
- }
10
- });
11
- const _Argument = require("./Argument");
12
- const _ctx = require("#ctx");
13
- class CommandBuilder {
14
- client;
15
- logger;
16
- name;
17
- description;
18
- aliases;
19
- options;
20
- _supportsSlash;
21
- _supportsPrefix;
22
- _onMessage;
23
- _onInteraction;
24
- get supportsSlash() {
25
- return this._supportsSlash && this._onInteraction;
26
- }
27
- get supportsPrefix() {
28
- return this._supportsPrefix && this._onMessage;
29
- }
30
- constructor(options){
31
- const client = _ctx.currentClient;
32
- if (!client) throw new Error("Client is not defined");
33
- this.client = client;
34
- this.logger = client.logger;
35
- this.name = options.name;
36
- this.description = options.description;
37
- this.aliases = options.aliases ?? [];
38
- this.options = (options.options ?? []).map((opt)=>{
39
- return opt instanceof _Argument.Argument ? opt.toJSON() : opt;
40
- });
41
- this._supportsPrefix = options.prefix ?? false;
42
- this._supportsSlash = options.slash ?? false;
43
- if (!this._supportsPrefix && !this._supportsSlash) {
44
- throw new Error(`Command ${this.name} must support either slash or prefix commands.`);
45
- }
46
- if (this.client.commands.has(this.name)) throw new Error(`Command name "${this.name}" is already registered.`);
47
- const existingAliasOwner = this.client.aliases.findKey((aliases)=>aliases.has(this.name));
48
- if (existingAliasOwner) {
49
- throw new Error(`Command name "${this.name}" is already registered as an alias for command "${existingAliasOwner}".`);
50
- }
51
- for (const alias of this.aliases){
52
- if (this.client.commands.has(alias)) {
53
- throw new Error(`Alias "${alias}" is already registered as a command name.`);
54
- }
55
- const conflictingCommand = this.client.aliases.findKey((aliases)=>aliases.has(alias));
56
- if (conflictingCommand) {
57
- throw new Error(`Alias "${alias}" is already registered as an alias for command "${conflictingCommand}".`);
58
- }
59
- }
60
- this.client.commands.set(this.name, this);
61
- if (this.aliases.length > 0) {
62
- this.client.aliases.set(this.name, new Set(this.aliases));
63
- }
64
- this.logger.debug(`Loaded Command ${this.name}`);
65
- }
66
- onMessage(func) {
67
- this._onMessage = func;
68
- return this;
69
- }
70
- onInteraction(func) {
71
- this._onInteraction = func;
72
- return this;
73
- }
74
- }
@@ -1,67 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "Context", {
6
- enumerable: true,
7
- get: function() {
8
- return Context;
9
- }
10
- });
11
- const _discord = require("discord.js");
12
- class Context {
13
- client;
14
- args;
15
- data;
16
- locale;
17
- constructor(client, payload){
18
- this.client = client;
19
- this.args = payload.args ?? [];
20
- if ("interaction" in payload) {
21
- this.data = payload.interaction;
22
- } else {
23
- this.data = payload.message;
24
- }
25
- }
26
- isInteraction() {
27
- return this.data instanceof _discord.ChatInputCommandInteraction;
28
- }
29
- isMessage() {
30
- return this.data instanceof _discord.Message;
31
- }
32
- get author() {
33
- if (this.isInteraction()) {
34
- return this.data.user;
35
- }
36
- if (this.isMessage()) {
37
- return this.data.author;
38
- }
39
- return null;
40
- }
41
- t(key, args) {
42
- if (!this.client.i18n) {
43
- throw new Error("i18n is not initialized");
44
- }
45
- let locale = this.locale ?? (Array.isArray(this.client.i18n.options.fallbackLng) ? this.client.i18n.options.fallbackLng[0] : this.client.i18n.options.fallbackLng) ?? "en";
46
- const t = this.client.i18n.getFixedT(locale);
47
- return t(key, args);
48
- }
49
- toJSON() {
50
- const { data, args, author } = this;
51
- if (this.isInteraction()) {
52
- return {
53
- kind: "interaction",
54
- interaction: data,
55
- author,
56
- t: this.t.bind(this)
57
- };
58
- }
59
- return {
60
- kind: "message",
61
- message: data,
62
- args,
63
- author,
64
- t: this.t.bind(this)
65
- };
66
- }
67
- }
@@ -1,53 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "EventBuilder", {
6
- enumerable: true,
7
- get: function() {
8
- return EventBuilder;
9
- }
10
- });
11
- const _ctx = require("#ctx");
12
- class EventBuilder {
13
- name;
14
- once;
15
- client;
16
- logger;
17
- handler;
18
- bound = false;
19
- listener = async (...args)=>{
20
- if (!this.handler) return;
21
- try {
22
- await this.handler(this, ...args);
23
- } catch (error) {
24
- this.client.logger.error(`Error executing event ${this.name} (${this.constructor.name}):`, error);
25
- }
26
- };
27
- constructor(name, once = false, _handler){
28
- this.name = name;
29
- this.once = once;
30
- if (!_ctx.currentClient) throw new Error("Client is not defined");
31
- this.client = _ctx.currentClient;
32
- this.logger = _ctx.currentClient.logger;
33
- if (_handler) {
34
- this.handler = _handler;
35
- this.register();
36
- }
37
- }
38
- register() {
39
- if (this.bound || !this.handler) return;
40
- if (this.once) {
41
- this.client.once(this.name, this.listener);
42
- } else {
43
- this.client.on(this.name, this.listener);
44
- }
45
- this.bound = true;
46
- this.logger.debug(`Loaded Event ${String(this.name)}`);
47
- }
48
- onExecute(func) {
49
- this.handler = func;
50
- this.register();
51
- return this;
52
- }
53
- }
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- const _export_star = require("@swc/helpers/_/_export_star");
6
- _export_star._(require("./Argument"), exports);
7
- _export_star._(require("./Command"), exports);
8
- _export_star._(require("./Context"), exports);
9
- _export_star._(require("./Event"), exports);
@@ -1,111 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "Client", {
6
- enumerable: true,
7
- get: function() {
8
- return Client;
9
- }
10
- });
11
- const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
12
- const _discord = require("discord.js");
13
- const _path = /*#__PURE__*/ _interop_require_default._(require("path"));
14
- const _utils = require("#utils");
15
- const _lodash = require("lodash");
16
- const _ctx = require("#ctx");
17
- const _fs = require("fs");
18
- const defaultOpts = {
19
- includePaths: [
20
- "events",
21
- "commands"
22
- ],
23
- autoRegisterCommands: true
24
- };
25
- class Client extends _discord.Client {
26
- logger;
27
- commands;
28
- aliases;
29
- prefix;
30
- i18n;
31
- constructor(opts){
32
- super((0, _lodash.merge)({}, defaultOpts, opts));
33
- this.logger = new _utils.Logger(opts.logger);
34
- this.commands = new _discord.Collection();
35
- this.aliases = new _discord.Collection();
36
- this.prefix = (0, _utils.getPrefix)(this.options.prefix ?? {
37
- enabled: false
38
- });
39
- if (this.options.i18n) {
40
- this.i18n = this.options.i18n;
41
- this.i18n.use(new _utils.I18nLoggerAdapter(this.logger));
42
- }
43
- (0, _ctx.setClient)(this);
44
- try {
45
- require("../events/ready");
46
- require("../events/interaction");
47
- if (this.prefix) require("../events/message");
48
- } finally{
49
- (0, _ctx.clearClient)();
50
- }
51
- }
52
- async login(token) {
53
- if (this.options.includePaths) {
54
- for (const p of this.options.includePaths){
55
- this.loadDir(_path.default.join((0, _utils.getProjectRoot)(), p)).catch((error)=>this.logger.error("Error loading events:", error));
56
- }
57
- }
58
- if (this.i18n && !this.i18n.isInitialized) {
59
- await this.i18n.init();
60
- }
61
- return super.login(token);
62
- }
63
- async loadDir(dir) {
64
- if (!(0, _fs.existsSync)(dir)) {
65
- this.logger.debug(`Directory not found: ${dir}`);
66
- return;
67
- }
68
- const files = (0, _utils.getFiles)(dir);
69
- for (const file of files){
70
- await this.loadFile(file);
71
- }
72
- }
73
- async loadFile(file) {
74
- try {
75
- delete require.cache[require.resolve(file)];
76
- (0, _ctx.setClient)(this);
77
- require(file);
78
- } catch (error) {
79
- this.logger.error(`Error loading file ${file}:`, error);
80
- } finally{
81
- (0, _ctx.clearClient)();
82
- }
83
- }
84
- async registerCommands() {
85
- if (!this.token) {
86
- this.logger.warn("registerCommands skipped: client token is not set.");
87
- return;
88
- }
89
- if (!this.application) {
90
- this.logger.warn("registerCommands skipped: client application is not ready.");
91
- return;
92
- }
93
- const slashCommands = this.commands.filter((cmd)=>cmd.supportsSlash).map((cmd)=>({
94
- name: cmd.name,
95
- description: cmd.description,
96
- options: cmd.options
97
- }));
98
- const rest = new _discord.REST({
99
- version: "10"
100
- }).setToken(this.token);
101
- try {
102
- this.logger.debug(`Started refreshing ${slashCommands.length} application (/) commands.`);
103
- await rest.put(_discord.Routes.applicationCommands(this.application.id), {
104
- body: slashCommands
105
- });
106
- this.logger.info(`Loaded ${slashCommands.length} application (/) commands.`);
107
- } catch (error) {
108
- this.logger.error("Failed to register commands:", error);
109
- }
110
- }
111
- }
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- const _export_star = require("@swc/helpers/_/_export_star");
6
- _export_star._(require("./Client"), exports);
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- const _export_star = require("@swc/helpers/_/_export_star");
6
- _export_star._(require("./core"), exports);
7
- _export_star._(require("./builder"), exports);
@@ -1,47 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- function _export(target, all) {
6
- for(var name in all)Object.defineProperty(target, name, {
7
- enumerable: true,
8
- get: Object.getOwnPropertyDescriptor(all, name).get
9
- });
10
- }
11
- _export(exports, {
12
- get getFiles () {
13
- return getFiles;
14
- },
15
- get getProjectRoot () {
16
- return getProjectRoot;
17
- }
18
- });
19
- const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
20
- const _fastglob = /*#__PURE__*/ _interop_require_default._(require("fast-glob"));
21
- const _path = /*#__PURE__*/ _interop_require_default._(require("path"));
22
- function getFiles(baseDir) {
23
- return _fastglob.default.sync([
24
- "**/*.ts",
25
- "**/*.js"
26
- ], {
27
- cwd: baseDir,
28
- absolute: true,
29
- ignore: [
30
- "**/*.d.ts",
31
- "node_modules/**",
32
- ".git/**",
33
- "dist/**",
34
- "lib/**",
35
- "out/**",
36
- "build/**",
37
- ".next/**",
38
- "coverage/**"
39
- ]
40
- });
41
- }
42
- function getProjectRoot() {
43
- if (!require.main?.filename) {
44
- return process.cwd();
45
- }
46
- return _path.default.dirname(require.main.filename);
47
- }