Codemod to un-pod Ember apps, addons, and engines

Overview

This project uses GitHub Actions for continuous integration.

ember-codemod-pod-to-octane

Codemod to un-pod Ember apps, addons, and engines

Usage

Step 1. Quickly return to default Octane.

cd <your/project/path>
npx ember-codemod-pod-to-octane <arguments>

Step 2. Remove podModulePrefix from config/environment.js and usePods from .ember-cli.

Step 3. Update relative paths in import statements.

Arguments

You must pass --type to indicate what type of project you have.

npx ember-codemod-pod-to-octane --type=app
npx ember-codemod-pod-to-octane --type=addon
npx ember-codemod-pod-to-octane --type=engine
Optional: Do a test run

Pass --test to preview how the codemod will move files around.

npx ember-codemod-pod-to-octane --test
Optional: Specify the project root

Pass --root to run the codemod against (1) a project somewhere else or (2) multiple projects (assuming you have an automation script).

npx ember-codemod-pod-to-octane --root=<your/project/path>
Optional: Specify the pod path

Pass --pod-path if podModulePrefix is set in config/environment.js and has a different value than modulePrefix. "Subtract" modulePrefix from podModulePrefix to get the pod path.

# If modulePrefix is 'my-app' and podModulePrefix is 'my-app/pods'
npx ember-codemod-pod-to-octane --pod-path=pods

Limitations

The codemod is designed to cover typical uses of an Ember app, addon, and engine. It is not designed to cover one-off cases.

Apps

To account for a bug (found when Ember CLI is combined with Ember Data), the codemod doesn't consider unit tests for adapters, models, and serializers. You will need to manually move the test files.

Addons

The codemod assumes that an addon is used to define components (not models or routes).

Engines

The codemod assumes that an engine is used to define routes and route-specific components.

To better meet your needs, consider forking the repo and running the codemod locally.

cd <your/forked/repo>
./bin/ember-codemod-pod-to-octane.js <arguments>

Compatibility

Contributing

To provide feedback, you can reach out to me on Discord at ijlee2. Please star this project so that I can gauge its importance to you and the Ember community.

Credits

Thanks goes to FlashRecruit, Imago, and CLARK, who gave me the necessary Ember experience. Some code is based on ember-component-template-colocation-migrator.

License

This project is licensed under the MIT License.

Comments
  • Updated @babel/core to v7.19.6

    Updated @babel/core to v7.19.6

    Description

    Package              Current Wanted Latest Package Type    URL
    @babel/core          7.19.0  7.19.6 7.19.6 dependencies    https://babel.dev/docs/en/next/babel-core
    @babel/eslint-parser 7.18.9  7.19.1 7.19.1 dependencies    https://babel.dev/
    eslint               8.23.0  8.26.0 8.26.0 devDependencies https://eslint.org
    yargs                17.5.1  17.6.0 17.6.0 dependencies    https://yargs.js.org/
    
    enhance: dependency 
    opened by ijlee2 0
  • Updated @babel/core to v7.19.0

    Updated @babel/core to v7.19.0

    Description

    Package                          Current Wanted Latest Package Type    URL                                                              
    @babel/core                      7.18.13 7.19.0 7.19.0 dependencies    https://babel.dev/docs/en/next/babel-core
    eslint                           8.22.0  8.23.0 8.23.0 devDependencies https://eslint.org
    eslint-plugin-simple-import-sort 7.0.0   7.0.0  8.0.0  devDependencies https://github.com/lydell/eslint-plugin-simple-import-sort#readme
    
    enhance: dependency 
    opened by ijlee2 0
  • Updated @babel/core to v7.18.13

    Updated @babel/core to v7.18.13

    Description

    Package     Current Wanted  Latest  Package Type    URL                                      
    @babel/core 7.18.9  7.18.13 7.18.13 dependencies    https://babel.dev/docs/en/next/babel-core
    eslint      8.20.0  8.22.0  8.22.0  devDependencies https://eslint.org
    
    enhance: dependency 
    opened by ijlee2 0
  • Allowed users to specify podModulePrefix (ember-app)

    Allowed users to specify podModulePrefix (ember-app)

    Description

    Closes #1. If a user specified podModulePrefix in their config/environment.js, they can pass the argument --pod-path to the codemod. At the moment, the --pod-path argument affects only Ember apps.

    Note, the name podPath came from the emberjs/ember.js repo. The value refers to the "difference" between podModulePrefix and modulePrefix. For example, if a user has the following config/environment.js:

    /* config/environment.js */
    'use strict';
    
    module.exports = function (environment) {
      let ENV = {
        modulePrefix: 'my-app',
        podModulePrefix: 'my-app/pods',
        ...
      };
    
      return ENV;
    };
    

    then:

    podPath = 'my-app/pods' - 'my-app' = 'pods'
    

    So the user will need to enter the following command:

    npx ember-codemod-pod-to-octane --pod-path=pods --type=app
    

    Due to a change in APIs, this pull request unfortunately became large. There may be opportunities to refactor code. Let's do so in a separate issue and pull request.

    enhance: code 
    opened by ijlee2 0
  • Added migration strategy for Sass (ember-app, ember-addon, ember-engine)

    Added migration strategy for Sass (ember-app, ember-addon, ember-engine)

    Description

    Closes #4. The codemod can move .scss files that were created as a result of using ember-css-modules-sass.

    Note, I'm uncertain how ember-css-modules-sass is supposed to work in addons and engines, as I didn't have real-life examples. I guessed how the migration should work. If this results in a bug, we can create an issue then.

    enhance: code 
    opened by ijlee2 0
  • Added migration strategy for services (ember-app)

    Added migration strategy for services (ember-app)

    Description

    Closes #3. migrateEmberApp() can now find services that are placed in a pod directory and move them to app/services.

    In a production app (with many addons and engines), I found only one example of a service that had been placed in a custom directory. To reduce the scope of work and future maintenance, I didn't add a migration strategy for addons and engines.

    enhance: code 
    opened by ijlee2 0
  • Account for Sass

    Account for Sass

    The codemod supports ember-css-modules, which then supports Sass. Update the migration strategies for stylesheets by checking for the file extension .scss.

    enhance: code 
    opened by ijlee2 0
  • Account for services

    Account for services

    I didn't realize that the file location of a service is also affected by the pod structure. Add a migration strategy for Ember apps ~(possibly, for engines too)~.

    ❯ ember g service my-route
    installing service
      create app/my-route/service.js
    installing service-test
      create tests/unit/my-route/service-test.js
    
    enhance: code 
    opened by ijlee2 0
  • Account for podModulePrefix

    Account for podModulePrefix

    Currently, the codemod assumes that podModulePrefix: '<my-app-name>' (i.e. equal to the value of modulePrefix). However, it's possible that a team has set another value such as '<my-app-name>/pods'.

    /* config/environment.js */
    'use strict';
    
    module.exports = function (environment) {
      let ENV = {
        modulePrefix: 'my-app',
        podModulePrefix: 'my-app/pods',
        ...
      };
    
      return ENV;
    };
    
    ❯ ember g component my-component --gc
    
    installing component
      create app/pods/components/my-component/component.js
      create app/pods/components/my-component/template.hbs
    installing component-test
      create tests/integration/pods/components/my-component/component-test.js
    
    ❯ ember g route my-route
    installing route
      create app/pods/my-route/route.js
      create app/pods/my-route/template.hbs
    installing route-test
      create tests/unit/pods/my-route/route-test.js
    
    ❯ ember g controller my-route
    installing controller
      create app/pods/my-route/controller.js
    installing controller-test
      create tests/unit/pods/my-route/controller-test.js
    
    enhance: code 
    opened by ijlee2 0
Releases(1.0.0)
  • 1.0.0(Oct 26, 2022)

    Since the initial release, ember-codemod-pod-to-octane has worked well and, in a short period of time, helped a large production app move away from pod. I am updating the tag to v1.0.0 to provide future users extra confidence.

    Source code(tar.gz)
    Source code(zip)
  • 0.3.2(Sep 9, 2022)

    No new features. I updated the README to clarify:

    • How to make manual fixes after running the codemod
    • How to use the codemod to un-pod an addon's demo app
    Source code(tar.gz)
    Source code(zip)
  • 0.3.1(Aug 24, 2022)

  • 0.3.0(Jul 25, 2022)

    The codemod will take podModulePrefix and ember-css-modules-sass into account when moving files around.

    Please pass the argument --pod-path to specify your podModulePrefix. The argument's value refers to the "difference" between podModulePrefix and modulePrefix. For example, if you have the following config/environment.js:

    /* config/environment.js */
    'use strict';
    
    module.exports = function (environment) {
      let ENV = {
        modulePrefix: 'my-app',
        podModulePrefix: 'my-app/pods',
        ...
      };
    
      return ENV;
    };
    

    then you would enter the following command:

    npx ember-codemod-pod-to-octane --pod-path=pods --type=app
    
    Source code(tar.gz)
    Source code(zip)
  • 0.2.0(Jul 23, 2022)

    When you run npx ember-codemod-pod-to-octane --type=app, the codemod will move services that are placed in a pod directory to app/services.

    Source code(tar.gz)
    Source code(zip)
