Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
patricklx committed Mar 21, 2024
1 parent 1bb417c commit cf2024e
Show file tree
Hide file tree
Showing 8 changed files with 517 additions and 1,188 deletions.
2 changes: 2 additions & 0 deletions carbon-components-ember/src/components/accordion.gts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { WithBoundArgs } from '@glint/template';
import { tracked } from '@glimmer/tracking';
import { action } from '@ember/object';
import or from '/helpers/or.ts';
import { on } from '@ember/modifier';
import { fn } from '@ember/helper';

interface AccordionSignature {
Args: {
Expand Down
2 changes: 2 additions & 0 deletions doc-app/app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ import Resolver from 'ember-resolver';
import loadInitializers from 'ember-load-initializers';
import config from 'doc-app/config/environment';
import { RSVP } from '@ember/-internals/runtime';
import Ember from 'ember';

window.define('doc-app/config/environment', () => config);
window.define('rsvp', () => RSVP);
window.define('ember', () => Ember);

export default class App extends Application {
modulePrefix = config.modulePrefix;
Expand Down
1 change: 0 additions & 1 deletion doc-app/app/pods/docs/template.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
hi
<DocsViewer as |viewer|>
<viewer.nav as |nav|>
<nav.section @label='Getting Started' />
Expand Down
4 changes: 4 additions & 0 deletions doc-app/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// eslint-disable-next-line n/no-missing-require
let config = require('./node_modules/.embroider/rewritten-app/_babel_config_');

module.exports = config;
3 changes: 2 additions & 1 deletion doc-app/ember-cli-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ module.exports = function (defaults) {

return require('@embroider/compat').compatBuild(
app,
require('@embroider/webpack').Webpack,
// require('@embroider/webpack').Webpack,
null,
{
staticAddonTrees: true,
staticAddonTestSupportTrees: true,
Expand Down
11 changes: 7 additions & 4 deletions doc-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,22 @@
"lint:hbs:fix": "ember-template-lint . --fix",
"lint:js": "eslint . --cache",
"lint:js:fix": "eslint . --fix",
"start": "ember serve",
"start": "vite --force",
"test": "concurrently \"npm:lint\" \"npm:test:*\" --names \"lint,test:\"",
"test:ember": "ember test"
},
"devDependencies": {
"vite": "^5.1.6",
"@rollup/plugin-babel": "^6.0.4",
"@babel/eslint-parser": "^7.22.5",
"@babel/plugin-proposal-decorators": "^7.22.5",
"@ember/optional-features": "^2.0.0",
"@ember/string": "^3.1.1",
"@ember/test-helpers": "^3.3.0",
"@embroider/compat": "^3.4.6",
"@embroider/core": "^3.4.6",
"@embroider/compat": "3.4.6-unstable.f30e685",
"@embroider/core": "3.4.6-unstable.f30e685",
"@embroider/test-setup": "^3.0.1",
"@embroider/vite": "^0.2.0",
"@embroider/vite": "0.2.1-unstable.f30e685",
"@embroider/webpack": "^3.2.2",
"@glimmer/component": "^1.1.2",
"@glimmer/tracking": "^1.1.2",
Expand Down Expand Up @@ -63,6 +65,7 @@
"ember-source-channel-url": "^3.0.0",
"ember-template-lint": "^5.11.0",
"ember-try": "^3.0.0",
"ember-vite-hmr": "^0.6.8",
"eslint": "^8.57.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-ember": "^12.0.2",
Expand Down
55 changes: 55 additions & 0 deletions doc-app/vite.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import { defineConfig } from "vite";
import {
resolver,
hbs,
scripts,
templateTag,
optimizeDeps,
compatPrebuild,
} from "@embroider/vite";
import { resolve } from "path";
import { babel } from "@rollup/plugin-babel";
import { hmr } from 'ember-vite-hmr';

const root = "node_modules/.embroider/rewritten-app";

export default defineConfig({
root,
// esbuild in vite does not support decorators
esbuild: false,
cacheDir: resolve("node_modules", ".vite"),
plugins: [
hbs(),
templateTag(),
scripts(),
resolver(),
// compatPrebuild(),
hmr(),

babel({
babelHelpers: "runtime",

// this needs .hbs because our hbs() plugin above converts them to
// javascript but the javascript still also needs babel, but we don't want
// to rename them because vite isn't great about knowing how to hot-reload
// them if we resolve them to made-up names.
extensions: [".gjs", ".js", ".hbs", ".ts", ".gts"],
}),
],
optimizeDeps: Object.assign(optimizeDeps(), { exclude: ['carbon-components-ember', '@embroider/macros'] }),
server: {
port: 4200,
watch: {
ignored: ["!**/node_modules/.embroider/rewritten-app/**"],
},
},
build: {
outDir: resolve(process.cwd(), "dist"),
rollupOptions: {
input: {
main: resolve(root, "index.html"),
tests: resolve(root, "tests/index.html"),
},
},
},
});
Loading

0 comments on commit cf2024e

Please sign in to comment.