Skip to content

Commit 7821914

Browse files
breck7Breck Yunits
andauthored
Rename Tree Notation to Scroll Notation and jtree to scrollsdk (breck7#183)
* checkpoint * checkpoint * checkpoint * checkpoint * checkpoint * checkpoint * checkpoint * checkpoint --------- Co-authored-by: Breck Yunits <[email protected]>
1 parent 8b709fc commit 7821914

File tree

103 files changed

+705
-760
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+705
-760
lines changed

CNAME

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
jtree.treenotation.org
1+
sdk.scroll.pub

builder.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ const { execSync } = require("child_process")
1313
const express = require("express")
1414
const prettierConfig = require("./package.json").prettier
1515

16-
import { treeNotationTypes } from "./products/treeNotationTypes"
16+
import { scrollNotationTypes } from "./products/scrollNotationTypes"
1717

1818
// todo: remove?
19-
const registeredExtensions: treeNotationTypes.stringMap = { js: "//", maia: "doc.tooling ", ts: "//", grammar: "tooling ", gram: "tooling " }
19+
const registeredExtensions: scrollNotationTypes.stringMap = { js: "//", maia: "doc.tooling ", ts: "//", grammar: "tooling ", gram: "tooling " }
2020

2121
class Builder extends TreeNode {
2222
private _typeScriptToJavascript(sourceCode: string, forBrowser = false) {
@@ -36,7 +36,7 @@ class Builder extends TreeNode {
3636
return result.outputText
3737
}
3838

39-
private _combineTypeScriptFilesForNode(typeScriptScriptsInOrder: treeNotationTypes.typeScriptFilePath[]) {
39+
private _combineTypeScriptFilesForNode(typeScriptScriptsInOrder: scrollNotationTypes.typeScriptFilePath[]) {
4040
// todo: prettify
4141
return typeScriptScriptsInOrder
4242
.map(src => Disk.read(src))
@@ -51,11 +51,11 @@ class Builder extends TreeNode {
5151
.join("\n")
5252
}
5353

54-
private _prettifyFile(path: treeNotationTypes.filepath) {
54+
private _prettifyFile(path: scrollNotationTypes.filepath) {
5555
Disk.write(path, require("prettier").format(Disk.read(path), prettierConfig))
5656
}
5757

58-
private _combineTypeScriptFilesForBrowser(typeScriptScriptsInOrder: treeNotationTypes.typeScriptFilePath[]) {
58+
private _combineTypeScriptFilesForBrowser(typeScriptScriptsInOrder: scrollNotationTypes.typeScriptFilePath[]) {
5959
return typeScriptScriptsInOrder
6060
.map(src => Disk.read(src))
6161
.map(content => new TypeScriptRewriter(content).removeRequires().removeImports().removeTsGeneratedCrap().removeHashBang().removeNodeJsOnlyLines().changeDefaultExportsToWindowExports().removeExports().getString())
@@ -66,7 +66,7 @@ class Builder extends TreeNode {
6666
Disk.write(outputFilePath, this._typeScriptToJavascript(sourceCode, forBrowser))
6767
}
6868

69-
protected _startServer(port: treeNotationTypes.portNumber, folder: string) {
69+
protected _startServer(port: scrollNotationTypes.portNumber, folder: string) {
7070
const app = express()
7171
app.listen(port, () => {
7272
console.log(`Running builder. cmd+dblclick: http://localhost:${port}/`)
@@ -122,7 +122,7 @@ class Builder extends TreeNode {
122122
const projectFolders = [folder] // todo
123123

124124
this._fsWatchers = projectFolders.map(folder =>
125-
fs.watch(folder, { recursive: true }, (event: any, filename: treeNotationTypes.fileName) => {
125+
fs.watch(folder, { recursive: true }, (event: any, filename: scrollNotationTypes.fileName) => {
126126
this._onFileChanged(folder + filename)
127127
})
128128
)
@@ -133,7 +133,7 @@ class Builder extends TreeNode {
133133
return path.join(__dirname, "products", outputFileName)
134134
}
135135

136-
async _produceBrowserProductFromTypeScript(files: treeNotationTypes.absoluteFilePath[] = [], outputFileName: treeNotationTypes.fileName, transformFn: (code: treeNotationTypes.javascriptCode) => string) {
136+
async _produceBrowserProductFromTypeScript(files: scrollNotationTypes.absoluteFilePath[] = [], outputFileName: scrollNotationTypes.fileName, transformFn: (code: scrollNotationTypes.javascriptCode) => string) {
137137
const outputFilePath = this._getOutputFilePath(outputFileName)
138138
await this._buildTsc(this._combineTypeScriptFilesForBrowser(files), outputFilePath, true)
139139
Disk.write(outputFilePath, transformFn(Disk.read(outputFilePath)))
@@ -158,11 +158,11 @@ class Builder extends TreeNode {
158158
if (productNode.has("executable")) Disk.makeExecutable(path.join(projectRootPath, "products", outputFileName))
159159
}
160160

161-
_getBundleFilePath(outputFileName: treeNotationTypes.fileName) {
161+
_getBundleFilePath(outputFileName: scrollNotationTypes.fileName) {
162162
return this._getProductFolder() + `${outputFileName.replace(".js", ".ts")}`
163163
}
164164

165-
async _produceNodeProductFromTypeScript(files: treeNotationTypes.absoluteFilePath[], outputFileName: treeNotationTypes.fileName, transformFn: (code: treeNotationTypes.javascriptCode) => string) {
165+
async _produceNodeProductFromTypeScript(files: scrollNotationTypes.absoluteFilePath[], outputFileName: scrollNotationTypes.fileName, transformFn: (code: scrollNotationTypes.javascriptCode) => string) {
166166
const outputFilePath = this._getOutputFilePath(outputFileName)
167167

168168
try {
@@ -176,7 +176,7 @@ class Builder extends TreeNode {
176176
return outputFilePath
177177
}
178178

179-
protected _updatePackageJson(packagePath: treeNotationTypes.filepath, newVersion: treeNotationTypes.semanticVersion) {
179+
protected _updatePackageJson(packagePath: scrollNotationTypes.filepath, newVersion: scrollNotationTypes.semanticVersion) {
180180
const packageJson = Disk.readJson(packagePath)
181181
packageJson.version = newVersion
182182
Disk.writeJson(packagePath, packageJson)
@@ -187,7 +187,7 @@ class Builder extends TreeNode {
187187
this._buildTsc(Disk.read(__filename), path.join(__dirname, "builder.js"))
188188
}
189189

190-
makeGrammarFileTestTree(grammarPath: treeNotationTypes.grammarFilePath) {
190+
makeGrammarFileTestTree(grammarPath: scrollNotationTypes.grammarFilePath) {
191191
// todo: can we ditch these dual tests at some point? ideally Grammar should be bootstrapped correct?
192192
const testTree: any = {}
193193
const checkGrammarFile = (equal: Function, program: any) => {
@@ -276,7 +276,7 @@ class Builder extends TreeNode {
276276
return path.join(__dirname, "products")
277277
}
278278

279-
updateVersion(newVersion: treeNotationTypes.semanticVersion) {
279+
updateVersion(newVersion: scrollNotationTypes.semanticVersion) {
280280
this._updatePackageJson(__dirname + "/package.json", newVersion)
281281

282282
const codePath = __dirname + "/treeNode/TreeNode.ts"
@@ -291,7 +291,7 @@ class Builder extends TreeNode {
291291
this._startServer(9999, __dirname + "/")
292292
}
293293

294-
_makeTestTreeForFolder(dir: treeNotationTypes.absoluteFolderPath) {
294+
_makeTestTreeForFolder(dir: scrollNotationTypes.absoluteFolderPath) {
295295
const allTestFiles: string[] = Disk.recursiveReaddirSyncSimple(dir)
296296
const swarm = require("./products/swarm.nodejs.js")
297297

ciBadges.scroll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
importOnly
2-
html <a href="https://github.com/publicdomaincompany/jtree/actions/workflows/didTheTestsPass.yaml"><img src="https://github.com/publicdomaincompany/jtree/actions/workflows/didTheTestsPass.yaml/badge.svg" style="width: 49%;"/></a> <a href="https://gitpod.io/#https://github.com/breck7/jtree"><img src="https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod"/ height="20" width="153"></a>
2+
html <a href="https://github.com/breck7/scrollsdk/actions/workflows/didTheTestsPass.yaml"><img src="https://github.com/breck7/scrollsdk/actions/workflows/didTheTestsPass.yaml/badge.svg" style="width: 49%;"/></a> <a href="https://gitpod.io/#https://github.com/scrollsdk"><img src="https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod"/ height="20" width="153"></a>

designer/DesignerApp.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class DesignerApp extends AbstractTreeComponentParser {
6666
willowBrowser.reload()
6767
}
6868

69-
async fetchAndLoadJtreeShippedLanguageCommand(name: string) {
69+
async fetchAndLoadScrollSDKShippedLanguageCommand(name: string) {
7070
const samplePath = `/langs/${name}/sample.${name}`
7171
const grammarPath = `/langs/${name}/${name}.grammar`
7272

@@ -166,7 +166,7 @@ class DesignerApp extends AbstractTreeComponentParser {
166166
const programUrl = deepLink.get("programUrl")
167167
if (standard) {
168168
console.log("Loading standard from deep link....")
169-
await this.fetchAndLoadJtreeShippedLanguageCommand(standard)
169+
await this.fetchAndLoadScrollSDKShippedLanguageCommand(standard)
170170
return true
171171
} else if (fromUrl) {
172172
console.log(`Loading grammar from '${fromUrl}'....`)
@@ -451,7 +451,7 @@ class samplesComponent extends AbstractTreeComponentParser {
451451
(lang: string) => ` a ${Utils.ucfirst(lang)}
452452
href #standard%20${lang}
453453
value ${lang}
454-
clickCommand fetchAndLoadJtreeShippedLanguageCommand`
454+
clickCommand fetchAndLoadScrollSDKShippedLanguageCommand`
455455
)
456456
.join("\n span | \n")
457457
return `p
@@ -594,7 +594,7 @@ class tableComponent extends AbstractTreeComponentParser {
594594

595595
class headerComponent extends AbstractTreeComponentParser {
596596
_getTitle() {
597-
return `Tree Language Designer`
597+
return `Scroll Designer`
598598
}
599599
toHakonCode() {
600600
return `#logo
@@ -609,15 +609,15 @@ class headerComponent extends AbstractTreeComponentParser {
609609
return `div
610610
h1
611611
a
612-
href https://treenotation.org
612+
href https://notation.scroll.pub
613613
style text-decoration: none;
614614
img
615615
id logo
616616
src /images/helloWorld3D.svg
617-
title TreeNotation.org
617+
title Notation.Scroll.pub
618618
span ${this._getTitle()}
619619
p
620-
a Tree Notation Sandbox
620+
a Scroll Notation Sandbox
621621
href /sandbox/
622622
span |
623623
a Help
@@ -637,12 +637,12 @@ class headerComponent extends AbstractTreeComponentParser {
637637
id helpSection
638638
style display: none;
639639
p This is a simple web IDE for designing and building Tree Languages. To build a Tree Language, you write code in a "grammar language" in the textarea on the left. You can then write code in your new language in the textarea on the right. You instantly get syntax highlighting, autocomplete, type/cell checking, suggested corrections, and more.
640-
p Click "Newlang" to create a New Language, or explore/edit existing languages. In dev tools, you can access the parsed trees below as "app.grammarProgram" and program at "app.program". We also have a work-in-progress <a href="https://jtree.treenotation.org/grammarTutorial.html">Tutorial for creating new Tree Languages using Grammar</a>.`
640+
p Click "Newlang" to create a New Language, or explore/edit existing languages. In dev tools, you can access the parsed trees below as "app.grammarProgram" and program at "app.program". We also have a work-in-progress <a href="https://sdk.scroll.pub/grammarTutorial.html">Tutorial for creating new Tree Languages using Grammar</a>.`
641641
}
642642
}
643643

644644
class githubTriangleComponent extends AbstractGithubTriangleComponent {
645-
githubLink = `https://github.com/treenotation/jtree/tree/main/designer`
645+
githubLink = `https://github.com/breck7/scrollsdk/tree/main/designer`
646646
}
647647

648648
export { DesignerApp }

designer/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<html>
22
<head>
3-
<title>Tree Language Designer</title>
3+
<title>Scroll Designer</title>
44
</head>
55
<body>
66
<link rel="stylesheet" type="text/css" href="/sandbox/lib/codemirror.css" />

designer/readme.scroll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
title Designer
22

3-
This is the folder containing the source code for the Tree Language Designer web app.
3+
This is the folder containing the source code for the Scroll Designer web app.
44

55
Try it Now
6-
https://jtree.treenotation.org/designer/
6+
https://sdk.scroll.pub/designer/
77

88
# For Designer Developers
99

1010
? How do I run the tests?
1111
code
12-
./jtree/designer/DesignerApp.test.ts
12+
./scrollsdk/designer/DesignerApp.test.ts
1313

1414
? How do I run the Designer locally?
1515
code
16-
cd jtree
16+
cd scrollsdk
1717
npm run local
1818
open http://localhost:3333/designer

0 commit comments

Comments
 (0)