File tree 2 files changed +15
-2
lines changed
2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change 1
1
import fs from 'fs' ;
2
+ import glob from 'glob' ;
2
3
import compiler from '../base.compiler.js' ;
3
4
4
5
const DEFAULT_OPTIONS = {
@@ -21,6 +22,18 @@ const DEFAULT_OPTIONS = {
21
22
. replace ( / \/ h e l p e r s \. s v e l t e / g, '' ) ;
22
23
23
24
fs . writeFileSync ( `${ outPath } /src/index.ts` , result , 'utf8' ) ;
25
+
26
+ // Add .svelte to all the indexes in src folder
27
+ glob . sync ( `${ outPath } /src/elements/**/index.ts` ) . map ( ( src ) => {
28
+ const data = fs
29
+ . readFileSync ( src , 'utf8' )
30
+ // add svelte to index
31
+ . replace ( / ( e x p o r t { d e f a u l t } f r o m ) ( .* ) ( ' ; ) / g, '$1$2.svelte$3' )
32
+ // but remove from hooks
33
+ . replace ( / \. h o o k \. s v e l t e / g, '.hook' ) ;
34
+
35
+ fs . writeFileSync ( src , data , 'utf8' ) ;
36
+ } ) ;
24
37
}
25
38
26
39
const data = fs . readFileSync ( outFile , 'utf8' ) ;
Original file line number Diff line number Diff line change 2
2
"name" : " papanasi" ,
3
3
"private" : true ,
4
4
"license" : " MIT" ,
5
- "version" : " 1.1.1 " ,
5
+ "version" : " 1.1.2 " ,
6
6
"type" : " module" ,
7
7
"scripts" : {
8
8
"compile" : " node ./compiler" ,
17
17
"postinstall" : " node ./hooks/post-install.hook.js" ,
18
18
"build-storybook" : " cross-env NODE_OPTIONS=--openssl-legacy-provider build-storybook" ,
19
19
"build" : " yarn compile" ,
20
- "package" : " lerna version 1.1.1 --force-publish" ,
20
+ "package" : " lerna version 1.1.2 --force-publish" ,
21
21
"postpackage" : " node ./hooks/post-package.hook.js" ,
22
22
"release" : " lerna publish from-package --force-publish"
23
23
},
You can’t perform that action at this time.
0 commit comments