Skip to content

Commit

Permalink
Version Packages (next) (#46)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] and github-actions[bot] authored Aug 5, 2024
1 parent ea5b50d commit 8bcfaf4
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@
},
"changesets": [
"chilled-baboons-battle",
"chilly-bobcats-reflect",
"cool-dingos-provide",
"dull-candles-exercise",
"eight-fishes-enjoy",
"eleven-kiwis-remain",
"loud-rivers-pretend",
"many-spies-fix",
"rude-berries-rescue",
"shy-turkeys-count",
"silly-seas-impress",
"swift-planets-rescue",
"tasty-radios-rhyme",
"two-pets-rescue"
]
Expand Down
77 changes: 77 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,82 @@
# @heymp/scratchpad

## 1.0.0-next.8

### Major Changes

- 4aa2817: Add `generate config` command [#38](https://github.com/heyMP/scratchpad/issues/38)

```bash
npx @heymp/scratchpad generate --help

Usage: scratchpad generate [options] [command]

Generate files from templates.

Options:
-h, --help display help for command

Commands:
config Generates an example config file.
help [command] display help for command
```

- 4aa2817: Add `run` command

```bash
npx @heymp/scratchpad run --help
Usage: cli run [options] <file>
Execute a file in a browser.
Arguments:
file file to execute in the browser.
Options:
--headless [boolean] specify running the browser in headless
mode.
--devtools [boolean] open browser devtools automatically.
--ts-write [boolean] write the js output of the target ts file.
--url [string] specify a specific url to execute the code
in.
-h, --help display help for command
```

### Minor Changes

- ea5b50d: Add `writeFile`, `appendFile` exposed functions. (#44)[https://github.com/heyMP/scratchpad/issues/44]

```.js
await writeFile('./log.txt', 'hello');
await appendFile('./log.txt', '\n');
await appendFile('./log.txt', 'world');
```

Include custom exposed functions example.

```.js
import { join } from 'node:path'
import fs from 'node:fs/promises';
function loadFile(path) {
return fs.readFile(join(process.cwd(), path), 'utf8');
}
export default /** @type {import('@heymp/scratchpad/src/config').Config} */ ({
playwright: async (args) => {
const { context, page } = args;
await context.exposeFunction('loadFile', loadFile)
}
});
```
- a242c0f: ⚠️ Change config types directory.
```js
export default /** @type {import('@heymp/scratchpad/src/config').Config} */ ({});
```
## 1.0.0-next.7
### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@heymp/scratchpad",
"description": "Run TS/JS snippets in a locally",
"version": "1.0.0-next.7",
"version": "1.0.0-next.8",
"main": "bin/cli.js",
"type": "module",
"bin": {
Expand Down

0 comments on commit 8bcfaf4

Please sign in to comment.