Skip to content

Commit

Permalink
Merge pull request #236 from josemarluedke/feat/core-all-gts
Browse files Browse the repository at this point in the history
Refactor: Move all core components to gts
  • Loading branch information
josemarluedke authored Jul 31, 2023
2 parents 95ac459 + 3fc597a commit f3c493d
Show file tree
Hide file tree
Showing 9 changed files with 167 additions and 38 deletions.
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@
"@glint/environment-ember-loose": "1.0.2",
"@glint/environment-ember-template-imports": "1.0.2",
"@glint/template": "1.0.2",
"@rollup/plugin-babel": "6.0.3",
"@tsconfig/ember": "^3.0.0",
"babel-plugin-ember-template-compilation": "^2.1.1",
"concurrently": "^8.2.0",
"ember-source": "^5.1.2",
"rollup": "^3.27.0",
"rollup-plugin-ts": "^3.2.0",
"tailwindcss": "^3.3.3",
"typescript": "^5.1.6"
},
Expand Down
13 changes: 6 additions & 7 deletions packages/core/rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import { babel } from '@rollup/plugin-babel';
import ts from "rollup-plugin-ts";
import { Addon } from '@embroider/addon-dev/rollup';

const addon = new Addon({
srcDir: 'src',
destDir: 'dist',
});

// Add extensions here, such as ts, gjs, etc that you may import
const extensions = ['.js', '.ts', '.gjs', '.gts'];

export default {
// This provides defaults that work well alongside `publicEntrypoints` below.
// You can augment this if you need to.
Expand Down Expand Up @@ -44,9 +41,11 @@ export default {
// It exists only to provide development niceties for you, like automatic
// template colocation.
// See `babel.config.json` for the actual Babel configuration!
babel({
extensions,
babelHelpers: 'bundled',
ts({
transpiler: "babel",
transpileOnly: true,
babelConfig: "./babel.config.js",
browserslist: ["last 2 firefox versions", "last 2 chrome versions"],
}),


Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/components/close-button.gts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import Component from '@glimmer/component';
import { action } from '@ember/object';
import 'focus-visible/dist/focus-visible.js';
import { on } from '@ember/modifier';
import useFrontileClass from '../helpers/use-frontile-class.ts';
import VisuallyHidden from './visually-hidden.ts';
import useFrontileClass from '../helpers/use-frontile-class';
import VisuallyHidden from './visually-hidden';

export interface CloseButtonArgs {
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import Component from '@glimmer/component';
import { action } from '@ember/object';
import { buildWaiter } from '@ember/test-waiters';
import safeStyles from '../../utils/safe-styles.ts';
import { on } from '@ember/modifier';
import didUpdate from '@ember/render-modifiers/modifiers/did-update';
import safeStyles from '../../utils/safe-styles';

const waiter = buildWaiter('@frontile/core:collapsible');

Expand Down Expand Up @@ -149,4 +151,15 @@ export default class Collapsible extends Component<CollapsibleSignature> {
});
});
}

<template>
<div
style={{this.styles}}
...attributes
{{didUpdate this.update @isOpen}}
{{on "transitionend" this.onTransitionEnd}}
>
{{yield}}
</div>
</template>
}
8 changes: 0 additions & 8 deletions packages/core/src/components/collapsible/index.hbs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,10 @@ export interface VisuallyHiddenSignature {
};
}

export default class VisuallyHidden extends Component<VisuallyHiddenSignature> {}
export default class VisuallyHidden extends Component<VisuallyHiddenSignature> {
<template>
<div class="sr-only" ...attributes>
{{yield}}
</div>
</template>
}
3 changes: 0 additions & 3 deletions packages/core/src/components/visually-hidden.hbs

This file was deleted.

2 changes: 1 addition & 1 deletion packages/core/src/template-registry.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type VisuallyHidden from './components/visually-hidden.ts';
import type VisuallyHidden from './components/visually-hidden';
import type CloseButton from './components/close-button';
import type Collapsible from './components/collapsible';

Expand Down
Loading

0 comments on commit f3c493d

Please sign in to comment.