* DONE upgrade rescript


* DONE pass ci


* TODO add package assemble


** DONE add package assemble

# pass compile

# pass bdd test


** DONE commit


** DONE implement generatePackage

change isStart to extension type:

fix convertAllFileData

** DONE implement loadPackage

** DONE commit

** DONE convertAllFileData support packages
** DONE generate support packages

** DONE commit



** DONE package assemble: add Packages, Selected Packages

pass compile

** DONE pass bdd test




** DONE implement publishPackage, getAllPublishPackageInfos, getAllPublishPackageEntryExtensionProtocols, findPackage

publishPackage:
entry extension protocol data:name, version
name,
version,
account


getAllPublishPackageInfos:
entryExtensionProtocolName,
entryExtensionProtocolVersion



findPackage:

return binaryFile




getAllPublishPackageEntryExtensionProtocols:






** DONE pass compile

** DONE pass bdd test

** DONE commit


** DONE fix publishPackage, getAllPublishPackageInfos

** DONE pass bdd test

** DONE finish PackageShop

pass draft

** DONE fix PublishPackage

*** DONE pass draft


*** DONE pass compile


** DONE frontend: pass compile


** DONE assemble-space: pass bdd test


** DONE implement downloadPackage

# draft

# compile

# bdd test
# pacakge_manager.steps add case one



# provide meta3d sdk repo

# run test



** DONE frontend: pass run test

test cloudbase


*** DONE publish package


*** DONE download package

load bug?

download bug?





# test 4everland


# *** TODO publish package


# *** TODO download package



** DONE ap assemble: add Packages, Selected Packages

** DONE pass bdd test

** DONE pass run test

** DONE ap assemble: update publish app

*** DONE pass bdd test

# publish app

////element visual

////run element

** DONE pass run test: ap use two packages(package2 use package1)


# test run package

# TODO fix


TODO rename 
export let getExtensionLife: getLifeMeta3D<service> = (api, extensionName) => {

*** DONE fix: not check dependency for generate package

ExtensionManager: use extension/contribute protocol name instead of name
    register extension/contribute protocol name


# fix meta3d:
# pass bdd test

# fix platform, assemble-space -> service.meta3d->extension/contribute name to protocol name

# loadPackage

generateExtension

fix backend, services -> service.meta3d->extension/contribute name to protocol name

** DONE pass run test: element use two packages(package2 use package1)


** DONE remove newName

PacakgeAssemble remove newName,
...

# pass meta3d


# pass assemble


# pass front


# pass backend


# pass service


# pass run test


** DONE refactor: remove entryExtensionName

# ** TODO change to startExtensionProtocolNames
# ** TODO change to entryExtensionProtocolNames

** DONE refactor: remove duplicate between package assemble and ap assemble






** TODO build like ap assemble

package is a collection, encapuslate by entry extension:
package = one entry extension + other extensions + contributes





no start extension, canvas


分为内部依赖和外部依赖

entry extension:
provide api, e.g. 
type service = 
    director: {
        getState: get engine state from meta3dState,
        setState,
        init,
        ...
    },
    gameObject:{
        create,
        ...
    }

# set outer dependency, e.g.
#     set meta3dPipelineWebGPUTriangleContributeName




如果入口扩展依赖的扩展和共享在该file中，则使用它们，并对外隐藏这些依赖；否则还是依赖于外部的扩展和共享！



shop:
# 选择到应用装配
# 选择到包装配
remain 选择


Extensions
Contributes
Packages


Selected Extensions
    mark Entry Extension
Selected Contributes

Selected Packages




meta3d:
# generateExtensionPackage
generatePackage
    like generateApp
        use entry extension instead of start extension

downloadPackage

    loadPackage
       register extensions, contributes
    #    return entry extension name, so can get its service by getExtensionService
    #    return entry extension name, so can get its service and set outer dependency by getPackageService(entry extension name, outer dependency data)
    #         set outer dependency, e.g.
    #             set meta3dPipelineWebGPUTriangleContributeName
       return entry extension name, so can get its service by getExtensionService(entry extension name)
            package outer dependency use registered extensions, contributes

       set entry extension name to dependency extension name map



so load multiple packages, then get their service and handle!
load packages contain same protocols will overwrite ones before!




use in ap assemble:

add Packages;

# loadPackage
#     set entry extension name to dependency extension name map

# extension can use package service by getExtensionService(entry extension name)

# package outer dependency use registered extensions, contributes

generateApp: add package to arrayBuffer

loadApp: load package to register all extensions(include entry extension), contributes


publishApp:
check dependency for package






service:
# publishExtensionPackage
publishPackage
    no config, only publish








** TODO publish

need protocol?
    use entry extension protocol?


*** TODO add extension package shop

show in extension package shop



** TODO download

use in local as webpack file


# ** TODO use one package by another package


** TODO use in ap

use like a extension




# ** TODO run test


# *** TODO build engine package, use in ap to draw a triangle by webgpu





# * TODO refactor
# ** TODO Index show Meta3d version and info without login







* DONE publish


** DONE test in pro

# ** TODO clear local env data

** DONE fix website: remove "用户数据归用户所有"