This repository has been archived by the owner on Mar 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 364
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- 真正的「混合开发」,React 代码会跟小程序代码一起构建, close #1153 - Web 端的的多页模式 - 支持小程序插件开发,close #705 - 集成 redbox-react,close #1077
- Loading branch information
Showing
1,581 changed files
with
72,138 additions
and
104,979 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,27 @@ | ||
{ | ||
"installCommand": "install:codesandbox", | ||
"packages": [ | ||
"packages/remax-types", | ||
"packages/remax-macro", | ||
"packages/remax-ali", | ||
"packages/remax-wechat", | ||
"packages/remax-toutiao", | ||
"packages/remax-router", | ||
"packages/remax-web", | ||
"packages/remax-one", | ||
"packages/babel-plugin-remax-host-component", | ||
"packages/babel-plugin-remax-lifecycle", | ||
"packages/babel-plugin-remax-regenerator-runtime", | ||
"packages/babel-plugin-remax-turbo-render", | ||
"packages/babel-preset-remax", | ||
"packages/postcss-remax-tag", | ||
"packages/remax", | ||
"packages/remax-ali", | ||
"packages/remax-build-store", | ||
"packages/remax-cli", | ||
"packages/remax-framework-shared", | ||
"packages/remax-macro", | ||
"packages/remax-one", | ||
"packages/remax-plugin-devtools", | ||
"packages/remax-plugin-error-screen", | ||
"packages/remax-runtime", | ||
"packages/postcss-remax-tag", | ||
"packages/remax-cli" | ||
"packages/remax-shared", | ||
"packages/remax-toutiao", | ||
"packages/remax-types", | ||
"packages/remax-web", | ||
"packages/remax-wechat" | ||
], | ||
"sandboxes": ["github/remaxjs/examples/tree/master/one"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: E2E web mpa | ||
|
||
on: | ||
push: | ||
branches: [master] | ||
pull_request: | ||
types: [opened, synchronize] | ||
|
||
jobs: | ||
test: | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
matrix: | ||
node-version: [14.x] | ||
os: [ubuntu-latest] | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- name: install | ||
run: yarn install --frozen-lockfile | ||
- name: build | ||
run: yarn build | ||
- name: e2e | ||
run: yarn test:e2e-web | ||
env: | ||
CI: true | ||
MPA: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: E2E web spa | ||
|
||
on: | ||
push: | ||
branches: [master] | ||
pull_request: | ||
types: [opened, synchronize] | ||
|
||
jobs: | ||
test: | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
matrix: | ||
node-version: [14.x] | ||
os: [ubuntu-latest] | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- name: install | ||
run: yarn install --frozen-lockfile | ||
- name: build | ||
run: yarn build | ||
- name: e2e | ||
run: yarn test:e2e-web | ||
env: | ||
CI: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
dist/ | ||
yarn-error.log | ||
yarn.lock | ||
.tea | ||
.vscode | ||
.DS_Store | ||
!src/node_modules | ||
build/ | ||
miniapptools_dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Change Log | ||
|
||
All notable changes to this project will be documented in this file. | ||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Remax E2E test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module.exports = { | ||
launch: { | ||
headless: process.env.HEADLESS !== 'false', | ||
}, | ||
server: { | ||
debug: true, | ||
command: 'npm run serve', | ||
port: 5678, | ||
launchTimeout: 60000, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
preset: './tests/preset.js', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"miniprogramRoot": "build/src", | ||
"scripts": { | ||
"watch": "npm run watch:mini", | ||
"beforePreview": "npm run build", | ||
"beforeUpload": "npm run build" | ||
}, | ||
"exclude": [ | ||
"src/**", | ||
"node_modules", | ||
"node_modules/**", | ||
"babel.config.js", | ||
"package-lock.json", | ||
"package.json", | ||
"remax.config.js", | ||
"app.json", | ||
"miniapptools_dist/**/*" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{ | ||
"name": "e2e-app", | ||
"private": true, | ||
"version": "1.1.0", | ||
"description": "intergration tests for Remax", | ||
"main": "index.js", | ||
"keywords": [], | ||
"author": "Wei Zhu <yesmeck@gmail.com>", | ||
"license": "MIT", | ||
"scripts": { | ||
"watch:mini": "remax build -w", | ||
"dev:mini": " mini build -w ./", | ||
"dev:web": "remax build -w -t web", | ||
"dev:web:mpa": "MPA=1 remax build -w -t web", | ||
"clean": "rimraf dist", | ||
"build": "./scripts/build.sh", | ||
"serve": "http-server ./dist/webng --cors --port=5678 -s", | ||
"pretest": "npm run build", | ||
"test": "jest", | ||
"test:mini": "TEST_TARGET=mini npm run test", | ||
"test:web": "TEST_TARGET=web npm run test" | ||
}, | ||
"dependencies": { | ||
"remax": "^2.8.8", | ||
"@remax/plugin-less": "^1.0.0", | ||
"clsx": "^1.0.4", | ||
"mini-antui": "^0.4.34", | ||
"react": "^16.8.6" | ||
}, | ||
"devDependencies": { | ||
"@types/expect-puppeteer": "^4.4.0", | ||
"@types/jest": "^25.2.3", | ||
"@types/puppeteer": "^2.0.0", | ||
"@types/react": "^16.9.1", | ||
"cross-env": "^6.0.3", | ||
"http-server": "^0.12.3", | ||
"jest": "^24.9.0", | ||
"jest-puppeteer": "^4.4.0", | ||
"merge": "^1.2.1", | ||
"rimraf": "^2.6.3", | ||
"ts-jest": "^24.1.0", | ||
"typescript": "^3.7.2" | ||
}, | ||
"workspaces": { | ||
"nohoist": [ | ||
"mini-antui", | ||
"react" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
const path = require('path'); | ||
const less = require('@remax/plugin-less'); | ||
|
||
module.exports = { | ||
output: process.env.REMAX_PLATFORM === 'web' ? 'dist/webng' : 'build/src', | ||
plugins: [less()], | ||
configWebpack({ config }) { | ||
if (process.env.REMAX_PLATFORM === 'web') { | ||
config.output.publicPath('/'); | ||
} | ||
}, | ||
turboRenders: !!process.env.TURBO_RENDERS, | ||
web: { | ||
mpa: !!process.env.MPA, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -x | ||
|
||
if [ -z "$SKIP_BUILD" ]; then | ||
npm run clean | ||
|
||
if [ "$TEST_TARGET" = "web" ]; then | ||
npx remax build -t web | ||
else | ||
npx remax build && cd build && cube build --webng=appxng --native=false --appxcompatible && mv dist .. | ||
fi | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import * as React from 'react'; | ||
|
||
export const GlobalContext = React.createContext({ | ||
name: '', | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import * as React from 'react'; | ||
import { View } from 'remax/one'; | ||
|
||
export default () => <View>custom error</View>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
const pages = [ | ||
'pages/index/index', | ||
'pages/error/index', | ||
'pages/lifecycle/index', | ||
'pages/image/index', | ||
'pages/query/index', | ||
'pages/navigate/one/index', | ||
'pages/navigate/two/index', | ||
]; | ||
|
||
if (process.env.REMAX_PLATFORM === 'ali') { | ||
pages.push( | ||
...[ | ||
'pages/native-component/index', | ||
'pages/native-component/module', | ||
'pages/native-component/commonChunk1', | ||
'pages/native-component/commonChunk2', | ||
'pages/turbo-page/index', | ||
'pages/insert-before/index', | ||
'pages/hybrid/index', | ||
] | ||
); | ||
} | ||
|
||
module.exports.ali = { | ||
pages, | ||
window: { | ||
defaultTitle: 'Test App', | ||
titleBarColor: '#323239', | ||
}, | ||
subPackages: [ | ||
{ | ||
root: 'packageA', | ||
pages: ['pages/index'], | ||
}, | ||
], | ||
tabBar: { | ||
textColor: '#ffffff', | ||
selectedColor: '#000000', | ||
backgroundColor: '#212121', | ||
items: [ | ||
{ | ||
pagePath: 'pages/index/index', | ||
name: '首页', | ||
icon: './assets/images/cat.jpg', | ||
activeIcon: './assets/images/dog.jpg', | ||
}, | ||
{ | ||
pagePath: 'packageA/pages/index', | ||
name: '其他', | ||
icon: './assets/images/cat.jpg', | ||
activeIcon: './assets/images/dog.jpg', | ||
}, | ||
], | ||
}, | ||
}; | ||
|
||
module.exports.web = { | ||
pages, | ||
title: 'Remax Web Template', | ||
tabBar: { | ||
backgroundColor: '#fff', | ||
activeTitleColor: 'red', | ||
titleColor: 'blue', | ||
items: [ | ||
{ | ||
url: 'pages/index/index', | ||
title: '首页', | ||
image: './assets/images/cat.jpg', | ||
activeImage: './assets/images/dog.jpg', | ||
}, | ||
{ | ||
url: 'packageA/pages/index', | ||
title: '其他', | ||
image: './assets/images/cat.jpg', | ||
activeImage: './assets/images/dog.jpg', | ||
}, | ||
], | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import * as React from 'react'; | ||
import { useAppEvent } from 'remax/macro'; | ||
import { GlobalContext } from './GlobalContext'; | ||
|
||
const App = props => { | ||
const [name, setName] = React.useState(''); | ||
|
||
useAppEvent('onLaunch', () => { | ||
console.log('launch'); | ||
setName('launch'); | ||
}); | ||
|
||
return <GlobalContext.Provider value={{ name }}>{props.children}</GlobalContext.Provider>; | ||
}; | ||
|
||
export default App; |
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<view id="a" class="{{className}}">a</view> |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.
45dab88
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs: