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

Give NPM publishing permissions to me and/or deprecate this library #38

Closed
dgreene1 opened this issue Aug 9, 2022 · 11 comments
Closed

Comments

@dgreene1
Copy link
Owner

dgreene1 commented Aug 9, 2022

Hi @lissitz, I'd like to formerly request (a) to be made admin of this repo and (b) to be given NPM publishing access. This is a continuing from the conversation in #23 (comment) where you said:

lissitz commented on Apr 1
Yes, I'm open to eventually adding you as a maintainer 🙂.

My team and I have made significant updates to this library and have motivation to continue maintaining it for the foreseeable future. But in order for us to do that, we need to be able to publish it whenever we have a business objective or a customer commitment. Having to rely on someone outside of our team causes us to miss those deadlines. For example, we have PRs that haven't been released in 20 days as of this writing.

So @lissitz, please choose whichever option is best for you. The options I see are as follows (in order of my preference):

  1. Full transfer:
  2. Additive:
    • You add me as an NPM owner. This has the negative consequence that one of us might release the library at the wrong time and cause race condition type of situations. But I'm sure we could make it work.
    • You add me as a Github admin for this repo so that I can update the protected branch status rules and move away from Travis (This saves you from having to grant me Travis access and it lets my team build the repo using Github Actions which we are highly skilled in).
  3. We deprecate this library and fork:
    • I would create a fork of this library publish it myself on NPM as the owner as the sequel to this library
    • We'd add a deprecation warning so that anyone who installed this library were informed to use the new fork that I own
    • We'd update the readme to explain the where to go for the official fork

I want to emphasize that the choice is yours. I want this to feel like we're here to support you and to celebrate your wonderful accomplishments of creating (what I believe is) the only accessible tree view for React. Well done! You've done great work so now you should be able to rest on those laurels and let us take it into maintenance mode.

@santialbo
Copy link

santialbo commented Aug 17, 2022

Please add a comment here if you end up deciding to fork it and publish on npm. I'm also looking forward to having types for this library.

In case anyone needs types, here's the patch-package file

