本文介绍了riotts(riot-ts)和jspm-有人一起工作吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在看这个雄心勃勃的项目 https://github.com/nippur72/RiotTS 已将riotjs移至riot-ts.作者使用了bower,我正在尝试使用jspm使其工作.

I have been looking at this ambitious project https://github.com/nippur72/RiotTS that has moved riotjs over to riot-ts. The author has used bower, and I am trying to get it working using jspm.

riot-ts在jspm存储库列表中不存在,所以我使用jspm install npm:riot-ts

riot-ts doesn't exist in the jspm repo list, so I imported using jspm install npm:riot-ts

package.json:

package.json:

{
"jspm": {
  "directories": {
    "baseURL": "public/assets"
  },
  "dependencies": {
    "riot-ts": "npm:riot-ts@^1.0.14"
  },
  "devDependencies": {
    "babel": "npm:babel-core@^5.8.24",
    "babel-runtime": "npm:babel-runtime@^5.8.24",
    "core-js": "npm:core-js@^1.1.4"
  }
},
"devDependencies": {
  "elixir-jasmine": "0.0.4",
  "gulp": "^3.9.1",
  "jspm": "^0.16.35",
  "laravel-elixir": "^6.0.0-2",
  "laravel-elixir-browsersync": "^0.1.5",
  "ws-laravel-elixir-typescript": "git+https://github.com/we-studio/laravel-elixir-typescript.git"
},
"dependencies": {
  "bootstrap": "^4.0.0-alpha.2"
}
}

SystemJS配置(为简洁起见,省略了一些文件):

SystemJS config (omitted some files for brevity):

    System.config({
    defaultJSExtensions: true,
    transpiler: "babel",
    babelOptions: {
        "optional": [
            "runtime",
            "optimisation.modules.system"
        ]
    },
    paths: {
        "github:*": "jspm_packages/github/*",
        "npm:*": "jspm_packages/npm/*"
    },
    map: {
        "babel": "npm:[email protected]",
        "babel-runtime": "npm:[email protected]",
        "core-js": "npm:[email protected]",
        "riot-ts": "npm:[email protected]",
        "npm:[email protected]": {
            "chalk": "npm:[email protected]",
            "chokidar": "npm:[email protected]",
            "cluster": "github:jspm/[email protected]",
            "co": "npm:[email protected]",
            "optionator": "npm:[email protected]",
            "path": "github:jspm/[email protected]",
            "process": "github:jspm/[email protected]",
            "riot-compiler": "npm:[email protected]",
            "rollup": "npm:[email protected]",
            "shelljs": "npm:[email protected]",
            "systemjs-json": "github:systemjs/[email protected]"
        },
        "npm:[email protected]": {
            "buffer": "github:jspm/[email protected]",
            "fs": "github:jspm/[email protected]",
            "path": "github:jspm/[email protected]",
            "process": "github:jspm/[email protected]"
        },
        "npm:[email protected]": {
            "riot-observable": "npm:[email protected]"
        },
        "npm:[email protected]": {
            "process": "github:jspm/[email protected]"
        },
        "npm:[email protected]": {
            "riot": "npm:[email protected]"
        },
        "npm:[email protected]": {
            "fs": "github:jspm/[email protected]",
            "path": "github:jspm/[email protected]",
            "process": "github:jspm/[email protected]",
            "riot-cli": "npm:[email protected]",
            "riot-compiler": "npm:[email protected]",
            "riot-observable": "npm:[email protected]",
            "riot-route": "npm:[email protected]",
            "riot-tmpl": "npm:[email protected]",
            "simple-dom": "npm:[email protected]",
            "simple-html-tokenizer": "npm:[email protected]"
        },
        "github:jspm/[email protected]": "...",
        "github:jspm/[email protected]": "...",
        "github:jspm/[email protected]": "...",
        "github:jspm/[email protected]": "...",
        "github:jspm/[email protected]": "...",
        "github:jspm/[email protected]": "...",
        "github:jspm/[email protected]": "...",
        "github:jspm/[email protected]": "...",
        "github:jspm/[email protected]": "...",
        "github:jspm/[email protected]": "...",
        "github:jspm/[email protected]": "...",
        "github:jspm/[email protected]": "...",
        "github:jspm/[email protected]": "...",
        "github:jspm/[email protected]": "...",
        "github:jspm/[email protected]": "...",
        "github:jspm/[email protected]": "...",
        "github:jspm/[email protected]": "...",
        "github:jspm/[email protected]": "...",
        "github:jspm/[email protected]": "...",
        "github:jspm/[email protected]": "...",
        "github:jspm/[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "crypto": "github:jspm/[email protected]",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "...",
        "npm:[email protected]": "..."
    }
});

即使在最普通的设置中,TSC仍抱怨找不到Riot tsc app.ts --module AMD

Even in the plainest setup, TSC complains it can't find Riot tsc app.ts --module AMD

吞咽错误

    fullFilename: 'aLongPath/leg-13-calculator/public/assets/jspm_packages/npm/[email protected]/index.ts',
  relativeFilename: 'public/assets/jspm_packages/npm/[email protected]/index.ts',
  file: <File "jspm_packages/npm/[email protected]/index.ts" <Buffer 69 6d 70 6f 72 74 20 2a 20 61 73 20 72 69 6f 74 20 66 72 6f 6d 20 22 72 69 6f 74 22 0d 0a 0d 0a 65 78 70 6f 72 74 20 66 75 6e 63 74 69 6f 6e 20 74 65 ... >>,
  startPosition: { position: 22, line: 1, character: 23 },
  endPosition: { position: 27, line: 1, character: 29 },
  message: '\u001b[31mpublic/assets/jspm_packages/npm/[email protected]/index.ts(1,23): \u001b[39merror TS2307: Cannot find module \'riot\'.' }

此文件存在.路径正确.只是没有发现骚动.

This file exists. The path is correct. It just isn't finding riot.

有人使用riot-ts与jspm协同工作吗?

Does anyone have an example of riot-ts working with jspm?

更新01-06-2016

  • 没有打字文件. http://jspm.io/docs/getting-started.html 上的指南真的需要提及.浪费了很多时间.
  • 尽管这可以解决打字稿中的错误,但不能解决riot-ts的集成问题.我现在已经回到凉亭.
  • Didn't have a typings file. The guide on http://jspm.io/docs/getting-started.html really needs to mention that. Many hours wasted.
  • Although this fixes the error from typescript, it doesn't fix the integration of riot-ts. I have gone back to bower for now.

更新02-06-2016

  • 无法在打字稿中使用@template装饰器.尝试了多个ts定义文件. TS只是bar倒...

推荐答案

尝试使用npm install -g typescript@next

您可以创建一个名为tsconfig.json的文件,其中包含:

You can create a file called tsconfig.json containing:

{ "compilerOptions": { ... "experimentalDecorators": true, ... ]

{ "compilerOptions": { ... "experimentalDecorators": true, ... ]

我还注意到Riot-TS的作者已经发布了使用jspm的hello world,您可能想在 https://github.com/nippur72/RiotTS-helloworld/blob/gh-pages/example-old- jpm/tsconfig.json

I also noticed that the author of Riot-TS has published a hello world for using jspm, you might want to check out his tsconfig.json file at https://github.com/nippur72/RiotTS-helloworld/blob/gh-pages/example-old-jpm/tsconfig.json

祝你好运!

这篇关于riotts(riot-ts)和jspm-有人一起工作吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-14 02:03