milkee 3.0.0 → 3.0.1-dev.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.
- package/README-ja.md +155 -0
- package/README.md +17 -15
- package/dist/commands/compile.js +3 -3
- package/dist/commands/plugin.js +1 -1
- package/dist/commands/setup.js +2 -2
- package/dist/lib/checks.js +58 -0
- package/dist/lib/constants.js +14 -0
- package/dist/lib/plugins.js +59 -0
- package/dist/lib/utils.js +48 -0
- package/dist/main.js +1 -1
- package/dist/options/copy.js +1 -1
- package/dist/options/refresh.js +1 -1
- package/docs/PLUGIN-ja.md +6 -6
- package/docs/PLUGIN.md +6 -6
- package/package.json +5 -3
package/README-ja.md
ADDED
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
[English](./README.md) | **日本語**
|
|
2
|
+
|
|
3
|
+
# Milkee
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
`coffee.config.cjs` を使ったシンプルな CoffeeScript ビルドツール
|
|
8
|
+
|
|
9
|
+
## はじめに
|
|
10
|
+
|
|
11
|
+
### インストール
|
|
12
|
+
|
|
13
|
+
Milkee をインストールします:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
# グローバルインストール
|
|
17
|
+
npm i -g milkee
|
|
18
|
+
|
|
19
|
+
# ローカルインストール
|
|
20
|
+
npm i -D milkee
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
CoffeeScript と `@babel/core` が必要です。
|
|
24
|
+
|
|
25
|
+
> [!TIP]
|
|
26
|
+
> `options.transpile` が `true` の場合は `@babel/core` が必要です。
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
# グローバルインストール
|
|
30
|
+
npm i -g coffeescript @babel/core
|
|
31
|
+
|
|
32
|
+
# ローカルインストール
|
|
33
|
+
npm i -D coffeescript @babel/core
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### セットアップ
|
|
37
|
+
|
|
38
|
+
`-s` (`--setup`) コマンドを実行すると、`coffee.config.cjs` が生成されます!
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
# グローバル
|
|
42
|
+
milkee -s
|
|
43
|
+
|
|
44
|
+
# ローカル
|
|
45
|
+
npx milkee -s
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
#### `coffee.config.cjs`
|
|
49
|
+
|
|
50
|
+
```js
|
|
51
|
+
/** @type {import('@milkee/d').Config} */
|
|
52
|
+
|
|
53
|
+
module.exports = {
|
|
54
|
+
// コンパイルのエントリーポイント。
|
|
55
|
+
// 単一ファイルまたはディレクトリ(例: 'src/' や 'src/app.coffee')を指定できます。
|
|
56
|
+
entry: 'src',
|
|
57
|
+
// コンパイルされた JavaScript ファイルの出力先。
|
|
58
|
+
// `options.join` が true の場合は単一ファイルパス(例: 'dist/app.js')
|
|
59
|
+
// `options.join` が false の場合はディレクトリ(例: 'dist')を指定します。
|
|
60
|
+
output: 'dist',
|
|
61
|
+
// (任意) CoffeeScript コンパイラの追加オプション。
|
|
62
|
+
// 利用可能な全オプションは `coffee --help` を参照してください。
|
|
63
|
+
// Web: https://coffeescript.org/annotated-source/command.html
|
|
64
|
+
options: {
|
|
65
|
+
// 以下のオプションがサポートされています:
|
|
66
|
+
// bare: false,
|
|
67
|
+
// join: false,
|
|
68
|
+
// map: false,
|
|
69
|
+
// inlineMap: false,
|
|
70
|
+
// noHeader: false,
|
|
71
|
+
// transpile: false,
|
|
72
|
+
// literate: false,
|
|
73
|
+
// watch: false,
|
|
74
|
+
},
|
|
75
|
+
// (任意) Milkee ビルダーの追加オプション / プラグイン。
|
|
76
|
+
milkee: {
|
|
77
|
+
options: {
|
|
78
|
+
// コンパイル前に出力ディレクトリをリセットします。
|
|
79
|
+
// refresh: false,
|
|
80
|
+
// コンパイル前に「実行しますか?」と確認します。
|
|
81
|
+
// confirm: false,
|
|
82
|
+
// コンパイル後に entry から output へ非 CoffeeScript ファイルをコピーします。(`options.join` が false の場合のみ有効)
|
|
83
|
+
// copy: false,
|
|
84
|
+
},
|
|
85
|
+
plugins: []
|
|
86
|
+
},
|
|
87
|
+
};
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
##### `options` (CoffeeScript コンパイラオプション)
|
|
91
|
+
|
|
92
|
+
これらのオプションは `coffee` コンパイラに直接渡されます。
|
|
93
|
+
|
|
94
|
+
| オプション | 型 | デフォルト | 説明 |
|
|
95
|
+
| :--- | :--- | :--- | :--- |
|
|
96
|
+
| `bare` | `boolean` | `false` | トップレベルの関数ラッパーなしでコンパイルする |
|
|
97
|
+
| `join` | `boolean` | `false` | コンパイル前にソースを連結する |
|
|
98
|
+
| `map` | `boolean` | `false` | ソースマップを生成して `.js.map` として保存する |
|
|
99
|
+
| `inlineMap` | `boolean` | `false` | ソースマップを生成して出力内に直接含める |
|
|
100
|
+
| `noHeader` | `boolean` | `false` | "Generated by" ヘッダを抑制する |
|
|
101
|
+
| `transpile` | `boolean` | `false` | 生成された JavaScript を Babel に通す |
|
|
102
|
+
| `literate` | `boolean` | `false` | 標準入力をリテラート形式の CoffeeScript として扱う |
|
|
103
|
+
| `watch` | `boolean` | `false` | ファイル変更を監視してコマンドを再実行する |
|
|
104
|
+
|
|
105
|
+
[CoffeeScript - command.coffee](https://coffeescript.org/annotated-source/command.html)
|
|
106
|
+
|
|
107
|
+
##### `milkee.options` (Milkee 固有オプション)
|
|
108
|
+
|
|
109
|
+
これらのオプションは Milkee の動作を制御します。
|
|
110
|
+
|
|
111
|
+
| オプション | 型 | デフォルト | 説明 |
|
|
112
|
+
| :--- | :--- | :--- | :--- |
|
|
113
|
+
| `refresh` | `boolean` | `false` | コンパイル前に出力ディレクトリをリセットする |
|
|
114
|
+
| `confirm` | `boolean` | `false` | コンパイル前に「実行しますか?」と確認する |
|
|
115
|
+
| `copy` | `boolean` | `false` | コンパイル後に entry から output へ非 CoffeeScript ファイルをコピーする(`options.join` が false の場合のみ) |
|
|
116
|
+
|
|
117
|
+
##### `milkee.plugins` (Milkee 固有プラグイン)
|
|
118
|
+
|
|
119
|
+
Milkee の機能はプラグインで拡張できます。プラグインは、各コンパイル成功後に実行され、コンパイル済みファイルと設定にアクセスできる単純な関数です。
|
|
120
|
+
|
|
121
|
+
例:
|
|
122
|
+
|
|
123
|
+
```js
|
|
124
|
+
const myPlugin = require('./plugins/my-plugin.js');
|
|
125
|
+
|
|
126
|
+
module.exports = {
|
|
127
|
+
// ...
|
|
128
|
+
milkee: {
|
|
129
|
+
plugins: [
|
|
130
|
+
// この呼び出しは PluginExecutor を返します
|
|
131
|
+
myPlugin({ option: 'value' }),
|
|
132
|
+
// ...
|
|
133
|
+
]
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### コンパイル
|
|
139
|
+
|
|
140
|
+
Milkee は自動で `coffee.config.cjs` を読み、`options` からコマンドを組み立ててコンパイルを開始します!
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
# グローバル
|
|
144
|
+
milkee
|
|
145
|
+
|
|
146
|
+
# ローカル
|
|
147
|
+
npx milkee
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## プラグインの作成
|
|
151
|
+
|
|
152
|
+
独自の Milkee プラグインを作成したいですか?プラグインのドキュメントを確認してください:
|
|
153
|
+
|
|
154
|
+
- [English](./docs/PLUGIN.md)
|
|
155
|
+
- [日本語](./docs/PLUGIN-ja.md)
|
package/README.md
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
**English** | [日本語](./README-ja.md)
|
|
2
|
+
|
|
1
3
|
# Milkee
|
|
2
4
|
|
|
3
5
|

|
|
@@ -89,16 +91,16 @@ module.exports = {
|
|
|
89
91
|
|
|
90
92
|
These options are passed directly to the `coffee` compiler.
|
|
91
93
|
|
|
92
|
-
| Option
|
|
93
|
-
|
|
|
94
|
-
| `bare`
|
|
95
|
-
| `join`
|
|
96
|
-
| `map`
|
|
97
|
-
| `inlineMap` | `boolean` | `false`
|
|
98
|
-
| `noHeader`
|
|
99
|
-
| `transpile` | `boolean` | `false`
|
|
100
|
-
| `literate`
|
|
101
|
-
| `watch`
|
|
94
|
+
| Option | Type | Default | Description |
|
|
95
|
+
| :--- | :--- | :--- | :--- |
|
|
96
|
+
| `bare` | `boolean` | `false` | compile without a top-level function wrapper |
|
|
97
|
+
| `join` | `boolean` | `false` | concatenate the source CoffeeScript before compiling |
|
|
98
|
+
| `map` | `boolean` | `false` | generate source map and save as `.js.map` files |
|
|
99
|
+
| `inlineMap` | `boolean` | `false` | generate source map and include it directly in output |
|
|
100
|
+
| `noHeader` | `boolean` | `false` | suppress the "Generated by" header |
|
|
101
|
+
| `transpile` | `boolean` | `false` | pipe generated JavaScript through Babel |
|
|
102
|
+
| `literate` | `boolean` | `false` | treat stdio as literate style coffeescript |
|
|
103
|
+
| `watch` | `boolean` | `false` | watch scripts for changes and rerun commands |
|
|
102
104
|
|
|
103
105
|
[CoffeeScript - command.coffee](https://coffeescript.org/annotated-source/command.html)
|
|
104
106
|
|
|
@@ -106,11 +108,11 @@ These options are passed directly to the `coffee` compiler.
|
|
|
106
108
|
|
|
107
109
|
These options control Milkee's behavior.
|
|
108
110
|
|
|
109
|
-
| Option
|
|
110
|
-
|
|
|
111
|
-
| `refresh` | `boolean` | `false`
|
|
112
|
-
| `confirm` | `boolean` | `false`
|
|
113
|
-
| `copy`
|
|
111
|
+
| Option | Type | Default | Description |
|
|
112
|
+
| :--- | :--- | :--- | :--- |
|
|
113
|
+
| `refresh` | `boolean` | `false` | Before compiling, reset the output directory. |
|
|
114
|
+
| `confirm` | `boolean` | `false` | Before compiling, prompt "Do you want to Continue?". |
|
|
115
|
+
| `copy` | `boolean` | `false` | After compiling, copy non-coffee files from entry to output directory. (Only works when `options.join` is `false`) |
|
|
114
116
|
|
|
115
117
|
##### `milkee.plugins` (Milkee Specific Plugins)
|
|
116
118
|
|
package/dist/commands/compile.js
CHANGED
|
@@ -11,11 +11,11 @@ crypto = require('crypto');
|
|
|
11
11
|
|
|
12
12
|
consola = require('consola');
|
|
13
13
|
|
|
14
|
-
({CWD, CONFIG_PATH, CONFIG_FILE} = require('../constants'));
|
|
14
|
+
({CWD, CONFIG_PATH, CONFIG_FILE} = require('../lib/constants'));
|
|
15
15
|
|
|
16
|
-
({checkLatest, checkCoffee} = require('../checks'));
|
|
16
|
+
({checkLatest, checkCoffee} = require('../lib/checks'));
|
|
17
17
|
|
|
18
|
-
({runPlugins} = require('../plugins'));
|
|
18
|
+
({runPlugins} = require('../lib/plugins'));
|
|
19
19
|
|
|
20
20
|
confirmContinue = require('../options/confirm');
|
|
21
21
|
|
package/dist/commands/plugin.js
CHANGED
package/dist/commands/setup.js
CHANGED
|
@@ -7,9 +7,9 @@ path = require('path');
|
|
|
7
7
|
|
|
8
8
|
consola = require('consola');
|
|
9
9
|
|
|
10
|
-
({CONFIG_FILE, CONFIG_PATH} = require('../constants'));
|
|
10
|
+
({CONFIG_FILE, CONFIG_PATH} = require('../lib/constants'));
|
|
11
11
|
|
|
12
|
-
({checkCoffee} = require('../checks'));
|
|
12
|
+
({checkCoffee} = require('../lib/checks'));
|
|
13
13
|
|
|
14
14
|
// async
|
|
15
15
|
setup = async function() {
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
// Generated by CoffeeScript 2.7.0
|
|
2
|
+
var CWD, checkCoffee, checkLatest, consola, exec, fs, isPackageLatest, path, pkg;
|
|
3
|
+
|
|
4
|
+
fs = require('fs');
|
|
5
|
+
|
|
6
|
+
path = require('path');
|
|
7
|
+
|
|
8
|
+
({exec} = require('child_process'));
|
|
9
|
+
|
|
10
|
+
consola = require('consola');
|
|
11
|
+
|
|
12
|
+
({isPackageLatest} = require('is-package-latest'));
|
|
13
|
+
|
|
14
|
+
({pkg, CWD} = require('./constants'));
|
|
15
|
+
|
|
16
|
+
// async
|
|
17
|
+
checkLatest = async function() {
|
|
18
|
+
var res;
|
|
19
|
+
try {
|
|
20
|
+
res = (await isPackageLatest(pkg));
|
|
21
|
+
if (res.success && !res.isLatest) {
|
|
22
|
+
consola.box({
|
|
23
|
+
title: "A new version is now available!",
|
|
24
|
+
message: `${res.currentVersion} --> \`${res.latestVersion}\`\n\n# global installation\n\`npm i -g milkee@latest\`\n# or local installation\n\`npm i -D milkee@latest\``
|
|
25
|
+
});
|
|
26
|
+
return true;
|
|
27
|
+
} else {
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
} catch (error1) {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
checkCoffee = function() {
|
|
36
|
+
var PKG_PATH, error, pkgData, pkgFile, ref, ref1;
|
|
37
|
+
PKG_PATH = path.join(CWD, 'package.json');
|
|
38
|
+
if (fs.existsSync(PKG_PATH)) {
|
|
39
|
+
try {
|
|
40
|
+
pkgFile = fs.readFileSync(PKG_PATH, 'utf-8');
|
|
41
|
+
pkgData = JSON.parse(pkgFile);
|
|
42
|
+
if (((ref = pkgData.dependencies) != null ? ref.coffeescript : void 0) || ((ref1 = pkgData.devDependencies) != null ? ref1.coffeescript : void 0)) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
} catch (error1) {
|
|
46
|
+
error = error1;
|
|
47
|
+
consola.warn(`Could not parse \`package.json\`: ${error.message}`);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return exec('coffee --version', function(error) {
|
|
51
|
+
if (error) {
|
|
52
|
+
consola.warn('CoffeeScript is not found in local dependencies (`dependencies`, `devDependencies`) or globally.');
|
|
53
|
+
return consola.info('Please install it via `npm install --save-dev coffeescript` to continue.');
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
module.exports = {checkLatest, checkCoffee};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Generated by CoffeeScript 2.7.0
|
|
2
|
+
var CONFIG_FILE, CONFIG_PATH, CWD, path, pkg;
|
|
3
|
+
|
|
4
|
+
path = require('path');
|
|
5
|
+
|
|
6
|
+
pkg = require('../../package.json');
|
|
7
|
+
|
|
8
|
+
CWD = process.cwd();
|
|
9
|
+
|
|
10
|
+
CONFIG_FILE = 'coffee.config.cjs';
|
|
11
|
+
|
|
12
|
+
CONFIG_PATH = path.join(CWD, CONFIG_FILE);
|
|
13
|
+
|
|
14
|
+
module.exports = {pkg, CWD, CONFIG_FILE, CONFIG_PATH};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// Generated by CoffeeScript 2.7.0
|
|
2
|
+
var CWD, consola, executePlugins, fs, getCompiledFiles, path, runPlugins;
|
|
3
|
+
|
|
4
|
+
path = require('path');
|
|
5
|
+
|
|
6
|
+
fs = require('fs');
|
|
7
|
+
|
|
8
|
+
consola = require('consola');
|
|
9
|
+
|
|
10
|
+
({CWD} = require('./constants'));
|
|
11
|
+
|
|
12
|
+
({getCompiledFiles} = require('./utils'));
|
|
13
|
+
|
|
14
|
+
executePlugins = function(config, compilationResult) {
|
|
15
|
+
var plugins, ref;
|
|
16
|
+
plugins = ((ref = config.milkee) != null ? ref.plugins : void 0) || [];
|
|
17
|
+
if (!(plugins.length > 0)) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
consola.start(`Running ${plugins.length} plugin(s)...`);
|
|
21
|
+
return (async function() { // async
|
|
22
|
+
var error, i, len, pluginFn;
|
|
23
|
+
try {
|
|
24
|
+
for (i = 0, len = plugins.length; i < len; i++) {
|
|
25
|
+
pluginFn = plugins[i];
|
|
26
|
+
if (typeof pluginFn === 'function') {
|
|
27
|
+
await Promise.resolve(pluginFn(compilationResult));
|
|
28
|
+
} else {
|
|
29
|
+
consola.warn(`Invalid plugin definition skipped (expected a function, got ${typeof pluginFn}).`);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return consola.success("Plugins executed successfully.");
|
|
33
|
+
} catch (error1) {
|
|
34
|
+
error = error1;
|
|
35
|
+
return consola.error("An error occurred during plugin execution:", error);
|
|
36
|
+
}
|
|
37
|
+
})();
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
runPlugins = function(config, options, stdout = '', stderr = '') {
|
|
41
|
+
var compilationResult, compiledFiles, mapPath, outputPath;
|
|
42
|
+
outputPath = path.join(CWD, config.output);
|
|
43
|
+
compiledFiles = getCompiledFiles(outputPath);
|
|
44
|
+
if (options.join && options.map && !options.inlineMap) {
|
|
45
|
+
mapPath = `${outputPath}.map`;
|
|
46
|
+
if (fs.existsSync(mapPath && !compiledFiles.includes(mapPath))) {
|
|
47
|
+
compiledFiles = compiledFiles.concat(getCompiledFiles(mapPath));
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
compilationResult = {
|
|
51
|
+
config: config,
|
|
52
|
+
compiledFiles: compiledFiles,
|
|
53
|
+
stdout: stdout,
|
|
54
|
+
stderr: stderr
|
|
55
|
+
};
|
|
56
|
+
return executePlugins(config, compilationResult);
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
module.exports = {runPlugins};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
// Generated by CoffeeScript 2.7.0
|
|
2
|
+
var consola, fs, getCompiledFiles, path, sleep;
|
|
3
|
+
|
|
4
|
+
fs = require('fs');
|
|
5
|
+
|
|
6
|
+
path = require('path');
|
|
7
|
+
|
|
8
|
+
consola = require('consola');
|
|
9
|
+
|
|
10
|
+
sleep = function(time) {
|
|
11
|
+
return new Promise(function(resolve) {
|
|
12
|
+
return setTimeout(resolve, time);
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
getCompiledFiles = function(targetPath) {
|
|
17
|
+
var error, filesList, i, item, itemPath, items, len, stat;
|
|
18
|
+
filesList = [];
|
|
19
|
+
if (!fs.existsSync(targetPath)) {
|
|
20
|
+
consola.warn(`Path does not exist, skipping scan ${targetPath}`);
|
|
21
|
+
return [];
|
|
22
|
+
}
|
|
23
|
+
try {
|
|
24
|
+
stat = fs.statSync(targetPath);
|
|
25
|
+
if (stat.isDirectory()) {
|
|
26
|
+
consola.start(`Scanning directory: ${targetPath}`);
|
|
27
|
+
items = fs.readdirSync(targetPath);
|
|
28
|
+
for (i = 0, len = items.length; i < len; i++) {
|
|
29
|
+
item = items[i];
|
|
30
|
+
itemPath = path.join(targetPath, item);
|
|
31
|
+
filesList = filesList.concat(getCompiledFiles(itemPath));
|
|
32
|
+
}
|
|
33
|
+
} else if (stat.isFile()) {
|
|
34
|
+
if (targetPath.endsWith('.js' || targetPath.endsWith('.js.map'))) {
|
|
35
|
+
if (fs.existsSync(targetPath)) {
|
|
36
|
+
consola.info(`Found file: \`${targetPath}\``);
|
|
37
|
+
}
|
|
38
|
+
filesList.push(targetPath);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
} catch (error1) {
|
|
42
|
+
error = error1;
|
|
43
|
+
consola.warn(`Could not scan output path ${targetPath}: ${error.message}`);
|
|
44
|
+
}
|
|
45
|
+
return filesList;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
module.exports = {sleep, getCompiledFiles};
|
package/dist/main.js
CHANGED
package/dist/options/copy.js
CHANGED
package/dist/options/refresh.js
CHANGED
package/docs/PLUGIN-ja.md
CHANGED
|
@@ -71,12 +71,12 @@ module.exports = main
|
|
|
71
71
|
|
|
72
72
|
Milkee はコンパイル後にこのオブジェクトをプラグインに渡します:
|
|
73
73
|
|
|
74
|
-
| プロパティ
|
|
75
|
-
|
|
|
76
|
-
| `config`
|
|
77
|
-
| `compiledFiles` | `string[]` | コンパイルされた `.js` と `.js.map` のパス
|
|
78
|
-
| `stdout`
|
|
79
|
-
| `stderr`
|
|
74
|
+
| プロパティ | 型 | 説明 |
|
|
75
|
+
| :--- | :--- | :--- |
|
|
76
|
+
| `config` | `object` | `coffee.config.cjs` の設定オブジェクト |
|
|
77
|
+
| `compiledFiles` | `string[]` | コンパイルされた `.js` と `.js.map` のパス |
|
|
78
|
+
| `stdout` | `string` | コンパイラの標準出力 |
|
|
79
|
+
| `stderr` | `string` | コンパイラの標準エラー |
|
|
80
80
|
|
|
81
81
|
### coffee.config.cjs での使用
|
|
82
82
|
|
package/docs/PLUGIN.md
CHANGED
|
@@ -71,12 +71,12 @@ module.exports = main
|
|
|
71
71
|
|
|
72
72
|
Milkee passes this object to your plugin after compilation:
|
|
73
73
|
|
|
74
|
-
| Property
|
|
75
|
-
|
|
|
76
|
-
| `config`
|
|
77
|
-
| `compiledFiles` | `string[]` | Paths to compiled `.js` and `.js.map` files
|
|
78
|
-
| `stdout`
|
|
79
|
-
| `stderr`
|
|
74
|
+
| Property | Type | Description |
|
|
75
|
+
| :--- | :--- | :--- |
|
|
76
|
+
| `config` | `object` | Full config from `coffee.config.cjs` |
|
|
77
|
+
| `compiledFiles` | `string[]` | Paths to compiled `.js` and `.js.map` files |
|
|
78
|
+
| `stdout` | `string` | Compiler standard output |
|
|
79
|
+
| `stderr` | `string` | Compiler standard error |
|
|
80
80
|
|
|
81
81
|
### Using in coffee.config.cjs
|
|
82
82
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "milkee",
|
|
3
|
-
"version": "3.0.0",
|
|
3
|
+
"version": "3.0.1-dev.0",
|
|
4
4
|
"description": "A simple CoffeeScript build tool with coffee.config.cjs",
|
|
5
5
|
"main": "dist/main.js",
|
|
6
6
|
"bin": {
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
},
|
|
9
9
|
"scripts": {
|
|
10
10
|
"test": "echo \"No test specified\" && exit 0",
|
|
11
|
-
"build": "coffee --output dist/ --compile --bare src/"
|
|
11
|
+
"build": "coffee --output dist/ --compile --bare src/",
|
|
12
|
+
"deprecate:dev": "node ./scripts/deprecate-dev-versions.js"
|
|
12
13
|
},
|
|
13
14
|
"repository": {
|
|
14
15
|
"type": "git",
|
|
@@ -40,6 +41,7 @@
|
|
|
40
41
|
"devDependencies": {
|
|
41
42
|
"@babel/core": "^7.28.5",
|
|
42
43
|
"@types/coffeescript": "^2.5.7",
|
|
43
|
-
"coffeescript": "^2.7.0"
|
|
44
|
+
"coffeescript": "^2.7.0",
|
|
45
|
+
"dotenv": "^17.2.3"
|
|
44
46
|
}
|
|
45
47
|
}
|