|
|
@@ -81,6 +81,45 @@ const App = () => {
|
|
|
};
|
|
|
export default App;`;
|
|
|
|
|
|
+ const expoMetroConfigCode = `// For Expo
|
|
|
+const { getDefaultConfig } = require("expo/metro-config");
|
|
|
+const { withNCoreUIKit } = require("ncore-ui-kit/metro-config");
|
|
|
+
|
|
|
+const config = getDefaultConfig(__dirname);
|
|
|
+
|
|
|
+module.exports = withNCoreUIKit(config);`;
|
|
|
+
|
|
|
+ const bareMetroConfigCode = `// For Bare React Native CLI
|
|
|
+const { getDefaultConfig } = require("@react-native/metro-config");
|
|
|
+const { withNCoreUIKit } = require("ncore-ui-kit/metro-config");
|
|
|
+
|
|
|
+const config = getDefaultConfig(__dirname);
|
|
|
+
|
|
|
+module.exports = withNCoreUIKit(config);`;
|
|
|
+
|
|
|
+ const defaultWebpackCode = `// webpack.config.js
|
|
|
+const { createDefaultWebpackConfig } = require("ncore-ui-kit/webpack-config");
|
|
|
+
|
|
|
+module.exports = createDefaultWebpackConfig({
|
|
|
+ appDirectory: require("path").resolve(__dirname, "./"),
|
|
|
+ HtmlWebpackPlugin: require("html-webpack-plugin"),
|
|
|
+ ESLintPlugin: require("eslint-webpack-plugin"),
|
|
|
+ CopyPlugin: require("copy-webpack-plugin"),
|
|
|
+ webpack: require("webpack")
|
|
|
+});`;
|
|
|
+
|
|
|
+ const wrapWebpackCode = `// webpack.config.js
|
|
|
+const { withNCoreUIKitWebpack } = require("ncore-ui-kit/webpack-config");
|
|
|
+const webpack = require("webpack");
|
|
|
+
|
|
|
+let config = {
|
|
|
+ // ... existing configuration
|
|
|
+};
|
|
|
+
|
|
|
+module.exports = withNCoreUIKitWebpack(config, webpack);`;
|
|
|
+
|
|
|
+ const envSetupCode = `npx ncore-setup`;
|
|
|
+
|
|
|
return <PageContainer
|
|
|
isWorkWithHeaderSpace={false}
|
|
|
isScrollable={true}
|
|
|
@@ -123,6 +162,138 @@ export default App;`;
|
|
|
language="tsx"
|
|
|
/>
|
|
|
</View>
|
|
|
+ <Text
|
|
|
+ style={{
|
|
|
+ marginBottom: spaces.spacingMd
|
|
|
+ }}
|
|
|
+ variant="bodyMediumSize"
|
|
|
+ color="mid"
|
|
|
+ >
|
|
|
+ Mobil (React Native / Expo) ortamında kurulum yaparken, Node.js core modül polyfill'leri (crypto, process, stream) için metro.config.js dosyanızı NCore UIKit ile sarmalamanız (wrap) gerekir.
|
|
|
+ </Text>
|
|
|
+ <View
|
|
|
+ style={[
|
|
|
+ stylesheet.borderedCard,
|
|
|
+ {
|
|
|
+ backgroundColor: colors.content.container.default,
|
|
|
+ borderColor: colors.content.border.subtle,
|
|
|
+ marginBottom: spaces.spacingMd,
|
|
|
+ padding: spaces.spacingMd
|
|
|
+ }
|
|
|
+ ]}
|
|
|
+ >
|
|
|
+ <Text
|
|
|
+ variant="headlineSmallSize"
|
|
|
+ >
|
|
|
+ {localize("your-project-main-directory")}/metro.config.js (Expo)
|
|
|
+ </Text>
|
|
|
+ <CodeViewer
|
|
|
+ code={expoMetroConfigCode}
|
|
|
+ language="javascript"
|
|
|
+ />
|
|
|
+ </View>
|
|
|
+ <View
|
|
|
+ style={[
|
|
|
+ stylesheet.borderedCard,
|
|
|
+ {
|
|
|
+ backgroundColor: colors.content.container.default,
|
|
|
+ borderColor: colors.content.border.subtle,
|
|
|
+ marginBottom: spaces.spacingMd,
|
|
|
+ padding: spaces.spacingMd
|
|
|
+ }
|
|
|
+ ]}
|
|
|
+ >
|
|
|
+ <Text
|
|
|
+ variant="headlineSmallSize"
|
|
|
+ >
|
|
|
+ {localize("your-project-main-directory")}/metro.config.js (React Native CLI)
|
|
|
+ </Text>
|
|
|
+ <CodeViewer
|
|
|
+ code={bareMetroConfigCode}
|
|
|
+ language="javascript"
|
|
|
+ />
|
|
|
+ </View>
|
|
|
+ <Text
|
|
|
+ style={{
|
|
|
+ marginBottom: spaces.spacingMd
|
|
|
+ }}
|
|
|
+ variant="bodyMediumSize"
|
|
|
+ color="mid"
|
|
|
+ >
|
|
|
+ Web (React Native Web) ortamında derleme yapmak için NCore'un hazır Webpack ayarını kullanabilir veya mevcut ayarınızı sarmalayabilirsiniz.
|
|
|
+ </Text>
|
|
|
+ <View
|
|
|
+ style={[
|
|
|
+ stylesheet.borderedCard,
|
|
|
+ {
|
|
|
+ backgroundColor: colors.content.container.default,
|
|
|
+ borderColor: colors.content.border.subtle,
|
|
|
+ marginBottom: spaces.spacingMd,
|
|
|
+ padding: spaces.spacingMd
|
|
|
+ }
|
|
|
+ ]}
|
|
|
+ >
|
|
|
+ <Text
|
|
|
+ variant="headlineSmallSize"
|
|
|
+ >
|
|
|
+ {localize("your-project-main-directory")}/webpack.config.js (Hazır Ayar)
|
|
|
+ </Text>
|
|
|
+ <CodeViewer
|
|
|
+ code={defaultWebpackCode}
|
|
|
+ language="javascript"
|
|
|
+ />
|
|
|
+ </View>
|
|
|
+ <View
|
|
|
+ style={[
|
|
|
+ stylesheet.borderedCard,
|
|
|
+ {
|
|
|
+ backgroundColor: colors.content.container.default,
|
|
|
+ borderColor: colors.content.border.subtle,
|
|
|
+ marginBottom: spaces.spacingMd,
|
|
|
+ padding: spaces.spacingMd
|
|
|
+ }
|
|
|
+ ]}
|
|
|
+ >
|
|
|
+ <Text
|
|
|
+ variant="headlineSmallSize"
|
|
|
+ >
|
|
|
+ {localize("your-project-main-directory")}/webpack.config.js (Sarmalama)
|
|
|
+ </Text>
|
|
|
+ <CodeViewer
|
|
|
+ code={wrapWebpackCode}
|
|
|
+ language="javascript"
|
|
|
+ />
|
|
|
+ </View>
|
|
|
+ <Text
|
|
|
+ style={{
|
|
|
+ marginBottom: spaces.spacingMd
|
|
|
+ }}
|
|
|
+ variant="bodyMediumSize"
|
|
|
+ color="mid"
|
|
|
+ >
|
|
|
+ Geliştirme ortamınızın (ESLint, TS, VSCode vb.) NCore UI Kit ile aynı standartlara sahip olmasını istiyorsanız tek tıkla projenizi yapılandırabilirsiniz:
|
|
|
+ </Text>
|
|
|
+ <View
|
|
|
+ style={[
|
|
|
+ stylesheet.borderedCard,
|
|
|
+ {
|
|
|
+ backgroundColor: colors.content.container.default,
|
|
|
+ borderColor: colors.content.border.subtle,
|
|
|
+ marginBottom: spaces.spacingMd,
|
|
|
+ padding: spaces.spacingMd
|
|
|
+ }
|
|
|
+ ]}
|
|
|
+ >
|
|
|
+ <Text
|
|
|
+ variant="headlineSmallSize"
|
|
|
+ >
|
|
|
+ Terminal
|
|
|
+ </Text>
|
|
|
+ <CodeViewer
|
|
|
+ code={envSetupCode}
|
|
|
+ language="bash"
|
|
|
+ />
|
|
|
+ </View>
|
|
|
<View
|
|
|
style={[
|
|
|
stylesheet.rowSpaceBetween,
|