Skip to content

Commit

Permalink
Merge pull request #65 from embroider-build/app-rewriting
Browse files Browse the repository at this point in the history
update to work without app rewriting
  • Loading branch information
mansona authored Sep 7, 2024
2 parents bf23115 + 4898520 commit 1e7f9fa
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 22 deletions.
3 changes: 0 additions & 3 deletions files-override/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,3 @@

# broccoli-debug
/DEBUG/

# temporary until https://github.com/embroider-build/embroider/issues/2020 is merged
/tmp/
8 changes: 1 addition & 7 deletions files-override/ember-cli-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,5 @@ const { maybeEmbroider } = require('@embroider/test-setup');
module.exports = function (defaults) {
let app = new EmberApp(defaults, {});

return maybeEmbroider(app, {
skipBabel: [
{
package: 'qunit',
},
],
});
return maybeEmbroider(app);
};
25 changes: 25 additions & 0 deletions files-override/testem.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
'use strict';

if (typeof module !== 'undefined') {
module.exports = {
test_page: 'tests/index.html?hidepassed',
disable_watching: true,
launch_in_ci: ['Chrome'],
launch_in_dev: ['Chrome'],
browser_start_timeout: 120,
browser_args: {
Chrome: {
ci: [
// --no-sandbox is needed when running Chrome inside a container
process.env.CI ? '--no-sandbox' : null,
'--headless',
'--disable-dev-shm-usage',
'--disable-software-rasterizer',
'--mute-audio',
'--remote-debugging-port=0',
'--window-size=1440,900',
].filter(Boolean),
},
},
};
}
1 change: 0 additions & 1 deletion files-override/tests/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
<script src="/testem.js" integrity="" data-embroider-ignore></script>
<script src="/@embroider/core/vendor.js"></script>
<script src="/@embroider/core/test-support.js"></script>
<script src="/@embroider/core/entrypoint" type="module"></script>
<script type="module">import "ember-testing";</script>

<script type="module">
Expand Down
14 changes: 3 additions & 11 deletions files/vite.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ import {
assets,
contentFor,
} from '@embroider/vite';
import { resolve } from 'path';
import { babel } from '@rollup/plugin-babel';

const root = 'tmp/rewritten-app';
const extensions = [
'.mjs',
'.gjs',
Expand All @@ -26,8 +24,6 @@ const extensions = [

export default defineConfig(({ mode }) => {
return {
root,
cacheDir: resolve('node_modules', '.vite'),
resolve: {
extensions,
},
Expand All @@ -46,20 +42,16 @@ export default defineConfig(({ mode }) => {
}),
],
optimizeDeps: optimizeDeps(),
publicDir: resolve(process.cwd(), 'public'),
server: {
port: 4200,
watch: {
ignored: ['!**/tmp/rewritten-app/**'],
},
},
build: {
outDir: resolve(process.cwd(), 'dist'),
outDir: 'dist',
rollupOptions: {
input: {
main: resolve(root, 'index.html'),
main: 'index.html',
...(shouldBuildTests(mode)
? { tests: resolve(root, 'tests/index.html') }
? { tests: 'tests/index.html' }
: undefined),
},
},
Expand Down
10 changes: 10 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,16 @@ module.exports = {
'test:ember': 'vite build --mode test && ember test --path dist',
};

json['ember-addon'] = {
type: 'app',
version: 2,
};

json.exports = {
'./tests/*': './tests/*',
'./*': './app/*',
};

fs.writeFileSync(packageJson, JSON.stringify(json, null, 2));

await emberCliUpdate({
Expand Down

0 comments on commit 1e7f9fa

Please sign in to comment.