File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 7575 run : node scripts/update-changelog.mjs
7676 if : ${{ github.event.inputs.releaseChannel == 'stable' }}
7777
78+ - name : Update version number in the base class
79+ run : node scripts/update-version-number.mjs
80+
7881 - name : Tagging
7982 run : |
8083 git add .
Original file line number Diff line number Diff line change 1+ import fs from 'fs' ;
2+ import util from 'util' ;
3+ import path , { dirname } from 'path' ;
4+ import { fileURLToPath } from 'url' ;
5+
6+ const __filename = fileURLToPath ( import . meta. url ) ;
7+ const __dirname = dirname ( __filename ) ;
8+
9+ const readFile = util . promisify ( fs . readFile ) ;
10+ const writeFile = util . promisify ( fs . writeFile ) ;
11+
12+ const BASE_CLASS_PATH = path . join (
13+ __dirname ,
14+ '..' ,
15+ 'src' ,
16+ 'includes' ,
17+ 'VscElement.ts'
18+ ) ;
19+
20+ async function main ( ) {
21+ const pkgPath = path . join ( __dirname , '..' , 'package.json' ) ;
22+ const pkg = JSON . parse ( fs . readFileSync ( pkgPath ) . toString ( ) ) ;
23+ const { version} = pkg ;
24+
25+ const fc = await readFile ( BASE_CLASS_PATH , 'utf-8' ) ;
26+ const newContent = fc . replace ( / r e a d o n l y v e r s i o n = ' [ a - z 0 - 9 - ] + ' ; / g, `readonly version = '${ version } ';` ) ;
27+
28+ await writeFile ( BASE_CLASS_PATH , newContent ) ;
29+
30+ console . log ( 'VscElement.ts updated successfully' ) ;
31+ }
32+
33+ main ( ) ;
Original file line number Diff line number Diff line change 11import { LitElement } from 'lit' ;
22
3- export class VscElement extends LitElement { }
3+ export class VscElement extends LitElement {
4+ /** VSC Element version */
5+ public readonly version = '1.0.0-pre.5' ;
6+ }
You can’t perform that action at this time.
0 commit comments