Skip to content

Commit

Permalink
release: v3.0.9 (#489)
Browse files Browse the repository at this point in the history
* fix(miniapp): duplicated taskname when both ali and wechat are compiled

* fix: compact react plugin targets is undefined (#490)

* feat: rax-app support css modules (#488)

* chore: CSS Modules

* chore: style example

* build(example): modify jsx compilerOptions to preserve in tsconfig

* chore: optimize example

* chore: upgrade dep version

* chore: remove branch_name

* chore: readme

Co-authored-by: 逆葵 <[email protected]>

* fix: custom output dir (#494)

* fix: custom output dir

* fix: ci error

* fix: ci error

* fix: ci yml

* chore: remove useless code

* feat: add enable assets

* fix: compatible with build-mpa-config (#499)

* chore: bump version (#497)

* chore: bump version

* chore: update version

* chore: update version

* chore: update version

* fix: dep check error

* chore: add changelog

* chore: update version

* chore: update version

Co-authored-by: 逆葵 <[email protected]>
Co-authored-by: NK <[email protected]>
Co-authored-by: 大果 <[email protected]>
  • Loading branch information
4 people authored Nov 23, 2020
1 parent cab9e91 commit 3a8fd66
Show file tree
Hide file tree
Showing 73 changed files with 826 additions and 107 deletions.
1 change: 0 additions & 1 deletion .github/workflows/beta-publisher.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: nelonoel/branch-name@v1
- uses: actions/setup-node@v1
with:
node-version: 10
Expand Down
39 changes: 20 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,23 @@ jobs:
matrix:
node-version: [10.x]
steps:
- uses: actions/checkout@v2
- name: Set branch name
run: echo >>$GITHUB_ENV BRANCH_NAME=${GITHUB_REF#refs/heads/}
- name: Echo branch name
run: echo ${BRANCH_NAME}
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm run setup
- run: npm run dependency:check
- run: npm run lint
- run: npm run test
- run: npm run version:check
- run: npm run coverage
env:
ACCESS_KEY_ID: ${{ secrets.ACCESS_KEY_ID }}
ACCESS_KEY_SECRET: ${{ secrets.ACCESS_KEY_SECRET }}
CI: true
- uses: actions/checkout@v2
- name: Set branch name
run: echo >>$GITHUB_ENV BRANCH_NAME=${GITHUB_REF#refs/heads/}
- name: Echo branch name
run: echo ${BRANCH_NAME}
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org/
- run: npm run setup
- run: npm run dependency:check
- run: npm run lint
- run: npm run test
- run: npm run version:check
- run: npm run coverage
env:
ACCESS_KEY_ID: ${{ secrets.ACCESS_KEY_ID }}
ACCESS_KEY_SECRET: ${{ secrets.ACCESS_KEY_SECRET }}
CI: true
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
## Changelog

### 3.0.9 (November 13, 2020)
- [x] Feat: support CSS Modules.([#488](https://github.com/raxjs/rax-app/pull/488))
- [x] Refactor: change mpa entry to `.rax` temp dir.([alibaba/ice#3825](https://github.com/alibaba/ice/pull/3825))
- [x] Fix: user couldn't custom `outputDir`.([#494](https://github.com/raxjs/rax-app/pull/494))
- [x] Feat: support config `sourceMap` and `minify` when dev mode.([alibaba/ice#3825](https://github.com/alibaba/ice/pull/3835) (raxjs/miniapp)[https://github.com/raxjs/miniapp/pull/45])
- [x] Feat: support dashed page name.([alibaba/ice#3824](https://github.com/alibaba/ice/pull/3824))
- [x] Fix: duplicated taskname when both ali and wechat are compiled.([#487](https://github.com/raxjs/rax-app/pull/487))
- [x] Fix: compact react plugin targets is undefined.([#490](https://github.com/raxjs/rax-app/pull/490))

### 3.0.8 (November 13, 2020)
- Fix: mpa restart logic.([#3817](https://github.com/alibaba/ice/pull/3817))
- Fix: kraken error.([#3817](https://github.com/alibaba/ice/pull/3817))

### 3.0.7 (November 12, 2020)

- Feat: support manually close store.([#3750](https://github.com/alibaba/ice/pull/3750))
Expand Down
24 changes: 10 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ English | [简体中文](./README_zh-CN.md)
<a href="https://www.npmjs.com/package/rax-app"><img src="https://badgen.net/npm/dm/rax-app" alt="Downloads"></a>
<a href="https://www.npmjs.com/package/rax-app"><img src="https://badgen.net/npm/v/rax-app" alt="Version"></a>
<a href="/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="GitHub license" /></a>
<a href="https://github.com/raxjs/rax-scripts/pulls"><img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" alt="PRs Welcome" /></a>
<a href="https://gitter.im/raxjs/rax-scripts"><img src="https://badges.gitter.im/raxjs/rax-scripts.svg" alt="Gitter" /></a>
<a href="https://github.com/raxjs/rax-app/pulls"><img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" alt="PRs Welcome" /></a>
<a href="https://gitter.im/raxjs/rax-app"><img src="https://badges.gitter.im/raxjs/rax-app.svg" alt="Gitter" /></a>
</p>

> An universal framework based on Rax
## Features

- 🐂 **Universal**:Support Web/MiniApp/Kraken
- 🐴 **App lifecycle**:Provide usePageShow、usePageHide etc.
- 🐒 **Engineering**Out of the box support for ES6+、TypeScript、Less、Sass、 CSS Modules,etc
- 🦊 **Routing**Powerful Routing System, supports configured routing and conventions routing
- 🐴 **App lifecycle**:Provide useS6+、TypeScript、Less、Sass、 CSS Modules,etc
- 🦊 **Routing**Powerful Routing System, supporPageShow、usePageHide etc.
- 🐒 **Engineering**Out of the box support for Ets configured routing and conventions routing
- 🐯 **State management**:Built-in icestore, lightweight state management solution based on React Hooks
- 🐦 **Config**:Modes and Environment Variables configuration in the config file
- 🦁 **Application configuration**:Provide powerful and extensible application configuration
Expand All @@ -34,7 +34,7 @@ We recommend creating a new rax app using [Iceworks](https://marketplace.visuals
### Setup by CLI

We recommend creating a new rax app using create-ice, which sets up everything automatically for you. To create a project, run:
Use npm init:

```bash
$ npm init rax <project-name>
Expand All @@ -52,15 +52,13 @@ $ npm run start # running on http://localhost:3333.

It's as simple as that!


## Examples

- [with-rax](https://github.com/raxjs/rax-scripts/tree/master/examples/with-rax)
- [with-rax-mpa](https://github.com/raxjs/rax-scripts/tree/master/examples/with-rax-mpa)
- [with-rax-store](https://github.com/raxjs/rax-scripts/tree/master/examples/with-rax-store)
- [with-rax-miniapp-compile](https://github.com/raxjs/rax-scripts/tree/master/examples/with-rax-miniapp-compile)


## Ecosystem

| Project | Version | Docs | Description |
Expand Down Expand Up @@ -98,10 +96,8 @@ It's as simple as that!

## Community

| DingTalk community | GitHub issues | Gitter |
|-------------------------------------|--------------|---------|
| <a href="https://img.alicdn.com/tfs/TB1xmE8p7T2gK0jSZPcXXcKkpXa-387-505.png"><img src="https://img.alicdn.com/tfs/TB1xmE8p7T2gK0jSZPcXXcKkpXa-387-505.png" width="150" /></a> | [issues] | [gitter]|

[issues]: https://github.com/raxjs/rax-scripts/issues
[gitter]: https://gitter.im/rax-scripts/rax-scripts
| DingTalk community | GitHub issues |
|-------------------------------------|--------------|
| <a href="https://img.alicdn.com/tfs/TB1xmE8p7T2gK0jSZPcXXcKkpXa-387-505.png"><img src="https://img.alicdn.com/tfs/TB1xmE8p7T2gK0jSZPcXXcKkpXa-387-505.png" width="150" /></a> | [issues] |

[issues]: https://github.com/raxjs/rax-app/issues
12 changes: 0 additions & 12 deletions README_zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,15 @@
## 特性

- 🐂 **多端**:支持 Web、小程序、Kraken 等容器运行

- 🐴 **完整的应用生命周期**:提供 usePageShow、usePageHide 等钩子

- 🐒 **工程**:开箱即用的工程配置,支持 ES6+、TypeScript、样式方案(Less/Sass/CSS Modules)等

- 🦊 **路由**:默认使用配置式路由,同时支持约定式路由

- 🐯 **数据流**:内置集成 icestore,基于 React Hooks 的轻量级状态管理方案

- 🐦 **环境配置**:内置集成 config, 支持多环境变量的配置

- 🦁 **应用配置**:提供强大的和可扩展的应用程序配置

- 🐌 **插件体系**:提供插件机制,可以扩展框架的核心功能

- 🐘 **TypeScript**:默认使用 TypeScript



## 快速开始

### 使用 Iceworks 创建项目
Expand Down Expand Up @@ -78,8 +68,6 @@ $ npm run start # running on http://localhost:3333.
| [icestore] | [![icestore-status]][icestore-package] | [docs][icestore-docs] | 简单友好的轻量级状态管理方案 |
| [iceworks]| [![iceworks-status]][iceworks-package] | [docs][iceworks-docs] | 可视化智能开发助手 |



[rax]: https://github.com/alibaba/rax
[rax-app]: https://github.com/raxjs/rax-scripts
[miniapp]: https://github.com/raxjs/miniapp
Expand Down
2 changes: 2 additions & 0 deletions examples/basic-compat-react/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Basic compact with react

5 changes: 5 additions & 0 deletions examples/basic-compat-react/build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"targets": ["web"],
"plugins": ["build-plugin-rax-compat-react"],
"store": false
}
22 changes: 22 additions & 0 deletions examples/basic-compat-react/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "with-rax",
"description": "rax example",
"dependencies": {
"rax": "^1.1.0",
"rax-document": "^0.1.0",
"rax-image": "^2.0.0",
"rax-link": "^1.0.1",
"rax-text": "^1.0.0",
"rax-view": "^1.0.0"
},
"devDependencies": {
"@types/rax": "^1.0.0"
},
"scripts": {
"start": "rax-app start",
"build": "rax-app build"
},
"engines": {
"node": ">=8.0.0"
}
}
11 changes: 11 additions & 0 deletions examples/basic-compat-react/src/app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"routes": [
{
"path": "/",
"source": "pages/Home/index"
}
],
"window": {
"title": "Rax App"
}
}
28 changes: 28 additions & 0 deletions examples/basic-compat-react/src/app.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { createElement } from 'rax';
import { runApp } from 'rax-app';

runApp({
router: {
type: 'browser',
},
app: {
// ErrorBoundary
errorBoundary: true,

// 生命周期
onShow() {
console.log('app show...');
},
onHide() {
console.log('app hide...');
},

// 获取初始数据
getInitialData: async () => {
return {
a: 1,
b: 2,
};
},
},
});
22 changes: 22 additions & 0 deletions examples/basic-compat-react/src/document/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { createElement } from 'rax';
import { Root, Style, Script, Data } from 'rax-document';

function Document(props) {
return (
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no,viewport-fit=cover" />
<title>@ali/demo-app</title>
<Style />
</head>
<body>
{/* root container */}
<Root />
<Data />
<Script />
</body>
</html>
);
}
export default Document;
16 changes: 16 additions & 0 deletions examples/basic-compat-react/src/pages/Home/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.home {
align-items: center;
margin-top: 200rpx;
}

.title {
font-size: 35rpx;
font-weight: bold;
margin: 20rpx 0;
}

.info {
font-size: 36rpx;
margin: 8rpx 0;
color: #555;
}
10 changes: 10 additions & 0 deletions examples/basic-compat-react/src/pages/Home/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React from 'react';

import './index.css';

export default function Home() {
return (
React.createElement('div', {}, [123])
);
}

1 change: 1 addition & 0 deletions examples/custom-output-dir/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# custom output dir
5 changes: 5 additions & 0 deletions examples/custom-output-dir/build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"targets": ["web", "miniapp"],
"compileDependencies": [],
"outputDir": "build/dist"
}
23 changes: 23 additions & 0 deletions examples/custom-output-dir/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "with-rax",
"description": "rax example",
"dependencies": {
"rax": "^1.1.0",
"rax-document": "^0.1.0",
"rax-image": "^2.0.0",
"rax-link": "^1.0.1",
"rax-text": "^1.0.0",
"rax-view": "^1.0.0"
},
"devDependencies": {
"@types/rax": "^1.0.0",
"miniapp-render": "^1.3.0"
},
"scripts": {
"start": "rax-app start",
"build": "rax-app build"
},
"engines": {
"node": ">=8.0.0"
}
}
15 changes: 15 additions & 0 deletions examples/custom-output-dir/src/app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"routes": [
{
"path": "/",
"source": "pages/Home/index"
},
{
"path": "/about",
"source": "pages/About/index"
}
],
"window": {
"title": "Rax App"
}
}
28 changes: 28 additions & 0 deletions examples/custom-output-dir/src/app.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { createElement } from 'rax';
import { runApp } from 'rax-app';

runApp({
router: {
type: 'browser',
},
app: {
// ErrorBoundary
errorBoundary: true,

// 生命周期
onShow() {
console.log('app show...');
},
onHide() {
console.log('app hide...');
},

// 获取初始数据
getInitialData: async () => {
return {
a: 1,
b: 2,
};
},
},
});
27 changes: 27 additions & 0 deletions examples/custom-output-dir/src/components/BuggyCounter/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { createElement, Component } from 'rax';
import Text from 'rax-text';

class BuggyCounter extends Component {
constructor(props) {
super(props);
this.state = { counter: 0 };
this.handleClick = this.handleClick.bind(this);
}

handleClick() {
this.setState(({ counter }) => ({
counter: counter + 1,
}));
}

render() {
if (this.state.counter === 5) {
// Simulate a JS error
throw new Error('I crashed!');
}
return <Text onClick={this.handleClick}>{this.state.counter}</Text>;
}
}


export default BuggyCounter;
Loading

0 comments on commit 3a8fd66

Please sign in to comment.