This repository was archived by the owner on Sep 9, 2024. It is now read-only.
File tree 8 files changed +15
-13
lines changed 8 files changed +15
-13
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ module.exports = {
15
15
'cypress/globals' : true ,
16
16
} ,
17
17
globals : {
18
- STATIC_CMS_CORE_VERSION : false ,
18
+ STATIC_CMS_APP_VERSION : false ,
19
19
CMS_ENV : false ,
20
20
} ,
21
21
rules : {
Original file line number Diff line number Diff line change 1
1
const path = require ( 'path' ) ;
2
2
3
- const coreVersion = require ( './package.json' ) . version ;
3
+ const appVersion = require ( './package.json' ) . version ;
4
4
const isProduction = process . env . NODE_ENV === 'production' ;
5
5
const isTest = process . env . NODE_ENV === 'test' ;
6
6
const isESM = process . env . NODE_ENV === 'esm' ;
@@ -59,7 +59,7 @@ function plugins() {
59
59
[
60
60
'transform-define' ,
61
61
{
62
- STATIC_CMS_CORE_VERSION : `${ coreVersion } ` ,
62
+ STATIC_CMS_APP_VERSION : `${ appVersion } ` ,
63
63
} ,
64
64
] ,
65
65
[
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ const webpack = require('webpack');
3
3
const ReactRefreshWebpackPlugin = require ( '@pmmmwh/react-refresh-webpack-plugin' ) ;
4
4
const TsconfigPathsPlugin = require ( 'tsconfig-paths-webpack-plugin' ) ;
5
5
const MiniCssExtractPlugin = require ( 'mini-css-extract-plugin' ) ;
6
+ const pkg = require ( './package.json' ) ;
6
7
7
8
const isProduction = process . env . NODE_ENV === 'production' ;
8
9
const devServerPort = parseInt ( process . env . STATIC_CMS_DEV_SERVER_PORT || `${ 8080 } ` ) ;
@@ -90,6 +91,9 @@ module.exports = {
90
91
process : 'process/browser' ,
91
92
Buffer : [ 'buffer' , 'Buffer' ] ,
92
93
} ) ,
94
+ new webpack . DefinePlugin ( {
95
+ STATIC_CMS_APP_VERSION : JSON . stringify ( `${ pkg . version } ${ isProduction ? '' : '-dev' } ` ) ,
96
+ } ) ,
93
97
] . filter ( Boolean ) ,
94
98
output : {
95
99
path : path . resolve ( __dirname , 'dist' ) ,
Original file line number Diff line number Diff line change @@ -81,7 +81,9 @@ function bootstrap<F extends BaseField = UnknownField>(opts?: {
81
81
/**
82
82
* Log the version number.
83
83
*/
84
- if ( typeof STATIC_CMS_CORE_VERSION === 'string' ) {
84
+ if ( typeof STATIC_CMS_APP_VERSION === 'string' ) {
85
+ console . info ( `[StaticCMS] Using @staticcms/app ${ STATIC_CMS_APP_VERSION } ` ) ;
86
+ } else if ( typeof STATIC_CMS_CORE_VERSION === 'string' ) {
85
87
console . info ( `[StaticCMS] Using @staticcms/core ${ STATIC_CMS_CORE_VERSION } ` ) ;
86
88
}
87
89
Original file line number Diff line number Diff line change @@ -51,8 +51,10 @@ ${config}
51
51
52
52
function buildIssueTemplate ( config ?: Config ) {
53
53
let version = '' ;
54
- if ( typeof STATIC_CMS_CORE_VERSION === 'string' ) {
55
- version = `static-cms@${ STATIC_CMS_CORE_VERSION } ` ;
54
+ if ( typeof STATIC_CMS_APP_VERSION === 'string' ) {
55
+ version = `@staticcms/app@${ STATIC_CMS_APP_VERSION } ` ;
56
+ } else if ( typeof STATIC_CMS_CORE_VERSION === 'string' ) {
57
+ version = `@staticcms/core@${ STATIC_CMS_CORE_VERSION } ` ;
56
58
}
57
59
const template = getIssueTemplate (
58
60
version ,
Original file line number Diff line number Diff line change 1
1
declare const STATIC_CMS_CORE_VERSION : string ;
2
+ declare const STATIC_CMS_APP_VERSION : string ;
Original file line number Diff line number Diff line change @@ -15,7 +15,6 @@ module.exports = {
15
15
jest : true ,
16
16
} ,
17
17
globals : {
18
- STATIC_CMS_CORE_VERSION : false ,
19
18
CMS_ENV : false ,
20
19
} ,
21
20
rules : {
Original file line number Diff line number Diff line change @@ -56,12 +56,6 @@ function plugins() {
56
56
if ( isESM ) {
57
57
return [
58
58
...defaultPlugins ,
59
- [
60
- 'transform-define' ,
61
- {
62
- STATIC_CMS_CORE_VERSION : `${ coreVersion } ` ,
63
- } ,
64
- ] ,
65
59
[
66
60
'inline-react-svg' ,
67
61
{
You can’t perform that action at this time.
0 commit comments