3.3.3
CLI Changes
To serve addon you can use one of the next examples:
lost serve
- Runs web server with default port "65432".
lost serve --port "{your_port}"
- Runs web serve with specifix port.
To create new Lost project by using bare bones you can use one of the next examples:
lost create --type "plugin"
OR
lost create --type "drawing-plugin"
OR
lost create --type "behavior"
Framework changes
setRuntimeScripts
method was reworked for both forplugin
ANDbehavior
addon types. Now you can use this method for changing script dependency from 'external-dom-script' to 'external-runtime-script' for files and directories inside./Scripts
folder. When you are settingtype
field to
type: 'directory'
All of your .js
AND .ts
scripts dependency type will be set to 'external-runtime-scripts'
Example
import { defineAddon, Plugin, Property } from '../../mod.ts';
import type { EditorInstance } from '@Editor/Instance.ts';
import type { EditorType } from '@Editor/Type.ts';
import config from './lost.config.ts';
export default defineAddon(
new Plugin<EditorInstance, EditorType>(config)
/** @Settings */
.setRuntimeScripts(
{ type: 'directory', path: 'runtimeScripts' },
{ type: 'file', path: 'test.js' }
)
/** @Properties */
)
setRemoteScripts
method was reworked for both forplugin
ANDbehavior
addon types. You can use this method as previously but now you have an ability to setscriptType
to 'module' for your remote script
Example
import { defineAddon, Plugin, Property } from '../../mod.ts';
import type { EditorInstance } from '@Editor/Instance.ts';
import type { EditorType } from '@Editor/Type.ts';
import config from './lost.config.ts';
export default defineAddon(
new Plugin<EditorInstance, EditorType>(config)
/** @Settings */
.addRemoteScripts(
{ url: 'https://myremoteurl.com/script.js'},
{ url: 'https://myremoteurl.com/script2.js', type: 'module' },
)
/** @Properties */
)