-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(chore: update package.json->meta3d:publish_dev_auto script)
- Loading branch information
Showing
128 changed files
with
743 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
.DS_Store | ||
.merlin | ||
.idea/ | ||
.vscode/ | ||
jest_0/ | ||
reference/ | ||
node_modules/ | ||
mine/ | ||
|
||
coverage | ||
|
||
dist/ | ||
|
||
npm-debug | ||
|
||
.bsb.lock | ||
|
||
yarn.lock | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
var gulp = require("gulp"); | ||
var path = require("path"); | ||
var publish = require("meta3d-tool-publish") | ||
|
||
gulp.task("publish_local_env", function (done) { | ||
publish.publishContribute( | ||
"local", | ||
path.join(__dirname, "package.json"), | ||
path.join(__dirname, "dist/static/js", "main.js") | ||
).then(() => { | ||
done() | ||
}) | ||
}); | ||
|
||
gulp.task("publish_production_env", function (done) { | ||
publish.publishContribute( | ||
"production", | ||
path.join(__dirname, "package.json"), | ||
path.join(__dirname, "dist/static/js", "main.js") | ||
).then(() => { | ||
done() | ||
}) | ||
}); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import { getContribute as getContributeMeta3D, state as meta3dState } from "meta3d-type" | ||
import { inputFunc, specificData, outputData, uiControlName, menuLabel, actionName, state } from "meta3d-ui-control-menu-protocol" | ||
import { service, uiControlContribute } from "meta3d-editor-whole-protocol/src/service/ServiceType" | ||
import type { Map } from "immutable" | ||
|
||
export let getContribute: getContributeMeta3D<uiControlContribute<inputFunc, specificData, outputData>> = (api) => { | ||
return { | ||
uiControlName: uiControlName, | ||
func: (meta3dState, | ||
_, | ||
{ | ||
rect, | ||
label, | ||
items | ||
} | ||
) => { | ||
let { menu } = api.nullable.getExn(api.getPackageService<service>(meta3dState, "meta3d-editor-whole-protocol")).ui(meta3dState) | ||
|
||
// let items: Array<[menuLabel, Record<menuLabel, string>]> = [ | ||
// [ | ||
// "编辑", | ||
// { | ||
// "导出事件": exportEventActionName, | ||
// "导出单一事件": exportSingleEventActionName, | ||
// "导入事件": importEventActionName | ||
// } | ||
// ], | ||
// [ | ||
// "发布", | ||
// { | ||
// "本地包": publishActionName | ||
// } | ||
// ], | ||
// [ | ||
// "帮助", | ||
// { | ||
// "关于Meta3D": jumpToLinkActionName | ||
// } | ||
// ], | ||
// ] | ||
|
||
console.log( | ||
rect, | ||
label, | ||
items | ||
|
||
) | ||
|
||
let data = menu(meta3dState, items.map(([label, secondLevelData]) => [ | ||
label, | ||
api.immutable.createMapOfData(meta3dState, secondLevelData).keySeq().toArray() | ||
]), "Menu Window", rect) | ||
meta3dState = data[0] | ||
let selectItemLabel = data[1] | ||
|
||
if (api.nullable.isNullable(selectItemLabel)) { | ||
return Promise.resolve([meta3dState, null]) | ||
} | ||
|
||
selectItemLabel = api.nullable.getExn(selectItemLabel) | ||
|
||
let actionNameMap: Map<menuLabel, actionName> = items.map(([_, secondLevelData]) => api.immutable.createMapOfData(meta3dState, secondLevelData) | ||
).reduce((result, map) => { | ||
return result.concat(map) | ||
}, api.immutable.createMap(meta3dState)) | ||
|
||
let { trigger } = api.nullable.getExn(api.getPackageService<service>(meta3dState, "meta3d-editor-whole-protocol")).event(meta3dState) | ||
|
||
return trigger(meta3dState, "meta3d-event-protocol", api.nullable.getExn(actionNameMap.get(selectItemLabel)), null).then(meta3dState => [meta3dState, null]) | ||
}, | ||
init: (meta3dState) => Promise.resolve(meta3dState) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "ES6", | ||
"module": "ES6", | ||
"moduleResolution": "node", | ||
"sourceMap": true, | ||
"resolveJsonModule": true, | ||
"esModuleInterop": true, | ||
"jsx": "react", | ||
// "noEmit": true, | ||
// "noUnusedLocals": true, | ||
// "noUnusedParameters": true, | ||
"noImplicitReturns": true, | ||
"lib": [ | ||
"DOM", | ||
"ESNext", | ||
], | ||
"types": [], | ||
"strict": true | ||
}, | ||
"include": [ | ||
"./src" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
const path = require('path'); | ||
const { CleanWebpackPlugin } = require('clean-webpack-plugin'); | ||
|
||
module.exports = { | ||
entry: "./src/Main.ts", | ||
mode: process.env.NODE_ENV.trim() == 'production' ? 'production' : 'development', | ||
output: { | ||
path: path.resolve(__dirname, 'dist'), | ||
filename: 'static/js/[name].js', | ||
library: { | ||
name: 'Contribute', | ||
type: 'window', | ||
}, | ||
}, | ||
|
||
// Enable sourcemaps for debugging webpack's output. | ||
// devtool: "source-map", | ||
|
||
resolve: { | ||
extensions: ['.ts', '.tsx', '.js', '.jsx', '.scss'], | ||
modules: ['node_modules'] | ||
}, | ||
|
||
module: { | ||
rules: [ | ||
// All files with a '.ts' or '.tsx' extension will be handled by 'awesome-typescript-loader'. | ||
{ | ||
test: /\.tsx?$/, | ||
exclude: /node_modules/, | ||
use: "ts-loader" | ||
}, | ||
// All output '.js' files will have any sourcemaps re-processed by 'source-map-loader'. | ||
{ | ||
enforce: 'pre', | ||
test: /\.js$/, | ||
loader: "source-map-loader" | ||
}, | ||
] | ||
}, | ||
plugins: [ | ||
/** | ||
* All files inside webpack's output.path directory will be removed once, but the | ||
* directory itself will not be. If using webpack 4+'s default configuration, | ||
* everything under <PROJECT_DIR>/dist/ will be removed. | ||
* Use cleanOnceBeforeBuildPatterns to override this behavior. | ||
* | ||
* During rebuilds, all webpack assets that are not used anymore | ||
* will be removed automatically. | ||
* | ||
* See `Options and Defaults` for information | ||
*/ | ||
new CleanWebpackPlugin(), | ||
// new HtmlWebpackPlugin({ | ||
// template: './user.html', | ||
// filename: 'user.html', | ||
// }), | ||
], | ||
// When importing a module whose path matches one of the following, just | ||
// assume a corresponding global variable exists and use that instead. | ||
// This is important because it allows us to avoid bundling all of our | ||
// dependencies, which allows browsers to cache those libraries between builds. | ||
externals: { | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.