@stacksjs/defaults 0.75.40 → 0.75.41
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/ai/skills/stacks-desktop/SKILL.md +12 -0
- package/app/Actions/Payment/CreatePaymentIntentAction.ts +1 -1
- package/app/Actions/Payment/CreateSetupIntentAction.ts +1 -1
- package/ide/vscode/.vscode/settings.json +1 -1
- package/ide/vscode/README.md +65 -20
- package/ide/vscode/package.json +102 -12
- package/ide/vscode/src/extension.ts +59 -0
- package/ide/vscode/src/project.ts +440 -0
- package/ide/vscode/src/stacks.ts +475 -0
- package/ide/vscode/src/vscode.d.ts +181 -0
- package/ide/vscode/tests/extension.test.ts +420 -0
- package/ide/vscode/tests/project.test.ts +268 -0
- package/ide/vscode/tsconfig.json +19 -0
- package/package.json +4 -4
|
@@ -214,8 +214,20 @@ buddy desktop:apple:init # generate the reusable GitHub Actions caller
|
|
|
214
214
|
buddy desktop:apple:doctor # validate Apple tooling, identities, profile, and API key
|
|
215
215
|
buddy desktop:apple:package # build, sandbox, sign, and create a Store .pkg
|
|
216
216
|
buddy desktop:apple:publish # validate or upload the package to App Store Connect
|
|
217
|
+
buddy desktop:probe # measure what a Craft window offers interactive/game content
|
|
217
218
|
```
|
|
218
219
|
|
|
220
|
+
`desktop:probe` opens a visible Craft window (not `--headless`, which stops
|
|
221
|
+
requestAnimationFrame) and measures WebGL2/WebGPU, frame pacing under load,
|
|
222
|
+
input and audio latency, the Gamepad API, fullscreen and pointer lock.
|
|
223
|
+
`--browser[=Safari]` runs the same page in a browser for comparison, and
|
|
224
|
+
`--record` writes the result into `storage/framework/core/desktop/src/probe/results/`,
|
|
225
|
+
which `buddy docs:capabilities` publishes in `docs/features/capabilities.md`.
|
|
226
|
+
Probes that need a real click or key press are recorded as
|
|
227
|
+
`requires-interaction`, never as a number. Stacks ships no game engine,
|
|
228
|
+
physics or asset pipeline; this only says what an engine someone else wrote
|
|
229
|
+
would get.
|
|
230
|
+
|
|
219
231
|
## Mac App Store
|
|
220
232
|
|
|
221
233
|
Run `buddy desktop:apple:init`, then configure the repository variables and
|
|
@@ -30,7 +30,7 @@ export default new Action({
|
|
|
30
30
|
// method is `createPayment`: `user.paymentIntent()` never existed.
|
|
31
31
|
const paymentIntent = await user.createPayment(Number(product.get('price')), {
|
|
32
32
|
currency: 'usd',
|
|
33
|
-
|
|
33
|
+
allowed_payment_method_types: ['card'],
|
|
34
34
|
})
|
|
35
35
|
|
|
36
36
|
return response.json(paymentIntent)
|
|
@@ -17,7 +17,7 @@ export default new Action({
|
|
|
17
17
|
return response.error(BILLING_NOT_ENABLED, 503)
|
|
18
18
|
|
|
19
19
|
const setupIntent = await user.createSetupIntent({
|
|
20
|
-
|
|
20
|
+
allowed_payment_method_types: ['card', 'link', 'us_bank_account'],
|
|
21
21
|
})
|
|
22
22
|
|
|
23
23
|
return response.json(setupIntent)
|
package/ide/vscode/README.md
CHANGED
|
@@ -1,36 +1,81 @@
|
|
|
1
|
-
# Stacks VS Code
|
|
1
|
+
# Stacks for VS Code
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Build a Stacks app without leaving the editor. Start the dev server, preview it in VS Code's built-in Simple Browser, and run any `buddy` command from the Command Palette. The extension also installs a small pack of extensions that Stacks projects are configured for.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
The extension activates in workspaces that contain a `buddy` file or a `config/app.ts`.
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Commands
|
|
8
|
+
|
|
9
|
+
Open the Command Palette (`Cmd+Shift+P` / `Ctrl+Shift+P`) and type `Stacks`.
|
|
10
|
+
|
|
11
|
+
| Command | What it does |
|
|
12
|
+
|---|---|
|
|
13
|
+
| **Stacks: Open Preview** | Opens the running dev server in the Simple Browser, beside your editor. If nothing is running, it offers to start the dev server. |
|
|
14
|
+
| **Stacks: Start Dev Server** | Runs `./buddy dev` in a terminal named `Stacks Dev` at the project root. Once the server is up, the preview opens in the Simple Browser. |
|
|
15
|
+
| **Stacks: Run Buddy Command...** | Lists every command `./buddy list` knows, including your own in `app/Commands/`. Pick one, and if it takes arguments you are asked for them. You can also type a full command line, such as `migrate --diff` or `make:model Post`. The command runs in a terminal named `Stacks Buddy`. |
|
|
16
|
+
|
|
17
|
+
The **Stacks** item in the status bar opens the preview.
|
|
18
|
+
|
|
19
|
+
Every command runs the project's own `./buddy`, relative to the workspace root. A `buddy` on your `PATH` or in `node_modules/.bin` is never used, because that name can also belong to an unrelated tool, such as the `@buddysh/buddy` dependency bot.
|
|
20
|
+
|
|
21
|
+
## Finding the preview URL
|
|
22
|
+
|
|
23
|
+
When the extension starts the dev server, it reads the URL `buddy dev` prints in its ready banner (for example `App: https://stacks.localhost/dashboard`). That URL already accounts for a shifted port and the app's entry page.
|
|
24
|
+
|
|
25
|
+
Otherwise it works the URL out the same way `buddy dev` does, from `.env`, `.env.local`, `.env.development` and `.env.development.local`:
|
|
26
|
+
|
|
27
|
+
- The frontend listens on `PORT`, or `3000` if it is not set.
|
|
28
|
+
- If `APP_URL` (default `stacks.localhost`) is not a localhost address, the app is served at `https://<APP_URL>` through the local HTTPS proxy. `STACKS_DEV_LOCALHOST=1` turns this off.
|
|
29
|
+
- `APP_PATH`, or `appPath` in `config/app.ts`, is appended as the entry page.
|
|
30
|
+
|
|
31
|
+
The extension checks that the frontend port is accepting connections before it opens anything. It uses the `https://` URL only when the proxy answers too, and falls back to `http://localhost:<PORT>` otherwise. In a remote window (SSH, WSL, Codespaces) localhost URLs are port-forwarded automatically.
|
|
32
|
+
|
|
33
|
+
## Settings
|
|
34
|
+
|
|
35
|
+
| Setting | Default | Description |
|
|
36
|
+
|---|---|---|
|
|
37
|
+
| `stacks.preview.url` | `""` | Always open this URL, e.g. `http://localhost:3000/dashboard`. Leave empty to detect it. |
|
|
38
|
+
| `stacks.preview.preferLocalhost` | `false` | Preview `http://localhost:<PORT>` even when `APP_URL` is a pretty `https://` domain. Use this if the Simple Browser stays blank because the local certificate is not trusted. |
|
|
39
|
+
| `stacks.devServer.args` | `[]` | Extra arguments for `./buddy dev`, e.g. `["frontend"]` or `["--site"]`. |
|
|
40
|
+
| `stacks.devServer.openPreview` | `true` | Open the Simple Browser once the dev server is up, instead of letting `buddy dev` open your system browser. |
|
|
41
|
+
| `stacks.statusBar.enabled` | `true` | Show the Stacks status bar item. |
|
|
42
|
+
|
|
43
|
+
The extension also sets a few editor defaults for Stacks projects: `.stx` files use HTML language support, the `buddy` script is highlighted as a shell script, `npm.packageManager` is `bun`, Go to Definition prefers source files over `.d.ts`, and TypeScript uses the workspace version.
|
|
44
|
+
|
|
45
|
+
## Included extensions
|
|
8
46
|
|
|
9
|
-
- Built-in HTML language support for `.stx` templates
|
|
10
|
-
- [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) - Editor integration for the Pickier configuration
|
|
11
|
-
- [markdownlint](https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint) - Markdown linting
|
|
12
|
-
- [Goto Definition Alias](https://marketplace.visualstudio.com/items?itemName=antfu.goto-definition-alias) - Allows jumping to the definition of an aliased import
|
|
13
|
-
- [NPM Intellisense](https://marketplace.visualstudio.com/items?itemName=christian-kohler.npm-intellisense) - Auto-completes package imports
|
|
14
47
|
- [Bun for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=oven.bun-vscode) - Bun runtime and test integration
|
|
15
|
-
- [Dotenvx](https://marketplace.visualstudio.com/items?itemName=dotenv.dotenvx-vscode) -
|
|
16
|
-
- [
|
|
48
|
+
- [Dotenvx](https://marketplace.visualstudio.com/items?itemName=dotenv.dotenvx-vscode) - encrypted environment file support
|
|
49
|
+
- [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) - editor integration for the project's lint rules
|
|
50
|
+
- [markdownlint](https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint) - Markdown linting
|
|
51
|
+
- [shell-format](https://marketplace.visualstudio.com/items?itemName=foxundermoon.shell-format) - shell script and Dockerfile formatting
|
|
52
|
+
- [Code Spell Checker](https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker) - spell checking with the Stacks dictionary
|
|
53
|
+
- [Total TypeScript Error Translator](https://marketplace.visualstudio.com/items?itemName=mattpocock.ts-error-translator) - plain-English TypeScript errors
|
|
54
|
+
- [Prettify TypeScript](https://marketplace.visualstudio.com/items?itemName=mylesmurphy.prettify-ts) - readable type hovers
|
|
55
|
+
- [Twoslash Query Comments](https://marketplace.visualstudio.com/items?itemName=Orta.vscode-twoslash-queries) - inline `// ^?` type queries
|
|
56
|
+
- [AWS Toolkit](https://marketplace.visualstudio.com/items?itemName=amazonwebservices.aws-toolkit-vscode) - the AWS resources `buddy deploy` creates
|
|
17
57
|
|
|
18
|
-
|
|
58
|
+
Some extensions were dropped from the pack because VS Code now does the same thing itself:
|
|
19
59
|
|
|
20
|
-
|
|
60
|
+
- **Goto Definition Alias**: built-in **Go to Source Definition**, which this extension enables by default.
|
|
61
|
+
- **npm Intellisense**: TypeScript's built-in package import completions.
|
|
62
|
+
- **DotENV**: VS Code's built-in `dotenv` language highlights `.env` and `.env.*` files.
|
|
63
|
+
- **Gremlins**: built-in Unicode highlighting (`editor.unicodeHighlight.*`) flags invisible and confusable characters.
|
|
21
64
|
|
|
22
|
-
##
|
|
65
|
+
## Development
|
|
23
66
|
|
|
24
67
|
```bash
|
|
25
|
-
bun run
|
|
26
|
-
|
|
68
|
+
bun run build # bundle src/ into dist/extension.js
|
|
69
|
+
bun test ./tests # unit tests for URL detection, `buddy list` parsing and the commands
|
|
70
|
+
bun run typecheck
|
|
71
|
+
bun run package # build and create a .vsix
|
|
72
|
+
code --install-extension vscode-stacks-<version>.vsix
|
|
27
73
|
```
|
|
28
74
|
|
|
29
|
-
|
|
75
|
+
The extension has no runtime dependencies. It is published automatically by the Stacks release workflow, and `vscode:prepublish` builds `dist/` first.
|
|
30
76
|
|
|
31
|
-
## Relevant
|
|
77
|
+
## Relevant links
|
|
32
78
|
|
|
33
79
|
- [GitHub](https://github.com/stacksjs/stacks)
|
|
34
80
|
- [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=stacks.vscode-stacks)
|
|
35
|
-
|
|
36
|
-
**Enjoy!**
|
|
81
|
+
- [IDE setup guide](https://stacksjs.com/docs/bootcamp/how-to/ide-setup)
|
package/ide/vscode/package.json
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
"publisher": "Stacks",
|
|
3
3
|
"name": "vscode-stacks",
|
|
4
4
|
"displayName": "Stacks",
|
|
5
|
-
"version": "0.75.
|
|
6
|
-
"description": "
|
|
5
|
+
"version": "0.75.41",
|
|
6
|
+
"description": "Develop Stacks apps without leaving VS Code: preview the dev server in the Simple Browser, start it, and run any buddy command.",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"funding": "https://github.com/sponsors/chrisbbreuer",
|
|
9
9
|
"sponsor": {
|
|
@@ -21,35 +21,129 @@
|
|
|
21
21
|
"keywords": [
|
|
22
22
|
"stacks",
|
|
23
23
|
"stacksjs",
|
|
24
|
-
"
|
|
25
|
-
"
|
|
24
|
+
"buddy",
|
|
25
|
+
"preview",
|
|
26
|
+
"simple browser",
|
|
27
|
+
"dev server",
|
|
28
|
+
"extension pack"
|
|
26
29
|
],
|
|
27
30
|
"categories": [
|
|
28
|
-
"Extension Packs"
|
|
31
|
+
"Extension Packs",
|
|
32
|
+
"Other"
|
|
29
33
|
],
|
|
30
34
|
"icon": "logo.png",
|
|
35
|
+
"main": "./dist/extension.js",
|
|
31
36
|
"files": [
|
|
32
37
|
".vscode/extensions.json",
|
|
33
38
|
".vscode/settings.json",
|
|
34
39
|
".vscode/stacks.code-snippets",
|
|
40
|
+
"dist/extension.js",
|
|
35
41
|
"LICENSE.md",
|
|
42
|
+
"README.md",
|
|
36
43
|
"logo.png"
|
|
37
44
|
],
|
|
38
45
|
"engines": {
|
|
39
46
|
"vscode": "^1.109.5"
|
|
40
47
|
},
|
|
48
|
+
"extensionKind": [
|
|
49
|
+
"workspace"
|
|
50
|
+
],
|
|
51
|
+
"activationEvents": [
|
|
52
|
+
"workspaceContains:buddy",
|
|
53
|
+
"workspaceContains:config/app.ts"
|
|
54
|
+
],
|
|
55
|
+
"capabilities": {
|
|
56
|
+
"untrustedWorkspaces": {
|
|
57
|
+
"supported": false,
|
|
58
|
+
"description": "The Stacks commands run the workspace's own ./buddy script, so they need a trusted workspace."
|
|
59
|
+
},
|
|
60
|
+
"virtualWorkspaces": false
|
|
61
|
+
},
|
|
41
62
|
"scripts": {
|
|
42
|
-
"
|
|
43
|
-
"
|
|
63
|
+
"build": "bun build ./src/extension.ts --outdir dist --target node --format cjs --external vscode",
|
|
64
|
+
"vscode:prepublish": "bun run build",
|
|
65
|
+
"test": "bun test ./tests",
|
|
66
|
+
"typecheck": "bun x --bun tsc --noEmit -p tsconfig.json",
|
|
67
|
+
"package": "bunx --bun vsce package --no-dependencies",
|
|
68
|
+
"release": "bunx --bun vsce publish --no-dependencies"
|
|
44
69
|
},
|
|
45
70
|
"galleryBanner": {
|
|
46
71
|
"color": "#d7e4f5",
|
|
47
72
|
"theme": "light"
|
|
48
73
|
},
|
|
49
74
|
"contributes": {
|
|
75
|
+
"commands": [
|
|
76
|
+
{
|
|
77
|
+
"command": "stacks.openPreview",
|
|
78
|
+
"title": "Open Preview",
|
|
79
|
+
"category": "Stacks",
|
|
80
|
+
"icon": "$(globe)"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"command": "stacks.startDevServer",
|
|
84
|
+
"title": "Start Dev Server",
|
|
85
|
+
"category": "Stacks",
|
|
86
|
+
"icon": "$(play)"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"command": "stacks.runBuddyCommand",
|
|
90
|
+
"title": "Run Buddy Command...",
|
|
91
|
+
"category": "Stacks",
|
|
92
|
+
"icon": "$(terminal)"
|
|
93
|
+
}
|
|
94
|
+
],
|
|
95
|
+
"menus": {
|
|
96
|
+
"commandPalette": [
|
|
97
|
+
{
|
|
98
|
+
"command": "stacks.openPreview",
|
|
99
|
+
"when": "stacks.isProject"
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"command": "stacks.startDevServer",
|
|
103
|
+
"when": "stacks.isProject"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"command": "stacks.runBuddyCommand",
|
|
107
|
+
"when": "stacks.isProject"
|
|
108
|
+
}
|
|
109
|
+
]
|
|
110
|
+
},
|
|
111
|
+
"configuration": {
|
|
112
|
+
"title": "Stacks",
|
|
113
|
+
"properties": {
|
|
114
|
+
"stacks.preview.url": {
|
|
115
|
+
"type": "string",
|
|
116
|
+
"default": "",
|
|
117
|
+
"markdownDescription": "URL `Stacks: Open Preview` always opens, e.g. `http://localhost:3000/dashboard`. Leave empty to find the running dev server the way `./buddy dev` picks its URL (`APP_URL`, `PORT`, `APP_PATH`)."
|
|
118
|
+
},
|
|
119
|
+
"stacks.preview.preferLocalhost": {
|
|
120
|
+
"type": "boolean",
|
|
121
|
+
"default": false,
|
|
122
|
+
"markdownDescription": "Preview `http://localhost:<PORT>` even when `APP_URL` gives the app a pretty `https://` domain. Useful when the local certificate is not trusted, which leaves the Simple Browser blank."
|
|
123
|
+
},
|
|
124
|
+
"stacks.devServer.args": {
|
|
125
|
+
"type": "array",
|
|
126
|
+
"items": {
|
|
127
|
+
"type": "string"
|
|
128
|
+
},
|
|
129
|
+
"default": [],
|
|
130
|
+
"markdownDescription": "Extra arguments for `./buddy dev`, e.g. `[\"frontend\"]` or `[\"--site\"]`. They are passed to the shell as written."
|
|
131
|
+
},
|
|
132
|
+
"stacks.devServer.openPreview": {
|
|
133
|
+
"type": "boolean",
|
|
134
|
+
"default": true,
|
|
135
|
+
"markdownDescription": "Open the preview in the Simple Browser once `Stacks: Start Dev Server` is up, instead of letting `./buddy dev` open the system browser."
|
|
136
|
+
},
|
|
137
|
+
"stacks.statusBar.enabled": {
|
|
138
|
+
"type": "boolean",
|
|
139
|
+
"default": true,
|
|
140
|
+
"description": "Show the Stacks item in the status bar, which opens the preview."
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
},
|
|
50
144
|
"configurationDefaults": {
|
|
51
145
|
"files.associations": {
|
|
52
|
-
"buddy": "
|
|
146
|
+
"buddy": "shellscript",
|
|
53
147
|
"*.stx": "html"
|
|
54
148
|
},
|
|
55
149
|
"npm.packageManager": "bun",
|
|
@@ -60,15 +154,11 @@
|
|
|
60
154
|
"extensionPack": [
|
|
61
155
|
"dotenv.dotenvx-vscode",
|
|
62
156
|
"amazonwebservices.aws-toolkit-vscode",
|
|
63
|
-
"antfu.goto-alias",
|
|
64
157
|
"dbaeumer.vscode-eslint",
|
|
65
|
-
"christian-kohler.npm-intellisense",
|
|
66
158
|
"davidanson.vscode-markdownlint",
|
|
67
159
|
"foxundermoon.shell-format",
|
|
68
160
|
"mattpocock.ts-error-translator",
|
|
69
|
-
"mikestead.dotenv",
|
|
70
161
|
"mylesmurphy.prettify-ts",
|
|
71
|
-
"nhoizey.gremlins",
|
|
72
162
|
"Orta.vscode-twoslash-queries",
|
|
73
163
|
"oven.bun-vscode",
|
|
74
164
|
"streetsidesoftware.code-spell-checker"
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The extension entry VS Code loads (`main` in package.json, bundled to
|
|
3
|
+
* dist/extension.js). It only wires the real machine into the controller in
|
|
4
|
+
* ./stacks.ts; the behavior lives there and in ./project.ts.
|
|
5
|
+
*/
|
|
6
|
+
import type { Host } from './stacks'
|
|
7
|
+
import { execFile } from 'node:child_process'
|
|
8
|
+
import { existsSync, readFileSync } from 'node:fs'
|
|
9
|
+
import { connect } from 'node:net'
|
|
10
|
+
import * as vscode from 'vscode'
|
|
11
|
+
import { createStacksExtension } from './stacks'
|
|
12
|
+
|
|
13
|
+
const PROBE_TIMEOUT_MS = 500
|
|
14
|
+
|
|
15
|
+
const host: Host = {
|
|
16
|
+
exists: path => existsSync(path),
|
|
17
|
+
|
|
18
|
+
read(path) {
|
|
19
|
+
try {
|
|
20
|
+
return readFileSync(path, 'utf8')
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
return undefined
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
exec(file, args, cwd) {
|
|
28
|
+
return new Promise((resolve, reject) => {
|
|
29
|
+
execFile(file, args, {
|
|
30
|
+
cwd,
|
|
31
|
+
timeout: 60_000,
|
|
32
|
+
maxBuffer: 32 * 1024 * 1024,
|
|
33
|
+
env: { ...process.env, NO_COLOR: '1', FORCE_COLOR: '0' },
|
|
34
|
+
}, (error, stdout) => error ? reject(error) : resolve(String(stdout)))
|
|
35
|
+
})
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
probe(hostname, port) {
|
|
39
|
+
return new Promise((resolve) => {
|
|
40
|
+
const socket = connect({ host: hostname, port })
|
|
41
|
+
const finish = (open: boolean) => {
|
|
42
|
+
socket.destroy()
|
|
43
|
+
resolve(open)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
socket.setTimeout(PROBE_TIMEOUT_MS)
|
|
47
|
+
socket.once('connect', () => finish(true))
|
|
48
|
+
socket.once('timeout', () => finish(false))
|
|
49
|
+
socket.once('error', () => finish(false))
|
|
50
|
+
})
|
|
51
|
+
},
|
|
52
|
+
|
|
53
|
+
sleep: ms => new Promise(resolve => setTimeout(resolve, ms)),
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const extension = createStacksExtension(vscode, host)
|
|
57
|
+
|
|
58
|
+
export const activate = extension.activate
|
|
59
|
+
export const deactivate = extension.deactivate
|