Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Pircher <[email protected]>
  • Loading branch information
patricklx committed Mar 1, 2024
1 parent eb0fef1 commit 8bb9326
Show file tree
Hide file tree
Showing 9 changed files with 1,987 additions and 1,098 deletions.
6 changes: 0 additions & 6 deletions carbon-components-ember/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@
"ember-cli-typescript": "^5.2.1",
"ember-composable-helpers": "^5.0.0",
"ember-concurrency": "^3.0.0",
"ember-css-modules": "^2.0.1",
"ember-css-modules-sass": "^1.1.0",
"ember-data": "^4.12.0",
"ember-get-config": "^2.1.1",
"ember-hbs-imports": "^0.5.39",
Expand All @@ -100,9 +98,6 @@
"yam": "^1.0.0"
},
"devDependencies": {
"@babel/core": "^7.17.0",
"@babel/plugin-transform-typescript": "^7.22.15",
"@babel/runtime": "^7.17.0",
"@embroider/addon-dev": "^4.1.0",
"@glint/environment-ember-loose": "^1.2.0",
"@glint/environment-ember-template-imports": "^1.2.0",
Expand Down Expand Up @@ -149,7 +144,6 @@
"@ember/optional-features": "^2.0.0",
"@ember/render-modifiers": "^2.1.0",
"@ember/string": "^3.1.1",
"@ember/test-helpers": "^3.2.0",
"@embroider/compat": "^3.2.1",
"@embroider/core": "^3.2.1",
"@embroider/macros": "^1.13.1",
Expand Down
4 changes: 2 additions & 2 deletions doc-app/app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
{{content-for "head"}}

<link integrity="" rel="stylesheet" href="{{rootURL}}assets/vendor.css">
<link integrity="" rel="stylesheet" href="{{rootURL}}assets/test-app.css">
<link integrity="" rel="stylesheet" href="{{rootURL}}assets/doc-app.css">

{{content-for "head-footer"}}
</head>
<body>
{{content-for "body"}}

<script src="{{rootURL}}assets/vendor.js"></script>
<script src="{{rootURL}}assets/test-app.js"></script>
<script src="{{rootURL}}assets/doc-app.js"></script>

{{content-for "body-footer"}}
</body>
Expand Down
2 changes: 1 addition & 1 deletion doc-app/app/pods/application/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<div id='{{this.dialogManager.id}}'>
{{#if this.dialogManager.currentDialog}}
{{component
this.dialogManager.currentDialog
(ensure-safe-component this.dialogManager.currentDialog)
options=this.dialogManager.options
}}
{{/if}}
Expand Down
Empty file added doc-app/app/templates/.gitkeep
Empty file.
68 changes: 66 additions & 2 deletions doc-app/ember-cli-build.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,82 @@
'use strict';

const EmberApp = require('ember-cli/lib/broccoli/ember-app');
const { resolve } = require('path');
const { Resolver } = require('@embroider/core');


const componentTemplateCandidates = Resolver.prototype.componentTemplateCandidates;
Resolver.prototype.componentTemplateCandidates = function () {
return [...componentTemplateCandidates.call(this)].concat([{ prefix: '/', suffix: '/template' }]);
}

const componentJSCandidates = Resolver.prototype.componentJSCandidates;
Resolver.prototype.componentJSCandidates = function () {
const extensions = ['.js', '.ts', '.gjs', '.gts'];
const result = [...componentJSCandidates.call(this)];
for (const ext of extensions) {
result.push(...[
{ prefix: '/', suffix: ext },
{ prefix: '/', suffix: `/index${ext}` },
{ prefix: '/', suffix: `/component${ext}` }
]);
}
return result;
}


const parseGlobalPath = Resolver.prototype.parseGlobalPath;
Resolver.prototype.parseGlobalPath = function (path, inEngine) {
if (path.includes('__hbs__import_')) {
const parts = path.replace('__hbs__import_', '').split('/');
let packageName = parts[0].startsWith('@') ? parts.slice(0, 2).join('/') : parts[0];
try {
// packageName = this.packageCache.resolve(packageName, inEngine).root;
} catch (e) {
//
}
const memberName = parts.join('/').replace(packageName + '/', '');
return {
packageName,
memberName,
from: resolve(inEngine.root, 'package.json')
}
}
return parseGlobalPath.call(this, path, inEngine);
}

const resolveHelper = Resolver.prototype.resolveHelper;
Resolver.prototype.resolveHelper = function (path, inEngine, request) {
if (path.includes('__hbs__import_')) {
let target = this.parseGlobalPath(path, inEngine);
return request.alias(`${target.packageName}/${target.memberName}`).rehome((0, path_1.resolve)(inEngine.root, 'package.json'));
}
return resolveHelper.call(this, path, inEngine, request);
}

const resolveModifier = Resolver.prototype.resolveModifier;
Resolver.prototype.resolveModifier = function (path, inEngine, request) {
if (path.includes('__hbs__import_')) {
let target = this.parseGlobalPath(path, inEngine);
return request.alias(`${target.packageName}/${target.memberName}`).rehome((0, path_1.resolve)(inEngine.root, 'package.json'));
}
return resolveModifier.call(this, path, inEngine, request);
}

module.exports = function (defaults) {
let app = new EmberApp(defaults, {
autoImport: {
watchDependencies: ['carbon-components-ember2'],
watchDependencies: ['carbon-components-ember'],
},
'ember-cli-addon-docs': {
documentingAddonAt: '../carbon-components-ember'
},
'ember-cli-babel': {
enableTypeScriptTransform: true,
},
});

return require('@embroider/compat').compatBuild(app, null, {
return require('@embroider/compat').compatBuild(app, require('@embroider/webpack').Webpack, {
staticAddonTrees: true,
staticAddonTestSupportTrees: true,
staticComponents: true,
Expand Down
17 changes: 11 additions & 6 deletions doc-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,21 @@
"test": "concurrently \"npm:lint\" \"npm:test:*\" --names \"lint,test:\"",
"test:ember": "ember test"
},
"dependencies": {
"ember-cli-addon-docs": "^7.0.1",
"ember-cli-addon-docs-yuidoc": "^1.1.0"
},
"devDependencies": {
"@rollup/plugin-babel": "^6.0.4",
"ember-vite-hmr": "^0.6.0",
"@embroider/compat": "3.4.4-unstable.12a42ca",
"@embroider/core": "3.4.4-unstable.12a42ca",
"@embroider/vite": "0.2.1-unstable.12a42ca",
"@embroider/compat": "^3.4.5",
"@embroider/core": "^3.4.5",
"@embroider/vite": "^0.2.0",
"@embroider/webpack": "^3.2.2",
"@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.1.0",
"@ember/test-helpers": "^3.3.0",
"@embroider/test-setup": "^3.0.1",
"@glimmer/component": "^1.1.2",
"@glimmer/tracking": "^1.1.2",
Expand All @@ -51,14 +55,15 @@
"ember-cli-inject-live-reload": "^2.1.0",
"ember-cli-sri": "^2.1.1",
"ember-cli-terser": "^4.0.2",
"ember-hbs-imports": "^1.0.4",
"ember-data": "~5.1.0",
"ember-fetch": "^8.1.2",
"ember-load-initializers": "^2.1.2",
"ember-modifier": "^4.1.0",
"ember-page-title": "^7.0.0",
"ember-qunit": "^7.0.0",
"ember-resolver": "^10.1.1",
"ember-source": "~5.6.0",
"ember-source": "~5.2.0",
"ember-source-channel-url": "^3.0.0",
"ember-template-lint": "^5.11.0",
"ember-try": "^3.0.0",
Expand Down
4 changes: 2 additions & 2 deletions doc-app/tests/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{{content-for "test-head"}}

<link rel="stylesheet" href="{{rootURL}}assets/vendor.css">
<link rel="stylesheet" href="{{rootURL}}assets/test-app.css">
<link rel="stylesheet" href="{{rootURL}}assets/doc-app.css">
<link rel="stylesheet" href="{{rootURL}}assets/test-support.css">

{{content-for "head-footer"}}
Expand All @@ -30,7 +30,7 @@
<script src="/testem.js" integrity="" data-embroider-ignore></script>
<script src="{{rootURL}}assets/vendor.js"></script>
<script src="{{rootURL}}assets/test-support.js"></script>
<script src="{{rootURL}}assets/test-app.js"></script>
<script src="{{rootURL}}assets/doc-app.js"></script>
<script src="{{rootURL}}assets/tests.js"></script>

{{content-for "body-footer"}}
Expand Down
Loading

0 comments on commit 8bb9326

Please sign in to comment.