Skip to content

Commit

Permalink
Merge pull request #972 from alibaba/rax-cli
Browse files Browse the repository at this point in the history
rax-cli v1.0.0
  • Loading branch information
yuanyan authored Mar 12, 2019
2 parents 49db0f4 + b2b0194 commit 40be06e
Show file tree
Hide file tree
Showing 28 changed files with 286 additions and 383 deletions.
2 changes: 1 addition & 1 deletion packages/rax-cli/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# rax-cli [![npm](https://img.shields.io/npm/v/rax-cli.svg)](https://www.npmjs.com/package/rax-cli) [![Dependency Status](https://david-dm.org/alibaba/rax.svg?path=packages/rax-cli)](https://david-dm.org/alibaba/rax.svg?path=packages/rax-cli) [![Known Vulnerabilities](https://snyk.io/test/npm/rax-cli/badge.svg)](https://snyk.io/test/npm/rax-cli)

> The Rax CLI tools.
> Command line interface for Rax
## Install

Expand Down
4 changes: 2 additions & 2 deletions packages/rax-cli/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "rax-cli",
"version": "1.0.0-beta.0",
"version": "1.0.2",
"license": "BSD-3-Clause",
"description": "The Rax CLI tools",
"description": "Command line interface for Rax",
"main": "src/index.js",
"repository": {
"type": "git",
Expand Down
2 changes: 0 additions & 2 deletions packages/rax-cli/src/generator/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
var path = require('path');
var chalk = require('chalk');
var fs = require('fs');
var spawn = require('cross-spawn');
var easyfile = require('easyfile');
var path = require('path');

Expand Down
199 changes: 97 additions & 102 deletions packages/rax-cli/src/generator/miniapp/_eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,123 +1,118 @@
/* eslint quotes: off */

module.exports = {
"root": true,
"parser": "babel-eslint",
"env": {
"browser": true,
"node": true,
"es6": true,
"jest": true,
"commonjs": true
'root': true,
'parser': 'babel-eslint',
'env': {
'browser': true,
'node': true,
'es6': true,
'jest': true,
'commonjs': true
},
"parserOptions": {
"sourceType": "module",
"ecmaVersion": 6,
"ecmaFeatures": {
"generators": true,
"experimentalObjectRestSpread": true
'parserOptions': {
'sourceType': 'module',
'ecmaVersion': 6,
'ecmaFeatures': {
'generators': true,
'experimentalObjectRestSpread': true
}
},
"globals": {
"webkitRequestAnimationFrame": true,
},
"rules": {
'rules': {
// ES6
"prefer-const": "off",
"no-const-assign": "error",
"no-class-assign": "error",
"no-dupe-class-members": "error",
"rest-spread-spacing": "error",
"no-duplicate-imports": "error",
"no-useless-rename": "error",
"arrow-spacing": "error",
"no-useless-computed-key": "error",
"template-curly-spacing": "error",
"generator-star-spacing": ["error", {"before": false, "after": true}],
"yield-star-spacing": ["error", {"before": false, "after": true}],
"strict": ["off", "global"],
"global-strict": ["off", "always"],
"no-extra-strict": "off",
"no-shadow": "off",
"no-unused-vars": ["off", {
"vars": "local",
"args": "after-used",
"varsIgnorePattern": "createElement"
'prefer-const': 'off',
'no-const-assign': 'error',
'no-class-assign': 'error',
'no-dupe-class-members': 'error',
'rest-spread-spacing': 'error',
'no-duplicate-imports': 'error',
'no-useless-rename': 'error',
'arrow-spacing': 'error',
'no-useless-computed-key': 'error',
'template-curly-spacing': 'error',
'generator-star-spacing': ['error', {'before': false, 'after': true}],
'yield-star-spacing': ['error', {'before': false, 'after': true}],
'strict': ['off', 'global'],
'global-strict': ['off', 'always'],
'no-extra-strict': 'off',
'no-shadow': 'off',
'no-unused-vars': ['off', {
'vars': 'local',
'args': 'after-used',
'varsIgnorePattern': 'createElement'
}],
"no-undef": "error",
"no-unused-expressions": "off",
"no-use-before-define": "off",
"yoda": "off",
"eqeqeq": "off",
"no-new": "off",
"consistent-return": "off",
"dot-notation": ["error", {
"allowKeywords": true
'no-undef': 'error',
'no-unused-expressions': 'off',
'no-use-before-define': 'off',
'yoda': 'off',
'eqeqeq': 'off',
'no-new': 'off',
'consistent-return': 'off',
'dot-notation': ['error', {
'allowKeywords': true
}],
"no-extend-native": "error",
"no-native-reassign": "error",
"no-return-assign": "off",
"no-constant-condition": ["error", {
"checkLoops": false
'no-extend-native': 'error',
'no-native-reassign': 'error',
'no-return-assign': 'off',
'no-constant-condition': ['error', {
'checkLoops': false
}],
"no-caller": "error",
"no-loop-func": "off",
'no-caller': 'error',
'no-loop-func': 'off',

// Node.js
"no-console": "off",
"no-catch-shadow": "error",
"no-new-require": "off",
"no-mixed-requires": ["off", false],
"no-path-concat": "off",
"handle-callback-err": "off",
'no-console': 'off',
'no-catch-shadow': 'error',
'no-new-require': 'off',
'no-mixed-requires': ['off', false],
'no-path-concat': 'off',
'handle-callback-err': 'off',

"no-empty": "off",
"indent": ["error", 2, {
"SwitchCase": 1
'no-empty': 'off',
'indent': ['error', 2, {
'SwitchCase': 1
}],
"camelcase": ["off", {
"properties": "always"
'camelcase': ['off', {
'properties': 'always'
}],
"quotes": ["error", "single", "avoid-escape"],
"brace-style": ["error", "1tbs", {
"allowSingleLine": false
'quotes': ['error', 'single', 'avoid-escape'],
'brace-style': ['error', '1tbs', {
'allowSingleLine': false
}],
"comma-spacing": ["error", {
"before": false,
"after": true
'comma-spacing': ['error', {
'before': false,
'after': true
}],
"comma-style": ["error", "last"],
"eol-last": "off",
"func-names": "off",
"new-cap": ["error", {
"newIsCap": true
'comma-style': ['error', 'last'],
'eol-last': 'off',
'func-names': 'off',
'new-cap': ['error', {
'newIsCap': true
}],
"key-spacing": ["error", {
"beforeColon": false,
"afterColon": true
'key-spacing': ['error', {
'beforeColon': false,
'afterColon': true
}],
"no-multi-spaces": "error",
"no-multiple-empty-lines": "error",
"no-new-object": "error",
"no-spaced-func": "error",
"no-trailing-spaces": "error",
"no-extra-parens": "error",
"padded-blocks": ["error", "never"],
"semi": "error",
"semi-spacing": "error",
"keyword-spacing": "error",
"space-before-blocks": "error",
"space-before-function-paren": ["error", "never"],
"space-infix-ops": "error",
"spaced-comment": ["error", "always", {
"line": {
"markers": ["/"],
"exceptions": ["-", "+"]
'no-multi-spaces': 'error',
'no-multiple-empty-lines': 'error',
'no-new-object': 'error',
'no-spaced-func': 'error',
'no-trailing-spaces': 'error',
'no-extra-parens': 'error',
'padded-blocks': ['error', 'never'],
'semi': 'error',
'semi-spacing': 'error',
'keyword-spacing': 'error',
'space-before-blocks': 'error',
'space-before-function-paren': ['error', 'never'],
'space-infix-ops': 'error',
'spaced-comment': ['error', 'always', {
'line': {
'markers': ['/'],
'exceptions': ['-', '+']
},
"block": {
"markers": ["!"],
"exceptions": ["*"],
"balanced": true
'block': {
'markers': ['!'],
'exceptions': ['*'],
'balanced': true
}
}]
}
Expand Down
2 changes: 2 additions & 0 deletions packages/rax-cli/src/generator/miniapp/_gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

*~
*.swp
*.log
Expand Down
8 changes: 4 additions & 4 deletions packages/rax-cli/src/generator/miniapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
"lint": "eslint --ext .js --ext .jsx ./src"
},
"dependencies": {
"rax": "^0.6.5",
"rax": "^1.0.0",
"atag": "^0.1.31"
},
"devDependencies": {
"rax-scripts": "^1.0.0-beta.0",
"babel-eslint": "^10.0.1",
"eslint": "^5.10.0"
"rax-scripts": "^1.0.0",
"eslint": "^5.15.1",
"babel-eslint": "^10.0.1"
}
}
3 changes: 0 additions & 3 deletions packages/rax-cli/src/generator/miniapp/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1, minimum-scale=1, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">
<title>MiniApp</title>
<script src="https://g.alicdn.com/code/npm/@webcomponents/webcomponentsjs/2.0.4/bundles/webcomponents-sd-ce-pf.js"></script>
<style>
Expand Down
5 changes: 0 additions & 5 deletions packages/rax-cli/src/generator/webapp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,3 @@ You will see the lint errors in the console.
### `npm run build`

Builds the app for production to the `build` folder.

## Universal "Gotchas"

- DOM & DOM like **`window`** & **`document`** do not exist on the server - so using them, or any library that uses them (jQuery for example) will not work.
- If you need to use them, consider limiting them to wrapping them situationally with the imported *isWeb / isNode / isWeex* features from Universal. `import {isWeb, isWeex, isNode} from 'universal-env'`;
Loading

0 comments on commit 40be06e

Please # to comment.