react-accessible-treeview+2.1.4.patch
diff --git a/node_modules/react-accessible-treeview/dist/TreeView/index.d.ts b/node_modules/react-accessible-treeview/dist/TreeView/index.d.ts
new file mode 100644
index 0000000..4a0f648
--- /dev/null
+++ b/node_modules/react-accessible-treeview/dist/TreeView/index.d.ts
@@ -0,0 +1,232 @@
+import React from "react";
+import { EventCallback } from "./utils";
+export interface INode {
+    /** A non-negative integer that uniquely identifies the node */
+    id: number;
+    /** Used to match on key press */
+    name: string;
+    /** An array with the ids of the children nodes */
+    children: number[];
+    /** The parent of the node; null for the root node */
+    parent: number | null;
+}
+export declare type INodeRef = HTMLLIElement | HTMLDivElement;
+export declare type INodeRefs = null | React.RefObject<{
+    [key: number]: INodeRef;
+}>;
+export declare type TreeViewAction = {
+    type: "COLLAPSE";
+    id: number;
+    lastInteractedWith?: number | null;
+} | {
+    type: "COLLAPSE_MANY";
+    ids: number[];
+    lastInteractedWith?: number | null;
+} | {
+    type: "EXPAND";
+    id: number;
+    lastInteractedWith?: number | null;
+} | {
+    type: "EXPAND_MANY";
+    ids: number[];
+    lastInteractedWith?: number | null;
+} | {
+    type: "HALF_SELECT";
+    id: number;
+    lastInteractedWith?: number | null;
+} | {
+    type: "SELECT";
+    id: number;
+    multiSelect?: boolean;
+    keepFocus?: boolean;
+    NotUserAction?: boolean;
+    lastInteractedWith?: number | null;
+} | {
+    type: "DESELECT";
+    id: number;
+    multiSelect?: boolean;
+    keepFocus?: boolean;
+    NotUserAction?: boolean;
+    lastInteractedWith?: number | null;
+} | {
+    type: "TOGGLE";
+    id: number;
+    lastInteractedWith?: number | null;
+} | {
+    type: "TOGGLE_SELECT";
+    id: number;
+    multiSelect?: boolean;
+    NotUserAction?: boolean;
+    lastInteractedWith?: number | null;
+} | {
+    type: "SELECT_MANY";
+    ids: number[];
+    select?: boolean;
+    multiSelect?: boolean;
+    lastInteractedWith?: number | null;
+} | {
+    type: "EXCLUSIVE_SELECT_MANY";
+} | {
+    type: "EXCLUSIVE_CHANGE_SELECT_MANY";
+    ids: number[];
+    select?: boolean;
+    multiSelect?: boolean;
+    lastInteractedWith?: number | null;
+} | {
+    type: "FOCUS";
+    id: number;
+    lastInteractedWith?: number | null;
+} | {
+    type: "BLUR";
+} | {
+    type: "DISABLE";
+    id: number;
+} | {
+    type: "ENABLE";
+    id: number;
+};
+export interface ITreeViewState {
+    /** Set of the ids of the expanded nodes */
+    expandedIds: Set<number>;
+    /** Set of the ids of the selected nodes */
+    disabledIds: Set<number>;
+    /** Set of the ids of the selected nodes */
+    halfSelectedIds: Set<number>;
+    /** Set of the ids of the selected nodes */
+    selectedIds: Set<number>;
+    /** Id of the node with tabindex = 0 */
+    tabbableId: number;
+    /** Whether the tree has focus */
+    isFocused: boolean;
+    /** Last selection made directly by the user */
+    lastUserSelect: number;
+    /** Last node interacted with */
+    lastInteractedWith?: number | null;
+    lastAction?: TreeViewAction["type"];
+}
+declare const clickActions: {
+    readonly select: "SELECT";
+    readonly focus: "FOCUS";
+    readonly exclusiveSelect: "EXCLUSIVE_SELECT";
+};
+export declare const CLICK_ACTIONS: readonly ("SELECT" | "FOCUS" | "EXCLUSIVE_SELECT")[];
+declare type ValueOf<T> = T[keyof T];
+export declare type ClickActions = ValueOf<typeof clickActions>;
+declare type ActionableNode = {
+    "aria-selected": boolean | undefined;
+} | {
+    "aria-checked": boolean | undefined | "mixed";
+};
+export declare type LeafProps = ActionableNode & {
+    role: string;
+    tabIndex: number;
+    onClick: EventCallback;
+    ref: <T extends INodeRef>(x: T | null) => void;
+    className: string;
+    "aria-setsize": number;
+    "aria-posinset": number;
+    "aria-level": number;
+    "aria-selected": boolean;
+    disabled: boolean;
+    "aria-disabled": boolean;
+};
+export interface IBranchProps {
+    onClick: EventCallback;
+    className: string;
+}
+export interface INodeRendererProps {
+    /** The object that represents the rendered node */
+    element: INode;
+    /** A function which gives back the props to pass to the node */
+    getNodeProps: (args?: {
+        onClick?: EventCallback;
+    }) => IBranchProps | LeafProps;
+    /** Whether the rendered node is a branch node */
+    isBranch: boolean;
+    /** Whether the rendered node is selected */
+    isSelected: boolean;
+    /** If the node is a branch node, whether it is half-selected, else undefined */
+    isHalfSelected: boolean;
+    /** If the node is a branch node, whether it is expanded, else undefined */
+    isExpanded: boolean;
+    /** Whether the rendered node is disabled */
+    isDisabled: boolean;
+    /** A positive integer that corresponds to the aria-level attribute */
+    level: number;
+    /** A positive integer that corresponds to the aria-setsize attribute */
+    setsize: number;
+    /** A positive integer that corresponds to the aria-posinset attribute */
+    posinset: number;
+    /** Function to assign to the onClick event handler of the element(s) that will toggle the selected state */
+    handleSelect: EventCallback;
+    /** Function to assign to the onClick event handler of the element(s) that will toggle the expanded state */
+    handleExpand: EventCallback;
+    /** Function to dispatch actions */
+    dispatch: React.Dispatch<TreeViewAction>;
+    /** state of the treeview */
+    treeState: ITreeViewState;
+}
+export interface ITreeViewOnSelectProps {
+    element: INode;
+    isBranch: boolean;
+    isExpanded: boolean;
+    isSelected: boolean;
+    isHalfSelected: boolean;
+    isDisabled: boolean;
+    treeState: ITreeViewState;
+}
+export interface ITreeViewOnExpandProps {
+    element: INode;
+    isExpanded: boolean;
+    isSelected: boolean;
+    isHalfSelected: boolean;
+    isDisabled: boolean;
+    treeState: ITreeViewState;
+}
+declare const nodeActions: {
+    readonly check: "check";
+    readonly select: "select";
+};
+export declare const NODE_ACTIONS: readonly ("select" | "check")[];
+export declare type NodeAction = ValueOf<typeof nodeActions>;
+export interface ITreeViewProps {
+    /** Tree data*/
+    data: INode[];
+    /** Function called when a node changes its selected state */
+    onSelect?: (props: ITreeViewOnSelectProps) => void;
+    /** Function called when a node changes its expanded state */
+    onExpand?: (props: ITreeViewOnExpandProps) => void;
+    /** className to add to the outermost ul */
+    className?: string;
+    /** Render prop for the node */
+    nodeRenderer: (props: INodeRendererProps) => React.ReactNode;
+    /** Indicates what action will be performed on a node which informs the correct aria-* properties to use on the node (aria-checked if using checkboxes, aria-selected if not). */
+    nodeAction?: NodeAction;
+    /** Array with the ids of the default expanded nodes */
+    defaultExpandedIds?: number[];
+    /** Array with the ids of the default selected nodes */
+    defaultSelectedIds?: number[];
+    /** Array with the ids of the default disabled nodes */
+    defaultDisabledIds?: number[];
+    /** If true, collapsing a node will also collapse its descendants */
+    propagateCollapse?: boolean;
+    /** If true, selecting a node will also select its descendants */
+    propagateSelect?: boolean;
+    /** If true, selecting a node will update the state of its parent (e.g. a parent node in a checkbox will be automatically selected if all of its children are selected) */
+    propagateSelectUpwards?: boolean;
+    /** Allows multiple nodes to be selected */
+    multiSelect?: boolean;
+    /** Selecting a node with a keyboard (using Space or Enter) will also toggle its expanded state */
+    expandOnKeyboardSelect?: boolean;
+    /** Wether the selected state is togglable */
+    togglableSelect?: boolean;
+    /** action to perform on click */
+    clickAction?: ClickActions;
+    /** Custom onBlur event that is triggered when focusing out of the component as a whole (moving focus between the nodes won't trigger it) */
+    onBlur?: (event: {
+        treeState: ITreeViewState;
+        dispatch: React.Dispatch<TreeViewAction>;
+    }) => void;
+}
+declare const TreeView: React.ForwardRefExoticComponent<ITreeViewProps & React.RefAttributes<HTMLUListElement>>;
+export default TreeView;
diff --git a/node_modules/react-accessible-treeview/dist/TreeView/utils.d.ts b/node_modules/react-accessible-treeview/dist/TreeView/utils.d.ts
new file mode 100644
index 0000000..611619e
--- /dev/null
+++ b/node_modules/react-accessible-treeview/dist/TreeView/utils.d.ts
@@ -0,0 +1,45 @@
+/// <reference types="react" />
+import { INode, INodeRef } from ".";
+export declare type EventCallback = <T, E>(event: React.MouseEvent<T, E> | React.KeyboardEvent<T>) => void;
+export declare const composeHandlers: (...handlers: EventCallback[]) => EventCallback;
+export declare const difference: (a: Set<number>, b: Set<number>) => Set<number>;
+export declare const symmetricDifference: (a: Set<number>, b: Set<number>) => Set<number>;
+export declare const usePrevious: (x: Set<number>) => Set<number> | undefined;
+export declare const isBranchNode: (data: INode[], i: number) => boolean;
+export declare const focusRef: (ref: INodeRef) => void;
+export declare const getParent: (data: INode[], id: number) => number | null;
+export declare const getDescendants: (data: INode[], id: number, disabledIds: Set<number>) => number[];
+export declare const getSibling: (data: INode[], id: number, diff: number) => number | null;
+export declare const getLastAccessible: (data: INode[], id: number, expandedIds: Set<number>) => number;
+export declare const getPreviousAccessible: (data: INode[], id: number, expandedIds: Set<number>) => number | null;
+export declare const getNextAccessible: (data: INode[], id: number, expandedIds: Set<number>) => number | null;
+export declare const propagateSelectChange: (data: INode[], ids: Set<number>, selectedIds: Set<number>, halfSelectedIds: Set<number>, disabledIds: Set<number>) => {
+    every: Set<number>;
+    some: Set<number>;
+    none: Set<number>;
+};
+export declare const getAccessibleRange: ({ data, expandedIds, from, to, }: {
+    data: INode[];
+    expandedIds: Set<number>;
+    from: number;
+    to: number;
+}) => number[];
+interface ITreeNode {
+    name: string;
+    children?: ITreeNode[];
+}
+export declare const flattenTree: (tree: ITreeNode) => INode[];
+export declare const getAriaSelected: ({ isSelected, isDisabled, multiSelect, }: {
+    isSelected: boolean;
+    isDisabled: boolean;
+    multiSelect: boolean;
+}) => boolean | undefined;
+export declare const getAriaChecked: ({ isSelected, isDisabled, isHalfSelected, multiSelect, }: {
+    isSelected: boolean;
+    isDisabled: boolean;
+    isHalfSelected: boolean;
+    multiSelect: boolean;
+}) => boolean | undefined | "mixed";
+export declare const propagatedIds: (data: INode[], ids: number[], disabledIds: Set<number>) => number[];
+export declare const onComponentBlur: (event: React.FocusEvent, treeNode: HTMLUListElement | null, callback: () => void) => void;
+export {};
diff --git a/node_modules/react-accessible-treeview/dist/index.d.ts b/node_modules/react-accessible-treeview/dist/index.d.ts
new file mode 100644
index 0000000..0647b57
--- /dev/null
+++ b/node_modules/react-accessible-treeview/dist/index.d.ts
@@ -0,0 +1,4 @@
+import TreeView, { ClickActions, CLICK_ACTIONS, IBranchProps, LeafProps, INode, INodeRendererProps, ITreeViewOnExpandProps, ITreeViewOnSelectProps, ITreeViewProps, ITreeViewState, TreeViewAction } from "./TreeView";
+import { EventCallback, flattenTree } from "./TreeView/utils";
+export { flattenTree, ITreeViewProps, INode, ITreeViewOnSelectProps, CLICK_ACTIONS, ITreeViewOnExpandProps, EventCallback, TreeViewAction, INodeRendererProps, ClickActions, IBranchProps, LeafProps, ITreeViewState, };
+export default TreeView;
diff --git a/node_modules/react-accessible-treeview/package.json b/node_modules/react-accessible-treeview/package.json
index a13b0a1..030de1d 100644
--- a/node_modules/react-accessible-treeview/package.json
+++ b/node_modules/react-accessible-treeview/package.json
@@ -3,6 +3,7 @@
 "description": "A react component that implements the treeview pattern as described by the WAI-ARIA Authoring Practices.",
 "version": "2.1.4",
 "author": "lissitz (https://github.com/lissitz)",
