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

Fix verdaccio build #3847

Closed
wants to merge 11 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions .circleci/comment.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ async function run() {
let pr;
// If we aren't running on a PR commit, double check if this is a branch created for a fork. If so, we'll need to
// comment the build link on the fork.
if (!process.env.CIRCLE_PULL_REQUEST) {
if (true) {
try {
const commit = await octokit.git.getCommit({
owner: 'adobe',
Expand Down Expand Up @@ -41,7 +41,7 @@ async function run() {
break;
}
}
} else if (process.env.CIRCLE_BRANCH === 'main') {
} else if (process.env.CIRCLE_BRANCH === 'fix-verdaccio-build') {
//If it isn't a PR commit, then we are on main. Create a comment for the test app and docs build
await octokit.repos.createCommitComment({
owner: 'adobe',
Expand Down
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ workflows:
- docs-verdaccio:
filters:
branches:
only: main
only: fix-verdaccio-build
requires:
- install
- deploy:
Expand Down
3,880 changes: 0 additions & 3,880 deletions examples/rsp-next-ts/yarn.lock

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ const BUDDHIST_ERA_START = -543;
* era, identified as 'BE'.
*/
export class BuddhistCalendar extends GregorianCalendar {
identifier = 'buddhist';
identifier;
constructor() {
super();
this.identifier = 'buddhist';
}

fromJulianDay(jd: number): CalendarDate {
let gregorianDate = super.fromJulianDay(jd);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ function getDaysInMonth(year: number, month: number) {
* on whether it is a leap year. Two eras are supported: 'AA' and 'AM'.
*/
export class EthiopicCalendar implements Calendar {
identifier = 'ethiopic';
identifier;
constructor() {
this.identifier = 'ethiopic';
}

fromJulianDay(jd: number): CalendarDate {
let [year, month, day] = julianDayToCE(ETHIOPIC_EPOCH, jd);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ const daysInMonth = {
*/
export class GregorianCalendar implements Calendar {
identifier = 'gregory';
constructor() {
this.identifier = 'gregory';
}

fromJulianDay(jd: number): CalendarDate {
let jd0 = jd;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,10 @@ function getDaysInMonth(year: number, month: number): number {
* In leap years, an extra month is inserted at month 6.
*/
export class HebrewCalendar implements Calendar {
identifier = 'hebrew';
identifier;
constructor() {
this.identifier = 'hebrew';
}

fromJulianDay(jd: number): CalendarDate {
let d = jd - HEBREW_EPOCH;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ const INDIAN_YEAR_START = 80;
* in each year, with either 30 or 31 days. Only one era identifier is supported: 'saka'.
*/
export class IndianCalendar extends GregorianCalendar {
identifier = 'indian';
identifier;
constructor() {
super();
this.identifier = 'indian';
}

fromJulianDay(jd: number): CalendarDate {
// Gregorian date for Julian day
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ function isLeapYear(year: number): boolean {
* Learn more about the available Islamic calendars [here](https://cldr.unicode.org/development/development-process/design-proposals/islamic-calendar-types).
*/
export class IslamicCivilCalendar implements Calendar {
identifier = 'islamic-civil';
identifier;
constructor() {
this.identifier = 'islamic-civil';
}

fromJulianDay(jd: number): CalendarDate {
return julianDayToIslamic(this, CIVIL_EPOC, jd);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,11 @@ function toGregorian(date: AnyCalendarDate) {
* Note that eras before 1868 (Gregorian) are not currently supported by this implementation.
*/
export class JapaneseCalendar extends GregorianCalendar {
identifier = 'japanese';
identifier;
constructor() {
super();
this.identifier = 'japanese';
}

fromJulianDay(jd: number): CalendarDate {
let date = super.fromJulianDay(jd);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ function persianToJulianDay(year: number, month: number, day: number): number {
* around the March equinox.
*/
export class PersianCalendar implements Calendar {
identifier = 'persian';
identifier;
constructor() {
this.identifier = 'persian';
}

fromJulianDay(jd: number): CalendarDate {
let d0 = jd - persianToJulianDay(475, 1, 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ function gregorianToTaiwan(year: number): [string, number] {
* 'before_minguo' and 'minguo'.
*/
export class TaiwanCalendar extends GregorianCalendar {
identifier = 'roc'; // Republic of China
identifier; // Republic of China
constructor() {
super();
this.identifier = 'roc';
}

fromJulianDay(jd: number): CalendarDate {
let date = super.fromJulianDay(jd);
Expand Down
9 changes: 6 additions & 3 deletions packages/@react-aria/focus/src/FocusScope.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -754,10 +754,11 @@ function last(walker: TreeWalker) {

class Tree {
private root: TreeNode;
private fastMap = new Map<ScopeRef, TreeNode>();
private fastMap: Map<ScopeRef, TreeNode>;

constructor() {
this.root = new TreeNode({scopeRef: null});
this.fastMap = new Map<ScopeRef, TreeNode>();
this.fastMap.set(null, this.root);
}

Expand Down Expand Up @@ -833,11 +834,13 @@ class TreeNode {
public scopeRef: ScopeRef;
public nodeToRestore: FocusableElement;
public parent: TreeNode;
public children: TreeNode[] = [];
public contain = false;
public children: TreeNode[];
public contain: boolean;

constructor(props: {scopeRef: ScopeRef}) {
this.scopeRef = props.scopeRef;
this.children = [];
this.contain = false;
}
addChild(node: TreeNode) {
this.children.push(node);
Expand Down
3 changes: 2 additions & 1 deletion packages/@react-aria/landmark/src/useLandmark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,12 @@ type Landmark = {
};

class LandmarkManager {
private landmarks: Array<Landmark> = [];
private landmarks: Array<Landmark>;
private static instance: LandmarkManager;
private isListening = false;

private constructor() {
this.landmarks = [];
this.f6Handler = this.f6Handler.bind(this);
this.focusinHandler = this.focusinHandler.bind(this);
this.focusoutHandler = this.focusoutHandler.bind(this);
Expand Down
3 changes: 2 additions & 1 deletion packages/@react-spectrum/card/src/BaseLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,14 @@ export class BaseLayout<T> extends Layout<Node<T>> implements KeyboardDelegate {
protected lastCollection: GridCollection<T>;
collection: GridCollection<T>;
isLoading: boolean;
disabledKeys: Set<Key> = new Set();
disabledKeys: Set<Key>;
direction: Direction;
scale: Scale;
margin: number;

constructor(options: BaseLayoutOptions = {}) {
super();
this.disabledKeys = new Set();
this.layoutInfos = new Map();
this.collator = options.collator;
this.lastCollection = null;
Expand Down
6 changes: 5 additions & 1 deletion packages/@react-stately/collections/src/CollectionBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ interface CollectionBuilderState {

export class CollectionBuilder<T extends object> {
private context?: unknown;
private cache: WeakMap<T, Node<T>> = new WeakMap();
private cache: WeakMap<T, Node<T>>;

constructor() {
this.cache = new WeakMap();
}

build(props: CollectionBase<T>, context?: unknown) {
this.context = context;
Expand Down
15 changes: 9 additions & 6 deletions packages/@react-stately/color/src/Color.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,10 @@ abstract class Color implements IColor {
abstract getColorChannels(): [ColorChannel, ColorChannel, ColorChannel]
}
class RGBColor extends Color {
private colorChannels: [ColorChannel, ColorChannel, ColorChannel];
constructor(private red: number, private green: number, private blue: number, private alpha: number) {
super();
this.colorChannels = ['red', 'green', 'blue'];
}

static parse(value: string) {
Expand Down Expand Up @@ -267,9 +269,8 @@ class RGBColor extends Color {
return 'rgb';
}

private static colorChannels: [ColorChannel, ColorChannel, ColorChannel] = ['red', 'green', 'blue'];
getColorChannels(): [ColorChannel, ColorChannel, ColorChannel] {
return RGBColor.colorChannels;
return this.colorChannels;
}
}

Expand All @@ -280,8 +281,10 @@ class RGBColor extends Color {
const HSB_REGEX = /hsb\(([-+]?\d+(?:.\d+)?\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d+(?:.\d+)?%)\)|hsba\(([-+]?\d+(?:.\d+)?\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d(.\d+)?)\)/;

class HSBColor extends Color {
private colorChannels: [ColorChannel, ColorChannel, ColorChannel];
constructor(private hue: number, private saturation: number, private brightness: number, private alpha: number) {
super();
this.colorChannels = ['hue', 'saturation', 'brightness'];
}

static parse(value: string): HSBColor | void {
Expand Down Expand Up @@ -405,9 +408,8 @@ class HSBColor extends Color {
return 'hsb';
}

private static colorChannels: [ColorChannel, ColorChannel, ColorChannel] = ['hue', 'saturation', 'brightness'];
getColorChannels(): [ColorChannel, ColorChannel, ColorChannel] {
return HSBColor.colorChannels;
return this.colorChannels;
}
}

Expand All @@ -422,8 +424,10 @@ function mod(n, m) {
}

class HSLColor extends Color {
private colorChannels: [ColorChannel, ColorChannel, ColorChannel];
constructor(private hue: number, private saturation: number, private lightness: number, private alpha: number) {
super();
this.colorChannels = ['hue', 'saturation', 'lightness'];
}

static parse(value: string): HSLColor | void {
Expand Down Expand Up @@ -545,8 +549,7 @@ class HSLColor extends Color {
return 'hsl';
}

private static colorChannels: [ColorChannel, ColorChannel, ColorChannel] = ['hue', 'saturation', 'lightness'];
getColorChannels(): [ColorChannel, ColorChannel, ColorChannel] {
return HSLColor.colorChannels;
return this.colorChannels;
}
}
2 changes: 1 addition & 1 deletion packages/@react-stately/grid/src/GridCollection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ interface GridCollectionOptions<T> {
}

export class GridCollection<T> implements IGridCollection<T> {
keyMap: Map<Key, GridNode<T>> = new Map();
keyMap: Map<Key, GridNode<T>>;
columnCount: number;
rows: GridNode<T>[];

Expand Down
6 changes: 4 additions & 2 deletions packages/@react-stately/layout/src/ListLayout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ export class ListLayout<T> extends Layout<Node<T>> implements KeyboardDelegate,
protected layoutNodes: Map<Key, LayoutNode>;
protected contentSize: Size;
collection: Collection<Node<T>>;
disabledKeys: Set<Key> = new Set();
allowDisabledKeyFocus: boolean = false;
disabledKeys: Set<Key>;
allowDisabledKeyFocus: boolean;
isLoading: boolean;
protected lastWidth: number;
protected lastCollection: Collection<Node<T>>;
Expand All @@ -80,6 +80,8 @@ export class ListLayout<T> extends Layout<Node<T>> implements KeyboardDelegate,
*/
constructor(options: ListLayoutOptions<T> = {}) {
super();
this.disabledKeys = new Set();
this.allowDisabledKeyFocus = false;
this.rowHeight = options.rowHeight;
this.estimatedRowHeight = options.estimatedRowHeight;
this.headingHeight = options.headingHeight;
Expand Down
15 changes: 10 additions & 5 deletions packages/@react-stately/layout/src/TableLayout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ type TableLayoutOptions<T> = ListLayoutOptions<T> & {
export class TableLayout<T> extends ListLayout<T> {
collection: TableCollection<T>;
lastCollection: TableCollection<T>;
columnWidths: Map<Key, number> = new Map();
columnWidths: Map<Key, number>;
stickyColumnIndices: number[];
wasLoading = false;
isLoading = false;
lastPersistedKeys: Set<Key> = null;
persistedIndices: Map<Key, number[]> = new Map();
wasLoading: boolean;
isLoading: boolean;
lastPersistedKeys: Set<Key>;
persistedIndices: Map<Key, number[]>;
private disableSticky: boolean;
columnLayout: TableColumnLayout<T>;
controlledColumns: Map<Key, GridNode<unknown>>;
Expand All @@ -41,6 +41,11 @@ export class TableLayout<T> extends ListLayout<T> {

constructor(options: TableLayoutOptions<T>) {
super(options);
this.wasLoading = false;
this.isLoading = false;
this.columnWidths = new Map();
this.persistedIndices = new Map();
this.lastPersistedKeys = null;
this.collection = options.initialCollection;
this.stickyColumnIndices = [];
this.disableSticky = this.checkChrome105();
Expand Down
3 changes: 2 additions & 1 deletion packages/@react-stately/list/src/ListCollection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ import {Collection, Node} from '@react-types/shared';
import {Key} from 'react';

export class ListCollection<T> implements Collection<Node<T>> {
private keyMap: Map<Key, Node<T>> = new Map();
private keyMap: Map<Key, Node<T>>;
private iterable: Iterable<Node<T>>;
private firstKey: Key;
private lastKey: Key;

constructor(nodes: Iterable<Node<T>>) {
this.keyMap = new Map();
this.iterable = nodes;

let visit = (node: Node<T>) => {
Expand Down
3 changes: 2 additions & 1 deletion packages/@react-stately/table/src/TableCollection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ export class TableCollection<T> extends GridCollection<T> {
columns: GridNode<T>[];
rowHeaderColumnKeys: Set<Key>;
body: GridNode<T>;
_size: number = 0;
_size: number;

constructor(nodes: Iterable<GridNode<T>>, prev?: TableCollection<T>, opts?: GridCollectionOptions) {
let rowHeaderColumnKeys: Set<Key> = new Set();
Expand Down Expand Up @@ -231,6 +231,7 @@ export class TableCollection<T> extends GridCollection<T> {
return node;
}
});
this._size = 0;
this.columns = columns;
this.rowHeaderColumnKeys = rowHeaderColumnKeys;
this.body = body;
Expand Down
9 changes: 6 additions & 3 deletions packages/@react-stately/table/src/TableColumnLayout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,14 @@ export interface TableColumnLayoutOptions<T> {
export class TableColumnLayout<T> {
getDefaultWidth: (column: GridNode<T>) => ColumnSize | null | undefined;
getDefaultMinWidth: (column: GridNode<T>) => ColumnSize | null | undefined;
columnWidths: Map<Key, number> = new Map();
columnMinWidths: Map<Key, number> = new Map();
columnMaxWidths: Map<Key, number> = new Map();
columnWidths: Map<Key, number>;
columnMinWidths: Map<Key, number>;
columnMaxWidths: Map<Key, number>;

constructor(options: TableColumnLayoutOptions<T>) {
this.columnWidths = new Map();
this.columnMinWidths = new Map();
this.columnMaxWidths = new Map();
this.getDefaultWidth = options.getDefaultWidth;
this.getDefaultMinWidth = options.getDefaultMinWidth;
}
Expand Down
3 changes: 2 additions & 1 deletion packages/@react-stately/tree/src/TreeCollection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@ import {Collection, Node} from '@react-types/shared';
import {Key} from 'react';

export class TreeCollection<T> implements Collection<Node<T>> {
private keyMap: Map<Key, Node<T>> = new Map();
private keyMap: Map<Key, Node<T>>;
private iterable: Iterable<Node<T>>;
private firstKey: Key;
private lastKey: Key;

constructor(nodes: Iterable<Node<T>>, {expandedKeys}: {expandedKeys?: Set<Key>} = {}) {
this.iterable = nodes;
this.keyMap = new Map();
expandedKeys = expandedKeys || new Set();

let visit = (node: Node<T>) => {
Expand Down