@gjsify/esbuild-plugin-gjsify 0.0.4 → 0.1.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.
@@ -1,2 +0,0 @@
1
- import type { Plugin } from "esbuild";
2
- export declare const aliasPlugin: (aliasObj: Record<string, string>) => Plugin;
@@ -1,3 +0,0 @@
1
- import type { PluginBuild } from "esbuild";
2
- import type { PluginOptions } from '../types/plugin-options.js';
3
- export declare const setupForDeno: (build: PluginBuild, pluginOptions: PluginOptions) => Promise<void>;
package/src/app/deno.ts DELETED
@@ -1,63 +0,0 @@
1
- import { aliasPlugin } from '@gjsify/esbuild-plugin-alias';
2
- import { denoPlugin } from '@gjsify/esbuild-plugin-deno-loader';
3
- import * as deepkitPlugin from '@gjsify/esbuild-plugin-deepkit';
4
- import { merge } from "lodash";
5
-
6
- // Types
7
- import type { PluginBuild, BuildOptions } from "esbuild";
8
- import type { PluginOptions } from '../types/plugin-options.js';
9
- import { getAliasesForDeno, globToEntryPoints } from "../utils/index.js";
10
-
11
- export const setupForDeno = async (build: PluginBuild, pluginOptions: PluginOptions) => {
12
-
13
- const external = [];
14
- const format = pluginOptions.format || 'esm';
15
-
16
- if(format !== 'esm') throw new TypeError('Only ESM format is supported for Deno');
17
-
18
- pluginOptions.aliases ||= {};
19
- pluginOptions.exclude ||= [];
20
-
21
- // Set default options
22
- const esbuildOptions: BuildOptions = {
23
- format, // Only 'esm' is supported for Deno
24
- bundle: true,
25
- minify: false,
26
- sourcemap: false,
27
- treeShaking: true,
28
- preserveSymlinks: false, // false means follow symlinks
29
- target: [ "esnext" ],
30
- platform: "neutral",
31
- mainFields: ['module', 'main'],
32
- conditions: ['module','import'],
33
- external,
34
- loader: {
35
- '.ts': 'ts',
36
- '.mts': 'ts',
37
- '.cts': 'ts',
38
- '.tsx': 'ts',
39
- '.mtsx': 'ts',
40
- '.ctsx': 'ts',
41
- '.mjs': 'ts',
42
- '.cjs': 'ts',
43
- '.js': 'ts',
44
- },
45
- inject: [],
46
- define: {
47
- global: 'globalThis',
48
- window: 'globalThis',
49
- },
50
- };
51
-
52
- merge(build.initialOptions, esbuildOptions);
53
-
54
- build.initialOptions.entryPoints = await globToEntryPoints(build.initialOptions.entryPoints, pluginOptions.exclude)
55
-
56
- const aliases = {...getAliasesForDeno({external}), ...pluginOptions.aliases};
57
-
58
- if(pluginOptions.debug) console.debug("initialOptions", build.initialOptions);
59
-
60
- await aliasPlugin(aliases).setup(build);
61
- await denoPlugin({reflection: pluginOptions.reflection}).setup(build);
62
- await deepkitPlugin.deepkitPlugin({reflection: pluginOptions.reflection}).setup(build);
63
- }
package/src/lodash.d.ts DELETED
@@ -1,46 +0,0 @@
1
- declare module 'lodash' {
2
- /**
3
- * Recursively merges own and inherited enumerable properties of source
4
- * objects into the destination object, skipping source properties that resolve
5
- * to `undefined`. Array and plain object properties are merged recursively.
6
- * Other objects and value types are overridden by assignment. Source objects
7
- * are applied from left to right. Subsequent sources overwrite property
8
- * assignments of previous sources.
9
- *
10
- * **Note:** This method mutates `object`.
11
- *
12
- * @category Object
13
- * @param object The destination object.
14
- * @param [sources] The source objects.
15
- * @returns Returns `object`.
16
- * @example
17
- *
18
- * var users = {
19
- * 'data': [{ 'user': 'barney' }, { 'user': 'fred' }]
20
- * };
21
- *
22
- * var ages = {
23
- * 'data': [{ 'age': 36 }, { 'age': 40 }]
24
- * };
25
- *
26
- * _.merge(users, ages);
27
- * // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] }
28
- */
29
- function merge<TObject, TSource>(object: TObject, source: TSource): TObject & TSource;
30
- /**
31
- * @see _.merge
32
- */
33
- function merge<TObject, TSource1, TSource2>(object: TObject, source1: TSource1, source2: TSource2): TObject & TSource1 & TSource2;
34
- /**
35
- * @see _.merge
36
- */
37
- function merge<TObject, TSource1, TSource2, TSource3>(object: TObject, source1: TSource1, source2: TSource2, source3: TSource3): TObject & TSource1 & TSource2 & TSource3;
38
- /**
39
- * @see _.merge
40
- */
41
- function merge<TObject, TSource1, TSource2, TSource3, TSource4>(object: TObject, source1: TSource1, source2: TSource2, source3: TSource3, source4: TSource4): TObject & TSource1 & TSource2 & TSource3 & TSource4;
42
- /**
43
- * @see _.merge
44
- */
45
- function merge(object: any, ...otherArgs: any[]): any;
46
- }