Skip to content
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
1 change: 1 addition & 0 deletions .github/actions/pnpm/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ runs:
- uses: pnpm/action-setup@v4.1.0
- uses: actions/setup-node@v4
with:
node-version: 24
cache: 'pnpm'
- name: 'Install dependencies'
shell: 'bash'
Expand Down
39 changes: 6 additions & 33 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,39 +133,6 @@ jobs:
working-directory: ./test-app
run: node_modules/.bin/ember try:one ${{matrix.try-scenario}} --skip-cleanup --- pnpm turbo test

# https://github.com/changesets/action
release:
name: Release
timeout-minutes: 5
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
needs:
- default_tests
- floating_tests
- typecheck
- try_scenarios

steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: TurboRepo local server
uses: felixmosh/turborepo-gh-artifacts@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: ./.github/actions/pnpm
- run: pnpm build:packages
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
# This expects you to have a script called release which does a build for your packages and calls changeset publish
publish: pnpm release
title: 'Release Preview'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

publishDocs:
name: Publish Docs to Cloudflare Pages
runs-on: ubuntu-latest
Expand All @@ -175,6 +142,8 @@ jobs:
contents: read
deployments: write
pull-requests: write
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.UX_OSS_CLOUDFLARE_API_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -183,6 +152,9 @@ jobs:
- run: pnpm build:docs
- name: Publish to Cloudflare Pages
id: publishStep
# skip (rather than fail) when the Cloudflare secrets are not
# configured, e.g. on forks or PRs from forks
if: env.CLOUDFLARE_API_TOKEN != ''
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.UX_OSS_CLOUDFLARE_API_TOKEN }}
Expand All @@ -191,6 +163,7 @@ jobs:
directory: ./docs-app/dist
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
- uses: marocchino/sticky-pull-request-comment@v2
if: env.CLOUDFLARE_API_TOKEN != '' && github.event_name == 'pull_request'
with:
message: |+
## Preview URLs
Expand Down
3 changes: 3 additions & 0 deletions docs-app/app/helpers/service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { getOwner } from '@ember/application';
import Helper from '@ember/component/helper';
import { assert } from '@ember/debug';

import type { Registry } from '@ember/service';

