Skip to content
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

(experiment) Yarn classic to Yarn 2 w/ nodeLinker #354

Closed
wants to merge 29 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
a8d4748
Bump ember-auto-import & ember-cli-typescript (leading to other vario…
phndiaye Dec 24, 2023
1273538
Fix ts failures
phndiaye Dec 24, 2023
328e302
More useless packages uninstalls
phndiaye Dec 24, 2023
5d73006
deps: Point ember-cli-typescript-blueprints to branch that follows Gl…
phndiaye Dec 24, 2023
d22b1af
remove import from ember-load-initializers
phndiaye Dec 24, 2023
d8bee31
Remove mentions of imports from deprecated htmlbars-inline-precompile
phndiaye Dec 24, 2023
486e77d
Remove dead upf-rating component
phndiaye Dec 24, 2023
67f6906
peerDeps: update qunit range
phndiaye Dec 26, 2023
7719c12
ci: update node version
phndiaye Dec 26, 2023
b57327f
fix irregular whitespace
phndiaye Dec 26, 2023
6bf152a
rebuild yarn.lock
phndiaye Dec 26, 2023
95643a6
Fix ember-qunit version
phndiaye Dec 26, 2023
d918b75
fix Qunit peer dependency required version
phndiaye Dec 28, 2023
249e6a7
Bump @glimmer/{component,tracking} to latest stable version to meet G…
phndiaye Dec 24, 2023
a6f5aaf
Install glint packages + config
phndiaye Dec 24, 2023
0bb09a9
Update component signature (using ember-codemod-args-to-signature cod…
phndiaye Dec 24, 2023
92c8366
helpers/fa-icon-style: provide signature
phndiaye Dec 24, 2023
5dc5fe0
Start by not checking existing templates so we can incrementally intr…
phndiaye Dec 24, 2023
b9fab5e
Get types for ember-intl t helper & @ember/render-modifiers
phndiaye Dec 24, 2023
0c62079
Typesafety for fa-icon-value helper and OSS::Button (first component,…
phndiaye Dec 24, 2023
0cc21b5
More typesafety, for ember-truth-helpers this time
phndiaye Dec 24, 2023
a9a7ebb
Some easy wins typesafe components
phndiaye Dec 24, 2023
7f80e7c
additional typing
phndiaye Dec 26, 2023
c494635
a bit more typing and fix some linting stuffs
phndiaye Dec 27, 2023
3e4e884
Bump storybook deps
phndiaye Dec 27, 2023
1593088
Remove ember-named-blocks-polyfil
phndiaye Dec 27, 2023
c20a128
As much Glint support as possible
phndiaye Jan 16, 2024
3988ae5
Yarn classic to Yarn 2 w/ nodeLinker
phndiaye Jan 17, 2024
8f1dff0
add undeclared used dependencies
phndiaye Jan 17, 2024
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: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ module.exports = {
'ember/no-mixins': 'off',
'ember/no-get': 'off',
'ember/avoid-leaking-state-in-ember-objects': 'off',
'ember/no-global-jquery': 'off',
'ember/no-classic-classes': 'off',
'ember/no-classic-components': 'off',
'ember/require-tagless-components': 'off',
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ on:

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_VERSION: '14'
NODE_VERSION: '16'
FONTAWESOME_NPM_AUTH_TOKEN: ${{ secrets.FONTAWESOME_NPM_AUTH_TOKEN }}
YARN_IGNORE_NODE: 1

jobs:
test:
Expand All @@ -29,7 +30,7 @@ jobs:
node-version: '${{ env.NODE_VERSION }}'
cache: 'yarn'
- name: Install Dependencies
run: yarn --prefer-offline --frozen-lockfile
run: yarn install
env:
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
- name: Lint
Expand All @@ -48,7 +49,7 @@ jobs:
node-version: '${{ env.NODE_VERSION }}'
cache: 'yarn'
- name: Install Dependencies
run: yarn --prefer-offline --frozen-lockfile
run: yarn install
env:
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
- name: Ember Build
Expand Down Expand Up @@ -77,7 +78,7 @@ jobs:
node-version: '${{ env.NODE_VERSION }}'
cache: 'yarn'
- name: Install Dependencies
run: yarn --prefer-offline --frozen-lockfile
run: yarn install
env:
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
- name: Publish
Expand Down
11 changes: 10 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ storybook-static
/libpeerconnection.log
npm-debug.log
testem.log
/yarn-error.log
/package-lock.json
ember-modules-codemod.*

Expand All @@ -34,3 +33,13 @@ doc
# storybook
preview-head.html
app/styles/core/fonts/

# yarn
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
/yarn-error.log
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v16.19.0
893 changes: 893 additions & 0 deletions .yarn/releases/yarn-4.0.2.cjs

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
nodeLinker: node-modules

npmRegistries:
//npm.pkg.github.com:
npmAuthToken: "${GITHUB_TOKEN}"

npmScopes:
fortawesome:
npmAlwaysAuth: true
npmAuthToken: "${FONTAWESOME_NPM_AUTH_TOKEN}"
npmRegistryServer: "https://npm.fontawesome.com/"
upfluence:
npmRegistryServer: "https://npm.pkg.github.com"

yarnPath: .yarn/releases/yarn-4.0.2.cjs
9 changes: 5 additions & 4 deletions addon-test-support/services/uploader.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import BaseUploader from '@upfluence/oss-components/services/base-uploader';
import UploaderInterface, {
UploadRequest,
FileValidator,
ValidationResponse
import {
type default as UploaderInterface,
type UploadRequest,
type FileValidator,
type ValidationResponse
} from '@upfluence/oss-components/types/uploader';

export default class extends BaseUploader implements UploaderInterface {
Expand Down
1 change: 1 addition & 0 deletions addon/components/o-s-s/access-panel.hbs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{! @glint-nocheck: not typesafe yet }}
<div class="oss-access-panel-backdrop" role="button" {{on "click" @onClose}}></div>
<div class="oss-access-panel-container" {{did-insert this.setupAnimation}} ...attributes>
{{#if (has-block "header")}}
Expand Down
33 changes: 25 additions & 8 deletions addon/components/o-s-s/access-panel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,26 @@ import { tracked } from '@glimmer/tracking';
import { action } from '@ember/object';
import { later } from '@ember/runloop';

interface OSSAccessPanelArgs {
records: unknown[];
initialLoad: boolean;
loading?: boolean;
onSearch(keyword: string): void;
onBottomReached(): void;
onClose(): void;
interface OSSAccessPanelSignature {
Args: {
records: unknown[];
initialLoad: boolean;
loading?: boolean;
onSearch(keyword: string): void;
onBottomReached(): void;
onClose(): void;
};
Blocks: {
columns: [];
'empty-state': [];
header: [];
'no-results': [];
row: [unknown];
};
Element: HTMLDivElement;
}

export default class OSSAccessPanel extends Component<OSSAccessPanelArgs> {
export default class OSSAccessPanelComponent extends Component<OSSAccessPanelSignature> {
loadingRows = new Array(12);
loadingMoreRows = new Array(3);

Expand All @@ -39,3 +49,10 @@ export default class OSSAccessPanel extends Component<OSSAccessPanelArgs> {
this.args.onSearch(this.searchKeyword!);
}
}

declare module '@glint/environment-ember-loose/registry' {
export default interface Registry {
'OSS::AccessPanel': typeof OSSAccessPanelComponent;
'o-s-s/access-panel': typeof OSSAccessPanelComponent;
}
}
2 changes: 1 addition & 1 deletion addon/components/o-s-s/alert.stories.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import hbs from 'htmlbars-inline-precompile';
import { hbs } from 'ember-cli-htmlbars';
import { action } from '@storybook/addon-actions';

const SkinTypes = ['success', 'info', 'warning', 'error'];
Expand Down
29 changes: 21 additions & 8 deletions addon/components/o-s-s/alert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,22 @@ type skinType = 'success' | 'error' | 'warning';

const DEFAULT_SKIN = 'info';

interface OSSAlertArgs {
skin?: skinType;
title?: string;
subtitle?: string;
plain?: boolean;
closable?: boolean;
onClose?(): void;
interface OSSAlertSignature {
Args: {
skin?: skinType;
title?: string;
subtitle?: string;
plain?: boolean;
closable?: boolean;
onClose?(): void;
};
Blocks: {
'extra-content': [];
};
Element: HTMLDivElement;
}

export default class OSSAlert extends Component<OSSAlertArgs> {
export default class OSSAlertComponent extends Component<OSSAlertSignature> {
private declare _DOMElement: HTMLElement;

get skinClass(): string {
Expand Down Expand Up @@ -50,3 +56,10 @@ export default class OSSAlert extends Component<OSSAlertArgs> {
this._DOMElement?.remove();
}
}

declare module '@glint/environment-ember-loose/registry' {
export default interface Registry {
'OSS::Alert': typeof OSSAlertComponent;
'o-s-s/alert': typeof OSSAlertComponent;
}
}
2 changes: 1 addition & 1 deletion addon/components/o-s-s/array-input.stories.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import hbs from 'htmlbars-inline-precompile';
import { hbs } from 'ember-cli-htmlbars';
import { action } from '@storybook/addon-actions';

export default {
Expand Down
30 changes: 20 additions & 10 deletions addon/components/o-s-s/array-input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,26 @@ import Component from '@glimmer/component';
import { action } from '@ember/object';
import { tracked } from '@glimmer/tracking';

interface OSSArrayInputArgs {
values?: string[];
keyboardTriggers?: string[];
errorMessage?: string;
disabled?: boolean;
validator?: (value: string) => boolean;
onChange?: (values: string[]) => void;
placeholder?: string;
interface OSSArrayInputSignature {
Args: {
values?: string[];
keyboardTriggers?: string[];
errorMessage?: string;
disabled?: boolean;
validator?: (value: string) => boolean;
onChange?: (values: string[]) => void;
placeholder?: string;
};
Element: HTMLDivElement;
}

const DEFAULT_KEYBOARD_TRIGGERS = ['Enter'];

export default class OSSArrayInput extends Component<OSSArrayInputArgs> {
export default class OSSArrayInputComponent extends Component<OSSArrayInputSignature> {
@tracked currentValue = '';
@tracked items: string[] = [];

constructor(owner: unknown, args: OSSArrayInputArgs) {
constructor(owner: unknown, args: OSSArrayInputSignature['Args']) {
super(owner, args);
if (this.args.values) {
this.items = this.args.values;
Expand Down Expand Up @@ -97,3 +100,10 @@ export default class OSSArrayInput extends Component<OSSArrayInputArgs> {
this._onChange();
}
}

declare module '@glint/environment-ember-loose/registry' {
export default interface Registry {
'OSS::ArrayInput': typeof OSSArrayInputComponent;
'o-s-s/array-input': typeof OSSArrayInputComponent;
}
}
1 change: 1 addition & 0 deletions addon/components/o-s-s/attribute/base.hbs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{! @glint-nocheck: not typesafe yet }}
<div class="oss-attribute"
{{on "mouseenter" (fn (mut this.displayCopyBtn) true)}}
{{on "mouseleave" (fn (mut this.displayCopyBtn) false)}}
Expand Down
22 changes: 18 additions & 4 deletions addon/components/o-s-s/attribute/base.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
import { isBlank } from '@ember/utils';
import Component from '@glimmer/component';

interface OSSAttributeBaseArgs {
value: string;
copyable?: boolean;
interface OSSAttributeBaseSignature {
Args: {
value: string;
copyable?: boolean;
};
Blocks: {
label: [];
value: [];
};
Element: HTMLDivElement;
}

export default class OSSAttributeBase extends Component<OSSAttributeBaseArgs> {
export default class OSSAttributeBaseComponent extends Component<OSSAttributeBaseSignature> {
get isCopyable(): boolean {
return (this.args.copyable ?? true) && !isBlank(this.args.value) && this.args.value !== '-';
}
}

declare module '@glint/environment-ember-loose/registry' {
export default interface Registry {
'OSS::Attribute::Base': typeof OSSAttributeBaseComponent;
'o-s-s/attribute/base': typeof OSSAttributeBaseComponent;
}
}
1 change: 1 addition & 0 deletions addon/components/o-s-s/attribute/country.hbs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{! @glint-nocheck: not typesafe yet }}
<OSS::Attribute::Base @value={{this.countryName}} data-control-name="attribute-country" ...attributes>
<:label>
<span>{{t "oss-components.attribute.country"}}</span>
Expand Down
2 changes: 1 addition & 1 deletion addon/components/o-s-s/attribute/country.stories.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import hbs from 'htmlbars-inline-precompile';
import { hbs } from 'ember-cli-htmlbars';

export default {
title: 'Components/OSS::Attribute::Country',
Expand Down
18 changes: 14 additions & 4 deletions addon/components/o-s-s/attribute/country.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import Component from '@glimmer/component';
import { CountryData, countries } from '@upfluence/oss-components/utils/country-codes';
import { type CountryData, countries } from '@upfluence/oss-components/utils/country-codes';
import { tracked } from '@glimmer/tracking';

interface OSSAttributeCountryArgs {
countryCode?: string;
interface OSSAttributeCountrySignature {
Args: {
countryCode?: string;
};
Element: HTMLElement;
}

export default class OSSAttributeCountry extends Component<OSSAttributeCountryArgs> {
export default class OSSAttributeCountryComponent extends Component<OSSAttributeCountrySignature> {
@tracked displayCopyBtn: boolean = false;

private countryDictionnary: CountryData[] = countries;
Expand All @@ -17,3 +20,10 @@ export default class OSSAttributeCountry extends Component<OSSAttributeCountryAr
);
}
}

declare module '@glint/environment-ember-loose/registry' {
export default interface Registry {
'OSS::Attribute::Country': typeof OSSAttributeCountryComponent;
'o-s-s/attribute/country': typeof OSSAttributeCountryComponent;
}
}
1 change: 1 addition & 0 deletions addon/components/o-s-s/attribute/phone-number.hbs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{! @glint-nocheck: not typesafe yet }}
<OSS::Attribute::Base @value={{this.formattedPhoneNumber}} data-control-name="attribute-phone-number" ...attributes>
<:label>
<span>{{t "oss-components.attribute.phone_number"}}</span>
Expand Down
2 changes: 1 addition & 1 deletion addon/components/o-s-s/attribute/phone-number.stories.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import hbs from 'htmlbars-inline-precompile';
import { hbs } from 'ember-cli-htmlbars';

export default {
title: 'Components/OSS::Attribute::PhoneNumber',
Expand Down
22 changes: 16 additions & 6 deletions addon/components/o-s-s/attribute/phone-number.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import Component from '@glimmer/component';
import { CountryData, countries } from '@upfluence/oss-components/utils/country-codes';
import { type CountryData, countries } from '@upfluence/oss-components/utils/country-codes';

interface OSSAttributePhoneNumberArgs {
countryCode?: string;
prefix?: string;
number?: string;
interface OSSAttributePhoneNumberSignature {
Args: {
countryCode?: string;
prefix?: string;
number?: string;
};
Element: HTMLElement;
}

export default class OSSAttributePhoneNumber extends Component<OSSAttributePhoneNumberArgs> {
export default class OSSAttributePhoneNumberComponent extends Component<OSSAttributePhoneNumberSignature> {
private countryDictionnary: CountryData[] = countries;

get formattedPhoneNumber(): string {
Expand All @@ -22,3 +25,10 @@ export default class OSSAttributePhoneNumber extends Component<OSSAttributePhone
return this.args.prefix ? `${this.args.prefix} ` : '';
}
}

declare module '@glint/environment-ember-loose/registry' {
export default interface Registry {
'OSS::Attribute::PhoneNumber': typeof OSSAttributePhoneNumberComponent;
'o-s-s/attribute/phone-number': typeof OSSAttributePhoneNumberComponent;
}
}
1 change: 1 addition & 0 deletions addon/components/o-s-s/attribute/rating.hbs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{! @glint-nocheck: not typesafe yet }}
<OSS::Attribute::Base class="oss-attribute--no-hover-effect" data-control-name="attribute-rating" ...attributes>
<:label>
<span>{{@label}}</span>
Expand Down
2 changes: 1 addition & 1 deletion addon/components/o-s-s/attribute/rating.stories.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import hbs from 'htmlbars-inline-precompile';
import { hbs } from 'ember-cli-htmlbars';

export default {
title: 'Components/OSS::Attribute::Rating',
Expand Down
Loading
Loading