Skip to content

Fix app watching -- Copy content from #82 #86

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

Merged
merged 1 commit into from
Jul 3, 2024
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions docs-app/ember-cli-build.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,42 @@
'use strict';

const EmberApp = require('ember-cli/lib/broccoli/ember-app');
const path = require('path');
const fs = require('fs');

module.exports = async function (defaults) {
const { readPackageUpSync } = await import('read-package-up');

const app = new EmberApp(defaults, {
// Add options here
trees: {
app: (() => {
let sideWatch = require('@embroider/broccoli-side-watch');

let paths = ['kolay', '@universal-ember/kolay-ui'].map((libraryName) => {
let entry = require.resolve(libraryName);
let { packageJson, path: packageJsonPath } = readPackageUpSync({ cwd: entry });
let packagePath = path.dirname(packageJsonPath);

console.debug(
`Side-watching ${libraryName} from ${packagePath}, which started in ${entry}`
);

let toWatch = packageJson.files
.map((f) => path.join(packagePath, f))
.filter((p) => {
if (!fs.existsSync(p)) return false;
if (!fs.lstatSync(p).isDirectory()) return false;

return !p.endsWith('/src');
});

return toWatch;
});

return sideWatch('app', { watching: paths.flat() });
})(),
},
'ember-cli-babel': {
enableTypeScriptTransform: true,
},
Expand Down
2 changes: 2 additions & 0 deletions docs-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"@ember/string": "^3.1.1",
"@ember/test-helpers": "^3.3.0",
"@ember/test-waiters": "^3.1.0",
"@embroider/broccoli-side-watch": "0.0.2-unstable.ba9fd29",
"@embroider/compat": "^3.4.8",
"@embroider/core": "^3.4.8",
"@embroider/webpack": "^4.0.0",
Expand Down Expand Up @@ -79,6 +80,7 @@
"prettier-plugin-ember-template-tag": "^2.0.0",
"qunit": "^2.20.0",
"qunit-dom": "^3.2.0",
"read-package-up": "^11.0.0",
"stylelint": "^16.4.0",
"stylelint-config-standard": "^36.0.0",
"stylelint-prettier": "^5.0.0",
Expand Down
Loading
Loading