Skip to content

Commit

Permalink
chore: rename all types
Browse files Browse the repository at this point in the history
  • Loading branch information
oktaysenkan committed Oct 5, 2024
1 parent 6cef675 commit 5953035
Show file tree
Hide file tree
Showing 47 changed files with 169 additions and 154 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# react-native-iconify v3
# monicon

## Development

Expand Down
8 changes: 4 additions & 4 deletions apps/next/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { Iconify } from "@monicon/react";
import { Monicon } from "@monicon/react";

import styles from "../styles/index.module.css";

export default function Web() {
return (
<main className={styles.container}>
<Iconify name="mdi:home" />
<Iconify name="logos:active-campaign" size={30} />
<Iconify name="logos:apache-superset-icon" />
<Monicon name="mdi:home" />
<Monicon name="logos:active-campaign" size={30} />
<Monicon name="logos:apache-superset-icon" />
</main>
);
}
4 changes: 2 additions & 2 deletions apps/next/next.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { IconifyPlugin } = require("@monicon/webpack");
const { MoniconPlugin } = require("@monicon/webpack");

module.exports = {
reactStrictMode: true,
Expand All @@ -18,7 +18,7 @@ module.exports = {
];

config.plugins.push(
new IconifyPlugin({
new MoniconPlugin({
icons: [
"mdi:home",
"mdi:account",
Expand Down
10 changes: 4 additions & 6 deletions apps/nuxt-app/app.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<script setup lang="ts">
import { Iconify } from "@monicon/vue";
useHead({
title: "Nuxt App",
meta: [{ name: "description", content: "Generated by create turbo" }],
Expand All @@ -9,10 +7,10 @@ useHead({

<template>
<main>
<Iconify name="mdi:home" :size="24" />
<Iconify name="logos:active-campaign" />
<Iconify name="logos:apache-superset-icon" />
<Iconify name="invalid:icon" />
<Monicon name="mdi:home" :size="24" />
<Monicon name="logos:active-campaign" />
<Monicon name="logos:apache-superset-icon" />
<Monicon name="invalid:icon" />
</main>
</template>

Expand Down
2 changes: 1 addition & 1 deletion apps/nuxt-app/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export default defineNuxtConfig({
devtools: { enabled: true },
compatibilityDate: "2024-10-05",
modules: ["@monicon/nuxt"],
iconify: {
monicon: {
icons: [
"mdi:home",
"mdi:account",
Expand Down
12 changes: 6 additions & 6 deletions apps/react-native-app/App.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import React from "react";
import { StyleSheet, View } from "react-native";
import { Iconify } from "@monicon/native";
import { Monicon } from "@monicon/native";

export default function App() {
return (
<View style={styles.container}>
<Iconify name="mdi:home" />
<Iconify name="feather:activity" />
<Iconify name="logos:active-campaign" size={30} />
<Iconify name="logos:apache-superset-icon" />
<Iconify name="invalid:icon" />
<Monicon name="mdi:home" />
<Monicon name="feather:activity" />
<Monicon name="logos:active-campaign" size={30} />
<Monicon name="logos:apache-superset-icon" />
<Monicon name="invalid:icon" />
</View>
);
}
Expand Down
12 changes: 6 additions & 6 deletions apps/react-native-app/metro.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Learn more https://docs.expo.io/guides/customizing-metro
const { getDefaultConfig } = require("expo/metro-config");
const { withIconify } = require("@monicon/metro");
const { withMonicon } = require("@monicon/metro");
const path = require("path");

// Find the workspace root, this can be replaced with `find-yarn-workspace-root`
Expand All @@ -9,7 +9,7 @@ const projectRoot = __dirname;

const config = getDefaultConfig(projectRoot);

const configWithIconify = withIconify(config, {
const configWithMonicon = withMonicon(config, {
icons: [
"mdi:home",
"mdi:account",
Expand All @@ -23,13 +23,13 @@ const configWithIconify = withIconify(config, {
});

// 1. Watch all files within the monorepo
configWithIconify.watchFolders = [workspaceRoot];
configWithMonicon.watchFolders = [workspaceRoot];
// 2. Let Metro know where to resolve packages, and in what order
configWithIconify.resolver.nodeModulesPaths = [
configWithMonicon.resolver.nodeModulesPaths = [
path.resolve(projectRoot, "node_modules"),
path.resolve(workspaceRoot, "node_modules"),
];
// 3. Force Metro to resolve (sub)dependencies only from the `nodeModulesPaths`
configWithIconify.resolver.disableHierarchicalLookup = true;
configWithMonicon.resolver.disableHierarchicalLookup = true;

module.exports = configWithIconify;
module.exports = configWithMonicon;
4 changes: 2 additions & 2 deletions apps/react-native-app/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
const createExpoWebpackConfigAsync = require("@expo/webpack-config");
const { IconifyPlugin } = require("@monicon/webpack");
const { MoniconPlugin } = require("@monicon/webpack");

module.exports = async function (env, argv) {
const config = await createExpoWebpackConfigAsync(env, argv);

config.plugins.push(
new IconifyPlugin({
new MoniconPlugin({
icons: [
"mdi:home",
"mdi:account",
Expand Down
4 changes: 2 additions & 2 deletions apps/rollup-react/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import nodeResolve from "@rollup/plugin-node-resolve";
import commonjs from "@rollup/plugin-commonjs";
import babel from "@rollup/plugin-babel";
import replace from "@rollup/plugin-replace";
import { IconifyPlugin } from "@monicon/rollup";
import monicon from "@monicon/rollup";
import serve from "rollup-plugin-serve";

const isDev = process.env.NODE_ENV === "development";
Expand All @@ -19,7 +19,7 @@ export default {
nodeResolve({
extensions: [".js", ".jsx"],
}),
IconifyPlugin({
monicon({
outputFileName: "rollup-react",
icons: ["mdi:home"],
}),
Expand Down
4 changes: 2 additions & 2 deletions apps/rollup-react/src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import { Iconify } from "@monicon/react";
import { Monicon } from "@monicon/react";

const App = () => {
return (
Expand All @@ -12,7 +12,7 @@ const App = () => {
height: "100vh",
}}
>
<Iconify name="mdi:home" size={32} />
<Monicon name="mdi:home" size={32} />
</main>
);
};
Expand Down
4 changes: 2 additions & 2 deletions apps/rspack-react/rspack.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { fileURLToPath } from "node:url";
import { defineConfig } from "@rspack/cli";
import { rspack } from "@rspack/core";
import RefreshPlugin from "@rspack/plugin-react-refresh";
import IconifyPlugin from "@monicon/rspack";
import MoniconPlugin from "@monicon/rspack";

const __dirname = dirname(fileURLToPath(import.meta.url));
const isDev = process.env.NODE_ENV === "development";
Expand Down Expand Up @@ -56,7 +56,7 @@ export default defineConfig({
template: "./index.html",
}),
isDev ? new RefreshPlugin() : null,
new IconifyPlugin({
new MoniconPlugin({
icons: ["mdi:home"],
outputFileName: "rspack-react",
}),
Expand Down
6 changes: 3 additions & 3 deletions apps/rspack-react/src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import React from "react";
import { Iconify } from "@monicon/react";
import { Monicon } from "@monicon/react";

import "./App.css";

function App() {
return (
<div className="App">
<Iconify name="mdi:home" size={32} />
<Iconify name="invalid:icon" />
<Monicon name="mdi:home" size={32} />
<Monicon name="invalid:icon" />
</div>
);
}
Expand Down
10 changes: 5 additions & 5 deletions apps/svelte-app/src/routes/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<script>
import { Iconify } from "@monicon/svelte";
import { Monicon } from "@monicon/svelte";
</script>

<main>
<Iconify name="mdi:home" size={24} />
<Iconify name="logos:active-campaign" />
<Iconify name="logos:apache-superset-icon" />
<Iconify name="invalid:icon" color="red" />
<Monicon name="mdi:home" size={24} />
<Monicon name="logos:active-campaign" />
<Monicon name="logos:apache-superset-icon" />
<Monicon name="invalid:icon" color="red" />
</main>

<style>
Expand Down
4 changes: 2 additions & 2 deletions apps/svelte-app/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { sveltekit } from "@sveltejs/kit/vite";
import { defineConfig } from "vite";
import { IconifyPlugin } from "@monicon/vite";
import monicon from "@monicon/vite";

export default defineConfig({
plugins: [
sveltekit(),
IconifyPlugin({
monicon({
icons: [
"mdi:home",
"mdi:account",
Expand Down
10 changes: 5 additions & 5 deletions apps/vite-react/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import "./App.css";

import { Iconify } from "@monicon/react";
import { Monicon } from "@monicon/react";

function App() {
return (
<main>
<Iconify name="mdi:home" />
<Iconify name="logos:active-campaign" />
<Iconify name="logos:apache-superset-icon" />
<Iconify name="invalid:icon" />
<Monicon name="mdi:home" />
<Monicon name="logos:active-campaign" />
<Monicon name="logos:apache-superset-icon" />
<Monicon name="invalid:icon" />
</main>
);
}
Expand Down
4 changes: 2 additions & 2 deletions apps/vite-react/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import { IconifyPlugin } from "@monicon/vite";
import monicon from "@monicon/vite";

// https://vitejs.dev/config/
export default defineConfig({
plugins: [
react(),
IconifyPlugin({
monicon({
icons: [
"mdi:home",
"mdi:account",
Expand Down
8 changes: 4 additions & 4 deletions apps/vite-vue/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

<template>
<main>
<Iconify name="mdi:home" :size="32" />
<Iconify name="logos:active-campaign" />
<Iconify name="logos:apache-superset-icon" />
<Iconify name="invalid:icon" />
<Monicon name="mdi:home" :size="32" />
<Monicon name="logos:active-campaign" />
<Monicon name="logos:apache-superset-icon" />
<Monicon name="invalid:icon" />
</main>
</template>
4 changes: 2 additions & 2 deletions apps/vite-vue/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { createApp } from "vue";
import Iconify from "@monicon/vue";
import Monicon from "@monicon/vue";

import App from "./App.vue";

import "./style.css";

const app = createApp(App);

app.use(Iconify);
app.use(Monicon);

app.mount("#app");
4 changes: 2 additions & 2 deletions apps/vite-vue/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import { IconifyPlugin } from "@monicon/vite";
import monicon from "@monicon/vite";

// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
IconifyPlugin({
monicon({
icons: [
"mdi:home",
"mdi:account",
Expand Down
6 changes: 3 additions & 3 deletions packages/babel-plugin/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type * as b from "@babel/core";
import {
getIconsFilePath,
getResolveAlias,
IconifyOptions,
MoniconOptions,
} from "@monicon/core";

const alias = getResolveAlias();
Expand All @@ -13,7 +13,7 @@ export default ({ types: t }: typeof b): b.PluginObj => {
ImportDeclaration(path) {
if (path.node.source.value === alias) {
path.node.source.value = getIconsFilePath(
this.opts as IconifyOptions
this.opts as MoniconOptions
);
}
},
Expand All @@ -33,7 +33,7 @@ export default ({ types: t }: typeof b): b.PluginObj => {
firstArg.value === alias;

if (isFunctionImport && isImportingIcons && firstArg) {
firstArg.value = getIconsFilePath(this.opts as IconifyOptions);
firstArg.value = getIconsFilePath(this.opts as MoniconOptions);
}
},
},
Expand Down
Loading

0 comments on commit 5953035

Please sign in to comment.