Skip to content

3.3.3

Compare
Choose a tag to compare
@dakln dakln released this 14 Dec 04:50
· 8 commits to master since this release

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 for plugin AND behavior 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 setting type 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 for plugin AND behavior addon types. You can use this method as previously but now you have an ability to set scriptType 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 */

)