File tree Expand file tree Collapse file tree 4 files changed +68
-2
lines changed Expand file tree Collapse file tree 4 files changed +68
-2
lines changed Original file line number Diff line number Diff line change 10
10
" cli"
11
11
],
12
12
"description" : " A CLI tool for easily adding components from gluestack to your projects." ,
13
- "version" : " 0.7.20 " ,
13
+ "version" : " 0.7.22 " ,
14
14
"license" : " MIT" ,
15
15
"main" : " dist/index.js" ,
16
16
"files" : [
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import {
12
12
} from '../util' ;
13
13
import path , { resolve } from 'path' ;
14
14
import fs from 'fs' ;
15
+ import { checkNextVersion } from '../util/check-next-version' ;
15
16
16
17
const initOptionsSchema = z . object ( {
17
18
useNpm : z . boolean ( ) ,
@@ -59,6 +60,16 @@ export const init = new Command()
59
60
) ;
60
61
process . exit ( 1 ) ;
61
62
}
63
+
64
+ //TODO : remove this check once nextjs 15 is supported properly
65
+ const isNextjs15 = await checkNextVersion ( ) ;
66
+ if ( isNextjs15 ) {
67
+ log . info (
68
+ `Next.js 15 is not supported by the init command.\n Please use 'npm create gluestack-ui@latest' to clone a new next 15 project.\n`
69
+ ) ;
70
+ process . exit ( 1 ) ;
71
+ }
72
+
62
73
//if multiple package managers are used
63
74
if (
64
75
( options . useNpm && options . useYarn ) ||
Original file line number Diff line number Diff line change
1
+ import { Transform } from 'jscodeshift' ;
2
+
3
+ const transform : Transform = ( file , api ) => {
4
+ const j = api . jscodeshift ;
5
+ const root = j ( file . source ) ;
6
+
7
+ // Look for eslintConfig array definition
8
+ root
9
+ . find ( j . VariableDeclarator , { id : { name : 'eslintConfig' } } )
10
+ . forEach ( ( path ) => {
11
+ const arrayExpression = path . node . init ;
12
+
13
+ if ( arrayExpression && arrayExpression . type === 'ArrayExpression' ) {
14
+ const newRuleObject = j . objectExpression ( [
15
+ j . property (
16
+ 'init' ,
17
+ j . identifier ( 'rules' ) ,
18
+ j . objectExpression ( [
19
+ j . property (
20
+ 'init' ,
21
+ j . stringLiteral ( '@typescript-eslint/no-explicit-any' ) ,
22
+ j . stringLiteral ( 'off' )
23
+ ) ,
24
+ ] )
25
+ ) ,
26
+ ] ) ;
27
+
28
+ // Ensure new rule object isn't already present
29
+ const hasRuleAlready = arrayExpression . elements . some (
30
+ ( el ) =>
31
+ el &&
32
+ el . type === 'ObjectExpression' &&
33
+ el . properties . some (
34
+ ( prop ) =>
35
+ prop . key . type === 'Identifier' &&
36
+ prop . key . name === 'rules' &&
37
+ prop . value . type === 'ObjectExpression' &&
38
+ prop . value . properties . some (
39
+ ( rule ) =>
40
+ rule . key . type === 'StringLiteral' &&
41
+ rule . key . value === '@typescript-eslint/no-explicit-any'
42
+ )
43
+ )
44
+ ) ;
45
+
46
+ if ( ! hasRuleAlready ) {
47
+ arrayExpression . elements . push ( newRuleObject ) ;
48
+ }
49
+ }
50
+ } ) ;
51
+
52
+ return root . toSource ( ) ;
53
+ } ;
54
+
55
+ export default transform ;
Original file line number Diff line number Diff line change 2
2
import React , { useRef , useState } from 'react' ;
3
3
import { useServerInsertedHTML } from 'next/navigation' ;
4
4
import { StyleRegistry , createStyleRegistry } from 'styled-jsx' ;
5
- // @ts -ignore
5
+ // @ts -expect-error : AppRegistry is defined in react-native-web but its type is not defined
6
6
import { AppRegistry } from 'react-native-web' ;
7
7
import { flush } from '@gluestack-ui/nativewind-utils/flush' ;
8
8
You can’t perform that action at this time.
0 commit comments