Skip to content

Commit 8bcfaf4

Browse files
Version Packages (next) (#46)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent ea5b50d commit 8bcfaf4

File tree

3 files changed

+82
-1
lines changed

3 files changed

+82
-1
lines changed

Diff for: .changeset/pre.json

+4
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,17 @@
66
},
77
"changesets": [
88
"chilled-baboons-battle",
9+
"chilly-bobcats-reflect",
910
"cool-dingos-provide",
1011
"dull-candles-exercise",
1112
"eight-fishes-enjoy",
13+
"eleven-kiwis-remain",
14+
"loud-rivers-pretend",
1215
"many-spies-fix",
1316
"rude-berries-rescue",
1417
"shy-turkeys-count",
1518
"silly-seas-impress",
19+
"swift-planets-rescue",
1620
"tasty-radios-rhyme",
1721
"two-pets-rescue"
1822
]

Diff for: CHANGELOG.md

+77
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,82 @@
11
# @heymp/scratchpad
22

3+
## 1.0.0-next.8
4+
5+
### Major Changes
6+
7+
- 4aa2817: Add `generate config` command [#38](https://github.com/heyMP/scratchpad/issues/38)
8+
9+
```bash
10+
npx @heymp/scratchpad generate --help
11+
12+
Usage: scratchpad generate [options] [command]
13+
14+
Generate files from templates.
15+
16+
Options:
17+
-h, --help display help for command
18+
19+
Commands:
20+
config Generates an example config file.
21+
help [command] display help for command
22+
```
23+
24+
- 4aa2817: Add `run` command
25+
26+
```bash
27+
npx @heymp/scratchpad run --help
28+
29+
Usage: cli run [options] <file>
30+
31+
Execute a file in a browser.
32+
33+
Arguments:
34+
file file to execute in the browser.
35+
36+
Options:
37+
--headless [boolean] specify running the browser in headless
38+
mode.
39+
--devtools [boolean] open browser devtools automatically.
40+
--ts-write [boolean] write the js output of the target ts file.
41+
--url [string] specify a specific url to execute the code
42+
in.
43+
-h, --help display help for command
44+
```
45+
46+
### Minor Changes
47+
48+
- ea5b50d: Add `writeFile`, `appendFile` exposed functions. (#44)[https://github.com/heyMP/scratchpad/issues/44]
49+
50+
```.js
51+
await writeFile('./log.txt', 'hello');
52+
await appendFile('./log.txt', '\n');
53+
await appendFile('./log.txt', 'world');
54+
```
55+
56+
Include custom exposed functions example.
57+
58+
```.js
59+
import { join } from 'node:path'
60+
import fs from 'node:fs/promises';
61+
62+
function loadFile(path) {
63+
return fs.readFile(join(process.cwd(), path), 'utf8');
64+
}
65+
66+
export default /** @type {import('@heymp/scratchpad/src/config').Config} */ ({
67+
playwright: async (args) => {
68+
const { context, page } = args;
69+
await context.exposeFunction('loadFile', loadFile)
70+
}
71+
});
72+
```
73+
74+
- a242c0f: ⚠️ Change config types directory.
75+
76+
```js
77+
export default /** @type {import('@heymp/scratchpad/src/config').Config} */ ({});
78+
```
79+
380
## 1.0.0-next.7
481

582
### Minor Changes

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@heymp/scratchpad",
33
"description": "Run TS/JS snippets in a locally",
4-
"version": "1.0.0-next.7",
4+
"version": "1.0.0-next.8",
55
"main": "bin/cli.js",
66
"type": "module",
77
"bin": {

0 commit comments

Comments
 (0)