Commit b706765a authored by Akari Labs's avatar Akari Labs

use cascade orchestration in userscript

parent e1fa1952
const ui = new (require('gltchrr.ui'))();
const gltchrr = ui.gltchrr;
// expose the control functions through window.gltchrr
window.gltchrr = ui.gltchrr.control;
module.exports = {
ready() {
ui.show();
},
cascade: {
postCtor: [
{
condition: info =>
info.module.exports &&
info.module.exports.default &&
info.module.exports.default.postStatus &&
info.module.exports.default.register,
callback: info => {
const _postStatus = info.module.exports.default.postStatus;
info.module.exports.default.postStatus = e => (e.status = gltchrr.processText(e.status), _postStatus(e));
}
}
]
}
}
\ No newline at end of file
const cascade = require('cascade.webpack');
const ui = new (require('gltchrr.ui'))();
const gltchrr = ui.gltchrr;
// install cascade
cascade.hookWebpack();
// hook postStatus
cascade.postCtor.push({
condition: info =>
info.module.exports &&
info.module.exports.default &&
info.module.exports.default.postStatus &&
info.module.exports.default.register,
callback: info => {
const _postStatus = info.module.exports.default.postStatus;
info.module.exports.default.postStatus = e => (e.status = gltchrr.processText(e.status), _postStatus(e));
}
});
// expose the control functions through window.gltchrr
window.gltchrr = ui.gltchrr.control;
window.onload = () => ui.show();
module.exports = {
ui
}
\ No newline at end of file
{
"name": "gltchrr",
"version": "0.0.1",
"version": "0.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
......@@ -94,18 +94,18 @@
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ="
},
"nanopack": {
"version": "git+https://git.agiri.ninja/lp0/nanopack.git#ab50fe4f706427cd0ed77da5818a7bee65d872b2",
"version": "git+https://git.agiri.ninja/lp0/nanopack.git#2148875150cea81ed57ae8b0929c20644e15e6ca",
"from": "git+https://git.agiri.ninja/lp0/nanopack.git",
"requires": {
"buble": "^0.19.7"
}
},
"nanopack_cascade": {
"version": "git+https://git.agiri.ninja/lp0/cascade-webpack.git#092949ed12da80e791d69caeb70025ef40693dff",
"version": "git+https://git.agiri.ninja/lp0/cascade-webpack.git#5f4c634aa239aed95ac654c39de1bbcf6569df37",
"from": "git+https://git.agiri.ninja/lp0/cascade-webpack.git"
},
"nanopack_kwm": {
"version": "git+https://git.agiri.ninja/lp0/kwm.git#707172a2aa2d4dbb585b86699c6ed0fd5f98a45d",
"version": "git+https://git.agiri.ninja/lp0/kwm.git#e02a586998a6d449e17c3a8279ed50853649edaf",
"from": "git+https://git.agiri.ninja/lp0/kwm.git"
},
"os-homedir": {
......
{
"name": "gltchrr",
"version": "0.0.1",
"version": "0.0.0",
"description": "an artificial text corruption system",
"main": "index.js",
"scripts": {
......
module.exports = () => ({
header: `<!DOCTYPE HTML><html><head><meta charset="utf-8"><script>`,
footer: `</script></head><body><noscript><h1>this page requires javascript, sorry!</h1></noscript></body></html>`,
jsxmodule: 'inertdom',
directories: [
'modules/shared',
'modules/standalone'
],
modules: [
'nanopack_kwm',
'nanopack_cascade'
],
main: ['index'],
output: 'gltchrr.html'
});
\ No newline at end of file
module.exports = () => ({
header: `// ==UserScript==
const target = {};
Object.assign(target, require('./shared.json'));
target.header = `// ==UserScript==
// @name gltchrr for PleromaFE
// @namespace http://akari.vii/
// @version 1.2.0
// @version 1.2.5
// @description g̴̐͋litcc̣̟̭̿cch
// @author lp0 and nocebo
// @match https://girldick.icu/*
......@@ -10,16 +11,13 @@ module.exports = () => ({
// @run-at document-start
// ==/UserScript==
`,
jsxmodule: 'inertdom',
directories: [
'modules/shared',
'modules/pleromafe'
],
modules: [
'nanopack_kwm',
'nanopack_cascade'
],
main: ['index'],
output: 'gltchrr_pleromafe.userscript.js'
});
\ No newline at end of file
`;
target.directories.push('modules/pleromafe');
target.modules.push('nanopack_cascade');
target.meta = {
'gltchrr.hook': {
orchestrate: true
}
};
target.output = 'gltchrr_pleromafe.userscript.js'
module.exports = () => target;
\ No newline at end of file
{
"jsxmodule": "inertdom",
"directories": [
"modules/shared"
],
"modules": [
"nanopack_kwm"
]
}
\ No newline at end of file
const target = {};
Object.assign(target, require('./shared.json'));
target.header = `<!DOCTYPE HTML><html><head><meta charset="utf-8"><script>`;
target.footer = `</script></head><body><noscript><h1>this page requires javascript, sorry!</h1></noscript></body></html>`;
target.directories.push('modules/standalone');
target.output = 'gltchrr.html';
target.main = ['index'];
module.exports = () => target;
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment