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: 0 additions & 1 deletion .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ untyped-type-import
sketchy-null

[options]
exact_by_default=false
experimental.const_params=true
autoimports=true
react.runtime=automatic
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deprecate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
contents: write
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
token: ${{ secrets.RPLDY_PAT_TOKEN }}
- name: Prepare
Expand Down Expand Up @@ -106,7 +106,7 @@ jobs:
if: ${{ inputs.version != '' }}
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- name: Prepare
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ jobs:
IS_CODE_CHANGED: ${{ steps.check-changes.outputs.code_changed }}
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 2
- name: Check for code changes
Expand Down Expand Up @@ -132,7 +132,7 @@ jobs:
if: ${{ needs.workflow-gate.outputs.proceed == 'true' && (needs.code-changes.outputs.IS_CODE_CHANGED == 'true' || needs.workflow-gate.outputs.has_rune2e_label == 'true') }}
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Prepare
uses: ./.github/actions/prepare
with:
Expand All @@ -154,7 +154,7 @@ jobs:
if: ${{ needs.workflow-gate.outputs.proceed == 'true' && needs.workflow-gate.outputs.is_label_event != 'true' }}
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Prepare
uses: ./.github/actions/prepare
with:
Expand All @@ -175,7 +175,7 @@ jobs:
actions: read
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Prepare
uses: ./.github/actions/prepare
with:
Expand Down Expand Up @@ -207,7 +207,7 @@ jobs:
if: ${{ needs.workflow-gate.outputs.proceed == 'true' && needs.workflow-gate.outputs.is_label_event != 'true' }}
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Prepare
uses: ./.github/actions/prepare
with:
Expand All @@ -230,7 +230,7 @@ jobs:
if: ${{ needs.workflow-gate.outputs.proceed == 'true' && needs.workflow-gate.outputs.is_label_event != 'true' }}
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Prepare
uses: ./.github/actions/prepare
with:
Expand All @@ -253,7 +253,7 @@ jobs:
actions: read
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Prepare
uses: ./.github/actions/prepare
with:
Expand Down Expand Up @@ -303,7 +303,7 @@ jobs:
pull-requests: read
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && 1 || 0 }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
echo "🔴 Failing Job - Cant use version: (premajor, preminor, prepatch, prerelease) without selecting 'preid' value too! >> $GITHUB_STEP_SUMMARY
exit 1

- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/storybook-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
name: Publish Uploady Storybook
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Prepare
uses: ./.github/actions/prepare
Expand Down
52 changes: 37 additions & 15 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,33 @@
const env = process.env.BABEL_ENV,
isUploadyBundle = process.env.UPLOADY_BUNDLE;

//inlines process.env.X member expressions into literal values at build time.
//replaces babel-plugin-transform-inline-environment-variables, which is unmaintained
//and broken under @babel/traverse 8.x (relies on the removed path.toComputedKey API)
function inlineEnvVariables({ types: t }) {
return {
visitor: {
MemberExpression(path) {
if (path.get("object").matchesPattern("process.env")) {
const property = path.node.property;

const key = path.node.computed
? (t.isStringLiteral(property) ? property.value : null)
: property.name;

if (key != null) {
path.replaceWith(t.valueToNode(process.env[key]));
}
}
},
},
};
}

