Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A couple of quick tweaks #1401

Merged
merged 1 commit into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 51 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": "0.2.0",
"configurations": [
{
{
"type": "node",
"request": "launch",
"skipFiles": [
Expand Down Expand Up @@ -73,6 +73,56 @@
],
"program": "${workspaceFolder}/node_modules/.bin/matter-run"
},
{
"type": "node",
"request": "launch",
"skipFiles": [
"<node_internals>/**"
],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"runtimeArgs": [
"--enable-source-maps"
],
"outFiles": [
"${workspaceFolder}/**/dist/esm/**/*.js",
"${workspaceFolder}/**/build/esm/**/*.js"
],
"presentation": {
"clear": true
},
"name": "Run shell",
"cwd": "${workspaceFolder}/packages/nodejs-shell",
"args": [
"dist/cjs/app.js"
],
"program": "${workspaceFolder}/node_modules/.bin/matter-run"
},
{
"type": "node",
"request": "launch",
"skipFiles": [
"<node_internals>/**"
],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"runtimeArgs": [
"--enable-source-maps"
],
"outFiles": [
"${workspaceFolder}/**/dist/esm/**/*.js",
"${workspaceFolder}/**/build/esm/**/*.js"
],
"presentation": {
"clear": true
},
"name": "Run CLI tool",
"cwd": "${workspaceFolder}/packages/cli-tool",
"args": [
"bin/matter.js"
],
"program": "${workspaceFolder}/node_modules/.bin/matter-run"
},
{
"type": "node",
"request": "launch",
Expand Down
4 changes: 4 additions & 0 deletions codegen/src/generate-vscode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ addTest({ name: "All tests" });
addTest({ name: "Test current file", args: ["--spec", "${input:testFile}", "--all-logs", "esm"] });
addRun({ name: "Run current file", args: ["${file}"] });

// Generate tool launchers
addRun({ name: "Run shell", cwd: Package.workspace.relative("packages/nodejs-shell"), args: ["dist/cjs/app.js"] });
addRun({ name: "Run CLI tool", cwd: Package.workspace.relative("packages/cli-tool"), args: ["bin/matter.js"] });

// Generate launches for each project that has tests
const graph = await Graph.load();
for (const node of graph.nodes) {
Expand Down
6 changes: 5 additions & 1 deletion packages/model/src/models/Model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,11 @@ export abstract class Model<T extends BaseElement = BaseElement> {
* Convert model to JSON.
*/
toJSON() {
return this.valueOf();
const fields = this.valueOf();
if (this.children.length) {
fields.children = this.children.map(child => child.toJSON());
}
return fields;
}

/**
Expand Down