Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated test fixtures #12

Merged
merged 5 commits into from
Jan 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 3 additions & 3 deletions codemod-test-fixture.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#
# Choice a. Run the codemod without the optional arguments.
#
# ./codemod-test-fixture.sh ember-container-query-typescript
# ./codemod-test-fixture.sh ember-container-query-glint
#
# Choice b. Run the codemod with the optional arguments. (For named arguments,
# do not include `=` between the flag and the value. Positional arguments must
Expand All @@ -40,7 +40,7 @@ FIXTURE=${@:$OPTIND:1}

if [ ! $FIXTURE ]
then
echo "ERROR: Please specify the fixture name (e.g. ember-container-query-typescript).\n"
echo "ERROR: Please specify the fixture name (e.g. ember-container-query-glint).\n"
exit 1
elif [ ! -d "tests/fixtures/$FIXTURE/input" ]
then
Expand All @@ -57,4 +57,4 @@ cp -r "tests/fixtures/$FIXTURE/input" "tests/fixtures/$FIXTURE/output"
--test-app-location=$TEST_APP_LOCATION \
--test-app-name=$TEST_APP_NAME

# echo "SUCCESS: Updated the output of $FIXTURE.\n"
echo "SUCCESS: Updated the output of $FIXTURE.\n"
1 change: 1 addition & 0 deletions codemod-test-fixtures.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#---------

./codemod-test-fixture.sh -a "packages/ember-container-query" -t "demo-app" -T "demo-app-for-ember-container-query" ember-container-query-customizations
./codemod-test-fixture.sh ember-container-query-glint
./codemod-test-fixture.sh ember-container-query-javascript
./codemod-test-fixture.sh ember-container-query-typescript
./codemod-test-fixture.sh -a "packages/new-v1-addon" -t "demo-app" -T "demo-app-for-new-v1-addon" new-v1-addon-customizations
Expand Down
4 changes: 2 additions & 2 deletions create-test-fixture.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
#
# Choice a. Keep most of the source code.
#
# ./create-test-fixture.sh "../../Desktop/ember-container-query" ember-container-query-typescript
# ./create-test-fixture.sh "../../Desktop/ember-container-query" ember-container-query-glint
#
# Choice b. Empty every file.
#
# ./create-test-fixture.sh "../../Desktop/ember-container-query" ember-container-query-typescript true
# ./create-test-fixture.sh "../../Desktop/ember-container-query" ember-container-query-glint true
#
#---------

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 '../helpers/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 '../helpers/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 '../helpers/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 'dummy/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 'dummy/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 'dummy/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 'dummy/data/music-revenue';
import type { Data, Summary } from 'dummy/utils/components/widgets/widget-2';
import {
createDataForVisualization,
createSummariesForCaptions,
} from '../../utils/components/widgets/widget-2';
} from 'dummy/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 'dummy/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 'dummy/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 'dummy/data/concert';
import concertData from 'dummy/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 'dummy/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 'dummy/data/concert';
import { findBestFittingImage } from 'dummy/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 'dummy/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 'dummy/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 'dummy/data/album';
import albumData from 'dummy/data/album';
import type { ModelFrom } from 'dummy/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 'dummy/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 'dummy/data/concert';

export type ContainerDimensions = {
aspectRatio: number;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { deprecate } from '@ember/debug';

import AspectRatioHelper from '../helpers/aspect-ratio';
import AspectRatioHelper from './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 '../helpers/height';
import HeightHelper from './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 '../helpers/width';
import WidthHelper from './width';

deprecate(
'The {{cq-width}} helper has been renamed to {{width}}. Please update the helper name in your template.',
Expand Down
6 changes: 6 additions & 0 deletions tests/fixtures/ember-container-query-glint/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { convertFixtureToJson } from '../../helpers/testing.js';

const inputProject = convertFixtureToJson('ember-container-query-glint/input');
const outputProject = convertFixtureToJson('ember-container-query-glint/output');

export { inputProject, outputProject };
19 changes: 19 additions & 0 deletions tests/fixtures/ember-container-query-glint/input/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org

root = true

[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 2

[*.hbs]
insert_final_newline = false

[*.{diff,md}]
trim_trailing_whitespace = false
15 changes: 15 additions & 0 deletions tests/fixtures/ember-container-query-glint/input/.ember-cli
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
/**
Ember CLI sends analytics information by default. The data is completely
anonymous, but there are times when you might want to disable this behavior.

Setting `disableAnalytics` to true will prevent any data from being sent.
*/
"disableAnalytics": false,

/**
Setting `isTypeScriptProject` to true will force the blueprint generators to generate TypeScript
rather than JavaScript by default, when a TypeScript version of a given blueprint is available.
*/
"isTypeScriptProject": false
}
25 changes: 25 additions & 0 deletions tests/fixtures/ember-container-query-glint/input/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# unconventional js
/blueprints/*/files/
/vendor/

# compiled output
/dist/
/tmp/

# dependencies
/bower_components/
/node_modules/

# misc
/coverage/
!.*
.*/
.eslintcache

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/npm-shrinkwrap.json.ember-try
/package.json.ember-try
/package-lock.json.ember-try
/yarn.lock.ember-try
69 changes: 69 additions & 0 deletions tests/fixtures/ember-container-query-glint/input/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
'use strict';

module.exports = {
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2018,
},
plugins: [
'ember',
'@typescript-eslint',
'simple-import-sort',
'typescript-sort-keys',
],
extends: [
'eslint:recommended',
'plugin:ember/recommended',
'plugin:prettier/recommended',
],
env: {
browser: true,
},
rules: {
curly: 'error',
'simple-import-sort/exports': 'error',
'simple-import-sort/imports': 'error',
},
overrides: [
// TypeScript files
{
files: ['**/*.ts'],
extends: [
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:typescript-sort-keys/recommended',
],
rules: {
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
},
},
// Node files
{
files: [
'./.eslintrc.js',
'./.prettierrc.js',
'./.stylelintrc.js',
'./.template-lintrc.js',
'./ember-cli-build.js',
'./index.js',
'./testem.js',
'./blueprints/*/index.js',
'./config/**/*.js',
'./tests/dummy/config/**/*.js',
],
env: {
browser: false,
node: true,
},
extends: ['plugin:n/recommended'],
},
// Test files
{
files: ['tests/**/*-test.{js,ts}'],
extends: ['plugin:qunit/recommended'],
},
],
};
Loading