diff --git a/README.md b/README.md
index 294b392bc..250e30722 100644
--- a/README.md
+++ b/README.md
@@ -45,14 +45,6 @@ Here are a few videos / talks that introduce Ignite and show off some of its fea
-
@@ -74,8 +66,6 @@ Nothing makes it into Ignite unless it's been proven on projects that Infinite R
| React | UI Framework | v19 | The most popular UI framework in the world |
| TypeScript | Language | v5 | Static typechecking |
| React Navigation | Navigation | v7 | Performant and consistent navigation framework |
-| MobX-State-Tree | State Management | v7 | Observable state tree |
-| MobX-React-Lite | React Integration | v4 | Re-render React performantly |
| Expo | SDK | v53 | Allows (optional) Expo modules |
| Expo Font | Custom Fonts | v13 | Import custom fonts |
| Expo Localization | Internationalization | v16 | i18n support (including RTL!) |
diff --git a/docs/boilerplate/Boilerplate.md b/docs/boilerplate/Boilerplate.md
index d29d3ad92..e303337de 100644
--- a/docs/boilerplate/Boilerplate.md
+++ b/docs/boilerplate/Boilerplate.md
@@ -25,7 +25,7 @@ your-project
│ ├── config
│ ├── devtools
│ ├── i18n
-│ ├── models
+│ ├── context
│ ├── navigators
│ ├── screens
│ ├── services
@@ -71,9 +71,9 @@ This is where setup and configuration of devtools like Reactotron occurs.
This is where your translations will live if you are using the included `react-native-i18n`.
-**[models](./app/models/Models.md)**
+**[context](./app/context/Context.md)**
-This is where your app's models will live. Each model has a directory which will contain the `mobx-state-tree` model file, test file, and any other supporting files like actions, types, etc. In addition, a helpers directory contains utility functions such as `getRootStore` to access the root store.
+This is where your app's react context providers live.
**[navigators](./app/navigators/Navigation.md)**
diff --git a/docs/boilerplate/app/app.md b/docs/boilerplate/app/app.md
index 0329b49a4..5b4e7eef8 100644
--- a/docs/boilerplate/app/app.md
+++ b/docs/boilerplate/app/app.md
@@ -6,14 +6,14 @@ title: app
The vast majority of your code will live in the `app` folder. This is where you'll spend most of your time.
-In this folder, there's only one file ([app.tsx](./app.tsx.md)). The rest are folders for containing components, models, screens, and more.
+In this folder, there's only one file ([app.tsx](./app.tsx.md)). The rest are folders for containing components, context, screens, and more.
- [app.tsx](./app.tsx.md) - The main entry point for your app
- [components](./components/Components.md) - Reusable components
- [config](./config/Config.md) - Configuration files
- [devtools](./devtools/Devtools.md) - Configuration/setup for Reactotron and other dev tools
- [i18n](./i18n/Internationalization.md) - Internationalization setup
-- [models](./models/Models.md) - MobX-State-Tree models
+- [context](./context/Context.md) - React context providers
- [navigators](./navigators/Navigation.md) - React Navigation navigators
- [screens](./screens/Screens.md) - The main screens of your app
- [services](./services/Services.md) - Services, such as API clients
diff --git a/docs/boilerplate/app/app.tsx.md b/docs/boilerplate/app/app.tsx.md
index 27d2d6673..c30f53892 100644
--- a/docs/boilerplate/app/app.tsx.md
+++ b/docs/boilerplate/app/app.tsx.md
@@ -12,7 +12,6 @@ Things that this file is responsible for:
- Loading fonts
- Setting up internationalization
-- Initializing the root MST store
- Initializing the root navigator
- Ensuring everything is loaded and then hiding the splash screen
- Setting up the safe area provider
diff --git a/docs/boilerplate/app/components/Components.md b/docs/boilerplate/app/components/Components.md
index d22e1ce6d..f69f67d94 100644
--- a/docs/boilerplate/app/components/Components.md
+++ b/docs/boilerplate/app/components/Components.md
@@ -203,7 +203,7 @@ This is an enhanced version of the built-in React Native Text component. It adds
preset="header"
tx="welcome:header"
txOptions={{
- name: rootStore.currentUser.name,
+ name: currentUser.name,
}}
style={$header}
/>
diff --git a/docs/boilerplate/app/context/Context.md b/docs/boilerplate/app/context/Context.md
new file mode 100644
index 000000000..860ecce08
--- /dev/null
+++ b/docs/boilerplate/app/context/Context.md
@@ -0,0 +1,24 @@
+# Context folder
+
+The `context` folder is where you can put your [React context providers](https://react.dev/learn/passing-data-deeply-with-context) or any other state management solutions you choose to use in your Ignited app.
+
+Ignite used to include [mobx-state-tree](https://mobx-state-tree.js.org/) as the default state management solution, but over time our projects have had more and more diverse state management solutions. We still love MST, and it was our go-to solution for many years, but shipping it by default with Ignite makes less sense now that there are so many other great options out there. Since we haven't settled on a single state management solution, simple React contexts are the default in this boilerplate.
+
+Currently this folder contains the following React contexts that are meant to be simple examples of how to use React context in your app:
+
+- `AuthContext`: This is a basic context that provides the demo app with a way to manage simple authentication state. We persist the data using MMKV hooks in this context provider. The app can consume the AuthContext wih the `useAuth` hook.
+- `EpisodeContext`: This context provides the demo app with a way to manage the list of episodes in the demo podcast screen. This context provides a `useEpisodes` hook that can be used to fetch the episodes and manage the state of the list.
+
+## State management solutions
+
+There are many state management solutions available for React Native apps. React context comes built in and is a is a reasonable solution for many apps. But you may want to consider other solutions depending on your app's complexity and needs.
+
+Here are some popular state management solutions you might consider (not in any particular order):
+
+- Redux using [Redux Toolkit](https://github.com/reduxjs/redux-toolkit): A predictable state container for JavaScript apps. It is widely used and has a large ecosystem of libraries and tools.
+- [MobX](https://mobx.js.org/README.html): A simple, scalable state management solution that uses observable data structures.
+- [Mobx State Tree (MST)](https://mobx-state-tree.js.org/): If MobX is a state management "engine", then MobX-State-Tree is a luxury car. MST gives you the structure, tools, and other features to get you where you're going.
+- [Zustand](https://github.com/pmndrs/zustand): A small, fast and scalable bearbones state-management solution using simplified flux principles.
+- [Legend State](https://github.com/LegendApp/legend-state): A super fast all-in-one state and sync library.
+- [React Query](https://react-query.tanstack.com/): A powerful data-fetching library that can also manage local state.
+- [XState](https://xstate.js.org/): Uses event-driven programming, state machines, statecharts, and the actor model to handle complex logic in predictable, robust, and visual ways.
diff --git a/docs/boilerplate/app/models/_category_.json b/docs/boilerplate/app/context/_category_.json
similarity index 57%
rename from docs/boilerplate/app/models/_category_.json
rename to docs/boilerplate/app/context/_category_.json
index e28ca9c76..26a5cd60f 100644
--- a/docs/boilerplate/app/models/_category_.json
+++ b/docs/boilerplate/app/context/_category_.json
@@ -1,8 +1,8 @@
{
- "label": "models",
+ "label": "context",
"position": 50,
"link": {
"type": "doc",
- "id": "Models"
+ "id": "Context"
}
}
diff --git a/docs/boilerplate/app/devtools/Devtools.md b/docs/boilerplate/app/devtools/Devtools.md
index 4b08c1982..2208e9df4 100644
--- a/docs/boilerplate/app/devtools/Devtools.md
+++ b/docs/boilerplate/app/devtools/Devtools.md
@@ -7,21 +7,7 @@ By default, Reactotron is configured to work with web and mobile apps and is con
### ReactotronConfig.ts
-The `reactotron-mst` plugin is included for MobX-State-Tree support.
-
-```typescript
-import { mst } from "reactotron-mst"
-const reactotron = Reactotron.configure({
- ...
-}).use(
- mst({
- /** ignore some chatty `mobx-state-tree` actions */
- filter: (event) => /postProcessSnapshot|@APPLY_SNAPSHOT/.test(event.name) === false,
- }),
-)
-```
-
-There are also a few custom commands included. You can use `reactotron.onCustomCommand` to add your own own custom debugging tools to Reactotron. Here is an example:
+There are a few custom commands included with this configuration. You can use `reactotron.onCustomCommand` to add your own own custom debugging tools to Reactotron. Here is an example:
```typescript
reactotron.onCustomCommand({
diff --git a/docs/boilerplate/app/models/Models.md b/docs/boilerplate/app/models/Models.md
deleted file mode 100644
index 13a177e67..000000000
--- a/docs/boilerplate/app/models/Models.md
+++ /dev/null
@@ -1,62 +0,0 @@
-# Models folder
-
-Ignite's perhaps most distinctive feature is its use of [MobX-State-Tree](https://mobx-state-tree.js.org/) (MST). This is a powerful and full-featured state management library that allows you to create strongly-typed observable models that can be used throughout your app and rerender on update intelligently without using selectors.
-
-We have [very good reasons](../../../concept/MobX-State-Tree.md) for using MST, but if after reading that doc you're still not keen on using it, we also have an [Ignite Cookbook recipe](https://ignitecookbook.com/docs/recipes/Redux) for removing MST and using Redux or Zustand instead.
-
-## RootStore
-
-The root of your MST tree is a single store (although you can create more if you want!). This usually contains high-level data that is used throughout your app, such as the user's authentication status, their locale, and more. It often contains other stores, such as AuthenticationStore, UserStore, ArticleStore, OrderStore, and so on.
-
-```typescript
-import { AuthenticationStoreModel } from "./AuthenticationStore"
-import { EpisodeStoreModel } from "./EpisodeStore"
-
-export const RootStoreModel = types.model("RootStore", {
- authenticationStore: types.optional(AuthenticationStoreModel, {}),
- episodeStore: types.optional(EpisodeStoreModel, {}),
-})
-```
-
-Each "store" is then made up of "models" (see below). (Note: In MST, "stores" and "models" are often used interchangeably, but we generally think of stores as being containers of multiple different models.)
-
-## Models
-
-You can [generate](../../../concept/Generators.md) models using the `npx ignite-cli generate model` command. This will create a new file in the `app/models` folder. You can also create models manually if you prefer.
-
-```typescript
-import { types } from "mobx-state-tree"
-
-/**
- * This represents an episode of React Native Radio.
- */
-export const EpisodeModel = types.model("Episode", {
- guid: types.identifier,
- title: "",
- link: "",
- author: "",
- thumbnail: "",
- description: "",
- content: "",
- categories: types.array(types.string),
-})
-```
-
-You will be able to create instances and use them in observed components like this:
-
-```typescript
-import { useStores } from "@/models/root-store"
-import { observer } from "mobx-react-lite"
-
-export const EpisodeScreen = observer(() => {
- const { episodeStore } = useStores()
-
- // automatically re-renders when the episode title changes
- // or if you change the current episode to a different one
- return {episodeStore.currentEpisode.title}
-})
-```
-
-Explore the existing models in your models folder (if you left demo code in) to see how they work. You can also read the [MST docs](https://mobx-state-tree.js.org/) for more information.
-
-And of course, you can always ask questions in the [Infinite Red Community Slack](http://community.infinite.red) or the [MobX-State-Tree GitHub Discussions group](https://github.com/mobxjs/mobx-state-tree/discussions).
diff --git a/docs/boilerplate/app/navigators/AppNavigator.tsx.md b/docs/boilerplate/app/navigators/AppNavigator.tsx.md
index a6ba96a3d..0911e039c 100644
--- a/docs/boilerplate/app/navigators/AppNavigator.tsx.md
+++ b/docs/boilerplate/app/navigators/AppNavigator.tsx.md
@@ -6,4 +6,4 @@ The AppNavigator is the root navigator for your whole app. It will have the navi
The AppStack is a native stack navigator (via [React Navigation](https://reactnavigation.org/docs/hello-react-navigation#creating-a-native-stack-navigator)) and contains all the screens and subnavigators of your app.
-In the case of Ignite's demo code, it is prepared with an example flow for an app requiring authentication. The screens included within the AppStack are dependent on value of `isAuthenticated` from `authenticationStore`. If in an unauthenticated state, the only screen to be shown will be the `LoginScreen`. Otherwise, that screen is left out of the navigator and the user is presented with the `WelcomeScreen` and screens that fall under the `DemoNavigator`
+In the case of Ignite's demo code, it is prepared with an example flow for an app requiring authentication. The screens included within the AppStack are dependent on value of `isAuthenticated` from the `useAuth()` hook. If in an unauthenticated state, the only screen to be shown will be the `LoginScreen`. Otherwise, that screen is left out of the navigator and the user is presented with the `WelcomeScreen` and screens that fall under the `DemoNavigator`
diff --git a/docs/boilerplate/app/navigators/Navigation.md b/docs/boilerplate/app/navigators/Navigation.md
index 989de0530..df022a5e0 100644
--- a/docs/boilerplate/app/navigators/Navigation.md
+++ b/docs/boilerplate/app/navigators/Navigation.md
@@ -27,10 +27,8 @@ We've found that there are some useful patterns for building navigators in React
We recommend following the guidance of [React Navigation's Authentication Flows](https://reactnavigation.org/docs/auth-flow/) and Ignite comes bootstrapped with this pattern in its demo code.
```tsx
-const AppStack = observer(function AppStack() {
- const {
- authenticationStore: { isAuthenticated },
- } = useStores()
+const AppStack = () => {
+ const { isAuthenticated } = useAuth()
return (
)
-})
+}
```
The screens included within the AppStack are dependent on value of `isAuthenticated` from `authenticationStore`. If the user hasn't been authenticated yet, the only screen to be shown will be the `LoginScreen`.
diff --git a/docs/boilerplate/ignite.md b/docs/boilerplate/ignite.md
index 8f63de795..e847d7db3 100644
--- a/docs/boilerplate/ignite.md
+++ b/docs/boilerplate/ignite.md
@@ -5,7 +5,7 @@ sidebar_position: 25
# Ignite Folder
-The `ignite` directory contains an initial set of generator templates to help scaffold new screens, components, models, app icons, and more.
+The `ignite` directory contains an initial set of generator templates to help scaffold new screens, components, context, app icons, and more.
Generators are the true gem of Ignite! They can save you countless hours as you build your app - we strongly recommend you give it a try!
Learn more about [Ignite Generators](../concept/Generators.md) and how to create your own [Ignite Generator Templates](../concept/Generator-Templates.md)
diff --git a/docs/cli/Ignite-CLI.md b/docs/cli/Ignite-CLI.md
index ac38daa15..42f6d2ba8 100644
--- a/docs/cli/Ignite-CLI.md
+++ b/docs/cli/Ignite-CLI.md
@@ -72,7 +72,7 @@ Tools
- `npx ignite-cli generate`
- Alias: `npx ignite-cli g`
-Provides generators to keep your code consistent while saving you time to scaffold new models, components and screens in an automated fashion.
+Provides generators to keep your code consistent while saving you time to scaffold new components and screens in an automated fashion.
For full documentation on this, head on over to the [Generators documentation](../concept/Generators.md).
@@ -98,7 +98,6 @@ Starts the interactive prompt for generating a new Ignite project. Any options n
- `--overwrite` overwrite the target directory if it exists
- `--targetPath` string, specify a target directory where the project should be created
- `--removeDemo` will remove the boilerplate demo code after project creation
-- `--state` string, one of `mst` or `none` to include MobX-State-Tree in project (**note:** if opting out of MobX-State-Tree the demo application will be removed)
- `--useCache` flag specifying to use dependency cache for quicker installs
- `--no-timeout` flag to disable the timeout protection (useful for slow internet connections)
- `--yes` accept all prompt defaults
diff --git a/docs/concept/Generator-Templates.md b/docs/concept/Generator-Templates.md
index 53e8a53f6..2365c6ff7 100644
--- a/docs/concept/Generator-Templates.md
+++ b/docs/concept/Generator-Templates.md
@@ -90,27 +90,6 @@ patch:
---
```
-### patches
-
-You can patch multiple files with `patches`. It works just the same as `patch`, but allows for multiple.
-
-```tsx
----
-patches:
- - path: "app/models/RootStore.ts"
- after: "from \"mobx-state-tree\"\n"
- insert: "import { <%= props.pascalCaseName %>Model } from \"../<%= props.kebabCaseName %>/<%= props.kebabCaseName %>\"\n"
- skip: <%= !props.kebabCaseName.endsWith('store') %>
- - path: "app/models/RootStore.ts"
- after: "types.model(\"RootStore\").props({\n"
- insert: " <%= props.camelCaseName %>: types.optional(<%= props.pascalCaseName %>Model, {} as any),\n"
- skip: <%= !props.kebabCaseName.endsWith('store') %>
- - path: "app/models/index.ts"
- append: "export * from \"./<%= props.kebabCaseName %>/<%= props.kebabCaseName %>\"\n"
- skip: <%= props.skipIndexFile %>
----
-```
-
## Notes
Front matter is very powerful, but not necessarily super intuitive. If you have questions about it, ask in the [Ignite Slack community](https://community.infinite.red) or post a [Discussion](https://github.com/infinitered/ignite/discussions).
diff --git a/docs/concept/Generators.md b/docs/concept/Generators.md
index ee1fc009a..059c2d773 100644
--- a/docs/concept/Generators.md
+++ b/docs/concept/Generators.md
@@ -16,7 +16,7 @@ npx ignite-cli generate --list
### Component generator
-This is the generator you will be using most often. They come pre-wrapped with mobx-react-lite's `observer` function, which you'll need to trigger re-renders if any MobX-State-Tree properties that are being used in this component change.
+This is the generator you will be using most often.
```
npx ignite-cli generate component MyAwesomeButton
@@ -26,24 +26,12 @@ npx ignite-cli generate component MyAwesomeButton
### Screen generator
-Generates a "hooks enabled" screen that is also pre-wrapped with mobx-react-lite's `observer` function, making it automatically re-render anytime a relevant MST property changes.
+Generates a "hooks enabled" screen.
```
npx ignite-cli generate screen Settings
```
-### Model generator
-
-Creates a Mobx-State-Tree model.
-
-```
-npx ignite-cli generate model Pizza
-```
-
-- Creates the model
-- Creates a unit test file
-- Appends export to `models/index.ts` unless you pass `--skip-index-file`
-
### Navigator generator
Creates a React Navigation navigator in the `app/navigators` folder.
diff --git a/docs/concept/MobX-State-Tree.md b/docs/concept/MobX-State-Tree.md
deleted file mode 100644
index 739594b01..000000000
--- a/docs/concept/MobX-State-Tree.md
+++ /dev/null
@@ -1,70 +0,0 @@
----
-sidebar_position: 125
----
-
-# Why MobX-State-Tree?
-
-If you've used Ignite Andross (the first Ignite stack), you know we formerly used Redux for state management, as does much of the community. However, we encountered some pain points with Redux so went in search of a different solution to meet our needs and landed on `mobx-state-tree` (also known as "MST"). We find that it’s a great middle-ground between completely structured (like `redux`) and completely freestyle (like `mobx`). It brings more than just state-management to the table as well (such as dependency injection, serialization, and lifecycle events).
-
-### Some Highlights of MST
-
-MST is...
-
-- Intuitive
- - With concepts like `props` and `actions`, it feels familiar for React developers
- - Updating your data means calling functions on objects, rather than dispatching actions.
- - Feels similar to relational databases, with concepts like `identifiers` (primary keys), `references` (foreign keys), and `views` (calculated fields)
-- Streamlined
- - No more `actionTypes`, `actionCreators`, or `reducers`
- - You don't have to declare your usage intentions with `mapStateToProps`; they are inferred
- - Side-effects are built-in; no need for 3rd party libraries like `redux-saga`, `redux-observable`, or `redux-thunk`
- - Immutability is built-in - no need for `immutable.js` or `seamless-immutable`
- - `types.compose` and `model.extend` allow for easy code-sharing of common patterns
-- More than state management
- - Lifecycle hooks like `afterCreate`, `preProcessSnapshot`, and `beforeDestroy` let you have control over your data at various points in its lifecycle
-- Performant
- - Round-trip store writes are much faster
- - Computed values (views) are only calculated when needed
- - `mobx-react-lite` makes React "MobX-aware" and only re-renders when absolutely necessary
-- Customizable
- - MST ships with pre-built middlewares, including one which allows for [Redux interoperability](https://github.com/mobxjs/mobx-state-tree/blob/master/packages/mst-middlewares/README.md#redux). These middlewares can also serve as examples to create your own!
-
-### Downsides
-
-We also recognize no state management solution is perfect. MST has some known downfalls:
-
-- Integration with TypeScript is clunky at times. MST's own typing system is sometimes at odds with what TypeScript wants
-- `mobx` and `mobx-state-tree` both seem to have "magic" or "sorcery" that makes issues less straightforward to debug because you don't always have a clear picture of what's happening (but using [Reactotron](https://github.com/infinitered/reactotron), which has `mobx-state-tree` support built-in, helps a lot). The [MobX docs](https://mobx.js.org/) can also help illuminate some of the magic.
-- The user base is small, so finding help on GitHub or Stack overflow is less convenient (however, the [Infinite Red Slack Community](http://community.infinite.red), as well as the [MobX-State-Tree GitHub Discussions group](https://github.com/mobxjs/mobx-state-tree/discussions) are both very helpful)
-- Fatal errors are sometimes too-easily triggered and error messages can be verbose and hard to grok
-- The API has a large surface area and the docs tend to be technical and unfriendly, although work is ongoing improving them all the time.
-
-### Remove MST Option
-
-We understand that state management is a highly opinionated topic with various options available. To accommodate this, we've added an option in Ignite CLI to remove MobX-State-Tree if you choose so! When Igniting a new project, provide `--state=none` to remove MobX-State-Tree code from the boilerplate. This option only works when also removing demo code.
-
-```
-npx ignite-cli@latest new PizzaApp --removeDemo=true --state=none
-```
-
-## Learning MobX-State-Tree
-
-MobX and MobX-State-Tree can be a lot to learn if you're coming from Redux, so here are a few of our favorite resources to learn the basics:
-
-- Be sure to check out the official [Getting Started](https://mobx-state-tree.js.org/intro/getting-started) guide for MobX-State-Tree.
-
-- There is also a free [egghead.io course](https://egghead.io/courses/manage-application-state-with-mobx-state-tree).
-
-- For a great explanation and walkthrough of the basics, check out [State Management with MobX-State-Tree](https://medium.com/react-native-training/state-management-with-mobx-state-tree-373f9f2dc68a) by React Native Training.
-
-- And for more in-depth reading, the [official documentation](https://github.com/mobxjs/mobx-state-tree/blob/master/README.md) is a great resource.
-
-- The official docs for [MobX](https://mobx.js.org/) are another important resource, since MST is built on MobX.
-
-- For help from real people in the community, make sure to check out the [Infinite Red Community Slack](https://community.infinite.red) as well as the [MobX-State-Tree GitHub Discussions group](https://github.com/mobxjs/mobx-state-tree/discussions).
-
-- To see example code bases using Ignite (and MST), check out these repositories:
-- https://github.com/robinheinze/ignite-trivia (based on [this tutorial](https://shift.infinite.red/creating-a-trivia-app-with-ignite-bowser-part-1-1987cc6e93a1) by @robinheinze)
-- https://github.com/jamonholmgren/PlayerPopularity (simple implementation)
-- https://github.com/jamonholmgren/TrailBlazers (simple implementation with hooks)
-- https://github.com/infinitered/ChainReactApp2019 (more in-depth implementation)
diff --git a/docs/concept/Testing.md b/docs/concept/Testing.md
index 9e3389127..1bee4df36 100644
--- a/docs/concept/Testing.md
+++ b/docs/concept/Testing.md
@@ -24,7 +24,7 @@ We provide an [Ignite Cookbook recipe](https://ignitecookbook.com/docs/recipes/M
### Test Structure
-In Ignite, we include unit tests for pure functions, such as models or utility functions.
+In Ignite, we include unit tests for pure utility functions.
Ignite uses Jest as our test runner. Jest tests are written using `it` or `test` statements, which take a describe of the test, and a function to execute the test code.
diff --git a/src/commands/new.ts b/src/commands/new.ts
index 3bb5b7090..c77b64a1d 100644
--- a/src/commands/new.ts
+++ b/src/commands/new.ts
@@ -32,7 +32,6 @@ import {
import type { ValidationsExports } from "../tools/validations"
import { boolFlag } from "../tools/flag"
import { cache } from "../tools/cache"
-import { mstDependenciesToRemove } from "../tools/mst"
import {
findAndRemoveDependencies,
findAndUpdateDependencyVersions,
@@ -41,7 +40,6 @@ import {
import { demoDependenciesToRemove, findDemoPatches } from "../tools/demo"
type Workflow = "cng" | "manual"
-type StateMgmt = "mst" | "none"
export interface Options {
/**
@@ -153,13 +151,6 @@ export interface Options {
* @default false
*/
noTimeout?: boolean
- /**
- * Whether or not to include MobX-State-Tree boilerplate code
- *
- * Input Source: `prompt.ask` | `parameter.option`
- * @default mst
- */
- state?: StateMgmt
/**
* Whether or not to enable the New Architecture
*
@@ -490,26 +481,8 @@ module.exports = {
// #endregion
- // #region Prompt to Remove MobX-State-Tree code
- const defaultMST = "mst"
- let stateMgmt = getDefault(options.state) ? defaultMST : options.state
-
- if (stateMgmt === undefined) {
- const includeMSTResponse = await prompt.ask<{ includeMST: StateMgmt }>(() => ({
- type: "confirm",
- name: "includeMST",
- message:
- "Include MobX-State-Tree for state management? (Recommended - opting out will remove the demo application)",
- initial: true,
- format: prettyPrompt.format.boolean,
- prefix,
- }))
- stateMgmt = includeMSTResponse.includeMST ? "mst" : "none"
- }
- // #endregion
-
// #region Prompt to Remove Demo code
- const defaultRemoveDemo = stateMgmt !== "mst" || experimentalExpoRouter
+ const defaultRemoveDemo = experimentalExpoRouter
if (defaultRemoveDemo) {
p(yellow(`Warning: the demo application will be removed.`))
}
@@ -666,11 +639,6 @@ module.exports = {
patchesToRemove.forEach((patch) => filesystem.cwd("./patches").remove(patch))
}
- if (stateMgmt === "none") {
- log(`Removing MST dependencies... ${mstDependenciesToRemove.join(", ")}`)
- packageJsonRaw = findAndRemoveDependencies(packageJsonRaw, mstDependenciesToRemove)
- }
-
if (!newArchEnabled) {
log(`Swapping old architecture compatible dependencies...`)
packageJsonRaw = findAndUpdateDependencyVersions(
@@ -880,29 +848,6 @@ module.exports = {
}
// #endregion
- // #region Remove MST code
- const removeMstPart = stateMgmt === "none" ? "code" : "markup"
- startSpinner(`Removing MobX-State-Tree ${removeMstPart}`)
- try {
- const IGNITE = "node " + filesystem.path(__dirname, "..", "..", "bin", "ignite")
- const CMD = stateMgmt === "none" ? "remove-mst" : "remove-mst-markup"
-
- log(`Ignite bin path: ${IGNITE}`)
- await system.run(
- `${IGNITE} ${CMD} "${targetPath}" "${experimentalExpoRouter ? "src" : "app"}"`,
- { onProgress: log },
- )
- } catch (e) {
- log(e)
- const additionalInfo =
- stateMgmt === "none"
- ? ` To perform updates manually, check out the recipe with full instructions: https://ignitecookbook.com/docs/recipes/RemoveMobxStateTree`
- : ""
- p(yellow(`Unable to remove MobX-State-Tree ${removeMstPart}.${additionalInfo}`))
- }
- stopSpinner(`Removing MobX-State-Tree ${removeMstPart}`, "🌳")
- // #endregion
-
// #region Run Format
const formattingMessage = `Cleaning up`
startSpinner(formattingMessage)
@@ -1012,7 +957,6 @@ module.exports = {
y: yname,
yes: yname,
noTimeout,
- state: stateMgmt,
},
projectName,
toolbox,
diff --git a/src/commands/remove-mst-markup.ts b/src/commands/remove-mst-markup.ts
deleted file mode 100644
index 8856eb1fb..000000000
--- a/src/commands/remove-mst-markup.ts
+++ /dev/null
@@ -1,57 +0,0 @@
-import { GluegunToolbox } from "gluegun"
-
-import { boolFlag } from "../tools/flag"
-import { p, warning } from "../tools/pretty"
-import { findFiles, updateFiles } from "../tools/markup"
-import { MST_MARKUP_PREFIX } from "../tools/mst"
-
-module.exports = {
- alias: ["rmstm", "remove-mst-markup"],
- description:
- "Remove all MobX-State-Tree markup from boilerplate. Add --dry-run to see what would be removed.",
- run: async (toolbox: GluegunToolbox) => {
- const { parameters } = toolbox
-
- const CWD = process.cwd()
- const TARGET_DIR = parameters.first ?? CWD
- const dryRun = boolFlag(parameters.options.dryRun) ?? false
-
- p()
- p(`Removing MobX-State-Tree markup from '${TARGET_DIR}'${dryRun ? " (dry run)" : ""}`)
-
- const filePaths = findFiles(TARGET_DIR)
-
- // Go through every file path and handle the operation for each demo comment
- const mstCommentResults = await updateFiles({
- filePaths,
- markupPrefix: MST_MARKUP_PREFIX,
- dryRun,
- removeMarkupOnly: true,
- })
-
- // Handle the results of the demo comment operations
- mstCommentResults
- // Sort the results by the path in alphabetical order
- .sort((a, b) => {
- if (a.status === "fulfilled" && b.status === "fulfilled") {
- return a.value.path.localeCompare(b.value.path)
- }
- return 0
- })
- .forEach((result) => {
- // Log any rejected results as warnings
- if (result.status === "rejected") {
- warning(result.reason)
- return
- }
-
- // Log any fulfilled results that have comments
- const { path, comments } = result.value
- if (comments.length > 0) {
- p(`Found ${comments.map((c) => `'${c}'`).join(", ")} in ${path}`)
- }
- })
-
- p(`Done removing MobX-State-Tree markup from '${TARGET_DIR}'${dryRun ? " (dry run)" : ""}`)
- },
-}
diff --git a/src/commands/remove-mst.ts b/src/commands/remove-mst.ts
deleted file mode 100644
index fe652cb31..000000000
--- a/src/commands/remove-mst.ts
+++ /dev/null
@@ -1,75 +0,0 @@
-import * as pathlib from "path"
-
-import { GluegunToolbox } from "gluegun"
-
-import { boolFlag } from "../tools/flag"
-import { p, warning } from "../tools/pretty"
-import { MST_MARKUP_PREFIX, mstDependenciesToRemove } from "../tools/mst"
-import { findFiles, removeEmptyDirs, updateFiles } from "../tools/markup"
-import { removePackageJSONDependencies } from "../tools/dependencies"
-
-module.exports = {
- alias: ["rm-mst", "remove-mst"],
- description:
- "Remove MobX-State-Tree code from generated boilerplate. Add --dry-run to see what would be removed.",
- run: async (toolbox: GluegunToolbox) => {
- const { parameters } = toolbox
-
- const CWD = process.cwd()
- const TARGET_DIR = parameters.first ?? CWD
- const dryRun = boolFlag(parameters.options.dryRun) ?? false
-
- p()
- p(`Removing MobX-State-Tree code from '${TARGET_DIR}'${dryRun ? " (dry run)" : ""}`)
-
- const filePaths = findFiles(TARGET_DIR)
-
- p(
- `Removing dependencies from package.json: ${mstDependenciesToRemove.join(", ")} ${
- dryRun ? "(dry run)" : ""
- }`,
- )
- if (!dryRun) {
- const packageJSONPath = pathlib.join(TARGET_DIR, "package.json")
- removePackageJSONDependencies(packageJSONPath, mstDependenciesToRemove)
- }
-
- const mstCommentResults = await updateFiles({
- filePaths,
- markupPrefix: MST_MARKUP_PREFIX,
- removeMarkupOnly: false,
- dryRun,
- })
-
- // Handle the results of the mst comment operations
- mstCommentResults
- // Sort the results by the path in alphabetical order
- .sort((a, b) => {
- if (a.status === "fulfilled" && b.status === "fulfilled") {
- return a.value.path.localeCompare(b.value.path)
- }
- return 0
- })
- .forEach((result) => {
- // Log any rejected results as warnings
- if (result.status === "rejected") {
- warning(result.reason)
- return
- }
-
- // Log any fulfilled results that have comments
- const { path, comments } = result.value
- if (comments.length > 0) {
- p(`Found ${comments.map((c) => `'${c}'`).join(", ")} in ${path}`)
- }
- })
-
- // first pass
- const emptyDirsRemoved = removeEmptyDirs({ targetDir: TARGET_DIR, dryRun })
- emptyDirsRemoved.forEach((path) => {
- p(`Removed empty directory '${path}'`)
- })
-
- p(`Done removing MobX-State-Tree code from '${TARGET_DIR}'${dryRun ? " (dry run)" : ""}`)
- },
-}
diff --git a/src/tools/__snapshots__/markup.test.ts.snap b/src/tools/__snapshots__/markup.test.ts.snap
index 825a36851..92e788d1d 100644
--- a/src/tools/__snapshots__/markup.test.ts.snap
+++ b/src/tools/__snapshots__/markup.test.ts.snap
@@ -12,20 +12,19 @@ import {
NavigationContainer,
} from "@react-navigation/native"
import { createNativeStackNavigator, NativeStackScreenProps } from "@react-navigation/native-stack"
-import { observer } from "mobx-react-lite"
+import { ComponentProps } from "react"
+
import * as Screens from "@/screens"
import Config from "@/config"
-import { navigationRef, useBackButtonHandler } from "./navigationUtilities"
import { useAppTheme, useThemeProvider } from "@/utils/useAppTheme"
+import { navigationRef, useBackButtonHandler } from "./navigationUtilities"
+import { useAuth } from "@/context/AuthContext"
+
/**
* This type allows TypeScript to know what routes are defined in this navigator
* as well as what properties (if any) they might take when navigating to them.
*
- * If no params are allowed, pass through undefined. Generally speaking, we
- * recommend using your MobX-State-Tree store(s) to keep application state
- * rather than passing state through navigation params.
- *
* For more information, see this documentation:
* https://reactnavigation.org/docs/params/
* https://reactnavigation.org/docs/typescript#type-checking-the-navigator
@@ -51,8 +50,13 @@ export type AppStackScreenProps = NativeStack
// Documentation: https://reactnavigation.org/docs/stack-navigator/
const Stack = createNativeStackNavigator()
-const AppStack = observer(function AppStack() {
+const AppStack = () => {
+ const {
+ theme: { colors },
+ } = useAppTheme()
+
return (
+
)
-})
+}
export interface NavigationProps
- extends Partial> {}
+ extends Partial>> {}
-export const AppNavigator = observer(function AppNavigator(props: NavigationProps) {
- const { theme, navigationTheme, setThemeContextOverride, ThemeProvider } = useThemeProvider()
+export const AppNavigator = (props: NavigationProps) => {
+ const { themeScheme, navigationTheme, setThemeContextOverride, ThemeProvider } =
+ useThemeProvider()
useBackButtonHandler((routeName) => exitRoutes.includes(routeName))
return (
-
+
-
+
+
+
)
-})
+}
"
`;
exports[`markup remove should remove all comments in WelcomeScreen 1`] = `
"
-import { observer } from "mobx-react-lite"
import { FC } from "react"
import { Image, ImageStyle, TextStyle, View, ViewStyle } from "react-native"
+
import {
Text,
+ Screen,
} from "@/components"
import { isRTL } from "@/i18n"
import { AppStackScreenProps } from "@/navigators"
-import type { ThemedStyle } from "@/theme"
+import { $styles, type ThemedStyle } from "@/theme"
import { useSafeAreaInsetsStyle } from "@/utils/useSafeAreaInsetsStyle"
+import { useAppTheme } from "@/utils/useAppTheme"
+import { useAuth } from "@/context/AuthContext"
const welcomeLogo = require("@assets/images/logo.png")
const welcomeFace = require("@assets/images/welcome-face.png")
interface WelcomeScreenProps extends AppStackScreenProps<"Welcome"> {}
-export const WelcomeScreen: FC = observer(function WelcomeScreen(
-) {
+export const WelcomeScreen: FC = (
+) => {
+ const { themed, theme } = useAppTheme()
const $bottomContainerInsets = useSafeAreaInsetsStyle(["bottom"])
return (
-
+ = observer(function WelcomeSc
preset="heading"
/>
-
+
-
+
-
+
)
-})
-
-const $container: ThemedStyle = ({ colors }) => ({
- flex: 1,
- backgroundColor: colors.background,
-})
+}
const $topContainer: ThemedStyle = ({ spacing }) => ({
flexShrink: 1,
diff --git a/src/tools/generators.ts b/src/tools/generators.ts
index b7acd0fd0..cd2d458b4 100644
--- a/src/tools/generators.ts
+++ b/src/tools/generators.ts
@@ -85,7 +85,7 @@ export function showGeneratorHelp(toolbox: GluegunToolbox) {
heading("Options")
p()
command("--dir", "Override front matter or default path for generated files", [
- "npx ignite-cli g model Episodes --dir src/models",
+ "npx ignite-cli g model Episodes --dir src/context",
])
command("--case", "Formats the generated filename", [
"npx ignite-cli g model episode --case=auto",
@@ -323,7 +323,7 @@ export async function generateFromTemplate(
}
// where are we copying to?
- const defaultDestinationDir = path(appDir(), pluralize(generator), options.subdirectory) // e.g. app/components, app/screens, app/models
+ const defaultDestinationDir = path(appDir(), pluralize(generator), options.subdirectory) // e.g. app/components, app/screens
const overrideDestinationDir = options.dir ?? frontMatterData.destinationDir // cli dir takes priority over front matter dir
const destinationDir = overrideDestinationDir
? path(cwd(), overrideDestinationDir)
diff --git a/src/tools/markup.test.ts b/src/tools/markup.test.ts
index 1c930b128..39557decc 100644
--- a/src/tools/markup.test.ts
+++ b/src/tools/markup.test.ts
@@ -317,7 +317,6 @@ describe("markup", () => {
expect(result).not.toContain(blockEndComment)
expect(result).not.toContain(currentLineComment)
expect(result).not.toContain(`NavigatorScreenParams`)
- expect(result).not.toContain(`import { useStores } from "@/models"`)
expect(result).not.toContain(
`import { DemoNavigator, DemoTabParamList } from "./DemoNavigator" "`,
)
@@ -327,35 +326,34 @@ describe("markup", () => {
})
const WelcomeScreen = /* jsx */ `
-import { observer } from "mobx-react-lite"
import { FC } from "react"
import { Image, ImageStyle, TextStyle, View, ViewStyle } from "react-native"
+
import {
Button, // @demo remove-current-line
Text,
+ Screen,
} from "@/components"
import { isRTL } from "@/i18n"
-import { useStores } from "@/models" // @demo remove-current-line
import { AppStackScreenProps } from "@/navigators"
-import type { ThemedStyle } from "@/theme"
+import { $styles, type ThemedStyle } from "@/theme"
import { useHeader } from "@/utils/useHeader" // @demo remove-current-line
import { useSafeAreaInsetsStyle } from "@/utils/useSafeAreaInsetsStyle"
-import { useAppTheme } from "@/utils/useAppTheme" // @demo remove-current-line
+import { useAppTheme } from "@/utils/useAppTheme"
+import { useAuth } from "@/context/AuthContext"
const welcomeLogo = require("@assets/images/logo.png")
const welcomeFace = require("@assets/images/welcome-face.png")
interface WelcomeScreenProps extends AppStackScreenProps<"Welcome"> {}
-export const WelcomeScreen: FC = observer(function WelcomeScreen(
+export const WelcomeScreen: FC = (
_props, // @demo remove-current-line
-) {
+) => {
+ const { themed, theme } = useAppTheme()
// @demo remove-block-start
- const { themed } = useAppTheme()
const { navigation } = _props
- const {
- authenticationStore: { logout },
- } = useStores()
+ const { logout } = useAuth()
function goNext() {
navigation.navigate("Demo", { screen: "DemoShowroom", params: {} })
@@ -363,7 +361,7 @@ export const WelcomeScreen: FC = observer(function WelcomeSc
useHeader(
{
- rightTx: "common.logOut",
+ rightTx: "common:logOut",
onRightPress: logout,
},
[logout],
@@ -373,7 +371,7 @@ export const WelcomeScreen: FC = observer(function WelcomeSc
const $bottomContainerInsets = useSafeAreaInsetsStyle(["bottom"])
return (
-
+ = observer(function WelcomeSc
preset="heading"
/>
-
+
-
+
{/* @demo remove-block-start */}
-
+
)
-})
-
-const $container: ThemedStyle = ({ colors }) => ({
- flex: 1,
- backgroundColor: colors.background,
-})
+}
const $topContainer: ThemedStyle = ({ spacing }) => ({
flexShrink: 1,
@@ -456,22 +454,20 @@ import {
NavigatorScreenParams, // @demo remove-current-line
} from "@react-navigation/native"
import { createNativeStackNavigator, NativeStackScreenProps } from "@react-navigation/native-stack"
-import { observer } from "mobx-react-lite"
+import { ComponentProps } from "react"
+
import * as Screens from "@/screens"
import Config from "@/config"
-import { useStores } from "@/models" // @demo remove-current-line
+import { useAppTheme, useThemeProvider } from "@/utils/useAppTheme"
+
import { DemoNavigator, DemoTabParamList } from "./DemoNavigator" // @demo remove-current-line
import { navigationRef, useBackButtonHandler } from "./navigationUtilities"
-import { useAppTheme, useThemeProvider } from "@/utils/useAppTheme"
+import { useAuth } from "@/context/AuthContext"
/**
* This type allows TypeScript to know what routes are defined in this navigator
* as well as what properties (if any) they might take when navigating to them.
*
- * If no params are allowed, pass through undefined. Generally speaking, we
- * recommend using your MobX-State-Tree store(s) to keep application state
- * rather than passing state through navigation params.
- *
* For more information, see this documentation:
* https://reactnavigation.org/docs/params/
* https://reactnavigation.org/docs/typescript#type-checking-the-navigator
@@ -499,15 +495,16 @@ export type AppStackScreenProps = NativeStack
// Documentation: https://reactnavigation.org/docs/stack-navigator/
const Stack = createNativeStackNavigator()
-const AppStack = observer(function AppStack() {
+const AppStack = () => {
// @demo remove-block-start
+ const { isAuthenticated } = useAuth()
+ // @demo remove-block-end
const {
- authenticationStore: { isAuthenticated },
- } = useStores()
- const { theme: { colors } } = useAppTheme()
+ theme: { colors },
+ } = useAppTheme()
- // @demo remove-block-end
return (
+
)
-})
+}
export interface NavigationProps
- extends Partial> {}
+ extends Partial>> {}
-export const AppNavigator = observer(function AppNavigator(props: NavigationProps) {
- const { theme, navigationTheme, setThemeContextOverride, ThemeProvider } = useThemeProvider()
+export const AppNavigator = (props: NavigationProps) => {
+ const { themeScheme, navigationTheme, setThemeContextOverride, ThemeProvider } =
+ useThemeProvider()
useBackButtonHandler((routeName) => exitRoutes.includes(routeName))
return (
-
+
-
+
+
+
)
-})
+}
`
diff --git a/src/tools/mst.ts b/src/tools/mst.ts
deleted file mode 100644
index 3a598a71b..000000000
--- a/src/tools/mst.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-export const MST_MARKUP_PREFIX = "@mst"
-
-export const mstDependenciesToRemove = [
- "mobx",
- "mobx-react-lite",
- "mobx-state-tree",
- "reactotron-mst",
-]
diff --git a/src/tools/react-native.ts b/src/tools/react-native.ts
index 4b9a545d2..b3cc20a7b 100644
--- a/src/tools/react-native.ts
+++ b/src/tools/react-native.ts
@@ -243,19 +243,16 @@ export function createExpoRouterScreenTemplate(toolbox: GluegunToolbox) {
const filePath = filesystem.path(TARGET_DIR, "ignite/templates/screen/NAME.tsx.ejs")
const EXPO_ROUTER_SCREEN_TPL = `import React, { FC } from "react"
-import { observer } from "mobx-react-lite"
import { ViewStyle } from "react-native"
import { Screen, Text } from "@/components"
-// @mst replace-next-line export default function <%= props.pascalCaseName %>Screen() {
-export default observer(function <%= props.pascalCaseName %>Screen() {
+export default function <%= props.pascalCaseName %>Screen() {
return (
)
-// @mst replace-next-line }
-})
+}
const $root: ViewStyle = {
flex: 1,
@@ -314,8 +311,6 @@ export function updateExpoRouterSrcDir(toolbox: GluegunToolbox) {
// has its own tsconfig, needs updating separately
"test/i18n.test.ts",
"test/setup.ts",
- "ignite/templates/model/NAME.ts.ejs",
- "ignite/templates/model/NAME.test.ts.ejs",
"ignite/templates/component/NAME.tsx.ejs",
]
expoRouterFilesToFix.forEach((file) => {
diff --git a/test/_test-helpers.ts b/test/_test-helpers.ts
index 54aaa4eb4..53e809a86 100644
--- a/test/_test-helpers.ts
+++ b/test/_test-helpers.ts
@@ -174,19 +174,14 @@ patches:
skip: <%= props.skipIndexFile %>
---
import React, { FC } from "react"
-import { observer } from "mobx-react-lite"
import { ViewStyle } from "react-native"
import { AppStackScreenProps } from "@/navigators"
import { Screen, Text } from "@/components"
// import { useNavigation } from "@react-navigation/native"
-// import { useStores } from "@/models"
interface <%= props.pascalCaseName %>ScreenProps extends AppStackScreenProps<"<%= props.pascalCaseName %>"> {}
-export const <%= props.pascalCaseName %>Screen: FC<<%= props.pascalCaseName %>ScreenProps> = observer(function <%= props.pascalCaseName %>Screen() {
- // Pull in one of our MST stores
- // const { someStore, anotherStore } = useStores()
-
+export const <%= props.pascalCaseName %>Screen: FC<<%= props.pascalCaseName %>ScreenProps> = () => {
// Pull in navigation via hook
// const navigation = useNavigation()
return (
@@ -194,7 +189,7 @@ export const <%= props.pascalCaseName %>Screen: FC<<%= props.pascalCaseName %>Sc
)
-})
+}
const $root: ViewStyle = {
flex: 1,
@@ -207,17 +202,16 @@ const $root: ViewStyle = {
export function copyExpoRouterScreenGenerator(tempBoilerplatePath: string): void {
const EXPO_ROUTER_SCREEN_TPL = `import React, { FC } from "react"
-import { observer } from "mobx-react-lite"
import { ViewStyle } from "react-native"
import { Screen, Text } from "@/components"
-export default observer(function <%= props.pascalCaseName %>Screen() {
+export default function <%= props.pascalCaseName %>Screen() {
return (
)
-})
+}
const $root: ViewStyle = {
flex: 1,
diff --git a/test/vanilla/__snapshots__/ignite-remove-demo.test.ts.snap b/test/vanilla/__snapshots__/ignite-remove-demo.test.ts.snap
index 165e19983..793addbf2 100644
--- a/test/vanilla/__snapshots__/ignite-remove-demo.test.ts.snap
+++ b/test/vanilla/__snapshots__/ignite-remove-demo.test.ts.snap
@@ -6,6 +6,8 @@ exports[`ignite-cli remove-demo should print the expected response 1`] = `
removing file /user/home/ignite/.maestro/flows/FavoritePodcast.yaml
removing file /user/home/ignite/.maestro/flows/Login.yaml
removing file /user/home/ignite/.maestro/shared/_Login.yaml
+removing file /user/home/ignite/app/context/AuthContext.tsx
+removing file /user/home/ignite/app/context/EpisodeContext.tsx
removing file /user/home/ignite/app/i18n/demo-ar.ts
removing file /user/home/ignite/app/i18n/demo-en.ts
removing file /user/home/ignite/app/i18n/demo-es.ts
@@ -13,10 +15,6 @@ removing file /user/home/ignite/app/i18n/demo-fr.ts
removing file /user/home/ignite/app/i18n/demo-hi.ts
removing file /user/home/ignite/app/i18n/demo-ja.ts
removing file /user/home/ignite/app/i18n/demo-ko.ts
-removing file /user/home/ignite/app/models/AuthenticationStore.ts
-removing file /user/home/ignite/app/models/Episode.test.ts
-removing file /user/home/ignite/app/models/Episode.ts
-removing file /user/home/ignite/app/models/EpisodeStore.ts
removing file /user/home/ignite/app/navigators/DemoNavigator.tsx
removing file /user/home/ignite/app/screens/DemoCommunityScreen.tsx
removing file /user/home/ignite/app/screens/DemoDebugScreen.tsx
@@ -42,6 +40,8 @@ removing file /user/home/ignite/app/screens/LoginScreen.tsx
Found 'remove-file' in /user/home/ignite/.maestro/flows/Login.yaml
Found 'remove-file' in /user/home/ignite/.maestro/shared/_Login.yaml
Found '@demo remove-current-line' in /user/home/ignite/app/components/Icon.tsx
+ Found 'remove-file' in /user/home/ignite/app/context/AuthContext.tsx
+ Found 'remove-file' in /user/home/ignite/app/context/EpisodeContext.tsx
Found '@demo remove-current-line', '@demo remove-block-start', '@demo remove-block-end' in /user/home/ignite/app/i18n/ar.ts
Found 'remove-file' in /user/home/ignite/app/i18n/demo-ar.ts
Found 'remove-file' in /user/home/ignite/app/i18n/demo-en.ts
@@ -56,11 +56,6 @@ removing file /user/home/ignite/app/screens/LoginScreen.tsx
Found '@demo remove-current-line', '@demo remove-block-start', '@demo remove-block-end' in /user/home/ignite/app/i18n/hi.ts
Found '@demo remove-current-line', '@demo remove-block-start', '@demo remove-block-end' in /user/home/ignite/app/i18n/ja.ts
Found '@demo remove-current-line', '@demo remove-block-start', '@demo remove-block-end' in /user/home/ignite/app/i18n/ko.ts
- Found 'remove-file' in /user/home/ignite/app/models/AuthenticationStore.ts
- Found 'remove-file' in /user/home/ignite/app/models/Episode.test.ts
- Found 'remove-file' in /user/home/ignite/app/models/Episode.ts
- Found 'remove-file' in /user/home/ignite/app/models/EpisodeStore.ts
- Found '@demo remove-current-line' in /user/home/ignite/app/models/RootStore.ts
Found '@demo remove-current-line', '@demo remove-block-start', '@demo remove-block-end' in /user/home/ignite/app/navigators/AppNavigator.tsx
Found 'remove-file' in /user/home/ignite/app/navigators/DemoNavigator.tsx
Found 'remove-file' in /user/home/ignite/app/screens/DemoCommunityScreen.tsx
@@ -88,6 +83,7 @@ removing file /user/home/ignite/app/screens/LoginScreen.tsx
Found '@demo remove-current-line', '@demo remove-block-start', '@demo remove-block-end' in /user/home/ignite/app/services/api/api.ts
Found '@demo remove-current-line', '@demo remove-block-start', '@demo remove-block-end' in /user/home/ignite/app/theme/styles.ts
Removed empty directory '/user/home/ignite/.maestro/flows'
+ Removed empty directory '/user/home/ignite/app/context'
Removed empty directory '/user/home/ignite/app/screens/DemoShowroomScreen/demos'
Removed empty directory '/user/home/ignite/app/screens/DemoShowroomScreen'
Removed demo directory '/user/home/ignite/assets/icons/demo'
diff --git a/test/vanilla/__snapshots__/ignite-remove-mst.test.ts.snap b/test/vanilla/__snapshots__/ignite-remove-mst.test.ts.snap
deleted file mode 100644
index 1c0e4ef6a..000000000
--- a/test/vanilla/__snapshots__/ignite-remove-mst.test.ts.snap
+++ /dev/null
@@ -1,26 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`ignite-cli remove-mst should print the expected response 1`] = `
-"
- Removing MobX-State-Tree code from '/user/home/ignite'
- Removing dependencies from package.json: mobx, mobx-react-lite, mobx-state-tree, reactotron-mst
-removing file /user/home/ignite/app/models/RootStore.ts
-removing file /user/home/ignite/app/models/helpers/getRootStore.ts
-removing file /user/home/ignite/app/models/helpers/setupRootStore.ts
-removing file /user/home/ignite/app/models/helpers/useStores.ts
-removing file /user/home/ignite/app/models/helpers/withSetPropAction.ts
-removing file /user/home/ignite/app/models/index.ts
- Found '@mst remove-current-line', '@mst replace-next-line' in /user/home/ignite/app/app.tsx
- Found '@mst remove-current-line', '@mst remove-block-start', '@mst remove-block-end' in /user/home/ignite/app/devtools/ReactotronConfig.ts
- Found 'remove-file' in /user/home/ignite/app/models/helpers/getRootStore.ts
- Found 'remove-file' in /user/home/ignite/app/models/helpers/setupRootStore.ts
- Found 'remove-file' in /user/home/ignite/app/models/helpers/useStores.ts
- Found 'remove-file' in /user/home/ignite/app/models/helpers/withSetPropAction.ts
- Found 'remove-file' in /user/home/ignite/app/models/index.ts
- Found 'remove-file' in /user/home/ignite/app/models/RootStore.ts
- Found '@mst remove-current-line', '@mst replace-next-line' in /user/home/ignite/app/navigators/AppNavigator.tsx
- Found '@mst remove-current-line', '@mst replace-next-line' in /user/home/ignite/app/screens/WelcomeScreen.tsx
- Removed empty directory '/user/home/ignite/app/models/helpers'
- Done removing MobX-State-Tree code from '/user/home/ignite'
-"
-`;
diff --git a/test/vanilla/ignite-generate.test.ts b/test/vanilla/ignite-generate.test.ts
index e6f3d99d7..5117ba61b 100644
--- a/test/vanilla/ignite-generate.test.ts
+++ b/test/vanilla/ignite-generate.test.ts
@@ -45,202 +45,6 @@ const replaceHomeDir = (result: string, { mock = "/user/home/ignite", temp = TEM
result.replace(new RegExp(temp, "g"), mock)
describe("ignite-cli generate", () => {
- describe("model", () => {
- it("should generate Pizza model and test, patch index model export, not patch RootStore and testing --overwrite option", async () => {
- const result = await runIgnite(`generate model Pizza`, options)
-
- expect(replaceHomeDir(result)).toMatchInlineSnapshot(`
- "
-
- Generated new files:
- /user/home/ignite/app/models/Pizza.test.ts
- /user/home/ignite/app/models/Pizza.ts
- "
- `)
- expect(read(`${TEMP_DIR}/app/models/Pizza.ts`)).toMatchInlineSnapshot(`
-"import { Instance, SnapshotIn, SnapshotOut, types } from "mobx-state-tree"
-import { withSetPropAction } from "./helpers/withSetPropAction"
-
-/**
- * Model description here for TypeScript hints.
- */
-export const PizzaModel = types
- .model("Pizza")
- .props({})
- .actions(withSetPropAction)
- .views((self) => ({})) // eslint-disable-line @typescript-eslint/no-unused-vars
- .actions((self) => ({})) // eslint-disable-line @typescript-eslint/no-unused-vars
-
-export interface Pizza extends Instance {}
-export interface PizzaSnapshotOut extends SnapshotOut {}
-export interface PizzaSnapshotIn extends SnapshotIn {}
-export const createPizzaDefaultModel = () => types.optional(PizzaModel, {})
-
-// @mst remove-file
-"
-`)
- expect(read(`${TEMP_DIR}/app/models/Pizza.test.ts`)).toMatchInlineSnapshot(`
-"import { PizzaModel } from "./Pizza"
-
-test("can be created", () => {
- const instance = PizzaModel.create({})
-
- expect(instance).toBeTruthy()
-})
-
-// @mst remove-file
-"
-`)
- expect(read(`${TEMP_DIR}/app/models/index.ts`)).toMatchInlineSnapshot(`
-"export * from "./RootStore"
-export * from "./helpers/getRootStore"
-export * from "./helpers/useStores"
-export * from "./helpers/setupRootStore"
-
-// @mst remove-file
-export * from "./Pizza"
-"
-`)
- expect(read(`${TEMP_DIR}/app/models/RootStore.ts`)).toEqual(
- read(`${BOILERPLATE_PATH}/app/models/RootStore.ts`),
- )
- const resultWithoutOverwriteOption = await runIgnite(`generate model Pizza`, options)
- expect(replaceHomeDir(resultWithoutOverwriteOption)).toMatchInlineSnapshot(`
- "
-
- Generated new files:
-
-
- Skipped these files because they already exist:
- /user/home/ignite/app/models/Pizza.test.ts
- /user/home/ignite/app/models/Pizza.ts
-
- To overwrite these files, run the command again with the \`--overwrite\` flag
- "
- `)
- const resultWithOverwriteOption = await runIgnite(`generate model Pizza --overwrite`, options)
- expect(replaceHomeDir(resultWithOverwriteOption)).toMatchInlineSnapshot(`
- "
-
- Generated new files:
- /user/home/ignite/app/models/Pizza.test.ts
- /user/home/ignite/app/models/Pizza.ts
- "
- `)
- })
-
- it("should generate PizzaStore model and test, patch index model export, patch RootStore and testing --overwrite option", async () => {
- const result = await runIgnite(`generate model PizzaStore`, options)
-
- expect(replaceHomeDir(result)).toMatchInlineSnapshot(`
- "
-
- Generated new files:
- /user/home/ignite/app/models/PizzaStore.test.ts
- /user/home/ignite/app/models/PizzaStore.ts
- "
- `)
- expect(read(`${TEMP_DIR}/app/models/PizzaStore.ts`)).toMatchInlineSnapshot(`
-"import { Instance, SnapshotIn, SnapshotOut, types } from "mobx-state-tree"
-import { withSetPropAction } from "./helpers/withSetPropAction"
-
-/**
- * Model description here for TypeScript hints.
- */
-export const PizzaStoreModel = types
- .model("PizzaStore")
- .props({})
- .actions(withSetPropAction)
- .views((self) => ({})) // eslint-disable-line @typescript-eslint/no-unused-vars
- .actions((self) => ({})) // eslint-disable-line @typescript-eslint/no-unused-vars
-
-export interface PizzaStore extends Instance {}
-export interface PizzaStoreSnapshotOut extends SnapshotOut {}
-export interface PizzaStoreSnapshotIn extends SnapshotIn {}
-export const createPizzaStoreDefaultModel = () => types.optional(PizzaStoreModel, {})
-
-// @mst remove-file
-"
-`)
- expect(read(`${TEMP_DIR}/app/models/PizzaStore.test.ts`)).toMatchInlineSnapshot(`
-"import { PizzaStoreModel } from "./PizzaStore"
-
-test("can be created", () => {
- const instance = PizzaStoreModel.create({})
-
- expect(instance).toBeTruthy()
-})
-
-// @mst remove-file
-"
-`)
- expect(read(`${TEMP_DIR}/app/models/index.ts`)).toMatchInlineSnapshot(`
-"export * from "./RootStore"
-export * from "./helpers/getRootStore"
-export * from "./helpers/useStores"
-export * from "./helpers/setupRootStore"
-
-// @mst remove-file
-export * from "./PizzaStore"
-"
-`)
- expect(read(`${TEMP_DIR}/app/models/RootStore.ts`)).toMatchInlineSnapshot(`
-"import { Instance, SnapshotOut, types } from "mobx-state-tree"
-import { PizzaStoreModel } from "./PizzaStore"
-
-import { AuthenticationStoreModel } from "./AuthenticationStore" // @demo remove-current-line
-import { EpisodeStoreModel } from "./EpisodeStore" // @demo remove-current-line
-
-/**
- * A RootStore model.
- */
-export const RootStoreModel = types.model("RootStore").props({
- pizzaStore: types.optional(PizzaStoreModel, {} as any),
- authenticationStore: types.optional(AuthenticationStoreModel, {}), // @demo remove-current-line
- episodeStore: types.optional(EpisodeStoreModel, {}), // @demo remove-current-line
-})
-
-/**
- * The RootStore instance.
- */
-export interface RootStore extends Instance {}
-/**
- * The data of a RootStore.
- */
-export interface RootStoreSnapshot extends SnapshotOut {}
-
-// @mst remove-file
-"
-`)
- const resultWithoutOverwriteOption = await runIgnite(`generate model PizzaStore`, options)
- expect(replaceHomeDir(resultWithoutOverwriteOption)).toMatchInlineSnapshot(`
- "
-
- Generated new files:
-
-
- Skipped these files because they already exist:
- /user/home/ignite/app/models/PizzaStore.test.ts
- /user/home/ignite/app/models/PizzaStore.ts
-
- To overwrite these files, run the command again with the \`--overwrite\` flag
- "
- `)
- const resultWithOverwriteOption = await runIgnite(
- `generate model PizzaStore --overwrite`,
- options,
- )
- expect(replaceHomeDir(resultWithOverwriteOption)).toMatchInlineSnapshot(`
- "
-
- Generated new files:
- /user/home/ignite/app/models/PizzaStore.test.ts
- /user/home/ignite/app/models/PizzaStore.ts
- "
- `)
- })
- })
-
describe("components", () => {
it("should generate Topping component and patch index components export", async () => {
const result = await runIgnite(`generate component Topping`, options)
@@ -254,7 +58,6 @@ export interface RootStoreSnapshot extends SnapshotOut {}
`)
expect(read(`${TEMP_DIR}/app/components/Topping.tsx`)).toMatchInlineSnapshot(`
"import { StyleProp, TextStyle, View, ViewStyle } from "react-native"
-import { observer } from "mobx-react-lite" // @mst remove-current-line
import { useAppTheme } from "@/utils/useAppTheme"
import type { ThemedStyle } from "@/theme"
import { Text } from "@/components/Text"
@@ -269,8 +72,7 @@ export interface ToppingProps {
/**
* Describe your component here
*/
-// @mst replace-next-line export const Topping = (props: ToppingProps) => {
-export const Topping = observer(function Topping(props: ToppingProps) {
+export const Topping = (props: ToppingProps) => {
const { style } = props
const $styles = [$container, style]
const { themed } = useAppTheme();
@@ -280,8 +82,7 @@ export const Topping = observer(function Topping(props: ToppingProps) {
Hello
)
-// @mst replace-next-line }
-})
+}
const $container: ViewStyle = {
justifyContent: "center",
@@ -324,7 +125,6 @@ export * from "./Topping"
`)
expect(read(`${TEMP_DIR}/app/components/sub/to/my/Topping.tsx`)).toMatchInlineSnapshot(`
"import { StyleProp, TextStyle, View, ViewStyle } from "react-native"
-import { observer } from "mobx-react-lite" // @mst remove-current-line
import { useAppTheme } from "@/utils/useAppTheme"
import type { ThemedStyle } from "@/theme"
import { Text } from "@/components/Text"
@@ -339,8 +139,7 @@ export interface ToppingProps {
/**
* Describe your component here
*/
-// @mst replace-next-line export const Topping = (props: ToppingProps) => {
-export const Topping = observer(function Topping(props: ToppingProps) {
+export const Topping = (props: ToppingProps) => {
const { style } = props
const $styles = [$container, style]
const { themed } = useAppTheme();
@@ -350,8 +149,7 @@ export const Topping = observer(function Topping(props: ToppingProps) {
Hello
)
-// @mst replace-next-line }
-})
+}
const $container: ViewStyle = {
justifyContent: "center",
@@ -408,19 +206,6 @@ describe("ignite-cli generate with path params", () => {
"
`)
})
-
- it("should generate `pizza` model in the src/models directory with exact casing", async () => {
- const result = await runIgnite(`generate model pizza --case=none --dir=src/models`, options)
-
- expect(replaceHomeDir(result)).toMatchInlineSnapshot(`
- "
-
- Generated new files:
- /user/home/ignite/src/models/pizza.test.ts
- /user/home/ignite/src/models/pizza.ts
- "
- `)
- })
})
describe("ignite-cli generate screens expo-router style", () => {
@@ -451,17 +236,16 @@ describe("ignite-cli generate screens expo-router style", () => {
`)
expect(read(`${TEMP_DIR}/src/app/(app)/(tabs)/log-in.tsx`)).toMatchInlineSnapshot(`
"import React, { FC } from "react"
-import { observer } from "mobx-react-lite"
import { ViewStyle } from "react-native"
import { Screen, Text } from "@/components"
-export default observer(function LogInScreen() {
+export default function LogInScreen() {
return (
)
-})
+}
const $root: ViewStyle = {
flex: 1,
@@ -485,17 +269,16 @@ const $root: ViewStyle = {
`)
expect(read(`${TEMP_DIR}/src/app/(app)/(tabs)/podcasts/[id].tsx`)).toMatchInlineSnapshot(`
"import React, { FC } from "react"
-import { observer } from "mobx-react-lite"
import { ViewStyle } from "react-native"
import { Screen, Text } from "@/components"
-export default observer(function IdScreen() {
+export default function IdScreen() {
return (
)
-})
+}
const $root: ViewStyle = {
flex: 1,
diff --git a/test/vanilla/ignite-new-expo-router.test.ts b/test/vanilla/ignite-new-expo-router.test.ts
index 55091bd53..8c087f238 100644
--- a/test/vanilla/ignite-new-expo-router.test.ts
+++ b/test/vanilla/ignite-new-expo-router.test.ts
@@ -1,13 +1,13 @@
import { filesystem } from "gluegun"
import * as tempy from "tempy"
-import { run, runIgnite, spawnIgniteAndPrintIfFail } from "../_test-helpers"
+import { run, spawnIgniteAndPrintIfFail } from "../_test-helpers"
const APP_NAME = "Foo"
const originalDir = process.cwd()
describe(`ignite new with expo-router`, () => {
- describe(`ignite new ${APP_NAME} --debug --packager=bun --install-deps=true --experimental=expo-router --state=mst --yes`, () => {
+ describe(`ignite new ${APP_NAME} --debug --packager=bun --install-deps=true --experimental=expo-router --yes`, () => {
let tempDir: string
let result: string
let appPath: string
@@ -15,7 +15,7 @@ describe(`ignite new with expo-router`, () => {
beforeAll(async () => {
tempDir = tempy.directory({ prefix: "ignite-" })
result = await spawnIgniteAndPrintIfFail(
- `new ${APP_NAME} --debug --packager=bun --install-deps=true --experimental=expo-router --state=mst --yes`,
+ `new ${APP_NAME} --debug --packager=bun --install-deps=true --experimental=expo-router --yes`,
{
pre: `cd ${tempDir}`,
post: `cd ${originalDir}`,
@@ -30,8 +30,8 @@ describe(`ignite new with expo-router`, () => {
filesystem.remove(tempDir) // clean up our mess
})
- it("should convert to Expo Router with MST", async () => {
- expect(result).toContain("--state=mst")
+ it("should convert to Expo Router", async () => {
+ expect(result).toContain("--experimental=expo-router")
// make sure src/navigators, src/screens, app/, app.tsx is gone
const dirs = filesystem.list(appPath)
@@ -44,19 +44,10 @@ describe(`ignite new with expo-router`, () => {
// check the contents of ignite/templates
const templates = filesystem.list(`${appPath}/ignite/templates`)
expect(templates).toContain("component")
- expect(templates).toContain("model")
expect(templates).toContain("screen")
expect(templates).not.toContain("navigator")
// inspect that destinationDir has been adjusted
- const modelTpl = filesystem.read(`${appPath}/ignite/templates/model/NAME.ts.ejs`)
- expect(modelTpl).not.toContain("destinationDir: app/models")
- expect(modelTpl).toContain("destinationDir: src/models")
-
- const modelTestTpl = filesystem.read(`${appPath}/ignite/templates/model/NAME.test.ts.ejs`)
- expect(modelTestTpl).not.toContain("destinationDir: app/models")
- expect(modelTestTpl).toContain("destinationDir: src/models")
-
const componentTpl = filesystem.read(`${appPath}/ignite/templates/component/NAME.tsx.ejs`)
expect(componentTpl).not.toContain("app/components")
expect(componentTpl).toContain("src/components")
@@ -78,14 +69,6 @@ describe(`ignite new with expo-router`, () => {
expect(reactotronConfig).not.toContain("navigate(")
expect(reactotronConfig).not.toContain("react-navigation")
expect(reactotronConfig).not.toContain("reset navigation state")
-
- // make sure _layout sets up initial root store
- const rootLayout = filesystem.read(`${appPath}/src/app/_layout.tsx`)
- expect(rootLayout).toContain("useInitialRootStore")
-
- // make sure index has observer
- const rootIndex = filesystem.read(`${appPath}/src/app/index.tsx`)
- expect(rootIndex).toContain("observer")
})
it("should pass test, lint, and compile checks", async () => {
@@ -101,48 +84,4 @@ describe(`ignite new with expo-router`, () => {
expect(await run("git diff HEAD --no-ext-diff", runOpts)).toBe("")
})
})
-
- describe(`ignite new ${APP_NAME} --debug --packager=bun --install-deps=false --experimental=expo-router --state-none --yes`, () => {
- let tempDir: string
- let result: string
- let appPath: string
-
- beforeAll(async () => {
- tempDir = tempy.directory({ prefix: "ignite-" })
- result = await runIgnite(
- `new ${APP_NAME} --debug --packager=bun --install-deps=false --experimental=expo-router --state=none --remove-demo --yes`,
- {
- pre: `cd ${tempDir}`,
- post: `cd ${originalDir}`,
- },
- )
- appPath = filesystem.path(tempDir, APP_NAME)
- })
-
- afterAll(() => {
- // console.log(tempDir) // uncomment for debugging, then run `code ` to see the generated app
- filesystem.remove(tempDir) // clean up our mess
- })
-
- it("should convert to Expo Router without MST", async () => {
- expect(result).toContain("--state=none")
- expect(result).not.toContain("Setting --state=mst")
-
- // check the contents of ignite/templates
- const templates = filesystem.list(`${appPath}/ignite/templates`)
- expect(templates).toContain("component")
- expect(templates).toContain("screen")
- expect(templates).not.toContain("model")
- expect(templates).not.toContain("navigator")
-
- // same as with MST but..
- // make sure _layout doesn't have mention of rehydrating root store
- const rootLayout = filesystem.read(`${appPath}/src/app/_layout.tsx`)
- expect(rootLayout).not.toContain("useInitialRootStore")
-
- // make sure index does not have observer
- const rootIndex = filesystem.read(`${appPath}/src/app/index.tsx`)
- expect(rootIndex).not.toContain("observer")
- })
- })
})
diff --git a/test/vanilla/ignite-new.test.ts b/test/vanilla/ignite-new.test.ts
index a39a50a9d..438e7d0d1 100644
--- a/test/vanilla/ignite-new.test.ts
+++ b/test/vanilla/ignite-new.test.ts
@@ -62,7 +62,6 @@ describe("ignite new", () => {
// check the contents of ignite/templates
const templates = filesystem.list(`${appPath}/ignite/templates`)
expect(templates).toContain("component")
- expect(templates).toContain("model")
expect(templates).toContain("screen")
expect(templates).toContain("app-icon")
})
@@ -99,10 +98,9 @@ describe("ignite new", () => {
expect(igniteJSON.scripts.ios).toBe("expo run:ios")
})
- it("should have created app.tsx with export and RootStore", () => {
+ it("should have created app.tsx with export", () => {
const appJS = filesystem.read(`${appPath}/app/app.tsx`)
expect(appJS).toContain("export function App")
- expect(appJS).toContain("RootStore")
})
it("should be able to use `generate` command and have pass output pass bun run test, bun run lint, and bun run compile scripts", async () => {
@@ -133,18 +131,6 @@ describe("ignite new", () => {
"export const WompBomp",
)
- // models
- const modelGen = await runIgnite(`generate model mod-test`, runOpts)
- expect(modelGen).toContain(`app/models/ModTest.ts`)
- expect(modelGen).toContain(`app/models/ModTest.test.ts`)
- expect(filesystem.list(`${appPath}/app/models`)).toContain("ModTest.ts")
- expect(filesystem.read(`${appPath}/app/models/ModTest.ts`)).toContain(
- "export const ModTestModel",
- )
- expect(filesystem.read(`${appPath}/app/models/index.ts`)).toContain(
- `export * from "./ModTest"`,
- )
-
// screens
const screenGen = await runIgnite(`generate screen bowser-screen --skip-index-file`, runOpts)
expect(screenGen).toContain(`Stripping Screen from end of name`)
@@ -264,7 +250,7 @@ describe("ignite new", () => {
// #region Assert Changes Can Be Commit To Git
// commit the change
- await run(`git add ./app/models ./app/components ./app.json ./assets/images`, runOpts)
+ await run(`git add ./app/context ./app/components ./app.json ./assets/images`, runOpts)
await run(`git commit -m "generated test components & assets"`, runOpts)
// #endregion
diff --git a/test/vanilla/ignite-remove-mst.test.ts b/test/vanilla/ignite-remove-mst.test.ts
deleted file mode 100644
index 0aef6a251..000000000
--- a/test/vanilla/ignite-remove-mst.test.ts
+++ /dev/null
@@ -1,40 +0,0 @@
-import { filesystem } from "gluegun"
-import * as tempy from "tempy"
-
-import { runIgnite } from "../_test-helpers"
-
-const BOILERPLATE_PATH = filesystem.path(__dirname, "../../boilerplate")
-
-const setup = (): { TEMP_DIR: string } => {
- const TEMP_DIR = tempy.directory({ prefix: "ignite-" })
-
- beforeEach(() => {
- // create the destination directory
- filesystem.dir(TEMP_DIR)
- // copy the relevant files & folders
- filesystem.copy(BOILERPLATE_PATH + "/package.json", TEMP_DIR + "/package.json", {
- overwrite: true,
- })
- filesystem.copy(BOILERPLATE_PATH + "/app", TEMP_DIR + "/app", { overwrite: true })
- })
-
- afterEach(() => {
- filesystem.remove(TEMP_DIR) // clean up our mess
- })
-
- return { TEMP_DIR }
-}
-
-describe("ignite-cli remove-mst", () => {
- const { TEMP_DIR } = setup()
-
- it("should print the expected response", async () => {
- const result = await runIgnite(`remove-mst ${TEMP_DIR}`)
-
- // "/user/home/ignite" replaces the temp directory, so we don't get failures when it changes every test run
- const MOCK_DIR = `/user/home/ignite`
- const output = result.replace(new RegExp(TEMP_DIR, "g"), MOCK_DIR)
-
- expect(output).toMatchSnapshot()
- })
-})