Expand All @@ -16,6 +17,8 @@ export default class GetService<Key extends keyof Registry> extends Helper<
compute([name]: [Key]): Registry[Key] {
const owner = getOwner(this);

assert('Expected the service helper to have an owner', owner);

return owner.lookup(`service:${name}`);
}
}
2 changes: 1 addition & 1 deletion docs-app/app/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default class Router extends EmberRouter {
location = config.locationType;
rootURL = config.rootURL;

constructor(...args: [object]) {
constructor(...args: ConstructorParameters<typeof EmberRouter>) {
super(...args);

const scroll = () => window.scrollTo(0, 0);
Expand Down
7 changes: 6 additions & 1 deletion docs-app/app/routes/application.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { getOwner } from '@ember/application';
import { assert } from '@ember/debug';
import Route from '@ember/routing/route';
import { service } from '@ember/service';

Expand All @@ -13,6 +14,10 @@ export default class Application extends Route {
}

afterModel() {
void setupHLJS(getOwner(this));
const owner = getOwner(this);

assert('Expected the application route to have an owner', owner);

void setupHLJS(owner);
}
}
13 changes: 7 additions & 6 deletions docs-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"@crowdstrike/tailwind-toucan-base": "^5.0.0",
"@docfy/core": "^0.9.0",
"@docfy/ember": "^0.8.5",
"@ember/app-tsconfig": "^1.0.0",
"@ember/optional-features": "^2.0.0",
"@ember/string": "^3.1.1",
"@ember/test-helpers": "^3.2.0",
Expand All @@ -41,8 +42,8 @@
"@glint/ember-tsc": "^1.0.3",
"@glint/template": "^1.6.1",
"@glint/tsserver-plugin": "^2.0.0",
"@nullvoxpopuli/eslint-configs": "^6.0.0",
"@tailwindcss/typography": "^0.5.7",
"@ember/app-tsconfig": "^1.0.0",
"@types/ember-qunit": "^6.0.0",
"@types/ember-resolver": "^9.0.0",
"@types/qunit": "^2.19.3",
Expand All @@ -66,9 +67,9 @@
"ember-qunit": "^8.0.0",
"ember-resolver": "^13.1.0",
"ember-source": "~5.12.0",
"ember-template-imports": "^3.1.2",
"ember-template-imports": "^4.4.0",
"ember-template-lint": "^4.14.0",
"eslint": "^9.0.0","@nullvoxpopuli/eslint-configs": "^6.0.0",
"eslint": "^9.0.0",
"loader.js": "^4.7.0",
"postcss": "^8.4.17",
"postcss-import": "^16.0.0",
Expand All @@ -91,12 +92,12 @@
"@crowdstrike/ember-oss-docs": "^1.1.8",
"@ember/test-waiters": "^3.0.2 || ^4.0.0",
"@embroider/router": "^2.1.6",
"ember-browser-services": "^5.0.0",
"ember-changeset": "^4.1.2",
"ember-changeset-validations": "^4.1.1",
"@universal-ember/form": "workspace:*",
"@universal-ember/form-changeset": "workspace:*",
"@universal-ember/form-yup": "workspace:*",
"ember-browser-services": "^5.0.0",
"ember-changeset": "^4.1.2",
"ember-changeset-validations": "^4.1.1",
"ember-modifier": "^4.0.0",
"ember-resources": "^7.0.0",
"highlight.js": "^11.6.0",
Expand Down
5 changes: 5 additions & 0 deletions docs-app/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
"paths": {
"docs-app/tests/*": ["tests/*"],
"docs-app/*": ["app/*"],
// ember-oss-docs' exports map points at extensionless `./dist/*` targets,
// which module: bundler resolution refuses to resolve for subpath imports
"@crowdstrike/ember-oss-docs/*": [
"node_modules/@crowdstrike/ember-oss-docs/dist/*"
],
"*": ["types/*"]
}
},
Expand Down
6 changes: 4 additions & 2 deletions packages/ember-headless-form/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,21 @@
"@babel/plugin-proposal-decorators": "^7.23.6",
"@babel/plugin-syntax-decorators": "^7.23.3",
"@babel/preset-typescript": "^7.23.3",
"@ember/library-tsconfig": "^1.0.0",
"@embroider/addon-dev": "^7.0.0",
"@glimmer/component": "^1.1.2",
"@glimmer/tracking": "^1.1.2",
"@glint/ember-tsc": "^1.0.3",
"@glint/template": "^1.6.1",
"@glint/tsserver-plugin": "^2.0.0",
"@ember/library-tsconfig": "^1.0.0",
"@nullvoxpopuli/eslint-configs": "^6.0.0",
"concurrently": "^9.0.0",
"ember-source": "^5.0.0",
"ember-template-imports": "^3.4.1",
"ember-template-lint": "^4.0.0",
"eslint": "^9.0.0","@nullvoxpopuli/eslint-configs": "^6.0.0",
"eslint": "^9.0.0",
"prettier": "^3.8.1",
"prettier-plugin-ember-template-tag": "^2.1.7",
"rollup": "^4.0.0",
"rollup-plugin-copy": "^3.4.0",
"rollup-plugin-glimmer-template-tag": "^0.4.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export interface HeadlessFormControlCheckboxGroupComponentSignature {
typeof HeadlessFormControlCheckboxGroupLabelComponent,
'id'
>;
}
},
];
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export interface HeadlessFormControlCheckboxComponentSignature {
typeof HeadlessFormControlCheckboxInputComponent,
'fieldId' | 'value' | 'toggleValue' | 'checked' | 'name'
>;
}
},
];
};
}
Expand All @@ -60,9 +60,11 @@ export default class HeadlessFormControlCheckboxComponent extends Component<Head
@action
toggleValue(checked: boolean): void {
if (checked) {
this.args.setValue([...this.args.selected, this.args.value]);
} else {
this.args.setValue([...this.args.selected.filter((v) => v !== this.args.value)]);
this.args.setValue([...this.args.selected, this.args.value]);
} else {
this.args.setValue([
...this.args.selected.filter((v) => v !== this.args.value),
]);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ export interface HeadlessFormControlCheckboxGroupLabelComponentSignature {
}

const HeadlessFormControlCheckboxGroupLabelComponent: TemplateOnlyComponent<HeadlessFormControlCheckboxGroupLabelComponentSignature> =
<template><div id={{@id}} ...attributes>{{yield}}</div></template>;
<template>
<div id={{@id}} ...attributes>{{yield}}</div>
</template>;

export default HeadlessFormControlCheckboxGroupLabelComponent;
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,13 @@ export interface HeadlessFormControlInputComponentSignature {
export default class HeadlessFormControlInputComponent extends Component<HeadlessFormControlInputComponentSignature> {
constructor(
owner: unknown,
args: HeadlessFormControlInputComponentSignature['Args']
args: HeadlessFormControlInputComponentSignature['Args'],
) {
assert(
`input component does not support @type="${args.type}" as there is a dedicated component for this. Please use the \`field.${args.type}\` instead!`,
args.type === undefined ||
// TS would guard us against using an unsupported `InputType`, but for JS consumers we add a dev-only runtime check here
!['checkbox', 'radio'].includes(args.type)
!['checkbox', 'radio'].includes(args.type),
);

super(owner, args);
Expand All @@ -107,7 +107,7 @@ export default class HeadlessFormControlInputComponent extends Component<Headles
handleInput(e: Event | InputEvent): void {
assert('Expected HTMLInputElement', e.target instanceof HTMLInputElement);
this.args.setValue(
this.type === 'number' ? parseFloat(e.target.value) : e.target.value
this.type === 'number' ? parseFloat(e.target.value) : e.target.value,
);
}
<template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export interface HeadlessFormControlRadioGroupComponentSignature {
typeof HeadlessFormControlRadioGroupLabelComponent,
'id'
>;
}
},
];
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ export interface HeadlessFormControlRadioGroupLabelComponentSignature {
}

const HeadlessFormControlRadioGroupLabelComponent: TemplateOnlyComponent<HeadlessFormControlRadioGroupLabelComponentSignature> =
<template><div id={{@id}} ...attributes>{{yield}}</div></template>;
<template>
<div id={{@id}} ...attributes>{{yield}}</div>
</template>;

export default HeadlessFormControlRadioGroupLabelComponent;
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export interface HeadlessFormControlRadioComponentSignature {
typeof HeadlessFormControlRadioInputComponent,
'fieldId' | 'value' | 'setValue' | 'checked' | 'name'
>;
}
},
];
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export interface HeadlessFormControlSelectComponentSignature {
typeof HeadlessFormControlSelectOptionComponent,
'selected'
>;
}
},
];
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export interface HeadlessFormErrorsComponentSignature<VALUE> {
};
}


export default class HeadlessFormErrorsComponent<VALUE> extends Component<
HeadlessFormErrorsComponentSignature<VALUE>
> {
Expand Down
Loading
Loading