File tree Expand file tree Collapse file tree 6 files changed +25
-9
lines changed Expand file tree Collapse file tree 6 files changed +25
-9
lines changed Original file line number Diff line number Diff line change 3
3
The format is based on [ Keep a Changelog] ( http://keepachangelog.com/en/1.0.0/ )
4
4
and this project adheres to [ Semantic Versioning] ( http://semver.org/spec/v2.0.0.html ) .
5
5
6
- <!-- ## [Unreleased]
6
+ ## [ Unreleased]
7
7
8
- --- -->
8
+ ---
9
+
10
+ ## Fixes
11
+
12
+ - Build wrongly outputting ` __VUE_2__ ` env variable instead of replacing
13
+
14
+ ## Added
15
+
16
+ - Export ` COMMIT ` , ` VERSION ` and ` VUE_VERSION ` in the ` index.ts `
9
17
10
18
## 1.0.0-dev.29
11
19
Original file line number Diff line number Diff line change @@ -127,7 +127,7 @@ Check out the [examples folder](examples) or start hacking on [codesandbox](http
127
127
> New packages needed
128
128
129
129
- [ Axios] ( https://pikax.me/vue-composable/composable/external/axios ) - [ @vue-composable/axios ] ( https://www.npmjs.com/package/@vue-composable/axios ) reactive ` axios ` wrapper client
130
- - [ makeAxios] ( https://pikax.me/vue-composable/composable/external/makeAxios ) - [ @vue-composable/makeAxios ] ( https://www.npmjs.com/package/@vue-composable/axios ) wrap your ` axios ` instance
130
+ - [ makeAxios] ( https://pikax.me/vue-composable/composable/external/makeAxios ) - [ @vue-composable/axios ] ( https://www.npmjs.com/package/@vue-composable/axios ) wrap your ` axios ` instance
131
131
132
132
## Usage
133
133
Original file line number Diff line number Diff line change 1
1
// Global compile-time constants
2
2
declare var __DEV__ : boolean ;
3
3
declare var __JSDOM__ : boolean ;
4
+ declare var __COMMIT__ : string ;
4
5
declare var __VERSION__ : string ;
5
6
declare var __VUE_2__ : boolean ;
Original file line number Diff line number Diff line change @@ -12,3 +12,7 @@ export * from "./date";
12
12
export * from "./format" ;
13
13
export * from "./validation" ;
14
14
export * from "./i18n" ;
15
+
16
+ export const VERSION = __VERSION__ ;
17
+ export const VUE_VERSION : "2" | "3" = __VUE_2__ ? "2" : "3" ;
18
+ export const COMMIT = __COMMIT__ ;
Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ if (!process.env.TARGET) {
9
9
throw new Error ( "TARGET package must be specified via --environment flag." ) ;
10
10
}
11
11
12
- const masterVersion = require ( "./package.json" ) . version ;
13
12
const packagesDir = path . resolve ( __dirname , "packages" ) ;
14
13
const packageDir = path . resolve ( packagesDir , process . env . TARGET ) ;
15
14
const name = path . basename ( packageDir ) ;
@@ -168,7 +167,7 @@ function createReplacePlugin(
168
167
) {
169
168
return replace ( {
170
169
__COMMIT__ : `"${ process . env . COMMIT } "` ,
171
- __VERSION__ : `"${ masterVersion } "` ,
170
+ __VERSION__ : `"${ process . env . VERSION } "` ,
172
171
__DEV__ : isBundlerESMBuild
173
172
? // preserve to be handled by bundlers
174
173
`(process.env.NODE_ENV !== 'production')`
@@ -184,7 +183,9 @@ function createReplacePlugin(
184
183
// the lean build drops options related code with buildOptions.lean: true
185
184
"process.env.NODE_ENV" : isBundlerESMBuild
186
185
? `process.env.NODE_ENV`
187
- : "'production'"
186
+ : "'production'" ,
187
+
188
+ __VUE_2__ : process . env . VUE_VERSION === "2"
188
189
} ) ;
189
190
}
190
191
Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ async function build(target, targetVersion) {
57
57
const majorVersion = mainPkg . version . split ( "-" ) [ 0 ] ;
58
58
59
59
const tempVersion = targetVersion === 3 ? "alpha" : "dev" ;
60
- const version = `${ majorVersion } -${ tempVersion } .${ currentMinor } ` ;
60
+ const pkgVersion = `${ majorVersion } -${ tempVersion } .${ currentMinor } ` ;
61
61
62
62
const peerDependencies =
63
63
targetVersion === 2 ? pkg . peerDependencies2 : pkg . peerDependencies3 ;
@@ -66,7 +66,7 @@ async function build(target, targetVersion) {
66
66
pkg . dependencies && pkg . dependencies [ "vue-composable" ]
67
67
? {
68
68
...pkg . dependencies ,
69
- "vue-composable" : `^${ version } `
69
+ "vue-composable" : `^${ pkgVersion } `
70
70
}
71
71
: pkg . dependencies ;
72
72
@@ -102,7 +102,9 @@ async function build(target, targetVersion) {
102
102
`TARGET:${ target } ` ,
103
103
formats ? `FORMATS:${ formats } ` : `` ,
104
104
buildTypes ? `TYPES:true` : `` ,
105
- prodOnly ? `PROD_ONLY:true` : ``
105
+ prodOnly ? `PROD_ONLY:true` : `` ,
106
+ `VERSION:${ pkgVersion } ` ,
107
+ `VUE_VERSION:${ version } `
106
108
]
107
109
. filter ( Boolean )
108
110
. join ( "," )
You can’t perform that action at this time.
0 commit comments