Skip to content

Commit

Permalink
fix gts
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Pircher <[email protected]>
  • Loading branch information
patricklx committed Mar 16, 2024
1 parent 9a44b69 commit 093aabc
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 45 deletions.
21 changes: 7 additions & 14 deletions carbon-components-ember/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@
"test": "echo 'A v2 addon does not have tests, run tests in test-app'"
},
"dependencies": {
"ember-resize-modifier": "^0.6.0",
"@ascua/maths": "^0.0.237",
"@ember/jquery": "^2.0.0",
"@ember/string": "^3.1.1",
"@ember/render-modifiers": "^2.1.0",
"@ascua/arrays": "^0.0.237",
"@babel/core": "^7.24.0",
"@babel/plugin-syntax-decorators": "^7.22.5",
Expand Down Expand Up @@ -102,14 +107,11 @@
"spark-md5": "^3.0.1",
"synckit": "^0.8.5",
"ts-node": "^10.9.1",
"yam": "^1.0.0"
"yam": "^1.0.0",
"astroturf": "^1.2.0"
},
"devDependencies": {
"@ascua/maths": "^0.0.237",
"@ember/jquery": "^2.0.0",
"@ember/optional-features": "^2.0.0",
"@ember/render-modifiers": "^2.1.0",
"@ember/string": "^3.1.1",
"@embroider/addon-dev": "^4.1.0",
"@embroider/compat": "^3.2.1",
"@embroider/core": "^3.2.1",
Expand All @@ -130,7 +132,6 @@
"@types/qunit-dom": "^0.7.0",
"@typescript-eslint/eslint-plugin": "^6.7.2",
"@typescript-eslint/parser": "^6.7.2",
"astroturf": "^1.2.0",
"babel-plugin-ember-template-compilation": "^2.2.0",
"bower": "^1.8.8",
"broccoli": "^3.4.2",
Expand All @@ -155,7 +156,6 @@
"ember-maybe-import-regenerator-for-testing": "^1.0.0",
"ember-modifier": "^4.1.0",
"ember-qunit": "^7.0.0",
"ember-resize-modifier": "^0.6.0",
"ember-resolver": "^10.0.0",
"ember-source": "^5.7.0",
"ember-source-channel-url": "latest",
Expand Down Expand Up @@ -269,18 +269,11 @@
"./services/notifications.js": "./dist/_app_/services/notifications.js"
}
},
"imports": {
"#∼/*": "./src/*"
},
"exports": {
".": {
"types": "./declarations/index.d.ts",
"default": "./dist/index.js"
},
"./components/*": {
"types": "./declarations/*.d.ts",
"default": "./dist/components/*.js"
},
"./*": {
"types": "./declarations/*.d.ts",
"default": "./dist/*.js"
Expand Down
38 changes: 24 additions & 14 deletions carbon-components-ember/rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -1,29 +1,42 @@
import path from 'path';
import fs from 'fs';
import { babel } from '@rollup/plugin-babel';
import copy from 'rollup-plugin-copy';
import { Addon } from '@embroider/addon-dev/rollup';
import astroturf from 'rollup-plugin-astroturf';
import postcss from 'rollup-plugin-postcss';
import rootImport from 'rollup-plugin-root-import';

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

const rootImport = (options) => ({
resolveId: (importee, importer) => {
if (importee[0] === '/') {
const rootPath = `${options.root}${importee}`;
const absPath = path.resolve('.', rootPath);
return fs.existsSync(absPath) ? absPath : null;
}
return null;
}
});

export default {
// This provides defaults that work well alongside `publicEntrypoints` below.
// You can augment this if you need to.
output: addon.output(),

plugins: [

// These are the modules that users should be able to import from your
// addon. Anything not listed here may get optimized away.
// By default all your JavaScript modules (**/*.js) will be importable.
// But you are encouraged to tweak this to only cover the modules that make
// up your addon's public API. Also make sure your package.json#exports
// is aligned to the config here.
// See https://github.com/embroider-build/embroider/blob/main/docs/v2-faq.md#how-can-i-define-the-public-exports-of-my-addon
addon.publicEntrypoints(['**/*.{js,gjs,ts,gts}', 'index.js', 'template-registry.js']),
addon.publicEntrypoints(['**/*.{js,ts}', 'index.js', 'template-registry.js']),

// These are the modules that should get reexported into the traditional
// "app" tree. Things in here should also be in publicEntrypoints above, but
Expand Down Expand Up @@ -51,12 +64,6 @@ export default {
babelHelpers: 'bundled',
}),

rootImport({
// Will first look in `client/src/*` and then `common/src/*`.
root: `${__dirname}/src`,
useInput: 'prepend',
}),

// Ensure that standalone .hbs files are properly integrated as Javascript.
addon.hbs(),

Expand All @@ -68,15 +75,17 @@ export default {
addon.keepAssets(['styles/**/*.scss']),

// Remove leftover build artifacts when starting a new build.
addon.clean(),
addon.clean({}),

astroturf({/* options */}),
postcss({
include: ['node_modules'],
extract: 'bundle.css',
modules: true
rootImport({
// Will first look in `client/src/*` and then `common/src/*`.
root: './src',
}),

astroturf({/* options */}),



// Copy Readme and License into published package
copy({
targets: [
Expand All @@ -86,3 +95,4 @@ export default {
}),
],
};

21 changes: 10 additions & 11 deletions carbon-components-ember/src/components/select.gts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import PowerSelectMultiple, {
} from 'ember-power-select/components/power-select-multiple';
import didInsert from '@ember/render-modifiers/modifiers/did-insert';
import defaultTo from '/helpers/default-to.ts';
import Checkbox from '/components/checkbox.gts'
import Checkbox from '/components/checkbox.gts';
import isSelected from 'ember-power-select/helpers/ember-power-select-is-selected';

type Args<T extends ContentValue> = {
Expand Down Expand Up @@ -136,17 +136,16 @@ export default class SelectComponent<T extends ContentValue> extends Component<
}

@action
didInsert(element) {
didInsert(element: HTMLElement) {
// eslint-disable-next-line ember/no-jquery
jQuery(element)
.find('.ember-power-select-status-icon')
.replaceWith(
'' +
'<svg class="cds--dropdown__arrow" ' +
'width="10" height="6" viewBox="0 0 10 6">\n' +
' <path d="M5 6L0 1 0.7 0.3 5 4.6 9.3 0.3 10 1z"></path>\n' +
' </svg>',
);
element
.getElementsByClassName('.ember-power-select-status-icon')
.item(
0,
).innerHTML = `
<svg class="cds--dropdown__arrow" width="10" height="6" viewBox="0 0 10 6">
<path d="M5 6L0 1 0.7 0.3 5 4.6 9.3 0.3 10 1z"></path>
</svg>`;
}

<template>
Expand Down
2 changes: 0 additions & 2 deletions carbon-components-ember/src/styles/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
@include grid.flex-grid();
@include grid.css-grid();

@import "pod-styles";

// Backgrounds
$ember-power-select-background-color: styles.$field-01 !default;
$ember-power-select-disabled-background-color: styles.$field-01 !default;
Expand Down
2 changes: 1 addition & 1 deletion carbon-components-ember/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"module": "ES6",
"experimentalDecorators": true,
"paths": {
"#∼/*": [
"/*": [
"src/*"
]
}
Expand Down
23 changes: 20 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 093aabc

Please sign in to comment.