Skip to content

0.7.7

Latest

Choose a tag to compare

@JanMiksovsky JanMiksovsky released this 03 Dec 20:01

This is a minor release that replaces files: URLs with regular file paths.

Upgrade steps

  1. In your npm build scripts, replace files:build with build/.
  2. If you use files: in your Origami programs (this is rare), remove the files and add a trailing slash.
  3. If you use Protocol.files (rare), replace it with Origami.files.

File system paths can now reference folders that don't exist yet

Previously specifying a folder that might not exist yet required using the files: protocol. For example, build scripts copied to files:build to handle running the script on a new machine where the build folder didn't exist yet.

Folder paths now support trailing slashes. A trailing slash at the end of a file system path indicates that you want a folder, even if that folder or the intermediate folders don't exist yet.

You can still reference a folder without a trailing slash, like path/to/folder, in which case:

  • If path/to/folder exists, this returns a reference to that folder.
  • If the intermediate path or path/to exist but path/to/folder doesn't, this returns undefined.
  • If the intermediate path or path/to don't exist, this throws an exception.

With this change, the standard build script incantation changes to:

ori copy src/site.ori, clear build/

Origami project templates like origami-start and origami-blog-start have had their build scripts updated to the above, so new projects created with them should build the first time without issues.

With this change, the files: protocol is no longer necessary and has been deprecated. A runtime warning will flag any use of files: and recommend using the corresponding path with a trailing slash.

In rare cases you may need to dereference a string that represents a file path. This was previously covered by a builtin called Protocol.files, but going forward that has been renamed to the builtin Origami.files.