const productionConfig = {
plugins: [
//cant add to base because breaks unit-tests that modify process.env
"transform-inline-environment-variables",
inlineEnvVariables,

]
};
Expand All @@ -22,29 +45,28 @@ const config = {
},
],
"@babel/react",
"@babel/flow",
],
plugins: [
"@babel/plugin-proposal-function-bind",
"@babel/plugin-proposal-export-default-from",
["babel-plugin-transform-flow-enums", {
//avoid using flow-enums-runtime, just return a frozen "enum" object
getRuntime: (t) => t.arrowFunctionExpression(
[t.identifier("enumObj")],
t.callExpression(
t.memberExpression(t.identifier("Object"), t.identifier("freeze")),
[t.identifier("enumObj")]
)
)
}],
"babel-plugin-syntax-hermes-parser",
//adding these here to stop sb build from breaking on loose mode issue :(
"minify-dead-code-elimination",
["module-resolver", {
"root": ["./"],
// "alias": {}
}]
],
overrides: [
{
test: /\.jsx?$/,
presets: ["@babel/flow"],
plugins: [
"babel-plugin-syntax-hermes-parser",
],
},
{
test: /\.tsx?$/,
presets: ["@babel/preset-typescript"],
},
],
env: {
//cant use plugin when building storybook :(
production: isUploadyBundle ? productionConfig : undefined,
Expand Down
2 changes: 1 addition & 1 deletion flow-typed/npm/bom.js
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,7 @@ declare class SharedWorker extends EventTarget {
declare function importScripts(...urls: Array<string | TrustedScriptURL>): void;

declare class WorkerGlobalScope extends EventTarget {
self: this;
+self: this;
location: WorkerLocation;
navigator: WorkerNavigator;
close(): void;
Expand Down
2 changes: 1 addition & 1 deletion flow-typed/npm/dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -1064,7 +1064,7 @@ declare class HTMLCollection<+Elem: HTMLElement> {
length: number;
item(nameOrIndex?: any, optionalIndex?: any): Elem | null;
namedItem(name: string): Elem | null;
[index: number | string]: Elem;
+[index: number | string]: Elem;
}

// from https://www.w3.org/TR/custom-elements/#extensions-to-document-interface-to-register
Expand Down
2 changes: 1 addition & 1 deletion flow-typed/npm/jsx-custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ declare class SyntheticEvent<+T: EventTarget = EventTarget, +E: Event = Event> {
isDefaultPrevented(): boolean;
isPropagationStopped(): boolean;
isTrusted: boolean;
nativeEvent: E;
+nativeEvent: E;
persist(): void;
preventDefault(): void;
stopPropagation(): void;
Expand Down
6 changes: 3 additions & 3 deletions flow-typed/npm/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -1484,7 +1484,7 @@ type http$agentOptions = {
declare class http$Agent<+SocketT = net$Socket> {
constructor(options: http$agentOptions): void;
destroy(): void;
freeSockets: { [name: string]: $ReadOnlyArray<SocketT>, ... };
+freeSockets: { +[name: string]: $ReadOnlyArray<SocketT>, ... };
getName(options: {
host: string,
port: number,
Expand All @@ -1493,8 +1493,8 @@ declare class http$Agent<+SocketT = net$Socket> {
}): string;
maxFreeSockets: number;
maxSockets: number;
requests: { [name: string]: $ReadOnlyArray<http$ClientRequest<SocketT>>, ... };
sockets: { [name: string]: $ReadOnlyArray<SocketT>, ... };
+requests: { +[name: string]: $ReadOnlyArray<http$ClientRequest<SocketT>>, ... };
+sockets: { +[name: string]: $ReadOnlyArray<SocketT>, ... };
}

declare class http$IncomingMessage<SocketT = net$Socket> extends stream$Readable {
Expand Down
49 changes: 24 additions & 25 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,39 +59,38 @@
"@actions/core": "^3.0.0",
"@actions/github": "^9.0.0",
"@babel/cli": "^8.0.4",
"@babel/core": "^7.29.0",
"@babel/plugin-proposal-export-default-from": "^7.27.1",
"@babel/plugin-proposal-function-bind": "^7.27.1",
"@babel/plugin-transform-runtime": "^7.29.0",
"@babel/preset-env": "^7.29.2",
"@babel/preset-flow": "^7.27.1",
"@babel/preset-react": "^7.28.5",
"@babel/core": "^8.0.1",
"@babel/plugin-proposal-export-default-from": "^8.0.1",
"@babel/plugin-proposal-function-bind": "^8.0.1",
"@babel/plugin-transform-runtime": "^8.0.1",
"@babel/preset-env": "^8.0.2",
"@babel/preset-flow": "^8.0.1",
"@babel/preset-react": "^8.0.1",
"@babel/preset-typescript": "^8.0.1",
"@babel/runtime-corejs3": "^8.0.0",
"@commitlint/cli": "^20.5.0",
"@commitlint/cli": "^21.2.1",
"@commitlint/config-conventional": "^21.0.2",
"@commitlint/config-lerna-scopes": "^21.0.2",
"@eslint/compat": "^2.1.0",
"@eslint/js": "^10.0.1",
"@monorepo-utils/package-utils": "^2.11.0",
"@storybook/addon-docs": "10.4.2",
"@storybook/addon-links": "10.4.2",
"@storybook/addon-docs": "10.4.6",
"@storybook/addon-links": "10.4.6",
"@storybook/addon-webpack5-compiler-babel": "^4.0.1",
"@storybook/react-webpack5": "10.4.2",
"@testing-library/jest-dom": "^6.6.3",
"@storybook/react-webpack5": "^10.4.6",
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.3.2",
"@testing-library/user-event": "^14.6.1",
"@types/react": "^19.2.14",
"@typescript/native": "npm:typescript@^7.0.2",
"@vitest/coverage-istanbul": "^4.1.2",
"@vitest/coverage-v8": "^4.1.2",
"@vitest/ui": "^4.1.2",
"async": "^3.2.6",
"babel-loader": "^10.1.1",
"babel-plugin-istanbul": "^8.0.0",
"babel-plugin-minify-dead-code-elimination": "^0.5.2",
"babel-plugin-module-resolver": "^5.0.3",
"babel-plugin-syntax-hermes-parser": "0.36.1",
"babel-plugin-transform-flow-enums": "^0.0.2",
"babel-plugin-transform-inline-environment-variables": "^0.4.4",
"bytes": "^3.1.2",
"chai": "^6.2.2",
"chai-dom": "^1.12.1",
Expand All @@ -102,19 +101,19 @@
"cypress-intercept-formdata": "^1.0.0",
"cypress-mochawesome-reporter": "^4.0.2",
"cypress-multi-reporters": "^2.0.5",
"eslint": "^10.4.1",
"eslint": "^10.7.0",
"eslint-plugin-ft-flow": "^3.0.11",
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-jsx-a11y": "^6.10.2",
"eslint-plugin-no-async": "^1.3.1",
"eslint-plugin-react": "^7.37.5",
"eslint-plugin-react-hooks": "^7.1.1",
"eslint-plugin-storybook": "10.4.2",
"eslint-plugin-storybook": "10.4.6",
"eslint-plugin-vitest": "^0.5.4",
"execa": "^9.6.0",
"filesize": "^11.0.15",
"flow-bin": "0.291.0",
"fs-extra": "^11.3.5",
"flow-bin": "0.322.0",
"fs-extra": "^11.3.6",
"glob": "^13.0.6",
"globals": "^17.6.0",
"hermes-eslint": "^0.36.1",
Expand All @@ -137,17 +136,17 @@
"rimraf": "^6.1.3",
"semver-utils": "^1.1.4",
"shelljs": "^0.10.0",
"storybook": "^10.4.2",
"storybook": "^10.4.6",
"styled-components": "^6.4.2",
"tty-browserify": "^0.0.1",
"typescript": "^6.0.3",
"typescript": "npm:@typescript/typescript6@^6.0.2",
"typescript-eslint": "^8.61.0",
"vite": "^8.0.16",
"vitest": "^4.1.7",
"vite": "^8.1.4",
"vitest": "^4.1.10",
"wait-on": "^9.0.10",
"weak-napi": "^2.0.2",
"webpack": "^5.107.2",
"webpack-cli": "^7.0.3",
"webpack": "^5.108.4",
"webpack-cli": "^7.2.1",
"webpack-merge": "^6.0.1",
"webpack-virtual-modules": "^0.6.2",
"xml2js": "^0.6.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/abort/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@rpldy/simple-state": "workspace:*"
},
"devDependencies": {
"flow-bin": "^0.291.0"
"flow-bin": "^0.322.0"
},
"publishConfig": {
"access": "public"
Expand Down
6 changes: 3 additions & 3 deletions packages/core/abort/src/abort.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ type StateAbortMethods = {
pending: (item: BatchItem, aborts: AbortsMap, finalizeItem: FinalizeRequestMethod) => boolean,
};

const ITEM_STATE_ABORTS: StateAbortMethods = (({
const ITEM_STATE_ABORTS: StateAbortMethods = ({
[FILE_STATES.UPLOADING]: (item: BatchItem, aborts: AbortsMap, _) => {
logger.debugLog(`abort: aborting uploading item - `, item);
return aborts[item.id]();
},
[FILE_STATES.ADDED]: abortNonUploadingItem,
[FILE_STATES.PENDING]: abortNonUploadingItem,
}: any): StateAbortMethods);
} as any) as StateAbortMethods;

const callAbortOnItem = (
item: BatchItem,
Expand All @@ -37,7 +37,7 @@ const callAbortOnItem = (
const itemState = item?.state;

const method = !!itemState &&
(ITEM_STATE_ABORTS: any)[itemState.valueOf()];
(ITEM_STATE_ABORTS as any)[itemState.valueOf()];

return method ?
method(item, aborts, finalizeItem) : false;
Expand Down
2 changes: 1 addition & 1 deletion packages/core/abort/src/getAbortEnhancer.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const getAbortEnhancer = <T>(): UploaderEnhancer<T> => {
*/
return (uploader: UploaderType<T>): UploaderType<T> => {
//$FlowIssue[incompatible-call]: unsure how to tell Flow this is ok...
uploader.update(({ abortAll, abortBatch, abortItem }: any));
uploader.update({ abortAll, abortBatch, abortItem } as any);
return uploader;
};
};
Expand Down
2 changes: 1 addition & 1 deletion packages/core/abort/src/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export type ItemsQueue = { [string]: string[] };

export type AbortResult = { isFast: boolean };

type InExactRawCreateOptions = { ...RawCreateOptions };
type InExactRawCreateOptions = { ...RawCreateOptions, ... };

export type AbortBatchMethod = (Batch, InExactRawCreateOptions, AbortsMap, ItemsQueue, FinalizeRequestMethod, InExactRawCreateOptions) => AbortResult;

Expand Down
Loading
Loading