Code Monkey home page Code Monkey logo

cli's Introduction

OpenSumi CLI

NPM Version NPM downloads

🛠️ Standard Tooling for OpenSumi Extensions Development

Develop

$ yarn
$ yarn dev

Test command on the local:

$ ./packages/cli/bin/sumi.js <command> [options]

Publish

$ yarn release

Then push commits and tag to the main branch, the @opensumi/cli@{tag_version} will release automatically.

Usage

Install @opensumi/cli:

$ npm install @opensumi/cli -g

Initailize the template:

$ sumi init opensumi-ext-demo
$ cd opensumi-ext-demo
$ npm run watch
$ sumi dev

Commands

Usage: sumi <command> [options]

Options:
  -V, --version                                          output the version number
  -h, --help                                             output usage information

Commands:
  init                                                   init a new extension powered by OpenSumi
  watch                                                  watch extension in development mode
  dev [options]                                          launch OpenSumi IDE load specified extension.
  compile                                                compile extension in production mode
  package [options]                                      Packages an extension
  install <publisher> <name> <version> [extensionDir]    installing a extension
  engine                                                 OpenSumi cli engine management
    add <version>                                        download and install a [version]
    remove <version>                                     remove specific [version] engine
    use  <version>                                       change current engine to [version]
    ls                                                   list installed engine versions
    ls-remote                                            list remote engine versions available for install
    current                                              display currently selected version

Run sumi <command> --help for detailed usage of given command.

Use the specified OpenSumi version

  1. List the remote engine version
$ sumi engine ls-remote

2.22.10-rc-1679037411.0   rc
              -> 2.23.0   latest
  1. Add expected version
$ sumi engine add 2.23.0

License

Copyright (c) 2019-present Alibaba Group Holding Limited, Ant Group Co. Ltd.

Licensed under the MIT license.

cli's People

Contributors

aaaaash avatar alvinhui avatar bk1012 avatar bytemain avatar dependabot[bot] avatar erha19 avatar hacke2 avatar ricbet avatar vagusx avatar

Watchers

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

cli's Issues

cli生成的配置引入第三方库貌似有点问题

应该是没配置js文件的loader,但是我使用自定义webpack配置后也是一直报错

sumi.config.js
const path = require("path");
const {
  browser,
} = require("@opensumi/cli/lib/config/webpack/shared.webpack.config");

const root = path.join(__dirname);

module.exports.browser = browser({
  mode: "production",
  context: path.join(process.cwd()),
  target: 'web',
  entry: {
    "SUMI-BROWSER": path.join(root, "src/extend/browser/index.ts"),
  },
  output: {
    filename: "browserExtension.js",
    path: path.join(__dirname, "dist"),
    libraryTarget: "commonjs",
  },
  module: {
    rules: [
      {
        test: /\.(m|j)s$/,
        loader: "babel-loader",
        options: {},
      },
      {
        test: /\.tsx?$/,
        exclude: /node_modules/,
        use: [
          {
            loader: require.resolve("ts-loader"),
            options: {
              compilerOptions: {
                sourceMap: false,
              },
            },
          },
        ],
      },
      {
        test: /\.less$/,
        use: [
          require.resolve("style-loader"),
          require.resolve("css-loader"),
          {
            loader: require.resolve("less-loader"),
            options: {
              lessOptions: {
                javascriptEnabled: true,
              },
            },
          },
        ],
      },
      {
        test: /\.css$/,
        use: [require.resolve("style-loader"), require.resolve("css-loader")],
      },
      {
        test: /\.(woff(2)?|ttf|eot|svg)(\?v=\d+\.\d+\.\d+)?$/,
        use: [
          {
            loader: require.resolve("file-loader"),
            options: {
              name: "[name].[ext]",
              outputPath: "fonts/",
            },
          },
        ],
      },
    ],
  },
  
  // resolve: {
  //   fallback: {
  //     dgram: false,
  //     fs: false,
  //     net: false,
  //     tls: false,
  //   },
  // },
  externals: {
    react: "React",
    "react-dom": "ReactDOM",
  },
});

请问这个该如何解决?

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.