GithubHelp home page GithubHelp logo

surgioproject / create-surgio-store Goto Github PK

View Code? Open in Web Editor NEW
24.0 24.0 9.0 692 KB

A Surgio starter kit.

License: MIT License

JavaScript 47.70% Smarty 36.99% Handlebars 14.95% TypeScript 0.36%
surgio

create-surgio-store's People

Contributors

dependabot[bot] avatar ekkog avatar geekdada avatar ladit avatar paiji avatar proletarius101 avatar sakuyamaij avatar snyk-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

create-surgio-store's Issues

Custom filtering doesn't work

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) }}

[bug report]npm init surgio-store my-rule-store

今天跑初始化脚手架发现只初始化了一个 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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.