-
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.
feat(platform): add Input Contribute
pass run test;
- Loading branch information
Showing
137 changed files
with
2,354 additions
and
281 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"name": "meta3d-input-runstopbutton", | ||
"version": "0.20.0", | ||
"publisher": "0xf63e1991A343814EdE505D7cfC368615EAe75307", | ||
"description": "", | ||
"protocol": { | ||
"name": "meta3d-input-runstopbutton-protocol" | ||
}, | ||
"license": "MIT", | ||
"scripts": { | ||
"watch": "tsc -w -noEmit", | ||
"webpack": "webpack --config webpack.config.js", | ||
"meta3d:publish_dev": "cross-env NODE_ENV=development npm run webpack && gulp publish_local_env", | ||
"meta3d:publish_pro": "cross-env NODE_ENV=production npm run webpack && gulp publish_production_env" | ||
}, | ||
"keywords": [], | ||
"dependencies": { | ||
"meta3d-type": "^0.20.0", | ||
"meta3d-input-runstopbutton-protocol": "^0.20.0" | ||
}, | ||
"devDependencies": { | ||
"clean-webpack-plugin": "^4.0.0", | ||
"cross-env": "^7.0.3", | ||
"cz-customizable": "^6.3.0", | ||
"gulp": "^4.0.2", | ||
"meta3d-tool-publish": "^0.20.0", | ||
"source-map-loader": "^3.0.0", | ||
"ts-loader": "^9.2.6", | ||
"typescript": "^4.2.3", | ||
"webpack": "^5.62.1", | ||
"webpack-cli": "^4.9.1" | ||
} | ||
} |
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,23 @@ | ||
import { getContribute as getContributeMeta3D } from "meta3d-type" | ||
import { data } from "meta3d-input-runstopbutton-protocol" | ||
import { inputContribute } from "meta3d-editor-whole-protocol/src/service/ServiceType" | ||
import { getExn, isNullable } from "meta3d-commonlib-ts/src/NullableUtils" | ||
import { actionName as runActionName, state as runState } from "meta3d-action-run-protocol" | ||
import { getActionStateInInput } from "meta3d-ui-utils/src/ElementStateUtils" | ||
|
||
export let getContribute: getContributeMeta3D<inputContribute<data>> = (api) => { | ||
return { | ||
inputName: "RunStopButtonInput", | ||
func: (meta3dState) => { | ||
let runState = getActionStateInInput<runState>(meta3dState, api, runActionName) | ||
|
||
if (isNullable(runState)) { | ||
return Promise.resolve(false) | ||
} | ||
|
||
runState = getExn(runState) | ||
|
||
return Promise.resolve(runState.isRun) | ||
} | ||
} | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"name": "meta3d-input-runstopbutton2", | ||
"version": "0.20.0", | ||
"publisher": "0xf63e1991A343814EdE505D7cfC368615EAe75307", | ||
"description": "", | ||
"protocol": { | ||
"name": "meta3d-input-runstopbutton-protocol" | ||
}, | ||
"license": "MIT", | ||
"scripts": { | ||
"watch": "tsc -w -noEmit", | ||
"webpack": "webpack --config webpack.config.js", | ||
"meta3d:publish_dev": "cross-env NODE_ENV=development npm run webpack && gulp publish_local_env", | ||
"meta3d:publish_pro": "cross-env NODE_ENV=production npm run webpack && gulp publish_production_env" | ||
}, | ||
"keywords": [], | ||
"dependencies": { | ||
"meta3d-type": "^0.20.0", | ||
"meta3d-input-runstopbutton-protocol": "^0.20.0" | ||
}, | ||
"devDependencies": { | ||
"clean-webpack-plugin": "^4.0.0", | ||
"cross-env": "^7.0.3", | ||
"cz-customizable": "^6.3.0", | ||
"gulp": "^4.0.2", | ||
"meta3d-tool-publish": "^0.20.0", | ||
"source-map-loader": "^3.0.0", | ||
"ts-loader": "^9.2.6", | ||
"typescript": "^4.2.3", | ||
"webpack": "^5.62.1", | ||
"webpack-cli": "^4.9.1" | ||
} | ||
} |
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,15 @@ | ||
import { getContribute as getContributeMeta3D } from "meta3d-type" | ||
import { data } from "meta3d-input-runstopbutton-protocol" | ||
import { inputContribute } from "meta3d-editor-whole-protocol/src/service/ServiceType" | ||
import { getExn, isNullable } from "meta3d-commonlib-ts/src/NullableUtils" | ||
import { actionName as runActionName, state as runState } from "meta3d-action-run-protocol" | ||
import { getActionStateInInput } from "meta3d-ui-utils/src/ElementStateUtils" | ||
|
||
export let getContribute: getContributeMeta3D<inputContribute<data>> = (api) => { | ||
return { | ||
inputName: "RunStopButtonInput2", | ||
func: (meta3dState) => { | ||
return Promise.resolve(false) | ||
} | ||
} | ||
} |
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
Oops, something went wrong.