Skip to content

Commit ab31d1d

Browse files
authored
Merge pull request #209 from GeekyAnts/develop
Release tag v0.1.4
2 parents c6e540a + db97898 commit ab31d1d

File tree

5 files changed

+84
-41
lines changed

5 files changed

+84
-41
lines changed

build/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ const builds = {
5252
entry: resolve("vue-native/compiler.js"),
5353
dest: resolve("packages/vue-native-template-compiler/build.js"),
5454
format: "cjs",
55-
external: ["change-case", "he", "de-indent"],
55+
external: ["change-case", "he", "de-indent", "lodash"],
5656
}
5757
};
5858

build/release.sh

Lines changed: 55 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,77 @@
11
set -e
22

3-
if [[ -z $1 ]]; then
4-
echo "Enter new version: "
5-
read VERSION
6-
else
7-
VERSION=$1
3+
# check if np is installed
4+
np_version=$(np --version)
5+
echo "Using np:" $np_version
6+
7+
# get the version number from the user
8+
read -e -p "Enter the new Vue Native version: " VERSION
9+
if [[ -z $VERSION ]]; then
10+
echo "No version entered. Exiting..."
11+
exit 0
812
fi
913

1014
read -p "Releasing $VERSION - are you sure? (y/n) " -n 1 -r
1115
echo
1216
if [[ $REPLY =~ ^[Yy]$ ]]; then
1317
echo "Releasing $VERSION ..."
1418

15-
npm run lint
16-
npm run flow
17-
npm run test:cover
18-
npm run test:e2e
19-
npm run test:ssr
19+
# bump package versions
20+
# packages:
21+
# - vue-native-core
22+
# - vue-native-helper
23+
# - vue-native-scripts
24+
# - vue-native-template-compiler
2025

21-
if [[ -z $SKIP_SAUCE ]]; then
22-
export SAUCE_BUILD_ID=$VERSION:`date +"%s"`
23-
npm run test:sauce
24-
fi
26+
cd packages/vue-native-core
27+
npm version $VERSION
28+
cd -
2529

26-
# build
27-
VERSION=$VERSION npm run build
30+
cd packages/vue-native-helper
31+
npm version $VERSION
32+
cd -
2833

29-
# update packages
30-
cd packages/vue-template-compiler
34+
cd packages/vue-native-scripts
3135
npm version $VERSION
32-
if [[ -z $RELEASE_TAG ]]; then
33-
npm publish
34-
else
35-
npm publish --tag $RELEASE_TAG
36-
fi
3736
cd -
3837

39-
cd packages/vue-server-renderer
38+
cd packages/vue-native-template-compiler
4039
npm version $VERSION
41-
if [[ -z $RELEASE_TAG ]]; then
42-
npm publish
43-
else
44-
npm publish --tag $RELEASE_TAG
45-
fi
4640
cd -
4741

42+
# build
43+
# the build needs to be generated after the version bump
44+
# because the Vue version comes from packages/vue-native-core/package.json
45+
# refer to build/config.js
46+
VERSION=$VERSION npm run build
47+
4848
# commit
4949
git add -A
5050
git commit -m "[build] $VERSION"
51-
npm version $VERSION --message "[release] $VERSION"
52-
53-
# publish
54-
git push origin refs/tags/v$VERSION
55-
git push
56-
if [[ -z $RELEASE_TAG ]]; then
57-
npm publish
58-
else
59-
npm publish --tag $RELEASE_TAG
60-
fi
51+
52+
# use np to create release with VERSION and publish vue-native-core
53+
# you MUST be in the master branch to do this
54+
# if it fails, then the last commit is reset and the script exits
55+
# TODO: add tests and remove --yolo
56+
np --no-yarn --contents packages/vue-native-core --yolo $VERSION || { git reset --soft HEAD~1; exit 1; }
57+
58+
# publish packages
59+
# vue-native-core has already been published by np
60+
# packages:
61+
# - vue-native-helper
62+
# - vue-native-scripts
63+
# - vue-native-template-compiler
64+
65+
cd packages/vue-native-helper
66+
npm publish
67+
cd -
68+
69+
cd packages/vue-native-scripts
70+
npm publish
71+
cd -
72+
73+
cd packages/vue-native-template-compiler
74+
npm publish
75+
cd -
76+
6177
fi

converting-react-native-project.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,29 @@ module.exports = (async () => {
4545
})();
4646
```
4747

48+
#### NOTE to Expo users:
49+
50+
The `app.json` file must be modified to allow `.vue` files to be recognised.
51+
52+
```diff
53+
{
54+
"expo": {
55+
"sdkVersion": "34.0.0",
56+
"platforms": [
57+
"ios",
58+
"android",
59+
"web"
60+
],
61+
...
62+
"packagerOpts": {
63+
+ "sourceExts": ["js", "json", "ts", "tsx", "vue"],
64+
"config": "metro.config.js"
65+
}
66+
}
67+
}
68+
```
69+
70+
4871
The `babelTransformPath` property above takes the path to the transformer you wish to use. In our case, we need to create a `vueTransformerPlugin.js` file to the project's root and specify supported extensions:
4972

5073
```js

src/compiler/parser/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import { cached, no, camelize } from 'shared/util'
88
import { genAssignmentCode } from '../directives/model'
99
import { isIE, isEdge, isServerRendering, isNative } from 'core/util/env'
1010

11+
import ReactNativeRenderGenerator from 'vue-native/compiler/codegen/NativeRenderGenerator.js'
12+
1113
import {
1214
addProp,
1315
addAttr,
@@ -549,7 +551,7 @@ export function processAttrs (el, options, customSlot = false) {
549551
) {
550552
// Add Attribute in parent element
551553
//
552-
var renderer = new ReactNativeRenderGenerator(el, options);
554+
const renderer = new ReactNativeRenderGenerator(el, options);
553555
let customRenderer = renderer.generateRender();
554556
let customImport = renderer.generateImport();
555557
customRenderer = customRenderer.replace(

src/platforms/vue-native/compiler/native.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import _ from 'lodash'
2+
13
import { parse, processAttrs } from "compiler/parser/index";
24

35
import { NativeRenderGenerator } from "vue-native/compiler/codegen/index";

0 commit comments

Comments
 (0)