+  "types": "dist/index.d.ts",
 "main": "dist/react-accessible-treeview.cjs.js",
 "module": "dist/react-accessible-treeview.esm.js",
 "peerDependencies": {

@lissitz
Copy link
Collaborator

lissitz commented Aug 26, 2022

Hi @dgreene1 I'm down to do a full transfer, but you need to delete or rename your fork for github to be able to do it, and I also need your npm alias.

@dgreene1
Copy link
Owner Author

@lissitz thank you so much. I have deleted my fork.

@dgreene1
Copy link
Owner Author

@lissitz looks like the repo name changed but I will need publishing right too. So when you have the time, please run the command line snippet in https://docs.npmjs.com/transferring-a-package-from-a-user-account-to-another-user-account

Thanks again for your time and generosity.

@lissitz
Copy link
Collaborator

lissitz commented Aug 26, 2022

Is your npm username also dgreene1?

@dgreene1
Copy link
Owner Author

@dgreene1
Copy link
Owner Author

dgreene1 commented Sep 8, 2022

Hi @lissitz, we’re going to try to publish this soon but we (@mellis481 and I) don’t know how to update the Netlify site. Are those stored as secrets in Travis?

Either way, can you add me as a user to your Travis build server and to Netlify?

As an alternative, we could consider making a new website (like through Github pages) and then you (or us) could add a redirect from the old Netlify site to the proposed Github Pages site.

@lissitz
Copy link
Collaborator

lissitz commented Sep 8, 2022

Hi @dgreene1 , the Travis server was only used to check the build didn't fail. I think it is not active anymore.

For the Netlify site, I think the easiest way is to make a personal transfer https://answers.netlify.com/t/support-guide-how-to-transfer-a-netlify-site-to-a-new-owner/3866. For that I need an email that is associated with a netlify account.

In the meantime, the netlify site deploys automatically after every commit, but the npm run build command is failing, see https://app.netlify.com/sites/react-accessible-treeview/deploys/62fe9fe384737200085d79cb

@dgreene1
Copy link
Owner Author

dgreene1 commented Sep 8, 2022

@lissitz if you give me your email I can email you mine. I don’t want to list my email here. Or you can DM me at https://www.linkedin.com/in/thedangreene and then I can reply with my email.

@mellis481
Copy link
Collaborator

In the meantime, the netlify site deploys automatically after every commit...

@lissitz What actually triggers the Netlify deployment because we just did a release, but the Netlify documentation was not updated.

@dgreene1
Copy link
Owner Author

dgreene1 commented Dec 5, 2022

Once we get Netlify access we will redirect that to our new Github Pages site. But since we have access to (new) documentation and to deploy via NPM, we’ll close this ticket.

@dgreene1 dgreene1 closed this as completed Dec 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants