Skip to content

Commit

Permalink
Removed the useRelativePaths step (#25)
Browse files Browse the repository at this point in the history
* bugfix: Removed useRelativePaths

* chore: Updated tests and test fixtures

* chore: Updated README

---------

Co-authored-by: ijlee2 <[email protected]>
  • Loading branch information
ijlee2 and ijlee2 authored Mar 10, 2023
1 parent 610d178 commit 31b2678
Show file tree
Hide file tree
Showing 134 changed files with 126 additions and 990 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ _Codemod to convert Ember addons to v2 addon format_
## Features

- Scaffolds files according to [`@embroider/addon-blueprint`](https://github.com/embroider-build/addon-blueprint)
- Switches Ember's "magic" import paths to relative paths
- Preserves your code whenever possible
- Supports [`ember-cli-typescript`](https://docs.ember-cli-typescript.com/) and [`glint`](https://typed-ember.gitbook.io/glint/)
- Focuses on maintainability and extensibility
Expand Down Expand Up @@ -116,7 +115,7 @@ You can also look at another codemod called [`ember-addon-migrator`](https://git

## Contributing

If you have an open-sourced addon that I can use as a test fixture, reach out to me on [Discord](https://discord.gg/emberjs) at `ijlee2`. Please star this project so that I can gauge its importance to you and the Ember community. ⭐
If you have an open-sourced addon (v1 or v2) that I can use as a reference, reach out to me on [Discord](https://discord.gg/emberjs) at `ijlee2`. Please star this project so that I can gauge its importance to you and the Ember community. ⭐


## Credits
Expand Down
2 changes: 0 additions & 2 deletions src/migration/ember-addon/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
updateAddonTsconfigJson,
updateTestAppPackageJson,
updateTestAppTsconfigJson,
useRelativePaths,
} from './steps/index.js';

export function migrateEmberAddon(codemodOptions) {
Expand All @@ -23,7 +22,6 @@ export function migrateEmberAddon(codemodOptions) {

// Prepare for migration
const context = analyzeAddon(options);
useRelativePaths(options);

// Preserve code
moveAddonFiles(options);
Expand Down
1 change: 0 additions & 1 deletion src/migration/ember-addon/steps/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@ export * from './update-addon-package-json.js';
export * from './update-addon-tsconfig-json.js';
export * from './update-test-app-package-json.js';
export * from './update-test-app-tsconfig-json.js';
export * from './use-relative-paths.js';
85 changes: 0 additions & 85 deletions src/migration/ember-addon/steps/use-relative-paths.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import templateOnlyComponent from '@ember/component/template-only';

import type { Track } from '../data/album';
import type { Track } from 'demo-app-for-ember-container-query/data/album';

interface TracksComponentSignature {
Args: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Component from '@glimmer/component';

import type { Track } from '../../data/album';
import type { Track } from 'demo-app-for-ember-container-query/data/album';

interface TracksListComponentSignature {
Args: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import templateOnlyComponent from '@ember/component/template-only';

import type { Track } from '../../data/album';
import type { Track } from 'demo-app-for-ember-container-query/data/album';

interface TracksTableComponentSignature {
Args: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import Component from '@glimmer/component';
import { tracked } from '@glimmer/tracking';

import musicRevenue from '../../data/music-revenue';
import type { Data, Summary } from '../../utils/components/widgets/widget-2';
import musicRevenue from 'demo-app-for-ember-container-query/data/music-revenue';
import type { Data, Summary } from 'demo-app-for-ember-container-query/utils/components/widgets/widget-2';
import {
createDataForVisualization,
createSummariesForCaptions,
} from '../../utils/components/widgets/widget-2';
} from 'demo-app-for-ember-container-query/utils/components/widgets/widget-2';

interface WidgetsWidget2ComponentSignature {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { action } from '@ember/object';
import Component from '@glimmer/component';
import { tracked } from '@glimmer/tracking';

import type { Summary } from '../../../utils/components/widgets/widget-2';
import type { Summary } from 'demo-app-for-ember-container-query/utils/components/widgets/widget-2';

interface WidgetsWidget2CaptionsComponentSignature {
Args: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import templateOnlyComponent from '@ember/component/template-only';

import type { Data } from '../../../utils/components/widgets/widget-2';
import type { Data } from 'demo-app-for-ember-container-query/utils/components/widgets/widget-2';

interface WidgetsWidget2StackedChartComponentSignature {
Args: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Component from '@glimmer/component';
import { tracked } from '@glimmer/tracking';

import type { Concert } from '../../data/concert';
import concertData from '../../data/concert';
import type { Concert } from 'demo-app-for-ember-container-query/data/concert';
import concertData from 'demo-app-for-ember-container-query/data/concert';

interface WidgetsWidget3ComponentSignature {}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import templateOnlyComponent from '@ember/component/template-only';

import type { Concert } from '../../../data/concert';
import type { Concert } from 'demo-app-for-ember-container-query/data/concert';

export interface WidgetsWidget3TourScheduleComponentSignature {
Args: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import Component from '@glimmer/component';
import { tracked } from '@glimmer/tracking';
import type { Dimensions } from 'ember-container-query/modifiers/container-query';

import type { Image } from '../../../../data/concert';
import { findBestFittingImage } from '../../../../utils/components/widgets/widget-3';
import type { Image } from 'demo-app-for-ember-container-query/data/concert';
import { findBestFittingImage } from 'demo-app-for-ember-container-query/utils/components/widgets/widget-3';

interface WidgetsWidget3TourScheduleResponsiveImageComponentSignature {
Args: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ModifierLike } from '@glint/template';

import type { Data } from '../utils/components/widgets/widget-2';
import type { Data } from 'demo-app-for-ember-container-query/utils/components/widgets/widget-2';

declare module '@glint/environment-ember-loose/registry' {
export default interface Registry {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import Modifier from 'ember-modifier';
import {
COLOR_PALETTE,
formatRevenue,
} from '../utils/components/widgets/widget-2';
} from 'demo-app-for-ember-container-query/utils/components/widgets/widget-2';

const musicFormats = Object.keys(COLOR_PALETTE);
const paletteColors = Object.values(COLOR_PALETTE);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Route from '@ember/routing/route';

import type { Album } from '../data/album';
import albumData from '../data/album';
import type { ModelFrom } from '../utils/routes';
import type { Album } from 'demo-app-for-ember-container-query/data/album';
import albumData from 'demo-app-for-ember-container-query/data/album';
import type { ModelFrom } from 'demo-app-for-ember-container-query/utils/routes';

export default class AlbumRoute extends Route {
model(): Album {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Revenue } from '../../../data/music-revenue';
import type { Revenue } from 'demo-app-for-ember-container-query/data/music-revenue';

export type Data = {
musicFormat: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Image } from '../../../data/concert';
import type { Image } from 'demo-app-for-ember-container-query/data/concert';

export type ContainerDimensions = {
aspectRatio: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type {
Features,
IndexSignatureParameter,
QueryResults,
} from '../modifiers/container-query';
} from 'ember-container-query/modifiers/container-query';

interface ContainerQueryComponentSignature<T extends IndexSignatureParameter> {
Args: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { helper } from '@ember/component/helper';

import type { Metadata } from '../modifiers/container-query';
import type { Metadata } from 'ember-container-query/modifiers/container-query';

interface AspectRatioHelperSignature {
Args: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { deprecate } from '@ember/debug';

import AspectRatioHelper from './aspect-ratio';
import AspectRatioHelper from 'ember-container-query/helpers/aspect-ratio';

deprecate(
'The {{cq-aspect-ratio}} helper has been renamed to {{aspect-ratio}}. Please update the helper name in your template.',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { deprecate } from '@ember/debug';

import HeightHelper from './height';
import HeightHelper from 'ember-container-query/helpers/height';

deprecate(
'The {{cq-height}} helper has been renamed to {{height}}. Please update the helper name in your template.',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { deprecate } from '@ember/debug';

import WidthHelper from './width';
import WidthHelper from 'ember-container-query/helpers/width';

deprecate(
'The {{cq-width}} helper has been renamed to {{width}}. Please update the helper name in your template.',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { helper } from '@ember/component/helper';

import type { Metadata } from '../modifiers/container-query';
import type { Metadata } from 'ember-container-query/modifiers/container-query';

interface HeightHelperSignature {
Args: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { helper } from '@ember/component/helper';

import type { Metadata } from '../modifiers/container-query';
import type { Metadata } from 'ember-container-query/modifiers/container-query';

interface WidthHelperSignature {
Args: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type {
Features,
IndexSignatureParameter,
QueryResults,
} from '../modifiers/container-query';
} from 'ember-container-query/modifiers/container-query';

interface ContainerQueryComponentSignature<T extends IndexSignatureParameter> {
Args: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { helper } from '@ember/component/helper';

import type { Metadata } from '../modifiers/container-query';
import type { Metadata } from 'ember-container-query/modifiers/container-query';

interface AspectRatioHelperSignature {
Args: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { deprecate } from '@ember/debug';

import AspectRatioHelper from './aspect-ratio';
import AspectRatioHelper from 'ember-container-query/helpers/aspect-ratio';

deprecate(
'The {{cq-aspect-ratio}} helper has been renamed to {{aspect-ratio}}. Please update the helper name in your template.',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { deprecate } from '@ember/debug';

import HeightHelper from './height';
import HeightHelper from 'ember-container-query/helpers/height';

deprecate(
'The {{cq-height}} helper has been renamed to {{height}}. Please update the helper name in your template.',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { deprecate } from '@ember/debug';

import WidthHelper from './width';
import WidthHelper from 'ember-container-query/helpers/width';

deprecate(
'The {{cq-width}} helper has been renamed to {{width}}. Please update the helper name in your template.',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { helper } from '@ember/component/helper';

import type { Metadata } from '../modifiers/container-query';
import type { Metadata } from 'ember-container-query/modifiers/container-query';

interface HeightHelperSignature {
Args: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { helper } from '@ember/component/helper';

import type { Metadata } from '../modifiers/container-query';
import type { Metadata } from 'ember-container-query/modifiers/container-query';

interface WidthHelperSignature {
Args: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import templateOnlyComponent from '@ember/component/template-only';

import type { Track } from '../data/album';
import type { Track } from 'test-app/data/album';

interface TracksComponentSignature {
Args: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Component from '@glimmer/component';

import type { Track } from '../../data/album';
import type { Track } from 'test-app/data/album';

interface TracksListComponentSignature {
Args: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import templateOnlyComponent from '@ember/component/template-only';

import type { Track } from '../../data/album';
import type { Track } from 'test-app/data/album';

interface TracksTableComponentSignature {
Args: {
Expand Down
Loading

0 comments on commit 31b2678

Please sign in to comment.