A TreeCode Programming Framework
BaseTree is a cross-platform application framework in development (extreme prototype). It is far from being working, so mainly just a collection of packages with API ideas. The long term goal is to now get this working :).
pnpm add @termsurf/base -g
Ignore the key folders:
/.base # compiled helper folder
/bind # environment variables
/hold # temporary folder
/host # generated content folder
/link # downloaded packages folder
Here is how a monolithic app might be structured:
/.gitignore
/.base
/base.tree
/bind # env variables, don't commit
/test.tree
/base.tree
/work.tree # dev
/moon.tree # staging
/star.tree # prod
/hold # scratchpad/tmp folder
/host
/javascript
/browser
/node
/log # logs
/work.tree # dev logs
/test.tree # test logs
/note # guides
/link
/deck
/form # schema
/code
/user.tree
/line # command line processing
/back # backend
/deck
/site-1
/site-2
/base # REST and webhook handlers
/task # handle API calls
/take
/save
/note # mailers
/work # jobs
/time # cron jobs
/form # schema
/user.tree
/call
/take # query allowance
/rule # policies/permissions
/face # frontend
/deck
/test
/dock # ui components
/vibe # styles/themes
/site-1
/wall # pages
/host
/base.tree
/case.tree
/deck
/base.tree
/case.tree
/text # copy
/kink # errors
/file # public directory
/text # fonts
/view # images
/base # database
/seed # seeding data
/move # migrations
/site # infrastructure
/hold.tree # don't commit this
/move # migrations
/task # dev helpers
/text # copy
/en.tree
/fr.tree
/zh.tree
For libraries, you might only have:
/base.tree
/code
/task
/hold
/host
/link
/note
The package manager and several other components can possibly be swapped out potentially in the future, each just depends on a small interface.
An example of this is the
bead.tree
repo.
const deck = new Deck({ home: '.' })
// save global package
Deck.save()
// remove global package
Deck.toss()
// verify global package
Deck.test()
// link global package
Deck.link()
// install defined packages
deck.load()
// add a package
deck.save({ link, mark, site })
// remove a package
deck.toss({ link, mark, site })
// verify a deck
deck.test({ link, mark, site })
// link a package
deck.link({ link, mark, site })
// resolve file link
deck.find({ file, base })
This is defined by the buck
library.
class Code {
make() {
this.load()
this.mesh()
this.lint()
this.tree()
this.text()
this.bind()
}
bind() {
code.on('file', code.make)
}
// load from the entrypoint of the project
load() {
bead()
buck()
}
// do type-checking, variable resolution, optimizations, etc..
mesh() {
chew.mesh()
}
// do linting and fix up code
lint() {
fish.lint()
}
// make output AST in target language
tree() {
till.make()
}
// write the AST to string
text() {
seal.make()
}
}
An example of this is the
seal.tree
repo.
const host = new Host({ code })
const ts = host.make({ form: 'typescript' })
const rust = host.make({ form: 'rust' })
The output is typed as a standard AST in each language.
- parse mine/mind files (mint)
- parse tree-role file types
- parse chat-talk-link tree
- convert into json
Copyright 2021-2024 TermSurf
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
This is being developed by the folks at TermSurf, a California-based project for helping humanity master information and computation. Find us on Twitter, LinkedIn, and Facebook. Check out our other GitHub projects as well!