@milkee/d 0.1.0 → 0.2.1

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 (2) hide show
  1. package/index.d.ts +57 -1
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -20,6 +20,40 @@ interface CoffeeOptions {
20
20
  watch?: boolean;
21
21
  }
22
22
 
23
+ /**
24
+ * Describes the compilation results passed to a plugin's executor function.
25
+ */
26
+ interface CompilationResult {
27
+ /**
28
+ * The complete configuration object loaded from `coffee.config.cjs`.
29
+ * (Typed as `any` to prevent circular type definitions, but it conforms to the `Config` interface).
30
+ */
31
+ config: any;
32
+
33
+ /**
34
+ * An array of absolute paths to the compiled .js and .js.map files.
35
+ */
36
+ compiledFiles: string[];
37
+
38
+ /**
39
+ * The stdout from the coffee compiler.
40
+ * (Note: In watch mode, this will be a placeholder string like '(watch mode)').
41
+ */
42
+ stdout: string;
43
+
44
+ /**
45
+ * The stderr from the coffee compiler.
46
+ */
47
+ stderr: string;
48
+ }
49
+
50
+ /**
51
+ * Defines the function returned by a plugin's setup function.
52
+ * This function is executed by Milkee after a successful compilation.
53
+ * It can be synchronous or asynchronous (return a Promise).
54
+ */
55
+ type PluginExecutor = (result: CompilationResult) => void | Promise<void>;
56
+
23
57
  /**
24
58
  * (Optional) Additional options/plugins for the Milkee builder.
25
59
  */
@@ -33,8 +67,30 @@ interface MilkeeConfig {
33
67
  * Before compiling, confirm "Do you want to Continue?"
34
68
  */
35
69
  confirm?: boolean;
70
+ copy?: boolean;
36
71
  };
37
- plugins?: any[];
72
+ /**
73
+ * (Optional) An array of plugin executor functions.
74
+ *
75
+ * A plugin executor is the function *returned* by your plugin's setup function
76
+ * (which is what you `require` in your config).
77
+ *
78
+ * @example
79
+ * // coffee.config.cjs
80
+ * const myPlugin = require('./plugins/my-plugin.js');
81
+ *
82
+ * module.exports = {
83
+ * // ...
84
+ * milkee: {
85
+ * plugins: [
86
+ * // This call returns the PluginExecutor
87
+ * myPlugin({ option: 'value' }),
88
+ * // ...
89
+ * ]
90
+ * }
91
+ * }
92
+ */
93
+ plugins?: PluginExecutor[];
38
94
  }
39
95
 
40
96
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@milkee/d",
3
- "version": "0.1.0",
3
+ "version": "0.2.1",
4
4
  "description": "Milkee config types.",
5
5
  "main": "",
6
6
  "types": "index.d.ts",