Owner
Isaac Lee
Isaac Lee
Ember.js addon allowing you to easily implement non-CRUD actions for your Ember Data models

@mainmatter/ember-api-actions This is an Ember.js addon allowing you to easily implement non-CRUD actions for your Ember Data models. Compatibility Em

Mainmatter 6 Dec 15, 2022
An accessible dropdown component for use in Ember apps.

ember-a11y-dropdown This is an accessible dropdown that you can use in your Ember app for a menu dropdown. I'm making it so people can stop using the

Melanie Sumner 2 Feb 10, 2022
Material Design Lite for Ember.js Apps

ember-material-lite Google's Material Design Lite for Ember.js apps This addon requires ember >= 1.11.0 Installation # ember-cli < 0.2.3 ember install

Mike North 148 Dec 17, 2021
Demonstration of how to use statecharts as and with actors in Ember.js

statechart-actors This app demonstrate how we can use ember-statecharts and XState's actor feature together. The demo-use case: Show a blog posts over

Michael Klein 3 Jan 9, 2022
A demo app to illustrate core and latest concepts in Ember.js

ember-workshop A demo app to illustrate core and latest concepts in Ember.js Setup Installation Clone this repo. git clone [email protected]:ijlee2/ember

Isaac Lee 15 Dec 17, 2022
📓 The UI component explorer. Develop, document, & test React, Vue, Angular, Web Components, Ember, Svelte & more!

Build bulletproof UI components faster Storybook is a development environment for UI components. It allows you to browse a component library, view the

Storybook 75.8k Jan 4, 2023
An Ember CLI Addon that provides a variety of UI components.

We use https://waffle.io/softlayer/sl-ember-components to work our issues. What sl-ember-components is An Ember CLI Addon that provides UI components

SoftLayer 115 May 7, 2022
Official Semantic UI Integration for Ember

Semantic-UI-Ember This is the official Ember library for the Semantic-UI modules. Support The NodeJS and EmberJS versions respective tags are tested o

Semantic Org 335 Oct 1, 2022
The ember implementation of UIkit

ember-uikit This addon is a wrapper for the CSS library UIkit which exposes certain components to give users an easy way for using UIkit in ember apps

Adfinis 25 Oct 20, 2022
Ember implementation of Google's Material Design

No longer maintained This project is no longer maintained. For an up-to-date material design project, please use Ember Paper. Ember-material-design Th

Mike Wilson 121 Mar 1, 2022
Bootstrap for Ember.js

Please use our CLI-ADDONS instead We rewrote almost all components from scratch and packed them as Ember-Addons, Please avoid using this project and u

null 708 Nov 17, 2022
Rich components for Ember.js framework.

Ember Components Ember Components is a comprehensive set of rich web components written purely in Ember.js that let you create an astonishing UI for a

Indexia Technologies, ltd. 185 Dec 18, 2020
Ember implementation of the game

Ember implementation of the game

null 9 Apr 27, 2022
Bugsnag integration for Ember applications.

Ember Bugsnag Bugsnag integration for Ember applications.

Bagaar 1 Apr 28, 2022
Vtexio-react-apps - Apps react para plafaforma VTEX.

Projeto Modal + Apps Extras Projeto modal setando cookies. Desenvolvido em React + TypeScript para aplicação em e-commerce VTEXIO. ?? Este projeto se

Marcelo 1 Jan 3, 2022
The Power CAT code components are a set of Power Apps component framework (PCF) controls that can be used to enhance power apps.

Power CAT code components The Power CAT code components are a set of Power Apps component framework (PCF) controls that can be used to enhance power a

Microsoft 70 Jan 2, 2023
Mobile app development framework and SDK using HTML5 and JavaScript. Create beautiful and performant cross-platform mobile apps. Based on Web Components, and provides bindings for Angular 1, 2, React and Vue.js.

Onsen UI - Cross-Platform Hybrid App and PWA Framework Onsen UI is an open source framework that makes it easy to create native-feeling Progressive We

null 8.7k Jan 8, 2023
Build blazing fast, modern apps and websites with React

Gatsby v3 ⚛️ ?? ?? Fast in every way that matters Gatsby is a free and open source framework based on React that helps developers build blazing fast w

Gatsby 54k Jan 9, 2023
A collection of sample apps built using GetStream and React Native

React Native samples [ Built with ♥ at Stream ] This repo contains projects and samples developed by the team and Stream community, using React Native

Stream 93 Jan 8, 2023