surgioproject / create-surgio-store Goto Github PK
View Code? Open in Web Editor NEWA Surgio starter kit.
License: MIT License
A Surgio starter kit.
License: MIT License
E.q.
// ./provider/demo.js
'use strict';
const { utils } = require('surgio');
module.exports = {
url: "https://example.com",
type: xxx,
customFilters: {
hkTwFilter: utils.useKeywords(['hk']),
},
};
The example in the template doesn't work too
// ./surgio.conf.js
'use strict';
const { utils } = require('surgio');
/**
* 使用文档:https://surgio.royli.dev/
*/
module.exports = {
customFilters: {
hktFilter: utils.useKeywords(['hkt', 'HKT']),
},
...
}
In the .tpl
, I mention it like this
// ./template/clash.tpl
Proxy Group:
- type: select
name: 🎬 Netflix
proxies: {{ getClashNodeNames(nodeList, hktFilter) | json }}
Surgio simply raises an error
⚠️ 发生错误
⚠️ Template render error: Template render error: Template render error: Template render error: Template render error: Template render error: Template render error: ([****])
Error: 传入的过滤器无效,请检查语法和变量名是否正确
However, the example in quantumultx_subscribe.tpl
works well.
// surgio.conf.js
{
name: 'QuantumultX_subscribe_us.conf',
template: 'quantumultx_subscribe',
provider: 'demo',
customParams: {
magicVariable: utils.usFilter,
},
},
// quantumultx_subscribe.tpl
{{ getQuantumultXNodes(nodeList, customParams.magicVariable) }}
17.0.0.0 不是苹果的 IP 段么,为什么在这里写在了 LAN 的规则下了啊?
今天跑初始化脚手架发现只初始化了一个 package.json, 我记得之前是初始化 包含 provider 和 template 等文件夹的
(base) ➜ rule-store
(base) ➜ rule-store cd ..
(base) ➜ lab rm -rf rule-store
(base) ➜ lab npm init surgio-store my-rule-store --use-cnpm
This utility will walk you through creating a package.json file.
It only covers the most common items, and tries to guess sensible defaults.
See `npm help json` for definitive documentation on these fields
and exactly what they do.
Use `npm install <pkg>` afterwards to install a package and
save it as a dependency in the package.json file.
Press ^C at any time to quit.
package name: (lab) npm WARN init canceled
(base) ➜ lab mkdir rule
(base) ➜ lab cd rule
(base) ➜ rule npm init surgio-store my-rule-store
This utility will walk you through creating a package.json file.
It only covers the most common items, and tries to guess sensible defaults.
See `npm help json` for definitive documentation on these fields
and exactly what they do.
Use `npm install <pkg>` afterwards to install a package and
save it as a dependency in the package.json file.
Press ^C at any time to quit.
package name: (rule)
version: (1.0.0)
description:
entry point: (index.js)
test command:
git repository:
keywords:
author:
license: (ISC)
About to write to /Users/zhangyao/project/lab/rule/package.json:
{
"name": "rule",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC"
}
Is this ok? (yes)
(base) ➜ rule ls
package.json
(base) ➜ rule pwd
/Users/zhangyao/project/lab/rule
(base) ➜ rule
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.