@withstudiocms/buildkit 0.1.0-beta.5 → 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.
- package/CHANGELOG.md +8 -0
- package/README.md +1 -0
- package/lib/cmds/builder.js +13 -0
- package/lib/index.js +2 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @withstudiocms/buildkit
|
|
2
2
|
|
|
3
|
+
## 0.1.0
|
|
4
|
+
|
|
5
|
+
## 0.1.0-beta.6
|
|
6
|
+
|
|
7
|
+
### Patch Changes
|
|
8
|
+
|
|
9
|
+
- [#859](https://github.com/withstudiocms/studiocms/pull/859) [`8b8352c`](https://github.com/withstudiocms/studiocms/commit/8b8352c3c7f4c35714651de8f46c5e480bc5698d) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Adds support for `.stub` file copy
|
|
10
|
+
|
|
3
11
|
## 0.1.0-beta.5
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
package/README.md
CHANGED
package/lib/cmds/builder.js
CHANGED
|
@@ -28,6 +28,7 @@ const defaultConfig = {
|
|
|
28
28
|
'.ttf': 'copy',
|
|
29
29
|
'.eot': 'copy',
|
|
30
30
|
'.otf': 'copy',
|
|
31
|
+
'.stub': 'copy',
|
|
31
32
|
},
|
|
32
33
|
};
|
|
33
34
|
|
|
@@ -41,10 +42,12 @@ const copyStubJsPlugin = {
|
|
|
41
42
|
setup(build) {
|
|
42
43
|
// Match both entry points and imported modules
|
|
43
44
|
const filter = /\.stub\.(?:js|mjs|cjs)$/;
|
|
45
|
+
/* v8 ignore start */
|
|
44
46
|
build.onLoad({ filter }, async (args) => {
|
|
45
47
|
const contents = await fs.readFile(args.path);
|
|
46
48
|
return { contents, loader: 'copy' };
|
|
47
49
|
});
|
|
50
|
+
/* v8 ignore stop */
|
|
48
51
|
},
|
|
49
52
|
};
|
|
50
53
|
|
|
@@ -58,10 +61,12 @@ const copyDTSPlugin = {
|
|
|
58
61
|
setup(build) {
|
|
59
62
|
// Match both entry points and imported modules
|
|
60
63
|
const filter = /\.d\.ts$/;
|
|
64
|
+
/* v8 ignore start */
|
|
61
65
|
build.onLoad({ filter }, async (args) => {
|
|
62
66
|
const contents = await fs.readFile(args.path);
|
|
63
67
|
return { contents, loader: 'copy' };
|
|
64
68
|
});
|
|
69
|
+
/* v8 ignore stop */
|
|
65
70
|
},
|
|
66
71
|
};
|
|
67
72
|
|
|
@@ -96,6 +101,7 @@ const dtsGen = (buildTsConfig, outdir) => ({
|
|
|
96
101
|
);
|
|
97
102
|
if (res) console.log(res);
|
|
98
103
|
console.log(chalk.dim(`[${date}] `) + chalk.green('√ Generated TypeScript declarations'));
|
|
104
|
+
/* v8 ignore start */
|
|
99
105
|
} catch (error) {
|
|
100
106
|
const msg =
|
|
101
107
|
(error && (error.message || String(error))) +
|
|
@@ -105,6 +111,7 @@ const dtsGen = (buildTsConfig, outdir) => ({
|
|
|
105
111
|
(typeof error?.stderr === 'string' ? error.stderr : (error?.stderr?.toString?.() ?? ''));
|
|
106
112
|
console.error(chalk.dim(`[${date}] `) + chalk.red(msg));
|
|
107
113
|
}
|
|
114
|
+
/* v8 ignore stop */
|
|
108
115
|
});
|
|
109
116
|
},
|
|
110
117
|
});
|
|
@@ -131,12 +138,14 @@ async function readPackageJSON(path) {
|
|
|
131
138
|
const content = await fs.readFile(path, { encoding: 'utf8' });
|
|
132
139
|
try {
|
|
133
140
|
return JSON.parse(content);
|
|
141
|
+
/* v8 ignore start */
|
|
134
142
|
} catch (parseError) {
|
|
135
143
|
throw new Error(`Invalid JSON in ${path}: ${parseError.message}`);
|
|
136
144
|
}
|
|
137
145
|
} catch (readError) {
|
|
138
146
|
throw new Error(`Failed to read ${path}: ${readError.message}`);
|
|
139
147
|
}
|
|
148
|
+
/* v8 ignore stop */
|
|
140
149
|
}
|
|
141
150
|
|
|
142
151
|
/**
|
|
@@ -198,6 +207,7 @@ export default async function builder(cmd, args) {
|
|
|
198
207
|
setup(build) {
|
|
199
208
|
build.onEnd(async (result) => {
|
|
200
209
|
const date = dt.format(new Date());
|
|
210
|
+
/* v8 ignore start */
|
|
201
211
|
if (result?.errors.length) {
|
|
202
212
|
const formatted = await esbuild.formatMessages(result.errors, {
|
|
203
213
|
kind: 'error',
|
|
@@ -216,6 +226,7 @@ export default async function builder(cmd, args) {
|
|
|
216
226
|
chalk.yellow(`! updated with warnings:\n${formattedWarns.join('\n')}`)
|
|
217
227
|
);
|
|
218
228
|
}
|
|
229
|
+
/* v8 ignore stop */
|
|
219
230
|
console.info(chalk.dim(`[${date}] `) + chalk.green('√ updated'));
|
|
220
231
|
});
|
|
221
232
|
},
|
|
@@ -235,9 +246,11 @@ export default async function builder(cmd, args) {
|
|
|
235
246
|
);
|
|
236
247
|
await builder.watch();
|
|
237
248
|
|
|
249
|
+
/* v8 ignore start */
|
|
238
250
|
process.on('beforeExit', () => {
|
|
239
251
|
builder.stop?.();
|
|
240
252
|
});
|
|
253
|
+
/* v8 ignore stop */
|
|
241
254
|
break;
|
|
242
255
|
}
|
|
243
256
|
case 'build': {
|
package/lib/index.js
CHANGED