Skip to content

Conversation

@kylebyrne
Copy link
Contributor

No description provided.

DevServer will be whats run by theme developers to sync files to their
themes when they're developing.
This implements a Watcher which listens for changes and uses Observable
to allow observers to act on those changes, we will implement a
watchlist that decides which files should be listened to and an uploader
which uploads changes to the app
We make use of a PStore to maintain config in a file at the root of the
directory.
We create a new `/.canvas/` directory if it doesn't exist and maintain a
`config.pstore` file there. We implement some basic manipulation methods
on this for easy setting and getting
This is a bit hacky as far as test go but we add an integration which
shows how we can now monitor linked files for changes and act upon that
This uses the GlobalConfig PStore to save your auth details in your home
directory.
Previously this was from when we had the concept of linking certain
files, now we just want to listen to every change
This class will post to the easol platform for each file change, we can
then check this on our side and update the files accordingly

For now I've just hardcoded in our local dev url
This lets us scope the files we're linting to those specified in the
command line call, e.g.

```
canvas lint blocks/gallery/block.html
```
I'm not proud of the code here, but cli ui sucks and makes outputting
stuff a pain in the ass.
What this does is effectively just run the linter on the changed file
before we sync it, most of the changes are just making the canvas gem
not output so that we can manage in the context of the new spin group or
something?
We might not get JSON back so we dont force it, we just rescue this for
now
Using this we can move to actually using the correct subdomain and
site_id in our client posting
kylebyrne and others added 13 commits December 7, 2022 14:45
We now need the ability to set values within a local config as well as
read them
On the `canvas dev` command, this will create a dev site by POSTing
to /canvas_api/dev_sites and then polling GET /canvas_api/dev_sites
until it has succeeded in duplicating the company's published site.
When running the canvas `dev command`, we want to sync files
with the API that have changes compared to what is on the git repo
and therefore what will be on the company's dev site.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants