Repository Name
stringlengths 1
28
| Git URL
stringlengths 26
64
| SHA
stringlengths 40
40
| Author
stringlengths 2
37
| Commit Date
stringlengths 19
19
| Description
stringlengths 13
160
| Body
stringlengths 8
30.2k
| Full Commit Message
stringlengths 36
42.6k
| Git Diff
stringlengths 22
22.6M
⌀ |
|---|---|---|---|---|---|---|---|---|
sentry
|
https://github.com/getsentry/sentry
|
cd64fc237be9a02e0b516562c7db9b053671f775
|
Lyn Nagara
|
2018-09-06 05:20:54
|
test: Fix discover tests (#9636)
|
Need to add feature flag to tests since this is feature gated now
|
test: Fix discover tests (#9636)
Need to add feature flag to tests since this is feature gated now
|
diff --git a/tests/snuba/test_organization_discover.py b/tests/snuba/test_organization_discover.py
index 9691094beb2252..242ee0cd852993 100644
--- a/tests/snuba/test_organization_discover.py
+++ b/tests/snuba/test_organization_discover.py
@@ -63,14 +63,15 @@ def setUp(self):
self.snuba_insert(events)
def test(self):
- url = reverse('sentry-api-0-organization-discover', args=[self.org.slug])
- response = self.client.post(url, {
- 'projects': [self.project.id],
- 'fields': ['message', 'platform'],
- 'start': (datetime.now() - timedelta(seconds=10)).strftime('%Y-%m-%dT%H:%M:%S'),
- 'end': (datetime.now() + timedelta(seconds=10)).strftime('%Y-%m-%dT%H:%M:%S'),
- 'orderby': '-timestamp',
- })
+ with self.feature('organizations:discover'):
+ url = reverse('sentry-api-0-organization-discover', args=[self.org.slug])
+ response = self.client.post(url, {
+ 'projects': [self.project.id],
+ 'fields': ['message', 'platform'],
+ 'start': (datetime.now() - timedelta(seconds=10)).strftime('%Y-%m-%dT%H:%M:%S'),
+ 'end': (datetime.now() + timedelta(seconds=10)).strftime('%Y-%m-%dT%H:%M:%S'),
+ 'orderby': '-timestamp',
+ })
assert response.status_code == 200, response.content
assert len(response.data['data']) == 1
@@ -78,14 +79,15 @@ def test(self):
assert response.data['data'][0]['platform'] == 'python'
def test_array_join(self):
- url = reverse('sentry-api-0-organization-discover', args=[self.org.slug])
- response = self.client.post(url, {
- 'projects': [self.project.id],
- 'fields': ['message', 'exception_stacks.type'],
- 'start': (datetime.now() - timedelta(seconds=10)).strftime('%Y-%m-%dT%H:%M:%S'),
- 'end': (datetime.now() + timedelta(seconds=10)).strftime('%Y-%m-%dT%H:%M:%S'),
- 'orderby': '-timestamp',
- })
+ with self.feature('organizations:discover'):
+ url = reverse('sentry-api-0-organization-discover', args=[self.org.slug])
+ response = self.client.post(url, {
+ 'projects': [self.project.id],
+ 'fields': ['message', 'exception_stacks.type'],
+ 'start': (datetime.now() - timedelta(seconds=10)).strftime('%Y-%m-%dT%H:%M:%S'),
+ 'end': (datetime.now() + timedelta(seconds=10)).strftime('%Y-%m-%dT%H:%M:%S'),
+ 'orderby': '-timestamp',
+ })
assert response.status_code == 200, response.content
assert len(response.data['data']) == 1
assert response.data['data'][0]['exception_stacks.type'] == 'ValidationError'
|
uno
|
https://github.com/unoplatform/uno
|
4dd2268b7fd19f00da12f1bc495c410f131cd083
|
Jérôme Laban
|
2024-10-27 05:04:36
|
docs: Adjust steps
|
(cherry picked from commit e377a053f903f80917a6609679d0cf9d80c06a73)
|
docs: Adjust steps
(cherry picked from commit e377a053f903f80917a6609679d0cf9d80c06a73)
|
diff --git a/doc/articles/uno-publishing-desktop.md b/doc/articles/uno-publishing-desktop.md
index 8c85faf2834c..5f9db8cfa09f 100644
--- a/doc/articles/uno-publishing-desktop.md
+++ b/doc/articles/uno-publishing-desktop.md
@@ -89,6 +89,13 @@ Create a file named `Properties\PublishProfiles\ClickOnceProfile.pubxml` in your
<PublishDir>bin\Release\net8.0-desktop\win-x64\app.publish\</PublishDir>
<PublishUrl>bin\publish\</PublishUrl>
</PropertyGroup>
+ <ItemGroup>
+ <!-- This section needs to be adjusted based on the target framework -->
+ <BootstrapperPackage Include="Microsoft.NetCore.DesktopRuntime.8.0.x64">
+ <Install>true</Install>
+ <ProductName>.NET Desktop Runtime 8.0.10 (x64)</ProductName>
+ </BootstrapperPackage>
+ </ItemGroup>
</Project>
```
@@ -107,6 +114,7 @@ To use the Visual Studio publishing wizard:
- Click the **+ New profile** button
- Select **ClicOnce**, then **Next**
- Configure your app publishing in all the following wizard pages
+- In the **Configuration** section, make sure to select **Portable** for the **Target runtime**
- Click Finish.
The `Properties\PublishProfiles\ClickOnceProfile.pubxml` file will be created.
@@ -123,6 +131,10 @@ The resulting package will be located in the `bin\publish` folder. You an change
Depending on your deployment settings, you can run the `Setup.exe` file to install the application on a machine.
+> [!IMPORTANT]
+> At this time, publishing with the Visual Studio Publishing Wizard is not supported for
+> multi-targeted projects. Using the command line above is required.
+
### macOS App Bundles
We now support generating `.app` bundles on macOS machines. From the CLI run:
|
aws-cdk
|
https://github.com/aws/aws-cdk
|
552cef48a7d98cd320150897ebcf1f2867360d56
|
Eric Tucker
|
2023-03-30 05:13:54
|
fix(lambda-nodejs): pnpm installs frozen lockfile in a CI environment (#24781)
|
[pnpm automatically enables `--frozen-lockfile` in CI environments](https://pnpm.io/cli/install#--frozen-lockfile) which breaks `NodejsFunction` local bundling.
This change appends the `--no-prefer-frozen-lockfile` flag as described in https://github.com/pnpm/pnpm/issues/1994#issuecomment-609403673
----
*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
fix(lambda-nodejs): pnpm installs frozen lockfile in a CI environment (#24781)
[pnpm automatically enables `--frozen-lockfile` in CI environments](https://pnpm.io/cli/install#--frozen-lockfile) which breaks `NodejsFunction` local bundling.
This change appends the `--no-prefer-frozen-lockfile` flag as described in https://github.com/pnpm/pnpm/issues/1994#issuecomment-609403673
----
*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
diff --git a/packages/@aws-cdk/aws-lambda-nodejs/lib/package-manager.ts b/packages/@aws-cdk/aws-lambda-nodejs/lib/package-manager.ts
index 5d68f20347840..52991051f1126 100644
--- a/packages/@aws-cdk/aws-lambda-nodejs/lib/package-manager.ts
+++ b/packages/@aws-cdk/aws-lambda-nodejs/lib/package-manager.ts
@@ -39,9 +39,10 @@ export class PackageManager {
case LockFile.PNPM:
return new PackageManager({
lockFile: LockFile.PNPM,
- installCommand: logLevel && logLevel !== LogLevel.INFO ? ['pnpm', 'install', '--reporter', 'silent', '--config.node-linker=hoisted', '--config.package-import-method=clone-or-copy'] : ['pnpm', 'install', '--config.node-linker=hoisted', '--config.package-import-method=clone-or-copy'],
+ installCommand: logLevel && logLevel !== LogLevel.INFO ? ['pnpm', 'install', '--reporter', 'silent', '--config.node-linker=hoisted', '--config.package-import-method=clone-or-copy', '--no-prefer-frozen-lockfile'] : ['pnpm', 'install', '--config.node-linker=hoisted', '--config.package-import-method=clone-or-copy', '--no-prefer-frozen-lockfile'],
// --config.node-linker=hoisted to create flat node_modules without symlinks
// --config.package-import-method=clone-or-copy to avoid hardlinking packages from the store
+ // --no-prefer-frozen-lockfile (works the same as yarn's --no-immutable) Disable --frozen-lockfile that is enabled by default in CI environments (https://github.com/pnpm/pnpm/issues/1994).
runCommand: ['pnpm', 'exec'],
argsSeparator: '--',
});
diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/bundling.test.ts b/packages/@aws-cdk/aws-lambda-nodejs/test/bundling.test.ts
index 59f396df21b9d..7bd900829398b 100644
--- a/packages/@aws-cdk/aws-lambda-nodejs/test/bundling.test.ts
+++ b/packages/@aws-cdk/aws-lambda-nodejs/test/bundling.test.ts
@@ -433,7 +433,7 @@ test('Detects pnpm-lock.yaml', () => {
assetHashType: AssetHashType.OUTPUT,
bundling: expect.objectContaining({
command: expect.arrayContaining([
- expect.stringMatching(/echo '' > "\/asset-output\/pnpm-workspace.yaml\".+pnpm-lock\.yaml.+pnpm install --config.node-linker=hoisted --config.package-import-method=clone-or-copy && rm "\/asset-output\/node_modules\/.modules.yaml"/),
+ expect.stringMatching(/echo '' > "\/asset-output\/pnpm-workspace.yaml\".+pnpm-lock\.yaml.+pnpm install --config.node-linker=hoisted --config.package-import-method=clone-or-copy --no-prefer-frozen-lockfile && rm "\/asset-output\/node_modules\/.modules.yaml"/),
]),
}),
});
diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/package-manager.test.ts b/packages/@aws-cdk/aws-lambda-nodejs/test/package-manager.test.ts
index 6be593f785eff..4c74e1270f252 100644
--- a/packages/@aws-cdk/aws-lambda-nodejs/test/package-manager.test.ts
+++ b/packages/@aws-cdk/aws-lambda-nodejs/test/package-manager.test.ts
@@ -37,7 +37,7 @@ test('from a pnpm-lock.yaml', () => {
const packageManager = PackageManager.fromLockFile('/path/to/pnpm-lock.yaml');
expect(packageManager.lockFile).toEqual(LockFile.PNPM);
expect(packageManager.argsSeparator).toEqual('--');
- expect(packageManager.installCommand).toEqual(['pnpm', 'install', '--config.node-linker=hoisted', '--config.package-import-method=clone-or-copy']);
+ expect(packageManager.installCommand).toEqual(['pnpm', 'install', '--config.node-linker=hoisted', '--config.package-import-method=clone-or-copy', '--no-prefer-frozen-lockfile']);
expect(packageManager.runCommand).toEqual(['pnpm', 'exec']);
expect(packageManager.runBinCommand('my-bin')).toBe('pnpm exec -- my-bin');
@@ -45,7 +45,7 @@ test('from a pnpm-lock.yaml', () => {
test('from a pnpm-lock.yaml with LogLevel.ERROR', () => {
const packageManager = PackageManager.fromLockFile('/path/to/pnpm-lock.yaml', LogLevel.ERROR);
- expect(packageManager.installCommand).toEqual(['pnpm', 'install', '--reporter', 'silent', '--config.node-linker=hoisted', '--config.package-import-method=clone-or-copy']);
+ expect(packageManager.installCommand).toEqual(['pnpm', 'install', '--reporter', 'silent', '--config.node-linker=hoisted', '--config.package-import-method=clone-or-copy', '--no-prefer-frozen-lockfile']);
});
test('defaults to NPM', () => {
|
bytebase
|
https://github.com/bytebase/bytebase
|
95ca79f556dfef43dc7c84edae122e280e417598
|
Liu Ji
|
2023-03-24 15:19:14
|
feat(frontend): custom approval settings (#5199)
|
* feat: approval flow settings
* chore: feature guard
* chore: support skip manual approval
|
feat(frontend): custom approval settings (#5199)
* feat: approval flow settings
* chore: feature guard
* chore: support skip manual approval
|
diff --git a/frontend/src/components/CustomApproval/Settings/components/CustomApproval/CustomApproval.vue b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/CustomApproval.vue
new file mode 100644
index 00000000000000..21afeccc128cd0
--- /dev/null
+++ b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/CustomApproval.vue
@@ -0,0 +1,34 @@
+<template>
+ <div class="w-full">
+ <NTabs v-model:value="tab">
+ <template #suffix>
+ <Toolbar />
+ </template>
+ <NTabPane
+ name="rules"
+ :tab="$t('custom-approval.rule.rules')"
+ display-directive="show:lazy"
+ >
+ <RulesPanel />
+ </NTabPane>
+ <NTabPane
+ name="flows"
+ :tab="$t('custom-approval.approval-flow.approval-flows')"
+ display-directive="show:lazy"
+ >
+ <FlowsPanel />
+ </NTabPane>
+ </NTabs>
+ </div>
+</template>
+
+<script lang="ts" setup>
+import { useCustomApprovalContext } from "./context";
+import RulesPanel from "./RulesPanel";
+import FlowsPanel from "./FlowsPanel";
+import Toolbar from "./Toolbar.vue";
+import { provideRiskFilter } from "../common/RiskFilter";
+
+const { tab } = useCustomApprovalContext();
+provideRiskFilter();
+</script>
diff --git a/frontend/src/components/CustomApproval/Settings/components/CustomApproval/FlowsPanel/FlowTable.vue b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/FlowsPanel/FlowTable.vue
new file mode 100644
index 00000000000000..d907ed4b2f2577
--- /dev/null
+++ b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/FlowsPanel/FlowTable.vue
@@ -0,0 +1,155 @@
+<template>
+ <BBGrid
+ :column-list="COLUMN_LIST"
+ :data-source="filteredApprovalRuleList"
+ :row-clickable="false"
+ :show-placeholder="true"
+ row-key="uid"
+ v-bind="$attrs"
+ >
+ <template #item="{ item: rule }: { item: LocalApprovalRule }">
+ <div class="bb-grid-cell">
+ {{ rule.template?.title }}
+ </div>
+ <div class="bb-grid-cell justify-center">
+ <template v-if="creatorOfRule(rule).id === SYSTEM_BOT_ID">
+ {{ $t("custom-approval.approval-flow.type.system") }}
+ </template>
+ <template v-else>
+ {{ $t("custom-approval.approval-flow.type.custom") }}
+ </template>
+ </div>
+ <div class="bb-grid-cell">
+ {{ creatorOfRule(rule).name }}
+ </div>
+ <div class="bb-grid-cell justify-center">
+ <NButton
+ quaternary
+ size="small"
+ type="info"
+ class="!rounded !w-[var(--n-height)] !p-0"
+ @click="state.viewFlow = rule.template.flow"
+ >
+ {{ rule.template.flow?.steps.length }}
+ </NButton>
+ </div>
+ <div class="bb-grid-cell">
+ {{ rule.template?.description }}
+ </div>
+ <div class="bb-grid-cell gap-x-2">
+ <template v-if="creatorOfRule(rule).id !== SYSTEM_BOT_ID">
+ <NButton size="small" @click="editApprovalTemplate(rule)">
+ {{ allowAdmin ? $t("common.edit") : $t("common.view") }}
+ </NButton>
+ <SpinnerButton
+ size="small"
+ :tooltip="$t('custom-approval.approval-flow.delete')"
+ :disabled="!allowAdmin"
+ :on-confirm="() => deleteRule(rule)"
+ >
+ {{ $t("common.delete") }}
+ </SpinnerButton>
+ </template>
+ </div>
+ </template>
+ </BBGrid>
+
+ <BBModal
+ v-if="state.viewFlow"
+ :title="$t('custom-approval.approval-flow.approval-nodes')"
+ @close="state.viewFlow = undefined"
+ >
+ <div class="w-[20rem]">
+ <StepsTable :flow="state.viewFlow" :editable="false" />
+ </div>
+ </BBModal>
+</template>
+
+<script lang="ts" setup>
+import { computed, reactive } from "vue";
+import { useI18n } from "vue-i18n";
+import { NButton } from "naive-ui";
+
+import { BBGrid, type BBGridColumn } from "@/bbkit";
+import { SpinnerButton } from "../../common";
+import {
+ pushNotification,
+ useWorkspaceApprovalSettingStore,
+ usePrincipalStore,
+} from "@/store";
+import { LocalApprovalRule, SYSTEM_BOT_ID, UNKNOWN_ID, unknown } from "@/types";
+import { ApprovalFlow } from "@/types/proto/store/approval";
+import { StepsTable } from "../common";
+import { useCustomApprovalContext } from "../context";
+
+type LocalState = {
+ viewFlow: ApprovalFlow | undefined;
+};
+
+const state = reactive<LocalState>({
+ viewFlow: undefined,
+});
+const { t } = useI18n();
+const store = useWorkspaceApprovalSettingStore();
+const context = useCustomApprovalContext();
+const { allowAdmin, dialog } = context;
+
+const COLUMN_LIST = computed(() => {
+ const columns: BBGridColumn[] = [
+ { title: t("common.name"), width: "1fr" },
+ {
+ title: t("common.type"),
+ width: "8rem",
+ class: "justify-center",
+ },
+ { title: t("common.creator"), width: "minmax(auto, 10rem)" },
+ {
+ title: t("custom-approval.approval-flow.approval-nodes"),
+ width: "6rem",
+ class: "justify-center text-center whitespace-pre-wrap capitalize",
+ },
+ { title: t("common.description"), width: "2fr" },
+ {
+ title: t("common.operations"),
+ width: "10rem",
+ },
+ ];
+
+ return columns;
+});
+
+const creatorOfRule = (rule: LocalApprovalRule) => {
+ const creatorId = rule.template.creatorId ?? UNKNOWN_ID;
+ if (creatorId === UNKNOWN_ID) return unknown("PRINCIPAL");
+ if (creatorId === SYSTEM_BOT_ID) {
+ return usePrincipalStore().principalById(creatorId);
+ }
+
+ return usePrincipalStore().principalById(creatorId);
+};
+
+const filteredApprovalRuleList = computed(() => {
+ // const { searchText } = approvalConfigContext.value;
+ const list = [...store.config.rules];
+ // if (searchText) {
+ // list = list.filter((ap) => ap.template?.title.includes(searchText));
+ // }
+ return list;
+});
+
+const editApprovalTemplate = (rule: LocalApprovalRule) => {
+ dialog.value = {
+ mode: "EDIT",
+ rule,
+ };
+};
+
+const deleteRule = async (rule: LocalApprovalRule) => {
+ await store.deleteRule(rule);
+ pushNotification({
+ module: "bytebase",
+ style: "SUCCESS",
+ title: t("common.deleted"),
+ });
+};
+</script>
diff --git a/frontend/src/components/CustomApproval/Settings/components/CustomApproval/FlowsPanel/FlowsPanel.vue b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/FlowsPanel/FlowsPanel.vue
new file mode 100644
index 00000000000000..52abcf26dd44e3
--- /dev/null
+++ b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/FlowsPanel/FlowsPanel.vue
@@ -0,0 +1,7 @@
+<template>
+ <FlowTable />
+</template>
+
+<script lang="ts" setup>
+import FlowTable from "./FlowTable.vue";
+</script>
diff --git a/frontend/src/components/CustomApproval/Settings/components/CustomApproval/FlowsPanel/Toolbar.vue b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/FlowsPanel/Toolbar.vue
new file mode 100644
index 00000000000000..ce5df8c868b06c
--- /dev/null
+++ b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/FlowsPanel/Toolbar.vue
@@ -0,0 +1,23 @@
+<template>
+ <div class="flex items-center gap-x-2">
+ <NButton type="primary" :disabled="!allowAdmin" @click="createRule">
+ {{ $t("common.create") }}
+ </NButton>
+ </div>
+</template>
+
+<script lang="ts" setup>
+import { NButton } from "naive-ui";
+
+import { useCustomApprovalContext } from "../context";
+import { emptyLocalApprovalRule } from "../logic";
+const context = useCustomApprovalContext();
+const { allowAdmin, dialog } = context;
+
+const createRule = () => {
+ dialog.value = {
+ mode: "CREATE",
+ rule: emptyLocalApprovalRule(),
+ };
+};
+</script>
diff --git a/frontend/src/components/CustomApproval/Settings/components/CustomApproval/FlowsPanel/index.ts b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/FlowsPanel/index.ts
new file mode 100644
index 00000000000000..d7fb17a4301623
--- /dev/null
+++ b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/FlowsPanel/index.ts
@@ -0,0 +1,3 @@
+import FlowsPanel from "./FlowsPanel.vue";
+
+export default FlowsPanel;
diff --git a/frontend/src/components/CustomApproval/Settings/components/CustomApproval/RuleDialog/RuleDialog.vue b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/RuleDialog/RuleDialog.vue
new file mode 100644
index 00000000000000..370cb06003e6b3
--- /dev/null
+++ b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/RuleDialog/RuleDialog.vue
@@ -0,0 +1,124 @@
+<template>
+ <BBModal
+ v-if="dialog"
+ :title="title"
+ :esc-closable="false"
+ :before-close="beforeClose"
+ @close="dialog = undefined"
+ >
+ <RuleForm
+ :dirty="state.dirty"
+ @cancel="cancel"
+ @update="state.dirty = true"
+ @save="handleSave"
+ />
+
+ <div
+ v-if="state.loading"
+ class="absolute inset-0 flex flex-col items-center justify-center bg-white/50 rounded-lg"
+ >
+ <BBSpin />
+ </div>
+ </BBModal>
+</template>
+
+<script lang="ts" setup>
+import { computed, reactive, watch } from "vue";
+import { defer } from "@/utils";
+import { useDialog } from "naive-ui";
+import { useI18n } from "vue-i18n";
+
+import { BBModal } from "@/bbkit";
+import RuleForm from "./RuleForm.vue";
+import { useCustomApprovalContext } from "../context";
+import { pushNotification, useWorkspaceApprovalSettingStore } from "@/store";
+import { LocalApprovalRule } from "@/types";
+
+type LocalState = {
+ loading: boolean;
+ dirty: boolean;
+};
+
+const { t } = useI18n();
+const context = useCustomApprovalContext();
+const { allowAdmin, dialog } = context;
+
+const store = useWorkspaceApprovalSettingStore();
+const state = reactive<LocalState>({
+ loading: false,
+ dirty: false,
+});
+
+const title = computed(() => {
+ if (dialog.value) {
+ if (!allowAdmin.value) {
+ return t("custom-approval.approval-flow.view-approval-flow");
+ }
+ const { mode } = dialog.value;
+ if (mode === "CREATE") {
+ return t("custom-approval.approval-flow.create-approval-flow");
+ }
+ if (mode === "EDIT") {
+ return t("custom-approval.approval-flow.edit-approval-flow");
+ }
+ }
+ return "";
+});
+
+const nDialog = useDialog();
+
+const cancel = async () => {
+ const pass = await beforeClose();
+ if (pass) {
+ dialog.value = undefined;
+ }
+};
+
+const beforeClose = async () => {
+ if (!state.dirty) {
+ return true;
+ }
+ if (!allowAdmin.value) {
+ return true;
+ }
+ const d = defer<boolean>();
+ nDialog.info({
+ title: t("common.close"),
+ content: t("common.will-lose-unsaved-data"),
+ maskClosable: false,
+ closeOnEsc: false,
+ positiveText: t("common.confirm"),
+ negativeText: t("common.cancel"),
+ onPositiveClick: () => d.resolve(true),
+ onNegativeClick: () => d.resolve(false),
+ });
+ return d.promise;
+};
+
+const handleSave = async (
+ newRule: LocalApprovalRule,
+ oldRule: LocalApprovalRule | undefined
+) => {
+ state.loading = true;
+ try {
+ await store.upsertRule(newRule, oldRule);
+ state.dirty = false;
+ pushNotification({
+ module: "bytebase",
+ style: "SUCCESS",
+ title: t("common.updated"),
+ });
+ dialog.value = undefined;
+ } finally {
+ state.loading = false;
+ }
+};
+
+watch(
+ dialog,
+ () => {
+ state.dirty = false;
+ },
+ { immediate: true }
+);
+</script>
diff --git a/frontend/src/components/CustomApproval/Settings/components/CustomApproval/RuleDialog/RuleForm.vue b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/RuleDialog/RuleForm.vue
new file mode 100644
index 00000000000000..d713d56a81216b
--- /dev/null
+++ b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/RuleDialog/RuleForm.vue
@@ -0,0 +1,133 @@
+<template>
+ <div
+ class="w-[calc(100vw-8rem)] lg:max-w-[35vw] max-h-[calc(100vh-10rem)] flex flex-col gap-y-4 text-sm"
+ >
+ <div class="flex-1 flex flex-col overflow-hidden space-y-4">
+ <div class="space-y-1">
+ <label class="block font-medium text-control space-x-1">
+ <RequiredStar />
+ {{ $t("common.name") }}
+ </label>
+ <NInput
+ v-model:value="state.rule.template.title"
+ :show-count="true"
+ :maxlength="64"
+ :disabled="!allowAdmin"
+ @update:value="$emit('update')"
+ />
+ </div>
+ <div class="space-y-1">
+ <label class="block font-medium text-control space-x-1">
+ <RequiredStar />
+ {{ $t("common.description") }}
+ </label>
+ <NInput
+ v-model:value="state.rule.template.description"
+ type="textarea"
+ :autosize="{
+ minRows: 3,
+ maxRows: 5,
+ }"
+ :disabled="!allowAdmin"
+ @update:value="$emit('update')"
+ />
+ </div>
+ <div class="w-full flex-1 space-y-1 overflow-y-auto">
+ <label class="block font-medium text-control space-x-1">
+ <RequiredStar />
+ {{ $t("custom-approval.approval-flow.node.nodes") }}
+ </label>
+ <div class="text-control-light">
+ {{ $t("custom-approval.approval-flow.node.description") }}
+ </div>
+ <div class="py-1 w-[30rem] space-y-2">
+ <StepsTable
+ v-if="state.rule.template.flow"
+ :flow="state.rule.template.flow"
+ :editable="true"
+ @update="$emit('update')"
+ />
+ </div>
+ </div>
+ </div>
+
+ <footer
+ v-if="allowAdmin"
+ class="flex items-center justify-end gap-x-2 pt-4 border-t"
+ >
+ <NButton @click="$emit('cancel')">{{ $t("common.cancel") }}</NButton>
+ <NButton
+ type="primary"
+ :disabled="!allowCreateOrUpdate"
+ @click="handleUpsert"
+ >
+ {{ mode === "CREATE" ? $t("common.create") : $t("common.update") }}
+ </NButton>
+ </footer>
+ </div>
+</template>
+
+<script lang="ts" setup>
+import { computed, ref } from "vue";
+import { NInput } from "naive-ui";
+import { cloneDeep } from "lodash-es";
+
+import type { LocalApprovalRule } from "@/types";
+import { RequiredStar } from "../../common";
+import { StepsTable } from "../common";
+import { validateApprovalTemplate } from "../logic";
+import { useCustomApprovalContext } from "../context";
+
+type LocalState = {
+ rule: LocalApprovalRule;
+};
+
+const props = defineProps<{
+ dirty?: boolean;
+}>();
+
+const emit = defineEmits<{
+ (event: "cancel"): void;
+ (event: "update"): void;
+ (
+ event: "save",
+ newRule: LocalApprovalRule,
+ oldRule: LocalApprovalRule | undefined
+ ): void;
+}>();
+
+const context = useCustomApprovalContext();
+const { allowAdmin, dialog } = context;
+
+const mode = computed(() => dialog.value!.mode);
+const rule = computed(() => dialog.value!.rule);
+
+const resolveLocalState = (): LocalState => {
+ return {
+ rule: cloneDeep(rule.value),
+ };
+};
+
+const state = ref(resolveLocalState());
+
+const allowCreateOrUpdate = computed(() => {
+ if (!validateApprovalTemplate(state.value.rule.template)) {
+ return false;
+ }
+ if (mode.value === "EDIT") {
+ if (!props.dirty) return false;
+ }
+ return true;
+});
+
+const handleUpsert = () => {
+ if (!context.hasFeature.value) {
+ context.showFeatureModal.value = true;
+ return;
+ }
+
+ const oldRule = mode.value === "EDIT" ? rule.value : undefined;
+ const newRule = cloneDeep(state.value.rule);
+ emit("save", newRule, oldRule);
+};
+</script>
diff --git a/frontend/src/components/CustomApproval/Settings/components/CustomApproval/RuleDialog/index.ts b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/RuleDialog/index.ts
new file mode 100644
index 00000000000000..187831bdd8c901
--- /dev/null
+++ b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/RuleDialog/index.ts
@@ -0,0 +1,3 @@
+import RuleDialog from "./RuleDialog.vue";
+
+export default RuleDialog;
diff --git a/frontend/src/components/CustomApproval/Settings/components/CustomApproval/RulesPanel/RuleSelect.vue b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/RulesPanel/RuleSelect.vue
new file mode 100644
index 00000000000000..a8b711648c9ce7
--- /dev/null
+++ b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/RulesPanel/RuleSelect.vue
@@ -0,0 +1,95 @@
+<template>
+ <div
+ class="flex items-center"
+ :class="attrs.class as VueClass"
+ :style="attrs.style as VueStyle"
+ >
+ <label v-if="label" class="mr-2">{{ label }}</label>
+ <SpinnerSelect
+ style="width: 14rem"
+ :value="value"
+ :on-update="onUpdate"
+ :options="options"
+ :placeholder="$t('custom-approval.approval-flow.select')"
+ :consistent-menu-width="false"
+ :disabled="disabled || !allowAdmin"
+ v-bind="selectAttrs"
+ />
+ <NButton
+ v-if="link"
+ quaternary
+ type="info"
+ class="!rounded !w-[var(--n-height)] !p-0 !ml-1"
+ :disabled="!selectedRule"
+ @click="toApprovalFlow"
+ >
+ <heroicons:arrow-top-right-on-square class="w-5 h-5" />
+ </NButton>
+ </div>
+</template>
+
+<script lang="ts" setup>
+import { computed, useAttrs } from "vue";
+import { NButton, type SelectProps, SelectOption } from "naive-ui";
+import { omit } from "lodash-es";
+import { useI18n } from "vue-i18n";
+
+import { VueClass, VueStyle } from "@/utils";
+import { useCustomApprovalContext } from "../context";
+import { useWorkspaceApprovalSettingStore } from "@/store";
+import { SpinnerSelect } from "../../common";
+
+export interface ApprovalTemplateSelectorProps extends SelectProps {
+ label?: string;
+ link?: boolean;
+ disabled?: boolean;
+ value?: string;
+ onUpdate: (value: string | undefined) => Promise<any>;
+ selectClass?: VueClass;
+ selectStyle?: VueStyle;
+}
+const props = defineProps<ApprovalTemplateSelectorProps>();
+
+defineEmits<{
+ (event: "update:value", value: string | undefined): void;
+}>();
+
+const { t } = useI18n();
+const store = useWorkspaceApprovalSettingStore();
+const context = useCustomApprovalContext();
+const { allowAdmin } = context;
+
+const attrs = useAttrs();
+const selectAttrs = computed(() => ({
+ ...omit(attrs, "class", "style"),
+ class: props.selectClass,
+ style: props.selectStyle,
+}));
+
+const options = computed(() => {
+ const ruleOptions = store.config.rules.map<SelectOption>((rule) => ({
+ label: rule.template.title,
+ value: rule.uid,
+ }));
+ return [
+ { value: "", label: t("custom-approval.approval-flow.skip") },
+ ...ruleOptions,
+ ];
+});
+
+const selectedRule = computed(() => {
+ return store.config.rules.find((rule) => rule.uid === props.value);
+});
+
+const toApprovalFlow = () => {
+ const rule = selectedRule.value;
+ if (!rule) {
+ return;
+ }
+ context.dialog.value = {
+ mode: "EDIT",
+ rule,
+ };
+ context.tab.value = "flows";
+};
+</script>
diff --git a/frontend/src/components/CustomApproval/Settings/components/CustomApproval/RulesPanel/RulesPanel.vue b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/RulesPanel/RulesPanel.vue
new file mode 100644
index 00000000000000..4ed07323ecc191
--- /dev/null
+++ b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/RulesPanel/RulesPanel.vue
@@ -0,0 +1,32 @@
+<template>
+ <div class="w-full">
+ <RiskFilter :hide-search="true" />
+
+ <div class="space-y-4 my-4">
+ <RulesSection
+ v-for="source in selectedSourceList"
+ :key="source"
+ :source="source"
+ />
+ </div>
+ </div>
+</template>
+
+<script lang="ts" setup>
+import { computed } from "vue";
+
+import { SupportedSourceList } from "@/types";
+import { Risk_Source } from "@/types/proto/v1/risk_service";
+import { RiskFilter, useRiskFilter } from "../../common";
+import RulesSection from "./RulesSection.vue";
+
+const filter = useRiskFilter();
+
+const selectedSourceList = computed(() => {
+ if (filter.source.value === Risk_Source.SOURCE_UNSPECIFIED) {
+ // "ALL"
+ return SupportedSourceList;
+ }
+ return [filter.source.value];
+});
+</script>
diff --git a/frontend/src/components/CustomApproval/Settings/components/CustomApproval/RulesPanel/RulesSection.vue b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/RulesPanel/RulesSection.vue
new file mode 100644
index 00000000000000..4e32349c3e3930
--- /dev/null
+++ b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/RulesPanel/RulesSection.vue
@@ -0,0 +1,112 @@
+<template>
+ <div class="space-y-2">
+ <div class="flex items-center justify-start">
+ <div class="font-medium text-base">
+ {{ sourceText(source) }}
+ </div>
+ </div>
+ <div>
+ <BBGrid
+ :column-list="COLUMNS"
+ :data-source="rows"
+ :row-clickable="false"
+ row-key="level"
+ class="border"
+ >
+ <template #item="{ item: row }: { item: Row }">
+ <div class="bb-grid-cell">
+ {{ levelText(row.level) }}
+ </div>
+ <div class="bb-grid-cell">
+ <RuleSelect
+ :value="row.rule"
+ :link="true"
+ :on-update="(rule) => updateRow(row, rule)"
+ />
+ </div>
+ </template>
+ </BBGrid>
+ </div>
+ </div>
+</template>
+
+<script lang="ts" setup>
+import { computed } from "vue";
+import { useI18n } from "vue-i18n";
+
+import { BBGrid, type BBGridColumn } from "@/bbkit";
+import { ParsedApprovalRule, PresetRiskLevelList } from "@/types";
+import { Risk_Source } from "@/types/proto/v1/risk_service";
+import { levelText, sourceText, useRiskFilter } from "../../common";
+import { pushNotification, useWorkspaceApprovalSettingStore } from "@/store";
+import RuleSelect from "./RuleSelect.vue";
+import { useCustomApprovalContext } from "../context";
+
+type Row = {
+ level: number;
+ rule: string | undefined; // LocalApprovalRule.uid
+};
+
+const props = defineProps<{
+ source: Risk_Source;
+}>();
+
+const { t } = useI18n();
+const store = useWorkspaceApprovalSettingStore();
+const context = useCustomApprovalContext();
+
+const COLUMNS = computed(() => {
+ const columns: BBGridColumn[] = [
+ {
+ title: t("custom-approval.risk.self"),
+ width: "10rem",
+ },
+ {
+ title: t("custom-approval.approval-flow.self"),
+ width: "1fr",
+ },
+ ];
+ return columns;
+});
+
+const filter = useRiskFilter();
+
+const rulesMap = computed(() => {
+ const map = new Map<number, ParsedApprovalRule>();
+ store.config.parsed
+ .filter((item) => item.source === props.source)
+ .forEach((item) => {
+ map.set(item.level, item);
+ });
+ return map;
+});
+
+const rows = computed(() => {
+ const filteredLevelList = [...filter.levels.value.values()];
+ const displayLevelList =
+ filteredLevelList.length === 0
+ ? PresetRiskLevelList.map((item) => item.level)
+ : filteredLevelList;
+
+ return displayLevelList.map<Row>((level) => ({
+ level,
+ rule: rulesMap.value.get(level)?.rule ?? "",
+ }));
+});
+
+const updateRow = async (row: Row, rule: string | undefined) => {
+ if (!context.hasFeature.value) {
+ context.showFeatureModal.value = true;
+ return;
+ }
+
+ const { source } = props;
+ const { level } = row;
+ await store.updateRuleFlow(source, level, rule);
+ pushNotification({
+ module: "bytebase",
+ style: "SUCCESS",
+ title: t("common.updated"),
+ });
+};
+</script>
diff --git a/frontend/src/components/CustomApproval/Settings/components/CustomApproval/RulesPanel/index.ts b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/RulesPanel/index.ts
new file mode 100644
index 00000000000000..21f27565082393
--- /dev/null
+++ b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/RulesPanel/index.ts
@@ -0,0 +1,3 @@
+import RulesPanel from "./RulesPanel.vue";
+
+export default RulesPanel;
diff --git a/frontend/src/components/CustomApproval/Settings/components/CustomApproval/RulesPanel/logic.ts b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/RulesPanel/logic.ts
new file mode 100644
index 00000000000000..b0aafc8bcc1a5f
--- /dev/null
+++ b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/RulesPanel/logic.ts
@@ -0,0 +1,107 @@
+import { PresetRiskLevelList, SupportedSourceList } from "@/types";
+import type { Expr } from "@/types/proto/google/api/expr/v1alpha1/syntax";
+import type {
+ WorkspaceApprovalSetting,
+ WorkspaceApprovalSetting_Rule as ApprovalRule,
+} from "@/types/proto/store/setting";
+import type { ParsedApprovalRule, UnrecognizedApprovalRule } from "./types";
+import { Risk_Source } from "@/types/proto/v1/risk_service";
+
+/*
+ WorkspaceApprovalSetting is a list of ApprovalRule = {
+ expr,
+ approval_template
+ }
+ Currently, every ApprovalRule.expr is a list of "OR" expr.
+ And every "OR" expr has a fixed "source==xx && level=yy" form.
+
+ So we walk through the list of ApprovalRule and find all combinations of
+ ParsedApprovalRule = {
+ source,
+ level,
+ rule,
+ }
+*/
+
+const resolveIdentExpr = (expr: Expr): string => {
+ return expr.identExpr?.name ?? "";
+};
+
+const resolveNumberExpr = (expr: Expr): number | undefined => {
+ return expr.constExpr?.int64Value;
+};
+
+const resolveSourceExpr = (expr: Expr): Risk_Source => {
+ const { function: operator, args } = expr.callExpr ?? {};
+ if (operator !== "_==_") return Risk_Source.UNRECOGNIZED;
+ if (!args || args.length !== 2) return Risk_Source.UNRECOGNIZED;
+ const factor = resolveIdentExpr(args[0]);
+ if (factor !== "source") return Risk_Source.UNRECOGNIZED;
+ const source = resolveNumberExpr(args[1]);
+ if (typeof source === "undefined") return Risk_Source.UNRECOGNIZED;
+ if (!SupportedSourceList.includes(source)) return Risk_Source.UNRECOGNIZED;
+ return source;
+};
+
+const resolveLevelExpr = (expr: Expr): number => {
+ const { function: operator, args } = expr.callExpr ?? {};
+ if (operator !== "_==_") return Number.NaN;
+ if (!args || args.length !== 2) return Number.NaN;
+ const factor = resolveIdentExpr(args[0]);
+ if (factor !== "level") return Number.NaN;
+ const level = resolveNumberExpr(args[1]);
+ if (typeof level === "undefined") return Number.NaN;
+ if (!PresetRiskLevelList.find((item) => item.level === level))
+ return Number.NaN;
+ return level;
+};
+
+export const resolveApprovalConfigRules = (
+ config: WorkspaceApprovalSetting
+) => {
+ const parsed: ParsedApprovalRule[] = [];
+ const unrecognized: UnrecognizedApprovalRule[] = [];
+
+ const fail = (expr: Expr | undefined, rule: ApprovalRule) => {
+ unrecognized.push({ expr, rule });
+ };
+
+ const resolveLogicAndExpr = (expr: Expr, rule: ApprovalRule) => {
+ const { function: operator, args } = expr.callExpr ?? {};
+ if (operator !== "_&&_") return fail(expr, rule);
+ if (!args || args.length !== 2) return fail(expr, rule);
+ const source = resolveSourceExpr(args[0]);
+ if (source === Risk_Source.UNRECOGNIZED) return fail(expr, rule);
+ const level = resolveLevelExpr(args[1]);
+ if (Number.isNaN(level)) return fail(expr, rule);
+
+ // Found a correct (source, level) combination
+ parsed.push({
+ source,
+ level,
+ rule,
+ });
+ };
+
+ const resolveLogicOrExpr = (expr: Expr, rule: ApprovalRule) => {
+ const { function: operator, args } = expr.callExpr ?? {};
+ if (operator !== "_||_") return fail(expr, rule);
+ if (!args || args.length === 0) return fail(expr, rule);
+
+ for (let i = 0; i < args.length; i++) {
+ resolveLogicAndExpr(args[i], rule);
+ }
+ };
+
+ for (let i = 0; i < config.rules.length; i++) {
+ const rule = config.rules[i];
+ const expr = rule.expression?.expr;
+ if (!expr) {
+ fail(expr, rule);
+ continue;
+ }
+ resolveLogicOrExpr(expr, rule);
+ }
+
+ return { parsed, unrecognized };
+};
diff --git a/frontend/src/components/CustomApproval/Settings/components/CustomApproval/RulesPanel/types.ts b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/RulesPanel/types.ts
new file mode 100644
index 00000000000000..e8aba9132d5c25
--- /dev/null
+++ b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/RulesPanel/types.ts
@@ -0,0 +1,14 @@
+import { Expr } from "@/types/proto/google/api/expr/v1alpha1/syntax";
+import { WorkspaceApprovalSetting_Rule as ApprovalRule } from "@/types/proto/store/setting";
+import { Risk_Source } from "@/types/proto/v1/risk_service";
+
+export type ParsedApprovalRule = {
+ source: Risk_Source;
+ level: number;
+ rule: ApprovalRule;
+};
+
+export type UnrecognizedApprovalRule = {
+ expr?: Expr;
+ rule: ApprovalRule;
+};
diff --git a/frontend/src/components/CustomApproval/Settings/components/CustomApproval/Toolbar.vue b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/Toolbar.vue
new file mode 100644
index 00000000000000..4f1370daf0f0da
--- /dev/null
+++ b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/Toolbar.vue
@@ -0,0 +1,10 @@
+<template>
+ <FlowsToolbar v-if="tab === 'flows'" />
+</template>
+
+<script lang="ts" setup>
+import FlowsToolbar from "./FlowsPanel/Toolbar.vue";
+import { useCustomApprovalContext } from "./context";
+
+const { tab } = useCustomApprovalContext();
+</script>
diff --git a/frontend/src/components/CustomApproval/Settings/components/CustomApproval/common/RoleSelect.vue b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/common/RoleSelect.vue
new file mode 100644
index 00000000000000..ee837e333bddf9
--- /dev/null
+++ b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/common/RoleSelect.vue
@@ -0,0 +1,44 @@
+<template>
+ <NSelect
+ style="width: 12rem"
+ :options="options"
+ :value="value"
+ :placeholder="$t('custom-approval.approval-flow.select')"
+ :consistent-menu-width="false"
+ :disabled="!allowAdmin"
+ @update:value="$emit('update:value', $event)"
+ />
+</template>
+
+<script lang="ts" setup>
+import { computed } from "vue";
+import { type SelectOption, type SelectProps, NSelect } from "naive-ui";
+
+import { ApprovalNode_GroupValue } from "@/types/proto/store/approval";
+import { useCustomApprovalContext } from "../context";
+import { approvalNodeGroupValueText } from "@/utils";
+
+const context = useCustomApprovalContext();
+const { allowAdmin } = context;
+
+interface RoleSelectorProps extends SelectProps {
+ value?: ApprovalNode_GroupValue;
+}
+defineProps<RoleSelectorProps>();
+
+defineEmits<{
+ (event: "update:value", value: ApprovalNode_GroupValue): void;
+}>();
+
+const options = computed(() => {
+ return [
+ ApprovalNode_GroupValue.PROJECT_MEMBER,
+ ApprovalNode_GroupValue.PROJECT_OWNER,
+ ApprovalNode_GroupValue.WORKSPACE_DBA,
+ ApprovalNode_GroupValue.WORKSPACE_OWNER,
+ ].map<SelectOption>((role) => ({
+ label: approvalNodeGroupValueText(role),
+ value: role,
+ }));
+});
+</script>
diff --git a/frontend/src/components/CustomApproval/Settings/components/CustomApproval/common/StepsTable.vue b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/common/StepsTable.vue
new file mode 100644
index 00000000000000..35f03bf39b9fcb
--- /dev/null
+++ b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/common/StepsTable.vue
@@ -0,0 +1,143 @@
+<template>
+ <BBGrid
+ :column-list="COLUMNS"
+ :data-source="steps"
+ :row-clickable="false"
+ class="border"
+ >
+ <template #item="{ item: step, row }: { item: ApprovalStep, row: number }">
+ <div class="bb-grid-cell justify-center text-center !pl-2">
+ {{ row + 1 }}
+ </div>
+ <div class="bb-grid-cell">
+ <RoleSelect
+ v-if="editable"
+ v-model:value="step.nodes[0].groupValue"
+ style="width: 80%"
+ @update:value="
+ (role) => {
+ step.nodes[0].groupValue = role;
+ $emit('update');
+ }
+ "
+ />
+ <template v-else-if="step.nodes[0].groupValue">
+ {{ approvalNodeGroupValueText(step.nodes[0].groupValue) }}
+ </template>
+ </div>
+ <div v-if="editable" class="bb-grid-cell gap-x-1">
+ <NButton
+ :disabled="row === 0 || !allowAdmin"
+ size="tiny"
+ @click="reorder(step, row, -1)"
+ >
+ <heroicons:arrow-up />
+ </NButton>
+ <NButton
+ :disabled="row === steps.length - 1 || !allowAdmin"
+ size="tiny"
+ @click="reorder(step, row, 1)"
+ >
+ <heroicons:arrow-down />
+ </NButton>
+ <SpinnerButton
+ size="tiny"
+ :tooltip="$t('custom-approval.approval-flow.node.delete')"
+ :disabled="!allowAdmin"
+ :on-confirm="() => removeStep(step, row)"
+ >
+ <heroicons:trash />
+ </SpinnerButton>
+ </div>
+ </template>
+ <template v-if="editable && allowAdmin" #footer>
+ <NButton @click="addStep">
+ <template #icon><heroicons:plus /></template>
+ <span>
+ {{ $t("custom-approval.approval-flow.node.add") }}
+ </span>
+ </NButton>
+ </template>
+ </BBGrid>
+</template>
+
+<script lang="ts" setup>
+import { computed } from "vue";
+import { useI18n } from "vue-i18n";
+import { NButton } from "naive-ui";
+
+import { BBGrid, type BBGridColumn } from "@/bbkit";
+import RoleSelect from "./RoleSelect.vue";
+import {
+ ApprovalFlow,
+ ApprovalNode_GroupValue,
+ ApprovalNode_Type,
+ ApprovalStep,
+ ApprovalStep_Type,
+} from "@/types/proto/store/approval";
+import { useCustomApprovalContext } from "../context";
+import { SpinnerButton } from "../../common";
+import { approvalNodeGroupValueText } from "@/utils";
+
+const props = defineProps<{
+ flow: ApprovalFlow;
+ editable: boolean;
+}>();
+
+const emit = defineEmits<{
+ (event: "update"): void;
+}>();
+
+const { t } = useI18n();
+
+const context = useCustomApprovalContext();
+const { allowAdmin } = context;
+
+const COLUMNS = computed(() => {
+ const columns: BBGridColumn[] = [
+ {
+ title: t("custom-approval.approval-flow.node.order"),
+ width: "4rem",
+ class: "justify-center !pl-2",
+ },
+ { title: t("custom-approval.approval-flow.node.approver"), width: "1fr" },
+ ];
+ if (props.editable) {
+ columns.push({ title: t("common.operations"), width: "auto" });
+ }
+ return columns;
+});
+
+const steps = computed(() => {
+ return props.flow.steps;
+});
+
+const reorder = (step: ApprovalStep, index: number, offset: -1 | 1) => {
+ const target = index + offset;
+ if (target < 0 || target >= steps.value.length) return;
+ const tmp = steps.value[index];
+ steps.value[index] = steps.value[target];
+ steps.value[target] = tmp;
+
+ emit("update");
+};
+const addStep = () => {
+ steps.value.push(
+ ApprovalStep.fromJSON({
+ type: ApprovalStep_Type.ANY,
+ nodes: [
+ {
+ type: ApprovalNode_Type.ANY_IN_GROUP,
+ groupValue: ApprovalNode_GroupValue.WORKSPACE_OWNER,
+ },
+ ],
+ })
+ );
+ emit("update");
+};
+
+const removeStep = async (step: ApprovalStep, index: number) => {
+ await new Promise((resolve) => setTimeout(resolve, 500));
+ steps.value.splice(index, 1);
+};
+</script>
diff --git a/frontend/src/components/CustomApproval/Settings/components/CustomApproval/common/index.ts b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/common/index.ts
new file mode 100644
index 00000000000000..bbd344c975cab7
--- /dev/null
+++ b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/common/index.ts
@@ -0,0 +1,3 @@
+import StepsTable from "./StepsTable.vue";
+
+export { StepsTable };
diff --git a/frontend/src/components/CustomApproval/Settings/components/CustomApproval/context.ts b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/context.ts
new file mode 100644
index 00000000000000..9a34cd17d5dfb2
--- /dev/null
+++ b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/context.ts
@@ -0,0 +1,34 @@
+import { inject, provide, type InjectionKey, type Ref } from "vue";
+import type { LocalApprovalRule } from "@/types";
+
+export const TabValueList = ["rules", "flows"] as const;
+export type TabValue = typeof TabValueList[number];
+
+export type DialogContext = {
+ mode: "EDIT" | "CREATE";
+ rule: LocalApprovalRule;
+};
+
+export type CustomApprovalContext = {
+ hasFeature: Ref<boolean>;
+ showFeatureModal: Ref<boolean>;
+ allowAdmin: Ref<boolean>;
+ ready: Ref<boolean>;
+ tab: Ref<TabValue>;
+
+ dialog: Ref<DialogContext | undefined>;
+};
+
+export const KEY = Symbol(
+ "bb.settings.custom-approval"
+) as InjectionKey<CustomApprovalContext>;
+
+export const useCustomApprovalContext = () => {
+ return inject(KEY)!;
+};
+
+export const provideCustomApprovalContext = (
+ context: CustomApprovalContext
+) => {
+ provide(KEY, context);
+};
diff --git a/frontend/src/components/CustomApproval/Settings/components/CustomApproval/index.ts b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/index.ts
new file mode 100644
index 00000000000000..49f3b4750909da
--- /dev/null
+++ b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/index.ts
@@ -0,0 +1,6 @@
+import CustomApproval from "./CustomApproval.vue";
+import ApprovalRuleDialog from "./RuleDialog";
+
+export default CustomApproval;
+export * from "./context";
+export { CustomApproval, ApprovalRuleDialog };
diff --git a/frontend/src/components/CustomApproval/Settings/components/CustomApproval/logic/index.ts b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/logic/index.ts
new file mode 100644
index 00000000000000..a22e0ffd5ae2cf
--- /dev/null
+++ b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/logic/index.ts
@@ -0,0 +1,2 @@
+export * from "./validate";
+export * from "./utils";
diff --git a/frontend/src/components/CustomApproval/Settings/components/CustomApproval/logic/utils.ts b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/logic/utils.ts
new file mode 100644
index 00000000000000..b3f871027dd400
--- /dev/null
+++ b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/logic/utils.ts
@@ -0,0 +1,16 @@
+import { v4 as uuidv4 } from "uuid";
+import { useCurrentUser } from "@/store";
+import { LocalApprovalRule } from "@/types";
+import { ApprovalTemplate } from "@/types/proto/store/approval";
+
+export const emptyLocalApprovalRule = (): LocalApprovalRule => {
+ return {
+ uid: uuidv4(),
+ template: ApprovalTemplate.fromJSON({
+ creatorId: useCurrentUser().value.id,
+ flow: {
+ steps: [],
+ },
+ }),
+ };
+};
diff --git a/frontend/src/components/CustomApproval/Settings/components/CustomApproval/logic/validate.ts b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/logic/validate.ts
new file mode 100644
index 00000000000000..63652563a4e996
--- /dev/null
+++ b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/logic/validate.ts
@@ -0,0 +1,48 @@
+import {
+ ApprovalFlow,
+ ApprovalNode_GroupValue,
+ ApprovalNode_Type,
+ ApprovalStep_Type,
+ ApprovalTemplate,
+} from "@/types/proto/store/approval";
+
+const validateApprovalFlow = (flow: ApprovalFlow) => {
+ const SupportedStepTypes = new Set([
+ ApprovalStep_Type.ALL,
+ ApprovalStep_Type.ANY,
+ ]);
+ const SupportedGroupValues = new Set([
+ ApprovalNode_GroupValue.PROJECT_MEMBER,
+ ApprovalNode_GroupValue.PROJECT_OWNER,
+ ApprovalNode_GroupValue.WORKSPACE_DBA,
+ ApprovalNode_GroupValue.WORKSPACE_OWNER,
+ ]);
+
+ return flow.steps.every((step) => {
+ const { type, nodes } = step;
+ if (!SupportedStepTypes.has(type)) {
+ return false;
+ }
+ return nodes.every((node) => {
+ const { type, groupValue } = node;
+ if (type !== ApprovalNode_Type.ANY_IN_GROUP) {
+ return false;
+ }
+ if (!groupValue) {
+ return false;
+ }
+ if (!SupportedGroupValues.has(groupValue)) {
+ return false;
+ }
+ return true;
+ });
+ });
+};
+
+export const validateApprovalTemplate = (template: ApprovalTemplate) => {
+ const { title = "", description = "", flow } = template;
+ if (title.trim().length === 0) return false;
+ if (description.trim().length === 0) return false;
+ if (!flow) return false;
+ return validateApprovalFlow(flow);
+};
diff --git a/frontend/src/components/CustomApproval/Settings/components/RiskCenter/RiskCenter.vue b/frontend/src/components/CustomApproval/Settings/components/RiskCenter/RiskCenter.vue
index 1f04a97ffa9b50..4b177b43b33bff 100644
--- a/frontend/src/components/CustomApproval/Settings/components/RiskCenter/RiskCenter.vue
+++ b/frontend/src/components/CustomApproval/Settings/components/RiskCenter/RiskCenter.vue
@@ -1,12 +1,12 @@
<template>
<div class="w-full">
- <RiskNavigation class="my-4">
+ <RiskFilter class="my-4">
<template #suffix>
<NButton type="primary" :disabled="!allowAdmin" @click="addRisk">
{{ $t("custom-approval.security-rule.add-rule") }}
</NButton>
</template>
- </RiskNavigation>
+ </RiskFilter>
<div class="space-y-4">
<RiskSection
@@ -23,29 +23,29 @@
import { computed, watch } from "vue";
import { groupBy } from "lodash-es";
-import RiskNavigation from "./RiskNavigation";
import RiskSection from "./RiskSection.vue";
+import { RiskFilter, orderByLevelDesc, useRiskFilter } from "../common";
import { useRiskCenterContext } from "./context";
import { Risk, Risk_Source } from "@/types/proto/v1/risk_service";
import { PresetRiskLevelList, SupportedSourceList } from "@/types";
import { useRiskStore } from "@/store";
-import { orderByLevelDesc } from "./common";
const riskStore = useRiskStore();
const context = useRiskCenterContext();
-const { allowAdmin, navigation } = context;
+const filter = useRiskFilter();
+const { allowAdmin } = context;
const filteredRiskList = computed(() => {
let list = [...riskStore.riskList];
- const { source, levels } = navigation.value;
- const search = navigation.value.search.trim();
+ const { source, levels } = filter;
+ const search = filter.search.value.trim();
// Risk_Source.SOURCE_UNSPECIFIED to "ALL"
- if (source !== Risk_Source.SOURCE_UNSPECIFIED) {
- list = list.filter((risk) => risk.source === source);
+ if (source.value !== Risk_Source.SOURCE_UNSPECIFIED) {
+ list = list.filter((risk) => risk.source === source.value);
}
// empty to "ALL"
- if (levels.size > 0) {
- list = list.filter((risk) => levels.has(risk.level));
+ if (levels.value.size > 0) {
+ list = list.filter((risk) => levels.value.has(risk.level));
}
if (search) {
list = list.filter((risk) => risk.title.includes(search));
@@ -60,22 +60,20 @@ const riskListGroupBySource = computed(() => {
riskList.sort(orderByLevelDesc);
return { source, riskList };
});
- if (navigation.value.source === Risk_Source.SOURCE_UNSPECIFIED) {
+ if (filter.source.value === Risk_Source.SOURCE_UNSPECIFIED) {
// Show "ALL" sources
return groups;
}
return groups.filter((group) => {
- return (
- group.riskList.length > 0 || group.source === navigation.value.source
- );
+ return group.riskList.length > 0 || group.source === filter.source.value;
});
});
const addRisk = () => {
const risk = Risk.fromJSON({
level: PresetRiskLevelList[0].level,
- source: navigation.value.source || SupportedSourceList[0],
+ source: filter.source.value || SupportedSourceList[0],
active: true,
});
context.dialog.value = {
@@ -89,8 +87,8 @@ watch(
(dialog) => {
const source = dialog?.risk?.source;
if (!source) return;
- if (navigation.value.source !== Risk_Source.SOURCE_UNSPECIFIED) {
- navigation.value.source = source;
+ if (filter.source.value !== Risk_Source.SOURCE_UNSPECIFIED) {
+ filter.source.value = source;
}
},
{ immediate: true }
diff --git a/frontend/src/components/CustomApproval/Settings/components/RiskCenter/RiskDialog/RiskDialog.vue b/frontend/src/components/CustomApproval/Settings/components/RiskCenter/RiskDialog/RiskDialog.vue
index f71a4b1f602d69..b1cd86421ecf9b 100644
--- a/frontend/src/components/CustomApproval/Settings/components/RiskCenter/RiskDialog/RiskDialog.vue
+++ b/frontend/src/components/CustomApproval/Settings/components/RiskCenter/RiskDialog/RiskDialog.vue
@@ -29,7 +29,7 @@ import { useDialog } from "naive-ui";
import { defer } from "@/utils";
import { useRiskCenterContext } from "../context";
-import { sourceText } from "../common";
+import { sourceText } from "../../common";
import RiskForm from "./RiskForm.vue";
import { Risk } from "@/types/proto/v1/risk_service";
import { pushNotification, useRiskStore } from "@/store";
diff --git a/frontend/src/components/CustomApproval/Settings/components/RiskCenter/RiskDialog/RiskLevelSelect.vue b/frontend/src/components/CustomApproval/Settings/components/RiskCenter/RiskDialog/RiskLevelSelect.vue
index cbc8e56a7cd4d2..cc0b71a004805a 100644
--- a/frontend/src/components/CustomApproval/Settings/components/RiskCenter/RiskDialog/RiskLevelSelect.vue
+++ b/frontend/src/components/CustomApproval/Settings/components/RiskCenter/RiskDialog/RiskLevelSelect.vue
@@ -16,7 +16,7 @@ import { NSelect, SelectOption, type SelectProps } from "naive-ui";
import { PresetRiskLevelList } from "@/types";
import { useRiskCenterContext } from "../context";
-import { levelText } from "../common";
+import { levelText } from "../../common";
export interface RiskLevelSelectorProps extends SelectProps {
value: number;
diff --git a/frontend/src/components/CustomApproval/Settings/components/RiskCenter/RiskDialog/RiskSourceSelect.vue b/frontend/src/components/CustomApproval/Settings/components/RiskCenter/RiskDialog/RiskSourceSelect.vue
index 388e895ac14111..7ec97f65587ea8 100644
--- a/frontend/src/components/CustomApproval/Settings/components/RiskCenter/RiskDialog/RiskSourceSelect.vue
+++ b/frontend/src/components/CustomApproval/Settings/components/RiskCenter/RiskDialog/RiskSourceSelect.vue
@@ -17,7 +17,7 @@ import { NSelect, SelectOption, type SelectProps } from "naive-ui";
import { Risk_Source } from "@/types/proto/v1/risk_service";
import { SupportedSourceList } from "@/types";
import { useRiskCenterContext } from "../context";
-import { sourceText } from "../common";
+import { sourceText } from "../../common";
export interface RiskSourceSelectProps extends SelectProps {
value: Risk_Source;
diff --git a/frontend/src/components/CustomApproval/Settings/components/RiskCenter/RiskNavigation/index.ts b/frontend/src/components/CustomApproval/Settings/components/RiskCenter/RiskNavigation/index.ts
deleted file mode 100644
index 4caeaaaedb0c5f..00000000000000
--- a/frontend/src/components/CustomApproval/Settings/components/RiskCenter/RiskNavigation/index.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import RiskNavigation from "./RiskNavigation.vue";
-
-export default RiskNavigation;
diff --git a/frontend/src/components/CustomApproval/Settings/components/RiskCenter/RiskSection.vue b/frontend/src/components/CustomApproval/Settings/components/RiskCenter/RiskSection.vue
index fe9dfb4430866e..71b51df67f9ec1 100644
--- a/frontend/src/components/CustomApproval/Settings/components/RiskCenter/RiskSection.vue
+++ b/frontend/src/components/CustomApproval/Settings/components/RiskCenter/RiskSection.vue
@@ -15,7 +15,7 @@
<script lang="ts" setup>
import RiskTable from "./RiskTable.vue";
import { Risk, Risk_Source } from "@/types/proto/v1/risk_service";
-import { sourceText } from "./common";
+import { sourceText } from "../common";
defineProps<{
source: Risk_Source;
diff --git a/frontend/src/components/CustomApproval/Settings/components/RiskCenter/RiskTable.vue b/frontend/src/components/CustomApproval/Settings/components/RiskCenter/RiskTable.vue
index 1158d3d5dd32f4..357ea4e67d3245 100644
--- a/frontend/src/components/CustomApproval/Settings/components/RiskCenter/RiskTable.vue
+++ b/frontend/src/components/CustomApproval/Settings/components/RiskCenter/RiskTable.vue
@@ -45,11 +45,10 @@ import { useI18n } from "vue-i18n";
import { NButton } from "naive-ui";
import { BBGrid, type BBGridColumn } from "@/bbkit";
-import { SpinnerButton, SpinnerSwitch } from "../common";
+import { SpinnerButton, SpinnerSwitch, levelText } from "../common";
import { useRiskCenterContext } from "./context";
import { Risk } from "@/types/proto/v1/risk_service";
import { pushNotification, useRiskStore } from "@/store";
-import { levelText } from "./common";
defineProps<{
riskList: Risk[];
@@ -89,6 +88,11 @@ const editRisk = (risk: Risk) => {
};
const toggleRisk = async (risk: Risk, active: boolean) => {
+ if (!context.hasFeature.value) {
+ context.showFeatureModal.value = true;
+ return;
+ }
+
risk.active = active;
await useRiskStore().upsertRisk(risk);
pushNotification({
@@ -99,6 +103,11 @@ const toggleRisk = async (risk: Risk, active: boolean) => {
};
const deleteRisk = async (risk: Risk) => {
+ if (!context.hasFeature.value) {
+ context.showFeatureModal.value = true;
+ return;
+ }
+
await useRiskStore().deleteRisk(risk);
pushNotification({
module: "bytebase",
diff --git a/frontend/src/components/CustomApproval/Settings/components/RiskCenter/context.ts b/frontend/src/components/CustomApproval/Settings/components/RiskCenter/context.ts
index 486393873bbb9e..43c94ce2cddd62 100644
--- a/frontend/src/components/CustomApproval/Settings/components/RiskCenter/context.ts
+++ b/frontend/src/components/CustomApproval/Settings/components/RiskCenter/context.ts
@@ -1,11 +1,5 @@
import { inject, provide, type InjectionKey, type Ref } from "vue";
-import { Risk, Risk_Source } from "@/types/proto/v1/risk_service";
-
-export type NavigationContext = {
- source: Risk_Source;
- levels: Set<number>; // empty to "ALL"
- search: string; // Risk_Source.SOURCE_UNSPECIFIED to "ALL"
-};
+import { Risk } from "@/types/proto/v1/risk_service";
export type DialogContext = {
mode: "EDIT" | "CREATE";
@@ -18,7 +12,6 @@ export type RiskCenterContext = {
allowAdmin: Ref<boolean>;
ready: Ref<boolean>;
- navigation: Ref<NavigationContext>;
dialog: Ref<DialogContext | undefined>;
};
diff --git a/frontend/src/components/CustomApproval/Settings/components/common/ExprEditor/components/common.ts b/frontend/src/components/CustomApproval/Settings/components/common/ExprEditor/components/common.ts
index 61e3a579b4b8f6..c414f07a444656 100644
--- a/frontend/src/components/CustomApproval/Settings/components/common/ExprEditor/components/common.ts
+++ b/frontend/src/components/CustomApproval/Settings/components/common/ExprEditor/components/common.ts
@@ -11,7 +11,7 @@ import {
SupportedSourceList,
} from "@/types";
import { Risk_Source, risk_SourceToJSON } from "@/types/proto/v1/risk_service";
-import { levelText } from "../../../RiskCenter/common";
+import { levelText } from "../../utils";
export const useSelectOptions = (expr: Ref<ConditionExpr>) => {
const context = useExprEditorContext();
diff --git a/frontend/src/components/CustomApproval/Settings/components/common/RequiredStar.vue b/frontend/src/components/CustomApproval/Settings/components/common/RequiredStar.vue
new file mode 100644
index 00000000000000..31df5af669b415
--- /dev/null
+++ b/frontend/src/components/CustomApproval/Settings/components/common/RequiredStar.vue
@@ -0,0 +1,3 @@
+<template>
+ <span class="text-red-500">*</span>
+</template>
diff --git a/frontend/src/components/CustomApproval/Settings/components/RiskCenter/RiskNavigation/RiskLevelFilter.vue b/frontend/src/components/CustomApproval/Settings/components/common/RiskFilter/LevelFilter.vue
similarity index 83%
rename from frontend/src/components/CustomApproval/Settings/components/RiskCenter/RiskNavigation/RiskLevelFilter.vue
rename to frontend/src/components/CustomApproval/Settings/components/common/RiskFilter/LevelFilter.vue
index a532b04b0a83c8..f7aba8980cba5a 100644
--- a/frontend/src/components/CustomApproval/Settings/components/RiskCenter/RiskNavigation/RiskLevelFilter.vue
+++ b/frontend/src/components/CustomApproval/Settings/components/common/RiskFilter/LevelFilter.vue
@@ -27,8 +27,8 @@ import { NCheckbox } from "naive-ui";
import BBBadge, { type BBBadgeStyle } from "@/bbkit/BBBadge.vue";
import { PresetRiskLevel, PresetRiskLevelList } from "@/types";
-import { useRiskCenterContext } from "../context";
-import { levelText } from "../common";
+import { levelText } from "../../common";
+import { useRiskFilter } from "./context";
type RiskLevelFilterItem = {
value: number;
@@ -36,7 +36,7 @@ type RiskLevelFilterItem = {
style: BBBadgeStyle;
};
-const { navigation } = useRiskCenterContext();
+const { levels } = useRiskFilter();
const riskLevelFilterItemList = computed(() => {
return PresetRiskLevelList.map<RiskLevelFilterItem>(({ level }) => {
@@ -56,12 +56,11 @@ const riskLevelFilterItemList = computed(() => {
});
const isCheckedLevel = (level: number) => {
- return navigation.value.levels.has(level);
+ return levels.value.has(level);
};
const toggleCheckLevel = (level: number, checked: boolean) => {
- const { levels } = navigation.value;
- if (checked) levels.add(level);
- else levels.delete(level);
+ if (checked) levels.value.add(level);
+ else levels.value.delete(level);
};
</script>
diff --git a/frontend/src/components/CustomApproval/Settings/components/RiskCenter/RiskNavigation/RiskNavigation.vue b/frontend/src/components/CustomApproval/Settings/components/common/RiskFilter/RiskFilter.vue
similarity index 52%
rename from frontend/src/components/CustomApproval/Settings/components/RiskCenter/RiskNavigation/RiskNavigation.vue
rename to frontend/src/components/CustomApproval/Settings/components/common/RiskFilter/RiskFilter.vue
index f824d196917e0c..5563b101a08071 100644
--- a/frontend/src/components/CustomApproval/Settings/components/RiskCenter/RiskNavigation/RiskNavigation.vue
+++ b/frontend/src/components/CustomApproval/Settings/components/common/RiskFilter/RiskFilter.vue
@@ -1,11 +1,14 @@
<template>
<div class="space-y-2">
<div class="flex items-center justify-between">
- <RiskLevelFilter />
+ <div>
+ <LevelFilter v-if="!hideLevelFilter" />
+ </div>
<div class="flex items-center justify-end gap-x-4">
<NInput
- v-model:value="navigation.search"
+ v-if="!hideSearch"
+ v-model:value="search"
:clearable="true"
:placeholder="$t('custom-approval.security-rule.search')"
>
@@ -18,8 +21,8 @@
</div>
</div>
- <div class="flex items-center justify-start">
- <RiskSourceFilter />
+ <div v-if="!hideSourceFilter" class="flex items-center justify-start">
+ <SourceFilter />
</div>
</div>
</template>
@@ -27,9 +30,15 @@
<script lang="ts" setup>
import { NInput } from "naive-ui";
-import RiskSourceFilter from "./RiskSourceFilter.vue";
-import RiskLevelFilter from "./RiskLevelFilter.vue";
-import { useRiskCenterContext } from "../context";
+import SourceFilter from "./SourceFilter.vue";
+import LevelFilter from "./LevelFilter.vue";
+import { useRiskFilter } from "./context";
+
+defineProps<{
+ hideLevelFilter?: boolean;
+ hideSourceFilter?: boolean;
+ hideSearch?: boolean;
+}>();
-const { navigation } = useRiskCenterContext();
+const { search } = useRiskFilter();
</script>
diff --git a/frontend/src/components/CustomApproval/Settings/components/RiskCenter/RiskNavigation/RiskSourceFilter.vue b/frontend/src/components/CustomApproval/Settings/components/common/RiskFilter/SourceFilter.vue
similarity index 81%
rename from frontend/src/components/CustomApproval/Settings/components/RiskCenter/RiskNavigation/RiskSourceFilter.vue
rename to frontend/src/components/CustomApproval/Settings/components/common/RiskFilter/SourceFilter.vue
index c779b07e5884c7..bb089eae9d9976 100644
--- a/frontend/src/components/CustomApproval/Settings/components/RiskCenter/RiskNavigation/RiskSourceFilter.vue
+++ b/frontend/src/components/CustomApproval/Settings/components/common/RiskFilter/SourceFilter.vue
@@ -12,20 +12,18 @@ import { useI18n } from "vue-i18n";
import { BBTabFilter, type BBTabFilterItem } from "@/bbkit";
import { Risk_Source } from "@/types/proto/v1/risk_service";
-import { useRiskCenterContext } from "../context";
import { SupportedSourceList } from "@/types";
import { minmax } from "@/utils";
-import { sourceText } from "../common";
+import { sourceText } from "../../common";
+import { useRiskFilter } from "./context";
export interface RiskSourceFilterItem {
value: Risk_Source;
label: string;
}
-const context = useRiskCenterContext();
-const { navigation } = context;
-
const { t } = useI18n();
+const { source } = useRiskFilter();
const filterItemList = computed(() => {
const items: RiskSourceFilterItem[] = [
@@ -46,14 +44,14 @@ const filterItemList = computed(() => {
const index = computed({
get() {
const index = filterItemList.value.findIndex(
- (item) => item.value === navigation.value.source
+ (item) => item.value === source.value
);
if (index < 0) return 0;
return index;
},
set(index) {
index = minmax(index, 0, filterItemList.value.length - 1);
- navigation.value.source = filterItemList.value[index].value;
+ source.value = filterItemList.value[index].value;
},
});
diff --git a/frontend/src/components/CustomApproval/Settings/components/common/RiskFilter/context.ts b/frontend/src/components/CustomApproval/Settings/components/common/RiskFilter/context.ts
new file mode 100644
index 00000000000000..74a7b14573e4ad
--- /dev/null
+++ b/frontend/src/components/CustomApproval/Settings/components/common/RiskFilter/context.ts
@@ -0,0 +1,34 @@
+import { type InjectionKey, type Ref, inject, provide, ref } from "vue";
+
+import { Risk_Source } from "@/types/proto/v1/risk_service";
+
+export type RiskFilterContext = {
+ source: Ref<Risk_Source>; // default Risk_Source.SOURCE_UNSPECIFIED to "ALL"
+ levels: Ref<Set<number>>; // default empty to "ALL"
+ search: Ref<string>; // default ""
+};
+
+export const KEY = Symbol(
+ "bb.settings.custom-approval+risk-center.risk-filter"
+) as InjectionKey<RiskFilterContext>;
+
+const useRiskFilterContext = () => {
+ return inject(KEY)!;
+};
+
+const provideRiskFilterContext = (context: RiskFilterContext) => {
+ provide(KEY, context);
+};
+
+export const useRiskFilter = () => {
+ const context = useRiskFilterContext();
+ return context;
+};
+
+export const provideRiskFilter = () => {
+ provideRiskFilterContext({
+ source: ref(Risk_Source.SOURCE_UNSPECIFIED),
+ levels: ref(new Set()),
+ search: ref(""),
+ });
+};
diff --git a/frontend/src/components/CustomApproval/Settings/components/common/RiskFilter/index.ts b/frontend/src/components/CustomApproval/Settings/components/common/RiskFilter/index.ts
new file mode 100644
index 00000000000000..926384f5ac7124
--- /dev/null
+++ b/frontend/src/components/CustomApproval/Settings/components/common/RiskFilter/index.ts
@@ -0,0 +1,4 @@
+import RiskFilter from "./RiskFilter.vue";
+
+export default RiskFilter;
+export * from "./context";
diff --git a/frontend/src/components/CustomApproval/Settings/components/common/SpinnerSelect.vue b/frontend/src/components/CustomApproval/Settings/components/common/SpinnerSelect.vue
new file mode 100644
index 00000000000000..b94844dd6d332f
--- /dev/null
+++ b/frontend/src/components/CustomApproval/Settings/components/common/SpinnerSelect.vue
@@ -0,0 +1,33 @@
+<template>
+ <NSelect :loading="loading" @update:value="handleUpdate" />
+</template>
+
+<script lang="ts">
+import { defineComponent } from "vue";
+defineComponent({
+ inheritAttrs: false,
+});
+</script>
+
+<script lang="ts" setup>
+import { ref } from "vue";
+import { type SelectProps, NSelect } from "naive-ui";
+
+export interface SpinnerSelectProps extends SelectProps {
+ onUpdate: (value: string | undefined) => Promise<any>;
+}
+const props = defineProps<SpinnerSelectProps>();
+
+const loading = ref(false);
+
+const handleUpdate = async (value: string | undefined) => {
+ if (loading.value) return;
+
+ loading.value = true;
+ try {
+ await props.onUpdate(value);
+ } finally {
+ loading.value = false;
+ }
+};
+</script>
diff --git a/frontend/src/components/CustomApproval/Settings/components/common/index.ts b/frontend/src/components/CustomApproval/Settings/components/common/index.ts
index ba43ea87dbe877..3873f20407d914 100644
--- a/frontend/src/components/CustomApproval/Settings/components/common/index.ts
+++ b/frontend/src/components/CustomApproval/Settings/components/common/index.ts
@@ -1,5 +1,18 @@
+import RequiredStar from "./RequiredStar.vue";
import SpinnerButton from "./SpinnerButton.vue";
import SpinnerSwitch from "./SpinnerSwitch.vue";
+import SpinnerSelect from "./SpinnerSelect.vue";
import ExprEditor from "./ExprEditor";
+import RiskFilter from "./RiskFilter";
-export { ExprEditor, SpinnerButton, SpinnerSwitch };
+export * from "./utils";
+export * from "./RiskFilter";
+export * from "./ExprEditor";
+export {
+ RequiredStar,
+ ExprEditor,
+ SpinnerButton,
+ SpinnerSwitch,
+ SpinnerSelect,
+ RiskFilter,
+};
diff --git a/frontend/src/components/CustomApproval/Settings/components/RiskCenter/common.ts b/frontend/src/components/CustomApproval/Settings/components/common/utils.ts
similarity index 85%
rename from frontend/src/components/CustomApproval/Settings/components/RiskCenter/common.ts
rename to frontend/src/components/CustomApproval/Settings/components/common/utils.ts
index ffdedd32fe5cc8..59c9b5e8b95b43 100644
--- a/frontend/src/components/CustomApproval/Settings/components/RiskCenter/common.ts
+++ b/frontend/src/components/CustomApproval/Settings/components/common/utils.ts
@@ -3,10 +3,13 @@ import {
Risk_Source,
risk_SourceToJSON,
} from "@/types/proto/v1/risk_service";
-import { useI18n } from "vue-i18n";
+import { t, te } from "@/plugins/i18n";
export const sourceText = (source: Risk_Source) => {
- const { t, te } = useI18n();
+ if (source === Risk_Source.SOURCE_UNSPECIFIED) {
+ return t("common.all");
+ }
+
const name = risk_SourceToJSON(source);
const keypath = `custom-approval.security-rule.risk.namespace.${name.toLowerCase()}`;
if (te(keypath)) {
@@ -16,7 +19,6 @@ export const sourceText = (source: Risk_Source) => {
};
export const levelText = (level: number) => {
- const { t, te } = useI18n();
const keypath = `custom-approval.security-rule.risk.risk-level.${level}`;
if (te(keypath)) {
return t(keypath);
diff --git a/frontend/src/components/CustomApproval/Settings/components/index.ts b/frontend/src/components/CustomApproval/Settings/components/index.ts
deleted file mode 100644
index 5a836433b9a75d..00000000000000
--- a/frontend/src/components/CustomApproval/Settings/components/index.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-// import Toolbar from "./Toolbar.vue";
-
-// export * from "./Workflow";
-export * from "./RiskCenter";
-
-// export { Toolbar };
diff --git a/frontend/src/components/CustomApproval/Settings/index.ts b/frontend/src/components/CustomApproval/Settings/index.ts
deleted file mode 100644
index 40b494c5f8737f..00000000000000
--- a/frontend/src/components/CustomApproval/Settings/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from "./components";
diff --git a/frontend/src/composables/useRouteHash.ts b/frontend/src/composables/useRouteHash.ts
new file mode 100644
index 00000000000000..be952ebdf84f4b
--- /dev/null
+++ b/frontend/src/composables/useRouteHash.ts
@@ -0,0 +1,28 @@
+import { computed } from "vue";
+import { useRoute, useRouter } from "vue-router";
+
+export const useRouteHash = <TS extends readonly string[]>(
+ defaultValue: TS[number],
+ values?: TS,
+ method: "replace" | "push" = "replace"
+) => {
+ type T = TS[number];
+
+ const route = useRoute();
+ const router = useRouter();
+ const normalize = (value: T): T => {
+ if (!values) return value;
+ if (values.includes(value)) return value;
+ return defaultValue;
+ };
+ return computed<T>({
+ get() {
+ const hash = (route.hash ?? "").replace(/^#?/, "") as T;
+ return normalize(hash || defaultValue);
+ },
+ set(value) {
+ value = normalize(value);
+ router[method](`#${value}`);
+ },
+ });
+};
diff --git a/frontend/src/grpcweb/index.ts b/frontend/src/grpcweb/index.ts
index 4bba5dfd22db03..4fc981c4d97a9c 100644
--- a/frontend/src/grpcweb/index.ts
+++ b/frontend/src/grpcweb/index.ts
@@ -10,7 +10,7 @@ import { InstanceServiceDefinition } from "@/types/proto/v1/instance_service";
import { ProjectServiceDefinition } from "@/types/proto/v1/project_service";
import { SQLServiceDefinition } from "@/types/proto/v1/sql_service";
import { RiskServiceDefinition } from "@/types/proto/v1/risk_service";
-// import { ApprovalTemplateServiceDefinition } from "@/types/proto/v1/approval_template_service";
+import { SettingServiceDefinition } from "@/types/proto/v1/setting_service";
// Create each grpc service client.
// Reference: https://github.com/deeplay-io/nice-grpc/blob/master/packages/nice-grpc-web/README.md
@@ -58,10 +58,10 @@ export const riskServiceClient = clientFactory.create(
channel
);
-// export const approvalTemplateServiceClient = clientFactory.create(
-// ApprovalTemplateServiceDefinition,
-// channel
-// );
+export const settingServiceClient = clientFactory.create(
+ SettingServiceDefinition,
+ channel
+);
export const sqlClient = clientFactory.create(SQLServiceDefinition, channel);
diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.json
index 490fa06bd4c56b..c2a329b5b71e2b 100644
--- a/frontend/src/locales/en-US.json
+++ b/frontend/src/locales/en-US.json
@@ -2077,7 +2077,6 @@
"security-rule": {
"self": "Security rule",
"security-rules": "Security rules",
- "description": "For each operation type, configure custom condition, risk and approval flow. ",
"x-risk-rules": {
"low": "Low Risk Rules",
"moderate": "Moderate Risk Rules",
@@ -2146,6 +2145,7 @@
},
"approval-flow": {
"self": "Approval flow",
+ "description": "For each operation type, configure custom condition, risk and approval flow. ",
"approval-flows": "Approval flows",
"approval-nodes": "Approval nodes",
"type": {
@@ -2162,16 +2162,34 @@
"description": "Only one approval is required on this node when there are multiple approvers.",
"order": "Order",
"approver": "Approver",
+ "group": {
+ "WORKSPACE_OWNER": "Workspace Owner",
+ "WORKSPACE_DBA": "DBA",
+ "PROJECT_OWNER": "Project Owner",
+ "PROJECT_MEMBER": "Project Member"
+ },
"add": "Add node",
"delete": "Delete approval node"
},
- "view-approval-flow": "View approval flow"
+ "presets": {
+ "owner-dba": "The system defines the approval process, first the project Owner approves, then the DBA approves.",
+ "owner": "The system defines the approval process and only needs the project Owner o approve it.",
+ "dba": "The system defines the approval process and only needs DBA approval.",
+ "admin": "The system defines the approval process and only needs Administrator approval.",
+ "owner-dba-admin": "The system defines the approval process, first the project Owner approves, then the DBA approves, and finally the Administrator approves."
+ },
+ "view-approval-flow": "View approval flow",
+ "skip": "Skip manual approval"
},
"risk": {
+ "self": "Risk",
"risk-center": "Risk Center"
},
"workflow-center": {
"workflow": "Workflow"
+ },
+ "rule": {
+ "rules": "Rules"
}
}
}
diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.json
index e2a17236714f0d..67576ab15435a0 100644
--- a/frontend/src/locales/zh-CN.json
+++ b/frontend/src/locales/zh-CN.json
@@ -2074,7 +2074,6 @@
"security-rule": {
"self": "安全规则",
"security-rules": "安全规则",
- "description": "对每种操作类型,配置自定义条件、风险和审批流。",
"x-risk-rules": {
"low": "低风险规则",
"moderate": "中风险规则",
@@ -2143,6 +2142,7 @@
},
"approval-flow": {
"self": "审批流",
+ "description": "对每种操作类型,配置自定义条件、风险和审批流。",
"approval-flows": "审批流",
"approval-nodes": "审批节点",
"type": {
@@ -2158,17 +2158,35 @@
"nodes": "审批节点",
"description": "当一个节点上有多个审批人时,只需要一次审批通过。",
"approver": "审批人",
+ "group": {
+ "WORKSPACE_OWNER": "管理员",
+ "WORKSPACE_DBA": "DBA",
+ "PROJECT_OWNER": "项目所有者",
+ "PROJECT_MEMBER": "项目成员"
+ },
"add": "增加节点",
"delete": "删除审批节点",
"order": "顺序"
},
- "view-approval-flow": "查看审批流"
+ "presets": {
+ "owner-dba": "系统定义的流程。先由项目所有者审批,再由 DBA 审批。",
+ "owner": "系统定义的流程。只需要项目所有者审批。",
+ "dba": "系统定义的流程。只需要 DBA 审批",
+ "admin": "系统定义的流程。只需要管理员审批",
+ "owner-dba-admin": "系统定义的流程。先由项目所有者审批,再由 DBA 审批,最后由管理员审批。"
+ },
+ "view-approval-flow": "查看审批流",
+ "skip": "跳过人工审批"
},
"risk": {
+ "self": "风险",
"risk-center": "风险中心"
},
"workflow-center": {
"workflow": "工作流"
+ },
+ "rule": {
+ "rules": "规则"
}
}
}
diff --git a/frontend/src/router/index.ts b/frontend/src/router/index.ts
index 72e0a8aab14dfd..3b33838d94f12f 100644
--- a/frontend/src/router/index.ts
+++ b/frontend/src/router/index.ts
@@ -416,6 +416,14 @@ const routes: Array<RouteRecordRaw> = [
import("../views/SettingWorkspaceRiskCenter.vue"),
props: true,
},
+ {
+ path: "custom-approval",
+ name: "setting.workspace.custom-approval",
+ meta: { title: () => t("custom-approval.self") },
+ component: () =>
+ import("../views/SettingWorkspaceCustomApproval.vue"),
+ props: true,
+ },
{
path: "gitops",
name: "setting.workspace.gitops",
@@ -1036,12 +1044,8 @@ router.beforeEach((to, from, next) => {
to.name === PASSWORD_RESET_MODULE ||
to.name === PASSWORD_FORGOT_MODULE
) {
- try {
- useTabStore().reset();
- useConversationStore().reset();
- } catch {
- // nothing
- }
+ useTabStore().reset();
+ useConversationStore().reset();
if (isLoggedIn) {
if (typeof to.query.redirect === "string") {
location.replace(to.query.redirect);
diff --git a/frontend/src/store/modules/index.ts b/frontend/src/store/modules/index.ts
index 91a66c0fc7b01c..a62aa1e98a9b48 100644
--- a/frontend/src/store/modules/index.ts
+++ b/frontend/src/store/modules/index.ts
@@ -47,3 +47,4 @@ export * from "./dbSchema";
export * from "./idp";
export * from "./user";
export * from "./risk";
+export * from "./workspaceApprovalSetting";
diff --git a/frontend/src/store/modules/workspaceApprovalSetting.ts b/frontend/src/store/modules/workspaceApprovalSetting.ts
new file mode 100644
index 00000000000000..d21be8d32bcf3f
--- /dev/null
+++ b/frontend/src/store/modules/workspaceApprovalSetting.ts
@@ -0,0 +1,125 @@
+import { defineStore } from "pinia";
+import { ref } from "vue";
+
+import { settingServiceClient } from "@/grpcweb";
+import { WorkspaceApprovalSetting } from "@/types/proto/store/setting";
+import { Setting } from "@/types/proto/v1/setting_service";
+import type { LocalApprovalConfig, LocalApprovalRule } from "@/types";
+import {
+ resolveLocalApprovalConfig,
+ buildWorkspaceApprovalSetting,
+ seedWorkspaceApprovalSetting,
+} from "@/utils";
+import { Risk_Source } from "@/types/proto/v1/risk_service";
+
+const SETTING_NAME = "settings/bb.workspace.approval";
+
+export const useWorkspaceApprovalSettingStore = defineStore(
+ "workspaceApprovalSetting",
+ () => {
+ const config = ref<LocalApprovalConfig>({
+ rules: [],
+ parsed: [],
+ unrecognized: [],
+ });
+
+ const setConfigSetting = (setting: Setting) => {
+ const _config = WorkspaceApprovalSetting.fromJSON(
+ JSON.parse(setting.value?.stringValue || "{}")
+ );
+ if (_config.rules.length === 0) {
+ _config.rules.push(...seedWorkspaceApprovalSetting());
+ }
+ config.value = resolveLocalApprovalConfig(_config);
+ };
+
+ const fetchConfig = async () => {
+ try {
+ const setting = await settingServiceClient.getSetting({
+ name: SETTING_NAME,
+ });
+ setConfigSetting(setting);
+ } catch (ex) {
+ console.error(ex);
+ }
+ };
+
+ const updateConfig = async () => {
+ const setting = buildWorkspaceApprovalSetting(config.value);
+ await settingServiceClient.setSetting({
+ setting: {
+ name: SETTING_NAME,
+ value: {
+ stringValue: JSON.stringify(setting),
+ },
+ },
+ });
+ };
+
+ const upsertRule = async (
+ newRule: LocalApprovalRule,
+ oldRule: LocalApprovalRule | undefined
+ ) => {
+ const { rules } = config.value;
+ if (oldRule) {
+ const index = rules.indexOf(oldRule);
+ if (index >= 0) {
+ rules[index] = newRule;
+ await updateConfig();
+ }
+ } else {
+ rules.unshift(newRule);
+ await updateConfig();
+ }
+ };
+
+ const deleteRule = async (rule: LocalApprovalRule) => {
+ await new Promise((r) => setTimeout(r, 500));
+ const { rules, parsed, unrecognized } = config.value;
+ config.value.parsed = parsed.filter((item) => item.rule !== rule.uid);
+ config.value.unrecognized = unrecognized.filter(
+ (item) => item.rule !== rule.uid
+ );
+ const index = rules.indexOf(rule);
+ if (index >= 0) {
+ rules.splice(index, 1);
+ }
+ await updateConfig();
+ };
+
+ const updateRuleFlow = async (
+ source: Risk_Source,
+ level: number,
+ rule: string | undefined
+ ) => {
+ const { parsed } = config.value;
+ const index = parsed.findIndex(
+ (item) => item.source == source && item.level === level
+ );
+ if (index >= 0) {
+ if (rule) {
+ parsed[index].rule = rule;
+ } else {
+ parsed.splice(index, 1);
+ }
+ } else {
+ if (rule) {
+ parsed.push({
+ source,
+ level,
+ rule,
+ });
+ }
+ }
+ await updateConfig();
+ };
+
+ return {
+ config,
+ fetchConfig,
+ upsertRule,
+ deleteRule,
+ updateRuleFlow,
+ };
+ }
+);
diff --git a/frontend/src/types/index.ts b/frontend/src/types/index.ts
index 688cd228be85ed..1a5c7f4a78f6bb 100644
--- a/frontend/src/types/index.ts
+++ b/frontend/src/types/index.ts
@@ -50,3 +50,4 @@ export * from "./schemaEditor";
export * from "./externalApproval";
export * from "./mfa";
export * from "./risk";
+export * from "./workspaceApprovalSetting";
diff --git a/frontend/src/types/workspaceApprovalSetting.ts b/frontend/src/types/workspaceApprovalSetting.ts
new file mode 100644
index 00000000000000..87a7b5d92dcfa5
--- /dev/null
+++ b/frontend/src/types/workspaceApprovalSetting.ts
@@ -0,0 +1,29 @@
+import type {
+ Expr,
+ ParsedExpr,
+} from "@/types/proto/google/api/expr/v1alpha1/syntax";
+import type { Risk_Source } from "@/types/proto/v1/risk_service";
+import type { ApprovalTemplate } from "./proto/store/approval";
+
+export type LocalApprovalRule = {
+ uid: string;
+ expression?: ParsedExpr;
+ template: ApprovalTemplate;
+};
+
+export type ParsedApprovalRule = {
+ source: Risk_Source;
+ level: number;
+ rule: string; // LocalApprovalRule.uid
+};
+
+export type UnrecognizedApprovalRule = {
+ expr?: Expr;
+ rule: string; // LocalApprovalRule.uid
+};
+
+export type LocalApprovalConfig = {
+ rules: LocalApprovalRule[];
+ parsed: ParsedApprovalRule[];
+ unrecognized: UnrecognizedApprovalRule[];
+};
diff --git a/frontend/src/utils/index.ts b/frontend/src/utils/index.ts
index e207481a3cb2c8..caf8e15d472be2 100644
--- a/frontend/src/utils/index.ts
+++ b/frontend/src/utils/index.ts
@@ -27,3 +27,4 @@ export * from "./sso";
export * from "./math";
export * from "./idp";
export * from "./id";
+export * from "./workspaceApprovalSetting";
diff --git a/frontend/src/utils/workspaceApprovalSetting.ts b/frontend/src/utils/workspaceApprovalSetting.ts
new file mode 100644
index 00000000000000..89a836d51ebe3f
--- /dev/null
+++ b/frontend/src/utils/workspaceApprovalSetting.ts
@@ -0,0 +1,316 @@
+import { cloneDeep } from "lodash-es";
+import { v4 as uuidv4 } from "uuid";
+
+import {
+ ParsedApprovalRule,
+ SYSTEM_BOT_ID,
+ UnrecognizedApprovalRule,
+} from "@/types";
+import {
+ Expr,
+ ParsedExpr,
+} from "@/types/proto/google/api/expr/v1alpha1/syntax";
+import {
+ WorkspaceApprovalSetting,
+ WorkspaceApprovalSetting_Rule as ApprovalRule,
+} from "@/types/proto/store/setting";
+import { Risk_Source } from "@/types/proto/v1/risk_service";
+import {
+ LocalApprovalConfig,
+ LocalApprovalRule,
+ PresetRiskLevelList,
+ SupportedSourceList,
+} from "@/types";
+import { t, te } from "@/plugins/i18n";
+import {
+ ApprovalNode_GroupValue,
+ approvalNode_GroupValueToJSON,
+ ApprovalNode_Type,
+ ApprovalStep_Type,
+} from "@/types/proto/store/approval";
+
+export const approvalNodeGroupValueText = (group: ApprovalNode_GroupValue) => {
+ const name = approvalNode_GroupValueToJSON(group);
+ const keypath = `custom-approval.approval-flow.node.group.${name}`;
+ if (te(keypath)) {
+ return t(keypath);
+ }
+ return name;
+};
+
+/*
+ A WorkspaceApprovalSetting is a list of ApprovalRule = {
+ expr,
+ approval_template
+ }
+ Currently, every ApprovalRule.expr is a list of "OR" expr.
+ And every "OR" expr has a fixed "source==xx && level=yy" form.
+
+ So we walk through the list of ApprovalRule and find all combinations of
+ ParsedApprovalRule = {
+ source,
+ level,
+ rule,
+ }
+*/
+export const resolveLocalApprovalConfig = (
+ config: WorkspaceApprovalSetting
+): LocalApprovalConfig => {
+ const rules = config.rules.map<LocalApprovalRule>((rule) => ({
+ uid: uuidv4(),
+ expression: cloneDeep(rule.expression),
+ template: cloneDeep(rule.template!),
+ }));
+ const { parsed, unrecognized } = resolveApprovalConfigRules(rules);
+ return {
+ rules,
+ parsed,
+ unrecognized,
+ };
+};
+const resolveApprovalConfigRules = (rules: LocalApprovalRule[]) => {
+ const parsed: ParsedApprovalRule[] = [];
+ const unrecognized: UnrecognizedApprovalRule[] = [];
+
+ const fail = (expr: Expr | undefined, rule: LocalApprovalRule) => {
+ unrecognized.push({ expr, rule: rule.uid });
+ };
+
+ const resolveLogicAndExpr = (expr: Expr, rule: LocalApprovalRule) => {
+ const { function: operator, args } = expr.callExpr ?? {};
+ if (operator !== "_&&_") return fail(expr, rule);
+ if (!args || args.length !== 2) return fail(expr, rule);
+ const source = resolveSourceExpr(args[0]);
+ if (source === Risk_Source.UNRECOGNIZED) return fail(expr, rule);
+ const level = resolveLevelExpr(args[1]);
+ if (Number.isNaN(level)) return fail(expr, rule);
+
+ // Found a correct (source, level) combination
+ parsed.push({
+ source,
+ level,
+ rule: rule.uid,
+ });
+ };
+
+ const resolveLogicOrExpr = (expr: Expr, rule: LocalApprovalRule) => {
+ const { function: operator, args } = expr.callExpr ?? {};
+ if (operator !== "_||_") return fail(expr, rule);
+ if (!args || args.length === 0) return fail(expr, rule);
+
+ for (let i = 0; i < args.length; i++) {
+ resolveLogicAndExpr(args[i], rule);
+ }
+ };
+
+ for (let i = 0; i < rules.length; i++) {
+ const rule = rules[i];
+ const expr = rule.expression?.expr;
+ if (!expr) {
+ fail(expr, rule);
+ continue;
+ }
+ if (expr.callExpr?.function === "_&&_") {
+ // A single "AND" expr maybe.
+ resolveLogicAndExpr(expr, rule);
+ } else {
+ // A huge "OR" expr combined with several "AND" exprs.
+ resolveLogicOrExpr(expr, rule);
+ }
+ }
+
+ return { parsed, unrecognized };
+};
+
+export const buildWorkspaceApprovalSetting = (config: LocalApprovalConfig) => {
+ const { rules, parsed } = config;
+
+ const parsedMap = toMap(parsed);
+
+ return WorkspaceApprovalSetting.fromJSON({
+ rules: rules.map<ApprovalRule>((rule) => {
+ const { uid, template } = rule;
+ const parsed = parsedMap.get(uid) ?? [];
+ const expression = buildParsedExpression(parsed);
+ return ApprovalRule.fromJSON({
+ expression,
+ template,
+ });
+ }),
+ });
+};
+
+const resolveIdentExpr = (expr: Expr): string => {
+ return expr.identExpr?.name ?? "";
+};
+
+const resolveNumberExpr = (expr: Expr): number | undefined => {
+ return expr.constExpr?.int64Value;
+};
+
+const resolveSourceExpr = (expr: Expr): Risk_Source => {
+ const { function: operator, args } = expr.callExpr ?? {};
+ if (operator !== "_==_") return Risk_Source.UNRECOGNIZED;
+ if (!args || args.length !== 2) return Risk_Source.UNRECOGNIZED;
+ const factor = resolveIdentExpr(args[0]);
+ if (factor !== "source") return Risk_Source.UNRECOGNIZED;
+ const source = resolveNumberExpr(args[1]);
+ if (typeof source === "undefined") return Risk_Source.UNRECOGNIZED;
+ if (!SupportedSourceList.includes(source)) return Risk_Source.UNRECOGNIZED;
+ return source;
+};
+
+const resolveLevelExpr = (expr: Expr): number => {
+ const { function: operator, args } = expr.callExpr ?? {};
+ if (operator !== "_==_") return Number.NaN;
+ if (!args || args.length !== 2) return Number.NaN;
+ const factor = resolveIdentExpr(args[0]);
+ if (factor !== "level") return Number.NaN;
+ const level = resolveNumberExpr(args[1]);
+ if (typeof level === "undefined") return Number.NaN;
+ if (!PresetRiskLevelList.find((item) => item.level === level))
+ return Number.NaN;
+ return level;
+};
+
+const toMap = <T extends { rule: string }>(items: T[]): Map<string, T[]> => {
+ return items.reduce((map, item) => {
+ const { rule } = item;
+ const array = map.get(rule) ?? [];
+ array.push(item);
+ map.set(rule, array);
+ return map;
+ }, new Map());
+};
+
+const buildParsedExpression = (parsed: ParsedApprovalRule[]) => {
+ if (parsed.length === 0) {
+ return ParsedExpr.fromJSON({});
+ }
+
+ const seq = {
+ id: 0,
+ next() {
+ return seq.id++;
+ },
+ };
+
+ const buildCallExpr = (op: "_&&_" | "_||_" | "_==_", args: Expr[]) => {
+ return Expr.fromJSON({
+ id: seq.next(),
+ callExpr: {
+ id: seq.next(),
+ function: op,
+ args,
+ },
+ });
+ };
+ const buildIdentExpr = (name: string) => {
+ return Expr.fromJSON({
+ id: seq.next(),
+ identExpr: {
+ id: seq.next(),
+ name,
+ },
+ });
+ };
+ const buildInt64Constant = (value: number) => {
+ return Expr.fromJSON({
+ id: seq.next(),
+ constExpr: {
+ id: seq.next(),
+ int64Value: value,
+ },
+ });
+ };
+ const args = parsed.map(({ source, level }) => {
+ const sourceExpr = buildCallExpr("_==_", [
+ buildIdentExpr("source"),
+ buildInt64Constant(source),
+ ]);
+ const levelExpr = buildCallExpr("_==_", [
+ buildIdentExpr("level"),
+ buildInt64Constant(level),
+ ]);
+ return buildCallExpr("_&&_", [sourceExpr, levelExpr]);
+ });
+ // A single '_&&_' expr
+ if (args.length === 1) {
+ return ParsedExpr.fromJSON({
+ expr: args[0],
+ });
+ }
+ // A huge '_||_' expr combined with several '_&&_' exprs.
+ return ParsedExpr.fromJSON({
+ expr: buildCallExpr("_||_", args),
+ });
+};
+
+export const seedWorkspaceApprovalSetting = () => {
+ const generateRule = (
+ title: string,
+ description: string,
+ roles: ApprovalNode_GroupValue[]
+ ): ApprovalRule => {
+ return ApprovalRule.fromJSON({
+ template: {
+ title,
+ description,
+ creatorId: SYSTEM_BOT_ID,
+ flow: {
+ steps: roles.map((role) => ({
+ type: ApprovalStep_Type.ANY,
+ nodes: [
+ {
+ type: ApprovalNode_Type.ANY_IN_GROUP,
+ groupValue: role,
+ },
+ ],
+ })),
+ },
+ },
+ });
+ };
+ type Preset = {
+ title?: string;
+ description: string;
+ roles: ApprovalNode_GroupValue[];
+ };
+ const presets: Preset[] = [
+ {
+ description: "owner-dba",
+ roles: [
+ ApprovalNode_GroupValue.PROJECT_OWNER,
+ ApprovalNode_GroupValue.WORKSPACE_DBA,
+ ],
+ },
+ {
+ description: "owner",
+ roles: [ApprovalNode_GroupValue.PROJECT_OWNER],
+ },
+ {
+ description: "dba",
+ roles: [ApprovalNode_GroupValue.WORKSPACE_DBA],
+ },
+ {
+ description: "admin",
+ roles: [ApprovalNode_GroupValue.WORKSPACE_OWNER],
+ },
+ {
+ description: "owner-dba-admin",
+ roles: [
+ ApprovalNode_GroupValue.PROJECT_OWNER,
+ ApprovalNode_GroupValue.WORKSPACE_DBA,
+ ApprovalNode_GroupValue.WORKSPACE_OWNER,
+ ],
+ },
+ ];
+ return presets.map((preset) => {
+ const title =
+ preset.title ??
+ preset.roles.map((role) => approvalNodeGroupValueText(role)).join(" -> ");
+ const keypath = `custom-approval.approval-flow.presets.${preset.description}`;
+ const description = t(keypath);
+ return generateRule(title, description, preset.roles);
+ });
+};
diff --git a/frontend/src/views/SettingSidebar.vue b/frontend/src/views/SettingSidebar.vue
index 4a5c45c5b6a71c..62c1ac9ad5c33a 100644
--- a/frontend/src/views/SettingSidebar.vue
+++ b/frontend/src/views/SettingSidebar.vue
@@ -89,6 +89,12 @@
>
{{ $t("custom-approval.risk.risk-center") }}
</router-link>
+ <router-link
+ to="/setting/custom-approval"
+ class="outline-item group w-full flex items-center truncate pl-11 pr-2 py-2"
+ >
+ {{ $t("custom-approval.self") }}
+ </router-link>
<router-link
v-if="showSensitiveDataItem"
to="/setting/sensitive-data"
diff --git a/frontend/src/views/SettingWorkspaceCustomApproval.vue b/frontend/src/views/SettingWorkspaceCustomApproval.vue
new file mode 100644
index 00000000000000..12d6492603cc78
--- /dev/null
+++ b/frontend/src/views/SettingWorkspaceCustomApproval.vue
@@ -0,0 +1,73 @@
+<template>
+ <div class="w-full mt-4 space-y-4 text-sm">
+ <CustomApproval v-if="state.ready" />
+ <div v-else class="w-full py-[4rem] flex justify-center items-center">
+ <BBSpin />
+ </div>
+ </div>
+
+ <ApprovalRuleDialog />
+
+ <FeatureModal
+ v-if="state.showFeatureModal"
+ feature="bb.feature.custom-approval"
+ @cancel="state.showFeatureModal = false"
+ />
+</template>
+
+<script lang="ts" setup>
+import { computed, onMounted, reactive, ref, toRef } from "vue";
+
+import {
+ featureToRef,
+ useWorkspaceApprovalSettingStore,
+ useCurrentUser,
+} from "@/store";
+import { hasWorkspacePermission } from "@/utils";
+import {
+ CustomApproval,
+ ApprovalRuleDialog,
+ provideCustomApprovalContext,
+ TabValueList,
+} from "@/components/CustomApproval/Settings/components/CustomApproval/";
+import { useRouteHash } from "@/composables/useRouteHash";
+
+interface LocalState {
+ ready: boolean;
+ showFeatureModal: boolean;
+}
+
+const store = useWorkspaceApprovalSettingStore();
+const state = reactive<LocalState>({
+ ready: false,
+ showFeatureModal: false,
+});
+const tab = useRouteHash("rules", TabValueList, "replace");
+const hasCustomApprovalFeature = featureToRef("bb.feature.custom-approval");
+
+const currentUser = useCurrentUser();
+const allowAdmin = computed(() => {
+ return hasWorkspacePermission(
+ "bb.permission.workspace.manage-custom-approval",
+ currentUser.value.role
+ );
+});
+
+provideCustomApprovalContext({
+ hasFeature: hasCustomApprovalFeature,
+ showFeatureModal: toRef(state, "showFeatureModal"),
+ allowAdmin,
+ ready: toRef(state, "ready"),
+ tab,
+ dialog: ref(),
+});
+
+onMounted(async () => {
+ try {
+ await Promise.all([store.fetchConfig()]);
+ state.ready = true;
+ } catch {
+ // nothing
+ }
+});
+</script>
diff --git a/frontend/src/views/SettingWorkspaceRiskCenter.vue b/frontend/src/views/SettingWorkspaceRiskCenter.vue
index ee79ff535541a8..4854ce8d2ac585 100644
--- a/frontend/src/views/SettingWorkspaceRiskCenter.vue
+++ b/frontend/src/views/SettingWorkspaceRiskCenter.vue
@@ -30,8 +30,8 @@ import {
RiskCenter,
RiskDialog,
provideRiskCenterContext,
-} from "@/components/CustomApproval/Settings";
-import { Risk_Source } from "@/types/proto/v1/risk_service";
+} from "@/components/CustomApproval/Settings/components/RiskCenter";
+import { provideRiskFilter } from "@/components/CustomApproval/Settings/components/common";
interface LocalState {
ready: boolean;
@@ -52,16 +52,12 @@ const allowAdmin = computed(() => {
);
});
+provideRiskFilter();
provideRiskCenterContext({
hasFeature: hasCustomApprovalFeature,
showFeatureModal: toRef(state, "showFeatureModal"),
allowAdmin,
ready: toRef(state, "ready"),
- navigation: ref({
- levels: new Set<number>(), // empty to "ALL"
- search: "",
- source: Risk_Source.SOURCE_UNSPECIFIED, // "ALL"
- }),
dialog: ref(),
});
|
go-zero
|
https://github.com/zeromicro/go-zero
|
cf6c3491188bceb286806c2ec4e5be9b19ee505b
|
Kevin Wan
|
2023-01-01 09:51:53
|
fix: #2735 (#2736)
|
* fix: #2735
* chore: make error consistent
|
fix: #2735 (#2736)
* fix: #2735
* chore: make error consistent
|
diff --git a/core/mapping/jsonunmarshaler.go b/core/mapping/jsonunmarshaler.go
index 540581a30344..f832224d57d9 100644
--- a/core/mapping/jsonunmarshaler.go
+++ b/core/mapping/jsonunmarshaler.go
@@ -34,7 +34,7 @@ func getJsonUnmarshaler(opts ...UnmarshalOption) *Unmarshaler {
}
func unmarshalJsonBytes(content []byte, v interface{}, unmarshaler *Unmarshaler) error {
- var m map[string]interface{}
+ var m interface{}
if err := jsonx.Unmarshal(content, &m); err != nil {
return err
}
@@ -43,7 +43,7 @@ func unmarshalJsonBytes(content []byte, v interface{}, unmarshaler *Unmarshaler)
}
func unmarshalJsonReader(reader io.Reader, v interface{}, unmarshaler *Unmarshaler) error {
- var m map[string]interface{}
+ var m interface{}
if err := jsonx.UnmarshalFromReader(reader, &m); err != nil {
return err
}
diff --git a/core/mapping/jsonunmarshaler_test.go b/core/mapping/jsonunmarshaler_test.go
index 28615d31b04e..05af99c9044b 100644
--- a/core/mapping/jsonunmarshaler_test.go
+++ b/core/mapping/jsonunmarshaler_test.go
@@ -856,8 +856,7 @@ func TestUnmarshalBytesError(t *testing.T) {
}
err := UnmarshalJsonBytes([]byte(payload), &v)
- assert.NotNil(t, err)
- assert.True(t, strings.Contains(err.Error(), payload))
+ assert.Equal(t, errTypeMismatch, err)
}
func TestUnmarshalReaderError(t *testing.T) {
@@ -867,9 +866,7 @@ func TestUnmarshalReaderError(t *testing.T) {
Any string
}
- err := UnmarshalJsonReader(reader, &v)
- assert.NotNil(t, err)
- assert.True(t, strings.Contains(err.Error(), payload))
+ assert.Equal(t, errTypeMismatch, UnmarshalJsonReader(reader, &v))
}
func TestUnmarshalMap(t *testing.T) {
@@ -920,3 +917,16 @@ func TestUnmarshalMap(t *testing.T) {
assert.Equal(t, "foo", v.Any)
})
}
+
+func TestUnmarshalJsonArray(t *testing.T) {
+ var v []struct {
+ Name string `json:"name"`
+ Age int `json:"age"`
+ }
+
+ body := `[{"name":"kevin", "age": 18}]`
+ assert.NoError(t, UnmarshalJsonBytes([]byte(body), &v))
+ assert.Equal(t, 1, len(v))
+ assert.Equal(t, "kevin", v[0].Name)
+ assert.Equal(t, 18, v[0].Age)
+}
diff --git a/core/mapping/unmarshaler.go b/core/mapping/unmarshaler.go
index 767b29039967..e6c7425e2549 100644
--- a/core/mapping/unmarshaler.go
+++ b/core/mapping/unmarshaler.go
@@ -71,8 +71,29 @@ func UnmarshalKey(m map[string]interface{}, v interface{}) error {
}
// Unmarshal unmarshals m into v.
-func (u *Unmarshaler) Unmarshal(m map[string]interface{}, v interface{}) error {
- return u.UnmarshalValuer(mapValuer(m), v)
+func (u *Unmarshaler) Unmarshal(i interface{}, v interface{}) error {
+ valueType := reflect.TypeOf(v)
+ if valueType.Kind() != reflect.Ptr {
+ return errValueNotSettable
+ }
+
+ elemType := valueType.Elem()
+ switch iv := i.(type) {
+ case map[string]interface{}:
+ if elemType.Kind() != reflect.Struct {
+ return errTypeMismatch
+ }
+
+ return u.UnmarshalValuer(mapValuer(iv), v)
+ case []interface{}:
+ if elemType.Kind() != reflect.Slice {
+ return errTypeMismatch
+ }
+
+ return u.fillSlice(elemType, reflect.ValueOf(v).Elem(), iv)
+ default:
+ return errUnsupportedType
+ }
}
// UnmarshalValuer unmarshals m into v.
diff --git a/core/mapping/unmarshaler_test.go b/core/mapping/unmarshaler_test.go
index c45b0600c7ac..8916e1838613 100644
--- a/core/mapping/unmarshaler_test.go
+++ b/core/mapping/unmarshaler_test.go
@@ -23,7 +23,14 @@ func TestUnmarshalWithFullNameNotStruct(t *testing.T) {
var s map[string]interface{}
content := []byte(`{"name":"xiaoming"}`)
err := UnmarshalJsonBytes(content, &s)
- assert.Equal(t, errValueNotStruct, err)
+ assert.Equal(t, errTypeMismatch, err)
+}
+
+func TestUnmarshalValueNotSettable(t *testing.T) {
+ var s map[string]interface{}
+ content := []byte(`{"name":"xiaoming"}`)
+ err := UnmarshalJsonBytes(content, s)
+ assert.Equal(t, errValueNotSettable, err)
}
func TestUnmarshalWithoutTagName(t *testing.T) {
diff --git a/rest/httpx/requests_test.go b/rest/httpx/requests_test.go
index 70c35c1d1df8..d6601f3321d2 100644
--- a/rest/httpx/requests_test.go
+++ b/rest/httpx/requests_test.go
@@ -223,6 +223,22 @@ func TestParseJsonBody(t *testing.T) {
assert.Equal(t, "", v.Name)
assert.Equal(t, 0, v.Age)
})
+
+ t.Run("array body", func(t *testing.T) {
+ var v []struct {
+ Name string `json:"name"`
+ Age int `json:"age"`
+ }
+
+ body := `[{"name":"kevin", "age": 18}]`
+ r := httptest.NewRequest(http.MethodPost, "/", strings.NewReader(body))
+ r.Header.Set(ContentType, header.JsonContentType)
+
+ assert.NoError(t, ParseJsonBody(r, &v))
+ assert.Equal(t, 1, len(v))
+ assert.Equal(t, "kevin", v[0].Name)
+ assert.Equal(t, 18, v[0].Age)
+ })
}
func TestParseRequired(t *testing.T) {
|
AutoGPT
|
https://github.com/Significant-Gravitas/AutoGPT
|
4db4ca08b2f4e9673a4b2fb4cd869f09ea282b5b
|
Reinier van der Leer
|
2024-04-22 22:10:48
|
refactor(agent): Tweak `model_providers.schema` for easier use
|
- Set default values for `ProviderBudget` / `ModelProviderBudget` fields
- Remove redundant field redefinitions on `ModelProviderBudget` class
- Change `ModelProviderUsage.update_usage(..)` and `ModelProviderBudget.update_usage_and_cost(..)` signatures for easier use
- Change `ModelProviderBudget.usage` from `ModelProviderUsage` to `defaultdict[str, ModelProviderUsage]` for per-model usage tracking
- Fix `ChatModelInfo`/`EmbeddingModelInfo` `service` attribute: rename from `llm_service` to match base class and fix types.
This makes it unnecessary to specify the `service` field when creating a `ChatModelInfo` or `EmbeddingModelInfo` object.
- Use `defaultdict(ModelProviderBudget)` for task budget tracking in agent_protocol_server.py
|
refactor(agent): Tweak `model_providers.schema` for easier use
- Set default values for `ProviderBudget` / `ModelProviderBudget` fields
- Remove redundant field redefinitions on `ModelProviderBudget` class
- Change `ModelProviderUsage.update_usage(..)` and `ModelProviderBudget.update_usage_and_cost(..)` signatures for easier use
- Change `ModelProviderBudget.usage` from `ModelProviderUsage` to `defaultdict[str, ModelProviderUsage]` for per-model usage tracking
- Fix `ChatModelInfo`/`EmbeddingModelInfo` `service` attribute: rename from `llm_service` to match base class and fix types.
This makes it unnecessary to specify the `service` field when creating a `ChatModelInfo` or `EmbeddingModelInfo` object.
- Use `defaultdict(ModelProviderBudget)` for task budget tracking in agent_protocol_server.py
|
diff --git a/autogpts/autogpt/autogpt/app/agent_protocol_server.py b/autogpts/autogpt/autogpt/app/agent_protocol_server.py
index dd40545b609d..fe0a3a0ee9d9 100644
--- a/autogpts/autogpt/autogpt/app/agent_protocol_server.py
+++ b/autogpts/autogpt/autogpt/app/agent_protocol_server.py
@@ -1,6 +1,7 @@
import logging
import os
import pathlib
+from collections import defaultdict
from io import BytesIO
from uuid import uuid4
@@ -60,7 +61,7 @@ def __init__(
self.file_storage = file_storage
self.llm_provider = llm_provider
self.agent_manager = AgentManager(file_storage)
- self._task_budgets = {}
+ self._task_budgets = defaultdict(ModelProviderBudget)
async def start(self, port: int = 8000, router: APIRouter = base_router):
"""Start the agent server."""
@@ -461,9 +462,7 @@ def _get_task_llm_provider(
"""
Configures the LLM provider with headers to link outgoing requests to the task.
"""
- task_llm_budget = self._task_budgets.get(
- task.task_id, self.llm_provider.default_settings.budget.copy(deep=True)
- )
+ task_llm_budget = self._task_budgets[task.task_id]
task_llm_provider_config = self.llm_provider._configuration.copy(deep=True)
_extra_request_headers = task_llm_provider_config.extra_request_headers
diff --git a/autogpts/autogpt/autogpt/core/resource/model_providers/openai.py b/autogpts/autogpt/autogpt/core/resource/model_providers/openai.py
index 2ebb56638ea7..8742827647ea 100644
--- a/autogpts/autogpt/autogpt/core/resource/model_providers/openai.py
+++ b/autogpts/autogpt/autogpt/core/resource/model_providers/openai.py
@@ -1,6 +1,5 @@
import enum
import logging
-import math
import os
from pathlib import Path
from typing import Any, Callable, Coroutine, Iterator, Optional, ParamSpec, TypeVar
@@ -37,9 +36,7 @@
ModelProviderConfiguration,
ModelProviderCredentials,
ModelProviderName,
- ModelProviderService,
ModelProviderSettings,
- ModelProviderUsage,
ModelTokenizer,
)
from autogpt.core.utils.json_schema import JSONSchema
@@ -49,7 +46,6 @@
_P = ParamSpec("_P")
OpenAIEmbeddingParser = Callable[[Embedding], Embedding]
-OpenAIChatParser = Callable[[str], dict]
class OpenAIModelName(str, enum.Enum):
@@ -87,7 +83,6 @@ class OpenAIModelName(str, enum.Enum):
for info in [
EmbeddingModelInfo(
name=OpenAIModelName.EMBEDDING_v2,
- service=ModelProviderService.EMBEDDING,
provider_name=ModelProviderName.OPENAI,
prompt_token_cost=0.0001 / 1000,
max_tokens=8191,
@@ -95,7 +90,6 @@ class OpenAIModelName(str, enum.Enum):
),
EmbeddingModelInfo(
name=OpenAIModelName.EMBEDDING_v3_S,
- service=ModelProviderService.EMBEDDING,
provider_name=ModelProviderName.OPENAI,
prompt_token_cost=0.00002 / 1000,
max_tokens=8191,
@@ -103,7 +97,6 @@ class OpenAIModelName(str, enum.Enum):
),
EmbeddingModelInfo(
name=OpenAIModelName.EMBEDDING_v3_L,
- service=ModelProviderService.EMBEDDING,
provider_name=ModelProviderName.OPENAI,
prompt_token_cost=0.00013 / 1000,
max_tokens=8191,
@@ -118,7 +111,6 @@ class OpenAIModelName(str, enum.Enum):
for info in [
ChatModelInfo(
name=OpenAIModelName.GPT3_v1,
- service=ModelProviderService.CHAT,
provider_name=ModelProviderName.OPENAI,
prompt_token_cost=0.0015 / 1000,
completion_token_cost=0.002 / 1000,
@@ -127,7 +119,6 @@ class OpenAIModelName(str, enum.Enum):
),
ChatModelInfo(
name=OpenAIModelName.GPT3_v2_16k,
- service=ModelProviderService.CHAT,
provider_name=ModelProviderName.OPENAI,
prompt_token_cost=0.003 / 1000,
completion_token_cost=0.004 / 1000,
@@ -136,7 +127,6 @@ class OpenAIModelName(str, enum.Enum):
),
ChatModelInfo(
name=OpenAIModelName.GPT3_v3,
- service=ModelProviderService.CHAT,
provider_name=ModelProviderName.OPENAI,
prompt_token_cost=0.001 / 1000,
completion_token_cost=0.002 / 1000,
@@ -145,7 +135,6 @@ class OpenAIModelName(str, enum.Enum):
),
ChatModelInfo(
name=OpenAIModelName.GPT3_v4,
- service=ModelProviderService.CHAT,
provider_name=ModelProviderName.OPENAI,
prompt_token_cost=0.0005 / 1000,
completion_token_cost=0.0015 / 1000,
@@ -154,7 +143,6 @@ class OpenAIModelName(str, enum.Enum):
),
ChatModelInfo(
name=OpenAIModelName.GPT4_v1,
- service=ModelProviderService.CHAT,
provider_name=ModelProviderName.OPENAI,
prompt_token_cost=0.03 / 1000,
completion_token_cost=0.06 / 1000,
@@ -163,7 +151,6 @@ class OpenAIModelName(str, enum.Enum):
),
ChatModelInfo(
name=OpenAIModelName.GPT4_v1_32k,
- service=ModelProviderService.CHAT,
provider_name=ModelProviderName.OPENAI,
prompt_token_cost=0.06 / 1000,
completion_token_cost=0.12 / 1000,
@@ -172,7 +159,6 @@ class OpenAIModelName(str, enum.Enum):
),
ChatModelInfo(
name=OpenAIModelName.GPT4_TURBO,
- service=ModelProviderService.CHAT,
provider_name=ModelProviderName.OPENAI,
prompt_token_cost=0.01 / 1000,
completion_token_cost=0.03 / 1000,
@@ -305,21 +291,12 @@ class OpenAIProvider(
retries_per_request=10,
),
credentials=None,
- budget=ModelProviderBudget(
- total_budget=math.inf,
- total_cost=0.0,
- remaining_budget=math.inf,
- usage=ModelProviderUsage(
- prompt_tokens=0,
- completion_tokens=0,
- total_tokens=0,
- ),
- ),
+ budget=ModelProviderBudget(),
)
- _budget: ModelProviderBudget
_configuration: OpenAIConfiguration
_credentials: OpenAICredentials
+ _budget: ModelProviderBudget
def __init__(
self,
@@ -648,12 +625,9 @@ async def _create_chat_completion_with_retry(
prompt_tokens_used = completion_tokens_used = 0
cost = self._budget.update_usage_and_cost(
- ChatModelResponse(
- response=AssistantChatMessage(content=None),
- model_info=OPEN_AI_CHAT_MODELS[model],
- prompt_tokens_used=prompt_tokens_used,
- completion_tokens_used=completion_tokens_used,
- )
+ model_info=OPEN_AI_CHAT_MODELS[model],
+ input_tokens_used=prompt_tokens_used,
+ output_tokens_used=completion_tokens_used,
)
self._logger.debug(
f"Completion usage: {prompt_tokens_used} input, "
diff --git a/autogpts/autogpt/autogpt/core/resource/model_providers/schema.py b/autogpts/autogpt/autogpt/core/resource/model_providers/schema.py
index 327718c1117d..dd69b526ea92 100644
--- a/autogpts/autogpt/autogpt/core/resource/model_providers/schema.py
+++ b/autogpts/autogpt/autogpt/core/resource/model_providers/schema.py
@@ -1,6 +1,7 @@
import abc
import enum
import math
+from collections import defaultdict
from typing import (
Any,
Callable,
@@ -90,7 +91,7 @@ class AssistantToolCallDict(TypedDict):
class AssistantChatMessage(ChatMessage):
- role: Literal["assistant"] = "assistant"
+ role: Literal[ChatMessage.Role.ASSISTANT] = ChatMessage.Role.ASSISTANT
content: Optional[str]
tool_calls: Optional[list[AssistantToolCall]] = None
@@ -187,39 +188,34 @@ class ModelProviderUsage(ProviderUsage):
completion_tokens: int = 0
prompt_tokens: int = 0
- total_tokens: int = 0
def update_usage(
self,
- model_response: ModelResponse,
+ input_tokens_used: int,
+ output_tokens_used: int = 0,
) -> None:
- self.completion_tokens += model_response.completion_tokens_used
- self.prompt_tokens += model_response.prompt_tokens_used
- self.total_tokens += (
- model_response.completion_tokens_used + model_response.prompt_tokens_used
- )
+ self.prompt_tokens += input_tokens_used
+ self.completion_tokens += output_tokens_used
class ModelProviderBudget(ProviderBudget):
- total_budget: float = UserConfigurable()
- total_cost: float
- remaining_budget: float
- usage: ModelProviderUsage
+ usage: defaultdict[str, ModelProviderUsage] = defaultdict(ModelProviderUsage)
def update_usage_and_cost(
self,
- model_response: ModelResponse,
+ model_info: ModelInfo,
+ input_tokens_used: int,
+ output_tokens_used: int = 0,
) -> float:
"""Update the usage and cost of the provider.
Returns:
float: The (calculated) cost of the given model response.
"""
- model_info = model_response.model_info
- self.usage.update_usage(model_response)
+ self.usage[model_info.name].update_usage(input_tokens_used, output_tokens_used)
incurred_cost = (
- model_response.completion_tokens_used * model_info.completion_token_cost
- + model_response.prompt_tokens_used * model_info.prompt_token_cost
+ output_tokens_used * model_info.completion_token_cost
+ + input_tokens_used * model_info.prompt_token_cost
)
self.total_cost += incurred_cost
self.remaining_budget -= incurred_cost
@@ -230,7 +226,7 @@ class ModelProviderSettings(ProviderSettings):
resource_type: ResourceType = ResourceType.MODEL
configuration: ModelProviderConfiguration
credentials: ModelProviderCredentials
- budget: ModelProviderBudget
+ budget: Optional[ModelProviderBudget] = None
class ModelProvider(abc.ABC):
@@ -238,8 +234,8 @@ class ModelProvider(abc.ABC):
default_settings: ClassVar[ModelProviderSettings]
- _budget: Optional[ModelProviderBudget]
_configuration: ModelProviderConfiguration
+ _budget: Optional[ModelProviderBudget] = None
@abc.abstractmethod
def count_tokens(self, text: str, model_name: str) -> int:
@@ -284,7 +280,7 @@ def decode(self, tokens: list) -> str:
class EmbeddingModelInfo(ModelInfo):
"""Struct for embedding model information."""
- llm_service = ModelProviderService.EMBEDDING
+ service: Literal[ModelProviderService.EMBEDDING] = ModelProviderService.EMBEDDING
max_tokens: int
embedding_dimensions: int
@@ -322,7 +318,7 @@ async def create_embedding(
class ChatModelInfo(ModelInfo):
"""Struct for language model information."""
- llm_service = ModelProviderService.CHAT
+ service: Literal[ModelProviderService.CHAT] = ModelProviderService.CHAT
max_tokens: int
has_function_call_api: bool = False
diff --git a/autogpts/autogpt/autogpt/core/resource/schema.py b/autogpts/autogpt/autogpt/core/resource/schema.py
index d8cc1de313ed..0da275ee2704 100644
--- a/autogpts/autogpt/autogpt/core/resource/schema.py
+++ b/autogpts/autogpt/autogpt/core/resource/schema.py
@@ -1,5 +1,6 @@
import abc
import enum
+import math
from pydantic import BaseModel, SecretBytes, SecretField, SecretStr
@@ -25,9 +26,9 @@ def update_usage(self, *args, **kwargs) -> None:
class ProviderBudget(SystemConfiguration):
- total_budget: float = UserConfigurable()
- total_cost: float
- remaining_budget: float
+ total_budget: float = UserConfigurable(math.inf)
+ total_cost: float = 0
+ remaining_budget: float = math.inf
usage: ProviderUsage
@abc.abstractmethod
diff --git a/autogpts/autogpt/tests/unit/test_config.py b/autogpts/autogpt/tests/unit/test_config.py
index 2eca547e872c..70d1b65b01e3 100644
--- a/autogpts/autogpt/tests/unit/test_config.py
+++ b/autogpts/autogpt/tests/unit/test_config.py
@@ -18,7 +18,6 @@
from autogpt.core.resource.model_providers.schema import (
ChatModelInfo,
ModelProviderName,
- ModelProviderService,
)
@@ -153,7 +152,6 @@ async def test_create_config_gpt4only(config: Config) -> None:
) as mock_get_models:
mock_get_models.return_value = [
ChatModelInfo(
- service=ModelProviderService.CHAT,
name=GPT_4_MODEL,
provider_name=ModelProviderName.OPENAI,
max_tokens=4096,
@@ -174,7 +172,6 @@ async def test_create_config_gpt3only(config: Config) -> None:
) as mock_get_models:
mock_get_models.return_value = [
ChatModelInfo(
- service=ModelProviderService.CHAT,
name=GPT_3_MODEL,
provider_name=ModelProviderName.OPENAI,
max_tokens=4096,
|
linkerd2
|
https://github.com/linkerd/linkerd2
|
b4beb52c64ae00143a506aa98870ad2e0b86e4d9
|
dependabot[bot]
|
2025-03-14 17:59:33
|
build(deps): bump tj-actions/changed-files from 45.0.7 to 45.0.8 (#13798)
|
Bumps [tj-actions/changed-files](https://github.com/tj-actions/changed-files) from 45.0.7 to 45.0.8.
- [Release notes](https://github.com/tj-actions/changed-files/releases)
- [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md)
- [Commits](https://github.com/tj-actions/changed-files/compare/dcc7a0cba800f454d79fff4b993e8c3555bcc0a8...9200e69727eb73eb060652b19946b8a2fdfb654b)
---
|
build(deps): bump tj-actions/changed-files from 45.0.7 to 45.0.8 (#13798)
Bumps [tj-actions/changed-files](https://github.com/tj-actions/changed-files) from 45.0.7 to 45.0.8.
- [Release notes](https://github.com/tj-actions/changed-files/releases)
- [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md)
- [Commits](https://github.com/tj-actions/changed-files/compare/dcc7a0cba800f454d79fff4b993e8c3555bcc0a8...9200e69727eb73eb060652b19946b8a2fdfb654b)
---
updated-dependencies:
- dependency-name: tj-actions/changed-files
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
|
diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml
index 61e4e3c66b89f..8a507a6730fd1 100644
--- a/.github/workflows/go.yml
+++ b/.github/workflows/go.yml
@@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- - uses: tj-actions/changed-files@dcc7a0cba800f454d79fff4b993e8c3555bcc0a8
+ - uses: tj-actions/changed-files@9200e69727eb73eb060652b19946b8a2fdfb654b
id: changed
with:
files: |
diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml
index 085398a743036..4913d63a98de6 100644
--- a/.github/workflows/integration.yml
+++ b/.github/workflows/integration.yml
@@ -29,7 +29,7 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- id: tag
run: echo "tag=$(CI_FORCE_CLEAN=1 bin/root-tag)" >> "$GITHUB_OUTPUT"
- - uses: tj-actions/changed-files@dcc7a0cba800f454d79fff4b993e8c3555bcc0a8
+ - uses: tj-actions/changed-files@9200e69727eb73eb060652b19946b8a2fdfb654b
id: core
with:
files: |
|
casdoor
|
https://github.com/casdoor/casdoor
|
effd25704033a4efbf8d60756e8fd7329496b543
|
DSP
|
2024-07-18 18:34:17
|
feat: fix isPasswordWithLdapEnabled logic in handleBind() for redirecting to other LDAP sources (#3059)
|
* Added parameters to function call in server.go
Added needed parameters for redirection to other LDAP sources to function correctly and not always run into the "wrong credentials" error
* Update server.go
---------
|
feat: fix isPasswordWithLdapEnabled logic in handleBind() for redirecting to other LDAP sources (#3059)
* Added parameters to function call in server.go
Added needed parameters for redirection to other LDAP sources to function correctly and not always run into the "wrong credentials" error
* Update server.go
---------
Co-authored-by: Yang Luo <[email protected]>
|
diff --git a/ldap/server.go b/ldap/server.go
index cf1aa4ff97f2..edf332b94e25 100644
--- a/ldap/server.go
+++ b/ldap/server.go
@@ -59,7 +59,15 @@ func handleBind(w ldap.ResponseWriter, m *ldap.Message) {
}
bindPassword := string(r.AuthenticationSimple())
- bindUser, err := object.CheckUserPassword(bindOrg, bindUsername, bindPassword, "en")
+
+ enableCaptcha := false
+ isSigninViaLdap := false
+ isPasswordWithLdapEnabled := false
+ if bindPassword != "" {
+ isPasswordWithLdapEnabled = true
+ }
+
+ bindUser, err := object.CheckUserPassword(bindOrg, bindUsername, bindPassword, "en", enableCaptcha, isSigninViaLdap, isPasswordWithLdapEnabled)
if err != nil {
log.Printf("Bind failed User=%s, Pass=%#v, ErrMsg=%s", string(r.Name()), r.Authentication(), err)
res.SetResultCode(ldap.LDAPResultInvalidCredentials)
|
sentry
|
https://github.com/getsentry/sentry
|
5a0766f2206d196ca0b86efc0c5330cabe206d46
|
Tony
|
2021-01-07 20:59:48
|
fix(vitals): Vitals percentages should not show when there is no vital data (#22946)
|
On the transaction vitals page, when there is no data for any of the web vitals,
the percentages currently display as emdash. This should not be displayed at
all when there is no data.
|
fix(vitals): Vitals percentages should not show when there is no vital data (#22946)
On the transaction vitals page, when there is no data for any of the web vitals,
the percentages currently display as emdash. This should not be displayed at
all when there is no data.
|
diff --git a/src/sentry/static/sentry/app/views/performance/transactionVitals/vitalCard.tsx b/src/sentry/static/sentry/app/views/performance/transactionVitals/vitalCard.tsx
index ea1fa880655e42..10f3e63c81c729 100644
--- a/src/sentry/static/sentry/app/views/performance/transactionVitals/vitalCard.tsx
+++ b/src/sentry/static/sentry/app/views/performance/transactionVitals/vitalCard.tsx
@@ -307,6 +307,7 @@ class VitalCard extends React.Component<Props, State> {
hideBar
hideVitalPercentNames
hideDurationDetail
+ hideEmptyState
/>
</PercentContainer>
</Feature>
diff --git a/src/sentry/static/sentry/app/views/performance/vitalDetail/vitalInfo.tsx b/src/sentry/static/sentry/app/views/performance/vitalDetail/vitalInfo.tsx
index bfd613e06bd903..82b7725bf0dee4 100644
--- a/src/sentry/static/sentry/app/views/performance/vitalDetail/vitalInfo.tsx
+++ b/src/sentry/static/sentry/app/views/performance/vitalDetail/vitalInfo.tsx
@@ -14,6 +14,7 @@ type Props = {
location: Location;
vitalName: WebVital;
hideBar?: boolean;
+ hideEmptyState?: boolean;
hideVitalPercentNames?: boolean;
hideDurationDetail?: boolean;
};
diff --git a/src/sentry/static/sentry/app/views/performance/vitalsCards.tsx b/src/sentry/static/sentry/app/views/performance/vitalsCards.tsx
index af1abb821d18a9..506654792737e5 100644
--- a/src/sentry/static/sentry/app/views/performance/vitalsCards.tsx
+++ b/src/sentry/static/sentry/app/views/performance/vitalsCards.tsx
@@ -123,6 +123,7 @@ type CardProps = Omit<Props, 'projects'> & {
isLoading?: boolean;
noBorder?: boolean;
hideBar?: boolean;
+ hideEmptyState?: boolean;
};
const NonPanel = styled('div')``;
@@ -206,7 +207,7 @@ function getColorStopsFromPercents(percents: Percent[]) {
}
export function VitalsCard(props: CardProps) {
- const {isLoading, tableData, vitalName, noBorder, hideBar} = props;
+ const {isLoading, tableData, vitalName, noBorder, hideBar, hideEmptyState} = props;
const measurement = vitalMap[vitalName];
@@ -216,6 +217,7 @@ export function VitalsCard(props: CardProps) {
noBorder={noBorder}
measurement={measurement}
titleDescription={vitalName ? vitalDescription[vitalName] || '' : ''}
+ hideEmptyState={hideEmptyState}
/>
);
}
@@ -229,6 +231,7 @@ export function VitalsCard(props: CardProps) {
noBorder={noBorder}
measurement={measurement}
titleDescription={vitalName ? vitalDescription[vitalName] || '' : ''}
+ hideEmptyState={hideEmptyState}
/>
);
}
@@ -354,11 +357,16 @@ type BlankCardProps = {
noBorder?: boolean;
measurement?: string;
titleDescription?: string;
+ hideEmptyState?: boolean;
};
const BlankCard = (props: BlankCardProps) => {
const Container = props.noBorder ? NonPanel : VitalCard;
+ if (props.hideEmptyState) {
+ return null;
+ }
+
return (
<Container interactive>
{props.noBorder || (
|
angular
|
https://github.com/angular/angular
|
14b7dfa00792cc571fd58d3a7adc6cb50abb42db
|
George Kalpakas
|
2017-04-14 00:25:33
|
fix(aio): create a proper commit link on preview comments (#15941)
|
Previously, only a few characters of the SHA would appear on the preview link
comment posted on the PR. This was usually enough for GitHub to create a link to
the corresponding commit, but it was possible to have collisions with other
commits with the same first characters (which prevented GitHub from identifying
the correct commit and create a link.)
This commit fixes this issue by including the full SHA on the commentso GitHub
can identify the correct commit and create the link. GitHub will automatically
truncate the link text (by default to 7 chars unless more are necessary to
uniquely identify the commit).
|
fix(aio): create a proper commit link on preview comments (#15941)
Previously, only a few characters of the SHA would appear on the preview link
comment posted on the PR. This was usually enough for GitHub to create a link to
the corresponding commit, but it was possible to have collisions with other
commits with the same first characters (which prevented GitHub from identifying
the correct commit and create a link.)
This commit fixes this issue by including the full SHA on the commentso GitHub
can identify the correct commit and create the link. GitHub will automatically
truncate the link text (by default to 7 chars unless more are necessary to
uniquely identify the commit).
|
diff --git a/aio/aio-builds-setup/dockerbuild/scripts-js/lib/upload-server/upload-server-factory.ts b/aio/aio-builds-setup/dockerbuild/scripts-js/lib/upload-server/upload-server-factory.ts
index 7f174be45a4873..cace76d61f2264 100644
--- a/aio/aio-builds-setup/dockerbuild/scripts-js/lib/upload-server/upload-server-factory.ts
+++ b/aio/aio-builds-setup/dockerbuild/scripts-js/lib/upload-server/upload-server-factory.ts
@@ -58,7 +58,7 @@ class UploadServerFactory {
const githubPullRequests = new GithubPullRequests(githubToken, repoSlug);
buildCreator.on(CreatedBuildEvent.type, ({pr, sha}: CreatedBuildEvent) => {
- const body = `The angular.io preview for ${sha.slice(0, 7)} is available [here][1].\n\n` +
+ const body = `The angular.io preview for ${sha} is available [here][1].\n\n` +
`[1]: https://pr${pr}-${sha}.${domainName}/`;
githubPullRequests.addComment(pr, body);
diff --git a/aio/aio-builds-setup/dockerbuild/scripts-js/test/upload-server/upload-server-factory.spec.ts b/aio/aio-builds-setup/dockerbuild/scripts-js/test/upload-server/upload-server-factory.spec.ts
index 3784b747a295a8..276c328210a9e0 100644
--- a/aio/aio-builds-setup/dockerbuild/scripts-js/test/upload-server/upload-server-factory.spec.ts
+++ b/aio/aio-builds-setup/dockerbuild/scripts-js/test/upload-server/upload-server-factory.spec.ts
@@ -143,7 +143,7 @@ describe('uploadServerFactory', () => {
it('should post a comment on GitHub on \'build.created\'', () => {
const prsAddCommentSpy = spyOn(GithubPullRequests.prototype, 'addComment');
- const commentBody = 'The angular.io preview for 1234567 is available [here][1].\n\n' +
+ const commentBody = 'The angular.io preview for 1234567890 is available [here][1].\n\n' +
'[1]: https://pr42-1234567890.domain.name/';
buildCreator.emit(CreatedBuildEvent.type, {pr: 42, sha: '1234567890'});
|
polybar
|
https://github.com/polybar/polybar
|
efbd8e394f52d38ba23845c369ab7afc74b60536
|
Patrick Ziegler
|
2022-04-28 00:39:59
|
fix(bar): Update struts when hiding (#2702)
|
When the bar is hidden, the struts should be 0 so that WMs can resize
their windows and not leave a gap.
|
fix(bar): Update struts when hiding (#2702)
When the bar is hidden, the struts should be 0 so that WMs can resize
their windows and not leave a gap.
Ref #2701
|
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 05f977538..c3ee2e7ba 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `internal/battery`: `poll-interval` not working ([`#2649`](https://github.com/polybar/polybar/issues/2649), [`#2677`](https://github.com/polybar/polybar/pull/2677))
- ipc: Polybar failing to open IPC channel after another user already ran polybar, if `XDG_RUNTIME_DIR` is not set ([`#2683`](https://github.com/polybar/polybar/issues/2683), [`#2684`](https://github.com/polybar/polybar/pull/2684))
- No overlines/underlines being drawn when using offsets ([`#2685`](https://github.com/polybar/polybar/pull/2685))
+- Update struts (`_NET_WM_STRUT_PARTIAL`) when hiding the bar ([`#2702`](https://github.com/polybar/polybar/pull/2702))
## [3.6.2] - 2022-04-03
### Fixed
diff --git a/src/components/bar.cpp b/src/components/bar.cpp
index b2efa93c7..7a08f67a2 100644
--- a/src/components/bar.cpp
+++ b/src/components/bar.cpp
@@ -440,10 +440,11 @@ void bar::hide() {
try {
m_log.info("Hiding bar window");
+ m_visible = false;
+ reconfigure_struts();
m_sig.emit(visibility_change{false});
m_connection.unmap_window_checked(m_opts.window);
m_connection.flush();
- m_visible = false;
} catch (const exception& err) {
m_log.err("Failed to unmap bar window (err=%s", err.what());
}
@@ -556,42 +557,46 @@ void bar::reconfigure_pos() {
* Reconfigure window strut values
*/
void bar::reconfigure_struts() {
- auto geom = m_connection.get_geometry(m_screen->root());
- int h = m_opts.size.h + m_opts.offset.y;
+ window win{m_connection, m_opts.window};
+ if (m_visible) {
+ auto geom = m_connection.get_geometry(m_screen->root());
+ int h = m_opts.size.h + m_opts.offset.y;
- // Apply user-defined margins
- if (m_opts.bottom) {
- h += m_opts.strut.top;
- } else {
- h += m_opts.strut.bottom;
- }
+ // Apply user-defined margins
+ if (m_opts.bottom) {
+ h += m_opts.strut.top;
+ } else {
+ h += m_opts.strut.bottom;
+ }
- h = std::max(h, 0);
+ h = std::max(h, 0);
- int correction = 0;
+ int correction = 0;
- // Only apply correction if any space is requested
- if (h > 0) {
- /*
- * Strut coordinates have to be relative to root window and not any monitor.
- * If any monitor is not aligned at the top or bottom
- */
- if (m_opts.bottom) {
+ // Only apply correction if any space is requested
+ if (h > 0) {
/*
- * For bottom-algined bars, the correction is the number of pixels between
- * the root window's bottom edge and the monitor's bottom edge
+ * Strut coordinates have to be relative to root window and not any monitor.
+ * If any monitor is not aligned at the top or bottom
*/
- correction = geom->height - (m_opts.monitor->y + m_opts.monitor->h);
- } else {
- // For top-aligned bars, we simply add the monitor's y-position
- correction = m_opts.monitor->y;
- }
+ if (m_opts.bottom) {
+ /*
+ * For bottom-algined bars, the correction is the number of pixels between
+ * the root window's bottom edge and the monitor's bottom edge
+ */
+ correction = geom->height - (m_opts.monitor->y + m_opts.monitor->h);
+ } else {
+ // For top-aligned bars, we simply add the monitor's y-position
+ correction = m_opts.monitor->y;
+ }
- correction = std::max(correction, 0);
+ correction = std::max(correction, 0);
+ }
+ win.reconfigure_struts(m_opts.size.w, h + correction, m_opts.pos.x, m_opts.bottom);
+ } else {
+ // Set struts to 0 for invisible bars
+ win.reconfigure_struts(0, 0, 0, m_opts.bottom);
}
-
- window win{m_connection, m_opts.window};
- win.reconfigure_struts(m_opts.size.w, h + correction, m_opts.pos.x, m_opts.bottom);
}
/**
@@ -634,6 +639,8 @@ void bar::broadcast_visibility() {
}
void bar::map_window() {
+ m_visible = true;
+
/**
* First reconfigures the window so that WMs that discard some information
* when unmapping have the correct window properties (geometry etc).
@@ -648,8 +655,6 @@ void bar::map_window() {
* mapping. Additionally updating the window position after mapping seems to fix that.
*/
reconfigure_pos();
-
- m_visible = true;
}
void bar::trigger_click(mousebtn btn, int pos) {
diff --git a/src/x11/window.cpp b/src/x11/window.cpp
index 0c31505aa..601cc003d 100644
--- a/src/x11/window.cpp
+++ b/src/x11/window.cpp
@@ -57,14 +57,16 @@ window window::reconfigure_pos(short int x, short int y) {
window window::reconfigure_struts(uint32_t w, uint32_t strut, uint32_t x, bool bottom) {
std::array<uint32_t, 12> values{};
+ uint32_t end_x = std::max<int>(0, x + w - 1);
+
if (bottom) {
values[to_integral(strut::BOTTOM)] = strut;
values[to_integral(strut::BOTTOM_START_X)] = x;
- values[to_integral(strut::BOTTOM_END_X)] = x + w - 1;
+ values[to_integral(strut::BOTTOM_END_X)] = end_x;
} else {
values[to_integral(strut::TOP)] = strut;
values[to_integral(strut::TOP_START_X)] = x;
- values[to_integral(strut::TOP_END_X)] = x + w - 1;
+ values[to_integral(strut::TOP_END_X)] = end_x;
}
connection().change_property_checked(
|
leetcode
|
https://github.com/doocs/leetcode
|
19fadded72a9e35d58f665d9eb7ea1ab5c2dbd08
|
yanglbme
|
2022-09-21 18:43:02
|
feat: add solutions to lc problem: No.1488
|
No.1488.Avoid Flood in The City
|
feat: add solutions to lc problem: No.1488
No.1488.Avoid Flood in The City
|
diff --git a/solution/1400-1499/1488.Avoid Flood in The City/README.md b/solution/1400-1499/1488.Avoid Flood in The City/README.md
index cc7620a8bad81..7531f87997736 100644
--- a/solution/1400-1499/1488.Avoid Flood in The City/README.md
+++ b/solution/1400-1499/1488.Avoid Flood in The City/README.md
@@ -77,6 +77,16 @@
<!-- 这里可写通用的实现逻辑 -->
+**方法一:贪心 + 二分查找**
+
+将所有晴天都存入 `sunny` 数组或者有序集合中,使用哈希表 `rainy` 记录每个湖泊最近一次下雨的日期。初始化答案数组 `ans` 每个元素为 `-1`。
+
+遍历 `rains` 数组,对于每个下雨的日期 $i$,如果 `rainy[rains[i]]` 存在,说明该湖泊在之前下过雨,那么我们需要找到 `sunny` 数组中第一个大于 `rainy[rains[i]]` 的日期,将其替换为下雨的日期,否则说明无法阻止洪水,返回空数组。对于没下雨的日期 $i$,我们将 $i$ 存入 `sunny` 数组中,并且将 `ans[i]` 置为 `1`。
+
+遍历结束,返回答案数组。
+
+时间复杂度 $O(n\log n)$,空间复杂度 $O(n)$。其中 $n$ 为 `rains` 数组的长度。
+
<!-- tabs:start -->
### **Python3**
@@ -84,7 +94,24 @@
<!-- 这里可写当前语言的特殊实现逻辑 -->
```python
-
+class Solution:
+ def avoidFlood(self, rains: List[int]) -> List[int]:
+ n = len(rains)
+ ans = [-1] * n
+ sunny = []
+ rainy = {}
+ for i, v in enumerate(rains):
+ if v:
+ if v in rainy:
+ idx = bisect_right(sunny, rainy[v])
+ if idx == len(sunny):
+ return []
+ ans[sunny.pop(idx)] = v
+ rainy[v] = i
+ else:
+ sunny.append(i)
+ ans[i] = 1
+ return ans
```
### **Java**
@@ -92,7 +119,96 @@
<!-- 这里可写当前语言的特殊实现逻辑 -->
```java
+class Solution {
+ public int[] avoidFlood(int[] rains) {
+ int n = rains.length;
+ int[] ans = new int[n];
+ Arrays.fill(ans, -1);
+ TreeSet<Integer> sunny = new TreeSet<>();
+ Map<Integer, Integer> rainy = new HashMap<>();
+ for (int i = 0; i < n; ++i) {
+ int v = rains[i];
+ if (v > 0) {
+ if (rainy.containsKey(v)) {
+ Integer t = sunny.higher(rainy.get(v));
+ if (t == null) {
+ return new int[0];
+ }
+ ans[t] = v;
+ sunny.remove(t);
+ }
+ rainy.put(v, i);
+ } else {
+ sunny.add(i);
+ ans[i] = 1;
+ }
+ }
+ return ans;
+ }
+}
+```
+
+### **C++**
+
+```cpp
+class Solution {
+public:
+ vector<int> avoidFlood(vector<int>& rains) {
+ int n = rains.size();
+ vector<int> ans(n, -1);
+ set<int> sunny;
+ unordered_map<int, int> rainy;
+ for (int i = 0; i < n; ++i) {
+ int v = rains[i];
+ if (v) {
+ if (rainy.count(v)) {
+ auto it = sunny.upper_bound(rainy[v]);
+ if (it == sunny.end()) {
+ return {};
+ }
+ ans[*it] = v;
+ sunny.erase(it);
+ }
+ rainy[v] = i;
+ } else {
+ sunny.insert(i);
+ ans[i] = 1;
+ }
+ }
+ return ans;
+ }
+};
+```
+### **Go**
+
+```go
+func avoidFlood(rains []int) []int {
+ n := len(rains)
+ ans := make([]int, n)
+ for i := range ans {
+ ans[i] = -1
+ }
+ sunny := []int{}
+ rainy := map[int]int{}
+ for i, v := range rains {
+ if v > 0 {
+ if j, ok := rainy[v]; ok {
+ idx := sort.Search(len(sunny), func(i int) bool { return sunny[i] > j })
+ if idx == len(sunny) {
+ return []int{}
+ }
+ ans[sunny[idx]] = v
+ sunny = append(sunny[:idx], sunny[idx+1:]...)
+ }
+ rainy[v] = i
+ } else {
+ sunny = append(sunny, i)
+ ans[i] = 1
+ }
+ }
+ return ans
+}
```
### **...**
diff --git a/solution/1400-1499/1488.Avoid Flood in The City/README_EN.md b/solution/1400-1499/1488.Avoid Flood in The City/README_EN.md
index 8a97a5e03eff7..5d4ab249c4bfd 100644
--- a/solution/1400-1499/1488.Avoid Flood in The City/README_EN.md
+++ b/solution/1400-1499/1488.Avoid Flood in The City/README_EN.md
@@ -76,13 +76,119 @@ After that, it will rain over lakes [1,2]. It's easy to prove that no matter
### **Python3**
```python
-
+class Solution:
+ def avoidFlood(self, rains: List[int]) -> List[int]:
+ n = len(rains)
+ ans = [-1] * n
+ sunny = []
+ rainy = {}
+ for i, v in enumerate(rains):
+ if v:
+ if v in rainy:
+ idx = bisect_right(sunny, rainy[v])
+ if idx == len(sunny):
+ return []
+ ans[sunny.pop(idx)] = v
+ rainy[v] = i
+ else:
+ sunny.append(i)
+ ans[i] = 1
+ return ans
```
### **Java**
```java
+class Solution {
+ public int[] avoidFlood(int[] rains) {
+ int n = rains.length;
+ int[] ans = new int[n];
+ Arrays.fill(ans, -1);
+ TreeSet<Integer> sunny = new TreeSet<>();
+ Map<Integer, Integer> rainy = new HashMap<>();
+ for (int i = 0; i < n; ++i) {
+ int v = rains[i];
+ if (v > 0) {
+ if (rainy.containsKey(v)) {
+ Integer t = sunny.higher(rainy.get(v));
+ if (t == null) {
+ return new int[0];
+ }
+ ans[t] = v;
+ sunny.remove(t);
+ }
+ rainy.put(v, i);
+ } else {
+ sunny.add(i);
+ ans[i] = 1;
+ }
+ }
+ return ans;
+ }
+}
+```
+
+### **C++**
+
+```cpp
+class Solution {
+public:
+ vector<int> avoidFlood(vector<int>& rains) {
+ int n = rains.size();
+ vector<int> ans(n, -1);
+ set<int> sunny;
+ unordered_map<int, int> rainy;
+ for (int i = 0; i < n; ++i) {
+ int v = rains[i];
+ if (v) {
+ if (rainy.count(v)) {
+ auto it = sunny.upper_bound(rainy[v]);
+ if (it == sunny.end()) {
+ return {};
+ }
+ ans[*it] = v;
+ sunny.erase(it);
+ }
+ rainy[v] = i;
+ } else {
+ sunny.insert(i);
+ ans[i] = 1;
+ }
+ }
+ return ans;
+ }
+};
+```
+### **Go**
+
+```go
+func avoidFlood(rains []int) []int {
+ n := len(rains)
+ ans := make([]int, n)
+ for i := range ans {
+ ans[i] = -1
+ }
+ sunny := []int{}
+ rainy := map[int]int{}
+ for i, v := range rains {
+ if v > 0 {
+ if j, ok := rainy[v]; ok {
+ idx := sort.Search(len(sunny), func(i int) bool { return sunny[i] > j })
+ if idx == len(sunny) {
+ return []int{}
+ }
+ ans[sunny[idx]] = v
+ sunny = append(sunny[:idx], sunny[idx+1:]...)
+ }
+ rainy[v] = i
+ } else {
+ sunny = append(sunny, i)
+ ans[i] = 1
+ }
+ }
+ return ans
+}
```
### **...**
diff --git a/solution/1400-1499/1488.Avoid Flood in The City/Solution.cpp b/solution/1400-1499/1488.Avoid Flood in The City/Solution.cpp
new file mode 100644
index 0000000000000..acbfb6e123988
--- /dev/null
+++ b/solution/1400-1499/1488.Avoid Flood in The City/Solution.cpp
@@ -0,0 +1,27 @@
+class Solution {
+public:
+ vector<int> avoidFlood(vector<int>& rains) {
+ int n = rains.size();
+ vector<int> ans(n, -1);
+ set<int> sunny;
+ unordered_map<int, int> rainy;
+ for (int i = 0; i < n; ++i) {
+ int v = rains[i];
+ if (v) {
+ if (rainy.count(v)) {
+ auto it = sunny.upper_bound(rainy[v]);
+ if (it == sunny.end()) {
+ return {};
+ }
+ ans[*it] = v;
+ sunny.erase(it);
+ }
+ rainy[v] = i;
+ } else {
+ sunny.insert(i);
+ ans[i] = 1;
+ }
+ }
+ return ans;
+ }
+};
\ No newline at end of file
diff --git a/solution/1400-1499/1488.Avoid Flood in The City/Solution.go b/solution/1400-1499/1488.Avoid Flood in The City/Solution.go
new file mode 100644
index 0000000000000..910b1499d4787
--- /dev/null
+++ b/solution/1400-1499/1488.Avoid Flood in The City/Solution.go
@@ -0,0 +1,26 @@
+func avoidFlood(rains []int) []int {
+ n := len(rains)
+ ans := make([]int, n)
+ for i := range ans {
+ ans[i] = -1
+ }
+ sunny := []int{}
+ rainy := map[int]int{}
+ for i, v := range rains {
+ if v > 0 {
+ if j, ok := rainy[v]; ok {
+ idx := sort.Search(len(sunny), func(i int) bool { return sunny[i] > j })
+ if idx == len(sunny) {
+ return []int{}
+ }
+ ans[sunny[idx]] = v
+ sunny = append(sunny[:idx], sunny[idx+1:]...)
+ }
+ rainy[v] = i
+ } else {
+ sunny = append(sunny, i)
+ ans[i] = 1
+ }
+ }
+ return ans
+}
\ No newline at end of file
diff --git a/solution/1400-1499/1488.Avoid Flood in The City/Solution.java b/solution/1400-1499/1488.Avoid Flood in The City/Solution.java
new file mode 100644
index 0000000000000..533a5eb39e28f
--- /dev/null
+++ b/solution/1400-1499/1488.Avoid Flood in The City/Solution.java
@@ -0,0 +1,27 @@
+class Solution {
+ public int[] avoidFlood(int[] rains) {
+ int n = rains.length;
+ int[] ans = new int[n];
+ Arrays.fill(ans, -1);
+ TreeSet<Integer> sunny = new TreeSet<>();
+ Map<Integer, Integer> rainy = new HashMap<>();
+ for (int i = 0; i < n; ++i) {
+ int v = rains[i];
+ if (v > 0) {
+ if (rainy.containsKey(v)) {
+ Integer t = sunny.higher(rainy.get(v));
+ if (t == null) {
+ return new int[0];
+ }
+ ans[t] = v;
+ sunny.remove(t);
+ }
+ rainy.put(v, i);
+ } else {
+ sunny.add(i);
+ ans[i] = 1;
+ }
+ }
+ return ans;
+ }
+}
\ No newline at end of file
diff --git a/solution/1400-1499/1488.Avoid Flood in The City/Solution.py b/solution/1400-1499/1488.Avoid Flood in The City/Solution.py
new file mode 100644
index 0000000000000..92e3a68508239
--- /dev/null
+++ b/solution/1400-1499/1488.Avoid Flood in The City/Solution.py
@@ -0,0 +1,18 @@
+class Solution:
+ def avoidFlood(self, rains: List[int]) -> List[int]:
+ n = len(rains)
+ ans = [-1] * n
+ sunny = []
+ rainy = {}
+ for i, v in enumerate(rains):
+ if v:
+ if v in rainy:
+ idx = bisect_right(sunny, rainy[v])
+ if idx == len(sunny):
+ return []
+ ans[sunny.pop(idx)] = v
+ rainy[v] = i
+ else:
+ sunny.append(i)
+ ans[i] = 1
+ return ans
|
sentry
|
https://github.com/getsentry/sentry
|
9e0ac1a391ecc6dbef60c294e366915ad66b08a0
|
Billy Vong
|
2022-09-15 23:25:17
|
feat(dev): Split and create tsconfig for test suite (#38882)
|
Change `tsconfig.build.json` into a "base" + "test" and create a new
"build" config that does not typecheck our test suite. `tsconfig.json`
in root will extend `test` as that will be the config used by IDEs and
should include tests + src
| filename | targets | used by |
| -------- | ------ | ---- |
| `config/tsconfig.base.json` | n/a | Base configuration that is
extended. Should not be used directly |
| `config/tsconfig.build.json` | application only (no tests) | [static
build](https://github.com/getsentry/sentry/blob/1557e3b21c789084485df94010f09503560bdc7c/src/sentry/utils/distutils/commands/build_assets.py#L132)
for self-hosted |
| `config/tsconfig.ci.json` | application + tests | Used by CI as we
would like to typecheck the application *and* tests |
| `tsconfig.json` | application + tests + configuration files |
storybook (almost everything) | TS configuration that is used when no
conf is specified by a tool (e.g. `tsc`), typechecks almost everything,
used by IDEs/LSP for example. |
This aims to change the behavior of `build_assets` where it typechecks
both the application source as well as tests. The problem is that our
build image does not install `devDependencies`, so it would fail if we
were to add some devDeps to test files that would be type checked.
|
feat(dev): Split and create tsconfig for test suite (#38882)
Change `tsconfig.build.json` into a "base" + "test" and create a new
"build" config that does not typecheck our test suite. `tsconfig.json`
in root will extend `test` as that will be the config used by IDEs and
should include tests + src
| filename | targets | used by |
| -------- | ------ | ---- |
| `config/tsconfig.base.json` | n/a | Base configuration that is
extended. Should not be used directly |
| `config/tsconfig.build.json` | application only (no tests) | [static
build](https://github.com/getsentry/sentry/blob/1557e3b21c789084485df94010f09503560bdc7c/src/sentry/utils/distutils/commands/build_assets.py#L132)
for self-hosted |
| `config/tsconfig.ci.json` | application + tests | Used by CI as we
would like to typecheck the application *and* tests |
| `tsconfig.json` | application + tests + configuration files |
storybook (almost everything) | TS configuration that is used when no
conf is specified by a tool (e.g. `tsc`), typechecks almost everything,
used by IDEs/LSP for example. |
This aims to change the behavior of `build_assets` where it typechecks
both the application source as well as tests. The problem is that our
build image does not install `devDependencies`, so it would fail if we
were to add some devDeps to test files that would be type checked.
|
diff --git a/.github/workflows/frontend.yml b/.github/workflows/frontend.yml
index a04054a803bf9e..a5c1b76a9fa393 100644
--- a/.github/workflows/frontend.yml
+++ b/.github/workflows/frontend.yml
@@ -113,7 +113,7 @@ jobs:
if: steps.dependencies.outcome == 'success'
run: |
set -o pipefail
- yarn tsc -p config/tsconfig.build.json --diagnostics --generateTrace /tmp/trace | tee /tmp/typescript-monitor.log
+ yarn tsc -p config/tsconfig.ci.json --diagnostics --generateTrace /tmp/trace | tee /tmp/typescript-monitor.log
- name: monitor-tsc
continue-on-error: true
diff --git a/config/tsconfig.base.json b/config/tsconfig.base.json
new file mode 100644
index 00000000000000..de770e59d61031
--- /dev/null
+++ b/config/tsconfig.base.json
@@ -0,0 +1,59 @@
+{
+ "compilerOptions": {
+ "allowJs": false,
+ "checkJs": false,
+ "alwaysStrict": false,
+ "declaration": false,
+ "declarationMap": false,
+ "downlevelIteration": true,
+ "inlineSources": false,
+ "importHelpers": true,
+ "lib": ["esnext", "dom"],
+ "module": "commonjs",
+ "moduleResolution": "node",
+ "noEmit": true,
+ "noEmitHelpers": true,
+ "noFallthroughCasesInSwitch": true,
+ "noImplicitAny": false,
+ "noImplicitReturns": true,
+ "noImplicitUseStrict": true,
+ "noImplicitThis": true,
+ "noUnusedLocals": true,
+ "noUnusedParameters": true,
+ "pretty": false,
+ "resolveJsonModule": true,
+ "sourceMap": true,
+ "strict": true,
+ "target": "es6",
+ "strictBindCallApply": false,
+ "experimentalDecorators": true,
+ "useUnknownInCatchVariables": false,
+ // Skip type checking of all declaration files
+ "skipLibCheck": true,
+ "esModuleInterop": true,
+ "jsx": "preserve",
+ "baseUrl": "../",
+ "outDir": "../src/sentry/static/sentry/dist",
+ "paths": {
+ "sentry/*": ["static/app/*"],
+ "sentry-test/*": ["tests/js/sentry-test/*"],
+ "sentry-images/*": ["static/images/*"],
+ "sentry-locale/*": ["src/sentry/locale/*"],
+ "sentry-logos/*": ["src/sentry/static/sentry/images/logos/*"],
+ "sentry-fonts/*": ["static/fonts/*"],
+ "docs-ui/*": ["docs-ui/*"],
+ // Use the stub file for typechecking. Webpack resolver will use the real files
+ // based on configuration.
+ "integration-docs-platforms": [
+ "fixtures/integration-docs/_platforms.json",
+ "src/sentry/integration-docs/_platforms.json"
+ ]
+ },
+ "plugins": [{"name": "typescript-styled-plugin"}]
+ },
+ "include": ["../static/app", "../tests/js", "../fixtures/js-stubs"],
+ "exclude": ["../node_modules", "../**/*.benchmark.ts"],
+ "ts-node": {
+ "transpileOnly": true
+ }
+}
diff --git a/config/tsconfig.benchmark.json b/config/tsconfig.benchmark.json
index 141b5c56c7e859..86662800bc747f 100644
--- a/config/tsconfig.benchmark.json
+++ b/config/tsconfig.benchmark.json
@@ -1,5 +1,5 @@
{
- "extends": "./tsconfig.build.json",
+ "extends": "./tsconfig.ci.json",
"ts-node": {
"transpileOnly": true,
"compilerOptions": {
diff --git a/config/tsconfig.build.json b/config/tsconfig.build.json
index ba24ec6e97dc3c..71aefc9681cc0e 100644
--- a/config/tsconfig.build.json
+++ b/config/tsconfig.build.json
@@ -1,59 +1,12 @@
{
+ "extends": "./tsconfig.base.json",
"compilerOptions": {
- "allowJs": false,
- "checkJs": false,
- "alwaysStrict": false,
- "declaration": false,
- "declarationMap": false,
- "downlevelIteration": true,
- "inlineSources": false,
- "importHelpers": true,
- "lib": ["esnext", "dom"],
- "module": "commonjs",
- "moduleResolution": "node",
- "noEmit": true,
- "noEmitHelpers": true,
- "noFallthroughCasesInSwitch": true,
- "noImplicitAny": false,
- "noImplicitReturns": true,
- "noImplicitUseStrict": true,
- "noImplicitThis": true,
- "noUnusedLocals": true,
- "noUnusedParameters": true,
- "pretty": false,
- "resolveJsonModule": true,
- "sourceMap": true,
- "strict": true,
- "target": "es6",
- "strictBindCallApply": false,
- "experimentalDecorators": true,
- "useUnknownInCatchVariables": false,
- // Skip type checking of all declaration files
- "skipLibCheck": true,
- "esModuleInterop": true,
- "jsx": "preserve",
- "baseUrl": "../",
- "outDir": "../src/sentry/static/sentry/dist",
- "paths": {
- "sentry/*": ["static/app/*"],
- "sentry-test/*": ["tests/js/sentry-test/*"],
- "sentry-images/*": ["static/images/*"],
- "sentry-locale/*": ["src/sentry/locale/*"],
- "sentry-logos/*": ["src/sentry/static/sentry/images/logos/*"],
- "sentry-fonts/*": ["static/fonts/*"],
- "docs-ui/*": ["docs-ui/*"],
- // Use the stub file for typechecking. Webpack resolver will use the real files
- // based on configuration.
- "integration-docs-platforms": [
- "fixtures/integration-docs/_platforms.json",
- "src/sentry/integration-docs/_platforms.json"
- ]
- },
- "plugins": [{"name": "typescript-styled-plugin"}]
+ "allowJs": true
},
- "include": ["../static", "../tests/js", "../fixtures/js-stubs"],
- "exclude": ["../node_modules", "../**/*.benchmark.ts"],
- "ts-node": {
- "transpileOnly": true
- }
+ "exclude": [
+ "tests/js",
+ "fixtures/js-stubs",
+ "../static/app/**/*.spec.*",
+ "../static/app/**/*.benchmark.ts"
+ ]
}
diff --git a/config/tsconfig.ci.json b/config/tsconfig.ci.json
new file mode 100644
index 00000000000000..d4c513ad880e6b
--- /dev/null
+++ b/config/tsconfig.ci.json
@@ -0,0 +1,5 @@
+{
+ "extends": "./tsconfig.base.json",
+ "compilerOptions": {},
+ "include": ["../static/app", "../tests/js", "../fixtures/js-stubs"]
+}
diff --git a/tsconfig.json b/tsconfig.json
index 036794f1f5defe..234262a7c9d5a1 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -1,8 +1,7 @@
{
- "extends": "./config/tsconfig.build.json",
+ "extends": "./config/tsconfig.base.json",
"compilerOptions": {
"allowJs": true
},
- "include": ["static", "tests/js", "docs-ui"],
- "exclude": ["node_modules", "**/*.benchmark.ts"]
+ "include": ["static/app", "tests/js", "fixtures/js-stubs", "docs-ui", "config"]
}
|
deno
|
https://github.com/denoland/deno
|
64abb65f0514afc1f10c426561e5150d9cae6b45
|
Colin Ihrig
|
2022-06-13 20:29:22
|
feat(console): pass options and depth to custom inspects (#14855)
|
This commit updates Deno.inspect() to pass inspect options and
the current inspect depth to custom inspect functions.
|
feat(console): pass options and depth to custom inspects (#14855)
This commit updates Deno.inspect() to pass inspect options and
the current inspect depth to custom inspect functions.
Refs: https://github.com/denoland/deno/issues/8099
Refs: https://github.com/denoland/deno/issues/14171
|
diff --git a/cli/tests/unit/console_test.ts b/cli/tests/unit/console_test.ts
index d349266e8b7e6a..fbaba9e432ba4e 100644
--- a/cli/tests/unit/console_test.ts
+++ b/cli/tests/unit/console_test.ts
@@ -884,7 +884,14 @@ Deno.test(async function consoleTestStringifyPromises() {
Deno.test(function consoleTestWithCustomInspector() {
class A {
- [customInspect](): string {
+ [customInspect](
+ inspect: unknown,
+ options: Deno.InspectOptions,
+ depth: number,
+ ): string {
+ assertEquals(typeof inspect, "function");
+ assertEquals(typeof options, "object");
+ assertEquals(depth, 0);
return "b";
}
}
diff --git a/ext/console/02_console.js b/ext/console/02_console.js
index 638047b3a9f31d..71eb58198044dd 100644
--- a/ext/console/02_console.js
+++ b/ext/console/02_console.js
@@ -335,7 +335,7 @@
ReflectHas(value, customInspect) &&
typeof value[customInspect] === "function"
) {
- return String(value[customInspect](inspect));
+ return String(value[customInspect](inspect, inspectOptions, level));
}
// Might be Function/AsyncFunction/GeneratorFunction/AsyncGeneratorFunction
let cstrName = ObjectGetPrototypeOf(value)?.constructor?.name;
@@ -1258,7 +1258,7 @@
ReflectHas(value, customInspect) &&
typeof value[customInspect] === "function"
) {
- return String(value[customInspect](inspect));
+ return String(value[customInspect](inspect, inspectOptions, level));
}
// This non-unique symbol is used to support op_crates, ie.
// in extensions/web we don't want to depend on public
@@ -1273,7 +1273,9 @@
// inspect implementations in `extensions` need it, but may not have access
// to the `Deno` namespace in web workers. Remove when the `Deno`
// namespace is always enabled.
- return String(value[privateCustomInspect](inspect));
+ return String(
+ value[privateCustomInspect](inspect, inspectOptions, level),
+ );
}
if (ObjectPrototypeIsPrototypeOf(ErrorPrototype, value)) {
return inspectError(value, maybeColor(colors.cyan, inspectOptions));
|
clap
|
https://github.com/clap-rs/clap
|
9167fdebf306c8fcad1134d4db2a95f493c4bc9a
|
Ed Page
|
2021-11-13 00:22:18
|
fix(derive): Don't emit warnings
|
Looks like this is coming from `update_from_arg_matches` where we do a
ladder of `if __clap_arg_matches.is_present(...)` that clippy wants to
be `else if`s. While for human edited code, that does clarify intent,
for machine generated code that is rarely read, its a pain to do, so
silencing it.
Unfortunately, it isn't in a group we can overall silence.
|
fix(derive): Don't emit warnings
Looks like this is coming from `update_from_arg_matches` where we do a
ladder of `if __clap_arg_matches.is_present(...)` that clippy wants to
be `else if`s. While for human edited code, that does clarify intent,
for machine generated code that is rarely read, its a pain to do, so
silencing it.
Unfortunately, it isn't in a group we can overall silence.
Fixes #3017
|
diff --git a/clap_derive/src/derives/arg_enum.rs b/clap_derive/src/derives/arg_enum.rs
index e27a02199b3..61f998212f8 100644
--- a/clap_derive/src/derives/arg_enum.rs
+++ b/clap_derive/src/derives/arg_enum.rs
@@ -60,7 +60,8 @@ pub fn gen_for_enum(name: &Ident, attrs: &[Attribute], e: &DataEnum) -> TokenStr
clippy::perf,
clippy::deprecated,
clippy::nursery,
- clippy::cargo
+ clippy::cargo,
+ clippy::suspicious_else_formatting,
)]
#[deny(clippy::correctness)]
impl clap::ArgEnum for #name {
diff --git a/clap_derive/src/derives/args.rs b/clap_derive/src/derives/args.rs
index 6f7a0e6e699..4a80b7f4c4c 100644
--- a/clap_derive/src/derives/args.rs
+++ b/clap_derive/src/derives/args.rs
@@ -74,7 +74,8 @@ pub fn gen_for_struct(
clippy::perf,
clippy::deprecated,
clippy::nursery,
- clippy::cargo
+ clippy::cargo,
+ clippy::suspicious_else_formatting,
)]
#[deny(clippy::correctness)]
impl clap::Args for #struct_name {
@@ -114,7 +115,8 @@ pub fn gen_from_arg_matches_for_struct(
clippy::perf,
clippy::deprecated,
clippy::nursery,
- clippy::cargo
+ clippy::cargo,
+ clippy::suspicious_else_formatting,
)]
#[deny(clippy::correctness)]
impl clap::FromArgMatches for #struct_name {
diff --git a/clap_derive/src/derives/into_app.rs b/clap_derive/src/derives/into_app.rs
index d5d0192fd44..86160ab82c2 100644
--- a/clap_derive/src/derives/into_app.rs
+++ b/clap_derive/src/derives/into_app.rs
@@ -67,7 +67,8 @@ pub fn gen_for_struct(struct_name: &Ident, attrs: &[Attribute]) -> TokenStream {
clippy::perf,
clippy::deprecated,
clippy::nursery,
- clippy::cargo
+ clippy::cargo,
+ clippy::suspicious_else_formatting,
)]
#[deny(clippy::correctness)]
impl clap::IntoApp for #struct_name {
@@ -109,7 +110,8 @@ pub fn gen_for_enum(enum_name: &Ident, attrs: &[Attribute]) -> TokenStream {
clippy::perf,
clippy::deprecated,
clippy::nursery,
- clippy::cargo
+ clippy::cargo,
+ clippy::suspicious_else_formatting,
)]
#[deny(clippy::correctness)]
impl clap::IntoApp for #enum_name {
diff --git a/clap_derive/src/derives/subcommand.rs b/clap_derive/src/derives/subcommand.rs
index e64d764e42b..989bc51e7ff 100644
--- a/clap_derive/src/derives/subcommand.rs
+++ b/clap_derive/src/derives/subcommand.rs
@@ -63,7 +63,8 @@ pub fn gen_for_enum(enum_name: &Ident, attrs: &[Attribute], e: &DataEnum) -> Tok
clippy::perf,
clippy::deprecated,
clippy::nursery,
- clippy::cargo
+ clippy::cargo,
+ clippy::suspicious_else_formatting,
)]
#[deny(clippy::correctness)]
impl clap::Subcommand for #enum_name {
@@ -102,7 +103,8 @@ fn gen_from_arg_matches_for_enum(name: &Ident, attrs: &[Attribute], e: &DataEnum
clippy::perf,
clippy::deprecated,
clippy::nursery,
- clippy::cargo
+ clippy::cargo,
+ clippy::suspicious_else_formatting,
)]
#[deny(clippy::correctness)]
impl clap::FromArgMatches for #name {
|
ohmyzsh
|
https://github.com/ohmyzsh/ohmyzsh
|
3e6ee85a161c8089955c19364728e167025a911d
|
Maksym
|
2020-11-05 02:40:22
|
fix(aws): support MFA for profiles without role to assume (#9411)
|
Previously, the plugin only supported MFA for profiles that had a role to assume, specified in role_arn. Now, the plugin supports MFA for profiles without a role to assume.
|
fix(aws): support MFA for profiles without role to assume (#9411)
Previously, the plugin only supported MFA for profiles that had a role to assume, specified in role_arn. Now, the plugin supports MFA for profiles without a role to assume.
Closes #9408
* refactor(aws plugin): remove dependency on jq
Previously, acp command relied on jq. Now that dependency has been removed, as well as some linter suggestions implemented.
|
diff --git a/plugins/aws/README.md b/plugins/aws/README.md
index 851f586ddd12..4c2ae96e5734 100644
--- a/plugins/aws/README.md
+++ b/plugins/aws/README.md
@@ -3,7 +3,7 @@
This plugin provides completion support for [awscli](https://docs.aws.amazon.com/cli/latest/reference/index.html)
and a few utilities to manage AWS profiles and display them in the prompt.
-To use it, make sure [jq](https://stedolan.github.io/jq/download/) is installed, and add `aws` to the plugins array in your zshrc file.
+To use it, add `aws` to the plugins array in your zshrc file.
```zsh
plugins=(... aws)
@@ -40,6 +40,6 @@ plugins=(... aws)
The plugin creates an `aws_prompt_info` function that you can use in your theme, which displays
the current `$AWS_PROFILE`. It uses two variables to control how that is shown:
-- ZSH_THEME_AWS_PREFIX: sets the prefix of the AWS_PROFILE. Defaults to `<aws:`.
+* ZSH_THEME_AWS_PREFIX: sets the prefix of the AWS_PROFILE. Defaults to `<aws:`.
-- ZSH_THEME_AWS_SUFFIX: sets the suffix of the AWS_PROFILE. Defaults to `>`.
+* ZSH_THEME_AWS_SUFFIX: sets the suffix of the AWS_PROFILE. Defaults to `>`.
diff --git a/plugins/aws/aws.plugin.zsh b/plugins/aws/aws.plugin.zsh
index 8149ba12116f..e6959759e388 100644
--- a/plugins/aws/aws.plugin.zsh
+++ b/plugins/aws/aws.plugin.zsh
@@ -39,60 +39,73 @@ function acp() {
return 1
fi
- local exists="$(aws configure get aws_access_key_id --profile $1)"
+ local aws_access_key_id="$(aws configure get aws_access_key_id --profile $1)"
+ local aws_secret_access_key="$(aws configure get aws_secret_access_key --profile $1)"
+ local aws_session_token="$(aws configure get aws_session_token --profile $1)"
+ local mfa_serial="$(aws configure get mfa_serial --profile $1)"
local role_arn="$(aws configure get role_arn --profile $1)"
- local aws_access_key_id=""
- local aws_secret_access_key=""
- local aws_session_token=""
- if [[ -n $exists || -n $role_arn ]]; then
- if [[ -n $role_arn ]]; then
- local mfa_serial="$(aws configure get mfa_serial --profile $1)"
- local mfa_token=""
- local mfa_opt=""
- if [[ -n $mfa_serial ]]; then
- echo "Please enter your MFA token for $mfa_serial:"
- read mfa_token
- echo "Please enter the session duration in seconds (900-43200; default: 3600, which is the default maximum for a role):"
- read sess_duration
- if [[ -z $sess_duration ]]; then
- sess_duration="3600"
- fi
- mfa_opt="--serial-number $mfa_serial --token-code $mfa_token --duration-seconds $sess_duration"
- fi
-
- local ext_id="$(aws configure get external_id --profile $1)"
- local extid_opt=""
- if [[ -n $ext_id ]]; then
- extid_opt="--external-id $ext_id"
- fi
-
- local profile=$1
- local source_profile="$(aws configure get source_profile --profile $1)"
- if [[ -n $source_profile ]]; then
- profile=$source_profile
- fi
-
- echo "Assuming role $role_arn using profile $profile"
- local assume_cmd=(aws sts assume-role "--profile=$profile" "--role-arn $role_arn" "--role-session-name "$profile"" "$mfa_opt" "$extid_opt")
- local JSON="$(eval ${assume_cmd[@]})"
-
- aws_access_key_id="$(echo $JSON | jq -r '.Credentials.AccessKeyId')"
- aws_secret_access_key="$(echo $JSON | jq -r '.Credentials.SecretAccessKey')"
- aws_session_token="$(echo $JSON | jq -r '.Credentials.SessionToken')"
- else
- aws_access_key_id="$(aws configure get aws_access_key_id --profile $1)"
- aws_secret_access_key="$(aws configure get aws_secret_access_key --profile $1)"
- aws_session_token="$(aws configure get aws_session_token --profile $1)"
+
+ # First, if the profile has MFA configured, lets get the token and session duration
+ local mfa_opt=""
+
+ if [[ -n $mfa_serial ]]; then
+ local mfa_token=""
+ echo "Please enter your MFA token for $mfa_serial:"
+ read -r mfa_token
+ echo "Please enter the session duration in seconds (900-43200; default: 3600, which is the default maximum for a role):"
+ read -r sess_duration
+ if [[ -z $sess_duration ]]; then
+ sess_duration="3600"
fi
+ mfa_opt="--serial-number $mfa_serial --token-code $mfa_token --duration-seconds $sess_duration"
+ fi
+
+ # Now see whether we need to just MFA for the current role, or assume a different one
+ local credentials_output=""
+ if [[ -n $role_arn ]]; then
+ # Means we need to assume a specified role
+ # Check whether external_id is configured to use while assuming the role
+ local ext_id="$(aws configure get external_id --profile $1)"
+ local extid_opt=""
+ if [[ -n $ext_id ]]; then
+ extid_opt="--external-id $ext_id"
+ fi
+
+ # Get source profile to use to assume role
+ local profile=$1
+ local source_profile="$(aws configure get source_profile --profile "$1")"
+ if [[ -n $source_profile ]]; then
+ profile=$source_profile
+ fi
+
+ echo "Assuming role $role_arn using profile $profile"
+ local assume_cmd=(aws sts assume-role "--profile=$profile" "--role-arn $role_arn" "--role-session-name $profile" "$mfa_opt" "$extid_opt"
+ "--query '[Credentials.AccessKeyId,Credentials.SecretAccessKey,Credentials.SessionToken]' --output text | tr '\t' '\n'")
+ credentials_output="$(eval "${assume_cmd[@]}")"
+ elif [[ -n $mfa_opt ]]; then
+ # Means we only need to do MFA
+ echo "Obtaining session token for profile $profile"
+ local get_token_cmd=(aws sts get-session-token "--profile=$profile" "$mfa_opt"
+ "--query '[Credentials.AccessKeyId,Credentials.SecretAccessKey,Credentials.SessionToken]' --output text | tr '\t' '\n'")
+ credentials_output="$(eval "${get_token_cmd[@]}")"
+ fi
+
+ if [[ -n $credentials_output ]]; then
+ local credentials=("${(f)credentials_output}")
+ aws_access_key_id=${credentials[1]}
+ aws_secret_access_key=${credentials[2]}
+ aws_session_token=${credentials[3]}
+ fi
+
+ if [[ -n $aws_access_key_id && -n $aws_secret_access_key ]]; then
export AWS_DEFAULT_PROFILE=$1
export AWS_PROFILE=$1
export AWS_EB_PROFILE=$1
export AWS_ACCESS_KEY_ID=$aws_access_key_id
export AWS_SECRET_ACCESS_KEY=$aws_secret_access_key
[[ -z "$aws_session_token" ]] && unset AWS_SESSION_TOKEN || export AWS_SESSION_TOKEN=$aws_session_token
-
- echo "Switched to AWS Profile: $1";
+ echo "Switched to AWS Profile: $1"
fi
}
@@ -120,8 +133,7 @@ function aws_profiles() {
function _aws_profiles() {
reply=($(aws_profiles))
}
-compctl -K _aws_profiles asp aws_change_access_key
-compctl -K _aws_profiles acp aws_change_access_key
+compctl -K _aws_profiles asp acp aws_change_access_key
# AWS prompt
function aws_prompt_info() {
|
zipkin
|
https://github.com/openzipkin/zipkin
|
9e81ff0185cd259da7feb618894488d6c1a177c8
|
Adrian Cole
|
2023-12-07 08:11:12
|
ci: adds comments missing from previous PR
|
a couple places missed from #3621
|
ci: adds comments missing from previous PR
a couple places missed from #3621
Signed-off-by: Adrian Cole <[email protected]>
|
diff --git a/.github/workflows/readme_test.yml b/.github/workflows/readme_test.yml
index 6db63abfaa1..b6e887860c0 100644
--- a/.github/workflows/readme_test.yml
+++ b/.github/workflows/readme_test.yml
@@ -66,8 +66,9 @@ jobs:
with:
distribution: 'zulu' # zulu as it supports a wide version range
java-version: '21' # Most recent LTS
- # We can't cache Docker without using buildx because GH actions restricts /var/lib/docker
- # That's ok because DOCKER_PARENT_IMAGE is always ghcr.io and local anyway.
+ # Don't attempt to cache Docker. Sensitive information can be stolen
+ # via forks, and login session ends up in ~/.docker. This is ok because
+ # we publish DOCKER_PARENT_IMAGE to ghcr.io, hence local to the runner.
- name: Cache NPM Packages
uses: actions/cache@v3
with:
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 0e7b746e753..3fd5ec96f56 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -81,8 +81,9 @@ jobs:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-maven-
- # We can't cache Docker without using buildx because GH actions restricts /var/lib/docker
- # That's ok because DOCKER_PARENT_IMAGE is always ghcr.io and local anyway.
+ # Don't attempt to cache Docker. Sensitive information can be stolen
+ # via forks, and login session ends up in ~/.docker. This is ok because
+ # we publish DOCKER_PARENT_IMAGE to ghcr.io, hence local to the runner.
- name: Test with Docker
run:
| # configure_test seeds NPM cache, which isn't needed for these tests
|
leetcode
|
https://github.com/doocs/leetcode
|
576638cfa0c85e9acb4bab687109148257b5b9f8
|
Yang Libin
|
2023-08-01 16:16:36
|
feat: add solutions to lc problem: No.0750 (#1362)
|
No.0750.Number Of Corner Rectangles
|
feat: add solutions to lc problem: No.0750 (#1362)
No.0750.Number Of Corner Rectangles
|
diff --git a/solution/0700-0799/0750.Number Of Corner Rectangles/README.md b/solution/0700-0799/0750.Number Of Corner Rectangles/README.md
index d2a26538e47a3..5683fb151d3f3 100644
--- a/solution/0700-0799/0750.Number Of Corner Rectangles/README.md
+++ b/solution/0700-0799/0750.Number Of Corner Rectangles/README.md
@@ -60,6 +60,12 @@
<!-- 这里可写通用的实现逻辑 -->
+**方法一:哈希表 + 枚举**
+
+我们枚举每一行作为矩形的下边,对于当前行,如果列 $i$ 和列 $j$ 都是 $1$,那么我们用哈希表找出此前的所有行中,有多少行的 $i$ 和 $j$ 列都是 $1$,那么就有多少个以 $(i, j)$ 为右下角的矩形,我们将其数量加入答案。然后将 $(i, j)$ 加入哈希表,继续枚举下一对 $(i, j)$。
+
+时间复杂度 $O(m \times n^2)$,空间复杂度 $O(n^2)$。其中 $m$ 和 $n$ 分别是矩阵的行数和列数。
+
<!-- tabs:start -->
### **Python3**
@@ -67,7 +73,19 @@
<!-- 这里可写当前语言的特殊实现逻辑 -->
```python
-
+class Solution:
+ def countCornerRectangles(self, grid: List[List[int]]) -> int:
+ ans = 0
+ cnt = Counter()
+ n = len(grid[0])
+ for row in grid:
+ for i, c1 in enumerate(row):
+ if c1:
+ for j in range(i + 1, n):
+ if row[j]:
+ ans += cnt[(i, j)]
+ cnt[(i, j)] += 1
+ return ans
```
### **Java**
@@ -75,7 +93,101 @@
<!-- 这里可写当前语言的特殊实现逻辑 -->
```java
+class Solution {
+ public int countCornerRectangles(int[][] grid) {
+ int n = grid[0].length;
+ int ans = 0;
+ Map<List<Integer>, Integer> cnt = new HashMap<>();
+ for (var row : grid) {
+ for (int i = 0; i < n; ++i) {
+ if (row[i] == 1) {
+ for (int j = i + 1; j < n; ++j) {
+ if (row[j] == 1) {
+ List<Integer> t = List.of(i, j);
+ ans += cnt.getOrDefault(t, 0);
+ cnt.merge(t, 1, Integer::sum);
+ }
+ }
+ }
+ }
+ }
+ return ans;
+ }
+}
+```
+
+### **C++**
+
+```cpp
+class Solution {
+public:
+ int countCornerRectangles(vector<vector<int>>& grid) {
+ int n = grid[0].size();
+ int ans = 0;
+ map<pair<int, int>, int> cnt;
+ for (auto& row : grid) {
+ for (int i = 0; i < n; ++i) {
+ if (row[i]) {
+ for (int j = i + 1; j < n; ++j) {
+ if (row[j]) {
+ ans += cnt[{i, j}];
+ ++cnt[{i, j}];
+ }
+ }
+ }
+ }
+ }
+ return ans;
+ }
+};
+```
+
+### **Go**
+
+```go
+func countCornerRectangles(grid [][]int) (ans int) {
+ n := len(grid[0])
+ type pair struct{ x, y int }
+ cnt := map[pair]int{}
+ for _, row := range grid {
+ for i, x := range row {
+ if x == 1 {
+ for j := i + 1; j < n; j++ {
+ if row[j] == 1 {
+ t := pair{i, j}
+ ans += cnt[t]
+ cnt[t]++
+ }
+ }
+ }
+ }
+ }
+ return
+}
+```
+### **TypeScript**
+
+```ts
+function countCornerRectangles(grid: number[][]): number {
+ const n = grid[0].length;
+ let ans = 0;
+ const cnt: Map<number, number> = new Map();
+ for (const row of grid) {
+ for (let i = 0; i < n; ++i) {
+ if (row[i] === 1) {
+ for (let j = i + 1; j < n; ++j) {
+ if (row[j] === 1) {
+ const t = i * 200 + j;
+ ans += cnt.get(t) ?? 0;
+ cnt.set(t, (cnt.get(t) ?? 0) + 1);
+ }
+ }
+ }
+ }
+ }
+ return ans;
+}
```
### **...**
diff --git a/solution/0700-0799/0750.Number Of Corner Rectangles/README_EN.md b/solution/0700-0799/0750.Number Of Corner Rectangles/README_EN.md
index 69dbeb85cb580..09d33e3f609cf 100644
--- a/solution/0700-0799/0750.Number Of Corner Rectangles/README_EN.md
+++ b/solution/0700-0799/0750.Number Of Corner Rectangles/README_EN.md
@@ -51,13 +51,119 @@
### **Python3**
```python
-
+class Solution:
+ def countCornerRectangles(self, grid: List[List[int]]) -> int:
+ ans = 0
+ cnt = Counter()
+ n = len(grid[0])
+ for row in grid:
+ for i, c1 in enumerate(row):
+ if c1:
+ for j in range(i + 1, n):
+ if row[j]:
+ ans += cnt[(i, j)]
+ cnt[(i, j)] += 1
+ return ans
```
### **Java**
```java
+class Solution {
+ public int countCornerRectangles(int[][] grid) {
+ int n = grid[0].length;
+ int ans = 0;
+ Map<List<Integer>, Integer> cnt = new HashMap<>();
+ for (var row : grid) {
+ for (int i = 0; i < n; ++i) {
+ if (row[i] == 1) {
+ for (int j = i + 1; j < n; ++j) {
+ if (row[j] == 1) {
+ List<Integer> t = List.of(i, j);
+ ans += cnt.getOrDefault(t, 0);
+ cnt.merge(t, 1, Integer::sum);
+ }
+ }
+ }
+ }
+ }
+ return ans;
+ }
+}
+```
+
+### **C++**
+
+```cpp
+class Solution {
+public:
+ int countCornerRectangles(vector<vector<int>>& grid) {
+ int n = grid[0].size();
+ int ans = 0;
+ map<pair<int, int>, int> cnt;
+ for (auto& row : grid) {
+ for (int i = 0; i < n; ++i) {
+ if (row[i]) {
+ for (int j = i + 1; j < n; ++j) {
+ if (row[j]) {
+ ans += cnt[{i, j}];
+ ++cnt[{i, j}];
+ }
+ }
+ }
+ }
+ }
+ return ans;
+ }
+};
+```
+
+### **Go**
+
+```go
+func countCornerRectangles(grid [][]int) (ans int) {
+ n := len(grid[0])
+ type pair struct{ x, y int }
+ cnt := map[pair]int{}
+ for _, row := range grid {
+ for i, x := range row {
+ if x == 1 {
+ for j := i + 1; j < n; j++ {
+ if row[j] == 1 {
+ t := pair{i, j}
+ ans += cnt[t]
+ cnt[t]++
+ }
+ }
+ }
+ }
+ }
+ return
+}
+```
+### **TypeScript**
+
+```ts
+function countCornerRectangles(grid: number[][]): number {
+ const n = grid[0].length;
+ let ans = 0;
+ const cnt: Map<number, number> = new Map();
+ for (const row of grid) {
+ for (let i = 0; i < n; ++i) {
+ if (row[i] === 1) {
+ for (let j = i + 1; j < n; ++j) {
+ if (row[j] === 1) {
+ const t = i * 200 + j;
+ ans += cnt.get(t) ?? 0;
+ cnt.set(t, (cnt.get(t) ?? 0) + 1);
+ }
+ }
+ }
+ }
+ }
+ return ans;
+}
```
### **...**
diff --git a/solution/0700-0799/0750.Number Of Corner Rectangles/Solution.cpp b/solution/0700-0799/0750.Number Of Corner Rectangles/Solution.cpp
new file mode 100644
index 0000000000000..edcf872d928ab
--- /dev/null
+++ b/solution/0700-0799/0750.Number Of Corner Rectangles/Solution.cpp
@@ -0,0 +1,21 @@
+class Solution {
+public:
+ int countCornerRectangles(vector<vector<int>>& grid) {
+ int n = grid[0].size();
+ int ans = 0;
+ map<pair<int, int>, int> cnt;
+ for (auto& row : grid) {
+ for (int i = 0; i < n; ++i) {
+ if (row[i]) {
+ for (int j = i + 1; j < n; ++j) {
+ if (row[j]) {
+ ans += cnt[{i, j}];
+ ++cnt[{i, j}];
+ }
+ }
+ }
+ }
+ }
+ return ans;
+ }
+};
\ No newline at end of file
diff --git a/solution/0700-0799/0750.Number Of Corner Rectangles/Solution.go b/solution/0700-0799/0750.Number Of Corner Rectangles/Solution.go
new file mode 100644
index 0000000000000..1ae14d4bdaa56
--- /dev/null
+++ b/solution/0700-0799/0750.Number Of Corner Rectangles/Solution.go
@@ -0,0 +1,19 @@
+func countCornerRectangles(grid [][]int) (ans int) {
+ n := len(grid[0])
+ type pair struct{ x, y int }
+ cnt := map[pair]int{}
+ for _, row := range grid {
+ for i, x := range row {
+ if x == 1 {
+ for j := i + 1; j < n; j++ {
+ if row[j] == 1 {
+ t := pair{i, j}
+ ans += cnt[t]
+ cnt[t]++
+ }
+ }
+ }
+ }
+ }
+ return
+}
\ No newline at end of file
diff --git a/solution/0700-0799/0750.Number Of Corner Rectangles/Solution.java b/solution/0700-0799/0750.Number Of Corner Rectangles/Solution.java
new file mode 100644
index 0000000000000..0faa65a72974b
--- /dev/null
+++ b/solution/0700-0799/0750.Number Of Corner Rectangles/Solution.java
@@ -0,0 +1,21 @@
+class Solution {
+ public int countCornerRectangles(int[][] grid) {
+ int n = grid[0].length;
+ int ans = 0;
+ Map<List<Integer>, Integer> cnt = new HashMap<>();
+ for (var row : grid) {
+ for (int i = 0; i < n; ++i) {
+ if (row[i] == 1) {
+ for (int j = i + 1; j < n; ++j) {
+ if (row[j] == 1) {
+ List<Integer> t = List.of(i, j);
+ ans += cnt.getOrDefault(t, 0);
+ cnt.merge(t, 1, Integer::sum);
+ }
+ }
+ }
+ }
+ }
+ return ans;
+ }
+}
\ No newline at end of file
diff --git a/solution/0700-0799/0750.Number Of Corner Rectangles/Solution.py b/solution/0700-0799/0750.Number Of Corner Rectangles/Solution.py
new file mode 100644
index 0000000000000..e0075d27420f7
--- /dev/null
+++ b/solution/0700-0799/0750.Number Of Corner Rectangles/Solution.py
@@ -0,0 +1,13 @@
+class Solution:
+ def countCornerRectangles(self, grid: List[List[int]]) -> int:
+ ans = 0
+ cnt = Counter()
+ n = len(grid[0])
+ for row in grid:
+ for i, c1 in enumerate(row):
+ if c1:
+ for j in range(i + 1, n):
+ if row[j]:
+ ans += cnt[(i, j)]
+ cnt[(i, j)] += 1
+ return ans
diff --git a/solution/0700-0799/0750.Number Of Corner Rectangles/Solution.ts b/solution/0700-0799/0750.Number Of Corner Rectangles/Solution.ts
new file mode 100644
index 0000000000000..c4e889a2b94fd
--- /dev/null
+++ b/solution/0700-0799/0750.Number Of Corner Rectangles/Solution.ts
@@ -0,0 +1,19 @@
+function countCornerRectangles(grid: number[][]): number {
+ const n = grid[0].length;
+ let ans = 0;
+ const cnt: Map<number, number> = new Map();
+ for (const row of grid) {
+ for (let i = 0; i < n; ++i) {
+ if (row[i] === 1) {
+ for (let j = i + 1; j < n; ++j) {
+ if (row[j] === 1) {
+ const t = i * 200 + j;
+ ans += cnt.get(t) ?? 0;
+ cnt.set(t, (cnt.get(t) ?? 0) + 1);
+ }
+ }
+ }
+ }
+ }
+ return ans;
+}
|
novu
|
https://github.com/novuhq/novu
|
3fadf30df593927b7a63552420884942e742bafb
|
309528
|
2022-09-23 08:07:22
|
feat(change contextpath to context_path and remove embed context path env variable): fix contextpath
|
Change CONTEXTPATH to CONTEXT_PATH and remove embed context path env variable
|
feat(change contextpath to context_path and remove embed context path env variable): fix contextpath
Change CONTEXTPATH to CONTEXT_PATH and remove embed context path env variable
|
diff --git a/apps/api/src/.env.development b/apps/api/src/.env.development
index a8f5ce5e725..6554963d8fd 100644
--- a/apps/api/src/.env.development
+++ b/apps/api/src/.env.development
@@ -2,8 +2,8 @@ NODE_ENV=dev
PORT=3000
API_ROOT_URL=https://dev.api.novu.co
FRONT_BASE_URL=https://dev.web.novu.co
-GLOBAL_CONTEXTPATH=
-API_CONTEXTPATH=
+GLOBAL_CONTEXT_PATH=
+API_CONTEXT_PATH=
DISABLE_USER_REGISTRATION=false
[email protected]
diff --git a/apps/api/src/.env.production b/apps/api/src/.env.production
index 2f4cfa88aab..8a1e8daf7ff 100644
--- a/apps/api/src/.env.production
+++ b/apps/api/src/.env.production
@@ -2,8 +2,8 @@ NODE_ENV=prod
PORT=3000
API_ROOT_URL=https://api.novu.co
FRONT_BASE_URL=https://web.novu.co
-GLOBAL_CONTEXTPATH=
-API_CONTEXTPATH=
+GLOBAL_CONTEXT_PATH=
+API_CONTEXT_PATH=
DISABLE_USER_REGISTRATION=false
WIDGET_BASE_URL=https://widget.novu.co
diff --git a/apps/api/src/.env.test b/apps/api/src/.env.test
index 7c6b0c2d4e8..6a3ad54572c 100644
--- a/apps/api/src/.env.test
+++ b/apps/api/src/.env.test
@@ -23,9 +23,8 @@ FRONT_BASE_URL=http://localhost:4200
[email protected]
BACK_OFFICE_URL=http://localhost:5200
INTERCOM_API_KEY=
-GLOBAL_CONTEXTPATH=
-API_CONTEXTPATH=
-
+GLOBAL_CONTEXT_PATH=
+API_CONTEXT_PATH=
S3_LOCAL_STACK=http://localhost:4566
S3_BUCKET_NAME=novu-test
diff --git a/apps/api/src/.example.env b/apps/api/src/.example.env
index f86c6006f35..145de4d3b3b 100644
--- a/apps/api/src/.example.env
+++ b/apps/api/src/.example.env
@@ -19,5 +19,5 @@ AWS_ACCESS_KEY_ID=test
AWS_SECRET_ACCESS_KEY=test
NEW_RELIC_ENABLED=false
-GLOBAL_CONTEXTPATH=
-API_CONTEXTPATH=
+GLOBAL_CONTEXT_PATH=
+API_CONTEXT_PATH=
diff --git a/apps/web/.env b/apps/web/.env
index ea4e9ee6613..1df259a73de 100644
--- a/apps/web/.env
+++ b/apps/web/.env
@@ -2,5 +2,5 @@ SKIP_PREFLIGHT_CHECK=true
REACT_APP_API_URL=api_url
REACT_APP_WIDGET_SDK_PATH=sdk_path
REACT_APP_ENVIRONMENT=dev
-GLOBAL_CONTEXTPATH=
-FRONT_BASE_CONTEXTPATH=
+GLOBAL_CONTEXT_PATH=
+WEB_CONTEXT_PATH=
diff --git a/apps/widget/.env b/apps/widget/.env
index f3f6dc00ee1..3309aba99e0 100644
--- a/apps/widget/.env
+++ b/apps/widget/.env
@@ -1,8 +1,8 @@
SKIP_PREFLIGHT_CHECK=true
REACT_APP_API_URL=http://localhost:3000
REACT_APP_WS_URL=http://localhost:3002
-GLOBAL_CONTEXTPATH=
-WIDGET_CONTEXTPATH=
+GLOBAL_CONTEXT_PATH=
+WIDGET_CONTEXT_PATH=
REACT_APP_ENVIRONMENT=dev
BROWSER=none
diff --git a/apps/ws/src/.env.development b/apps/ws/src/.env.development
index 1261ce5d91e..47b87c53d8b 100644
--- a/apps/ws/src/.env.development
+++ b/apps/ws/src/.env.development
@@ -6,5 +6,5 @@ REDIS_HOST=localhost
REDIS_DB_INDEX=2
JWT_SECRET=TEST_CHANGE9s
-GLOBAL_CONTEXTPATH=
-REACT_APP_WS_CONTEXTPATH=
+GLOBAL_CONTEXT_PATH=
+WS_CONTEXT_PATH=
diff --git a/apps/ws/src/.env.production b/apps/ws/src/.env.production
index 94bfc1e4bba..dc7bcd2007b 100644
--- a/apps/ws/src/.env.production
+++ b/apps/ws/src/.env.production
@@ -4,5 +4,5 @@ REDIS_PORT=6379
REDIS_DB_INDEX=2
WIDGET_BASE_URL=https://widget.novu.co
-GLOBAL_CONTEXTPATH=
-REACT_APP_WS_CONTEXTPATH=
+GLOBAL_CONTEXT_PATH=
+WS_CONTEXT_PATH=
diff --git a/apps/ws/src/.env.test b/apps/ws/src/.env.test
index 4045edef675..766f0d18527 100644
--- a/apps/ws/src/.env.test
+++ b/apps/ws/src/.env.test
@@ -6,5 +6,5 @@ PORT=1340
JWT_SECRET=ASD#asda23DFEFSFHG%fg
NODE_ENV=test
-GLOBAL_CONTEXTPATH=
-REACT_APP_WS_CONTEXTPATH=
+GLOBAL_CONTEXT_PATH=
+WS_CONTEXT_PATH=
diff --git a/apps/ws/src/.example.env b/apps/ws/src/.example.env
index 4ef0cb482f9..d8cf3736560 100644
--- a/apps/ws/src/.example.env
+++ b/apps/ws/src/.example.env
@@ -6,5 +6,5 @@ REDIS_HOST=localhost
REDIS_DB_INDEX=2
JWT_SECRET=%ASTEST_CHANGE9s
-GLOBAL_CONTEXTPATH=
-REACT_APP_WS_CONTEXTPATH=
+GLOBAL_CONTEXT_PATH=
+WS_CONTEXT_PATH=
diff --git a/docker/.env.example b/docker/.env.example
index a1b0724a6e7..f72a5a03472 100644
--- a/docker/.env.example
+++ b/docker/.env.example
@@ -30,8 +30,8 @@ WIDGET_URL=http://localhost:4500
# Context Paths
# Only needed for setups with reverse-proxies
-GLOBAL_CONTEXTPATH=
-FRONT_BASE_CONTEXTPATH=
-API_CONTEXTPATH=
-REACT_APP_WS_CONTEXTPATH=
-WIDGET_CONTEXTPATH=
+GLOBAL_CONTEXT_PATH=
+WEB_CONTEXT_PATH=
+API_CONTEXT_PATH=
+WS_CONTEXT_PATH=
+WIDGET_CONTEXT_PATH=
diff --git a/libs/shared/src/config/contextPath.ts b/libs/shared/src/config/contextPath.ts
index e2ae8013c40..e90baea01b3 100644
--- a/libs/shared/src/config/contextPath.ts
+++ b/libs/shared/src/config/contextPath.ts
@@ -3,41 +3,34 @@ export enum NovuComponentEnum {
API,
WIDGET,
WS,
- EMBEDED,
}
export function getContextPath(component: NovuComponentEnum) {
let contextPath = '';
- if (process.env.GLOBAL_CONTEXTPATH) {
- contextPath += process.env.GLOBAL_CONTEXTPATH + '/';
+ if (process.env.GLOBAL_CONTEXT_PATH) {
+ contextPath += process.env.GLOBAL_CONTEXT_PATH + '/';
}
switch (component) {
case NovuComponentEnum.API:
- if (process.env.API_CONTEXTPATH) {
- contextPath += process.env.API_CONTEXTPATH + '/';
+ if (process.env.API_CONTEXT_PATH) {
+ contextPath += process.env.API_CONTEXT_PATH + '/';
}
break;
case NovuComponentEnum.WEB:
- if (process.env.FRONT_BASE_CONTEXTPATH) {
- contextPath += process.env.FRONT_BASE_CONTEXTPATH + '/';
+ if (process.env.FRONT_BASE_CONTEXT_PATH) {
+ contextPath += process.env.FRONT_BASE_CONTEXT_PATH + '/';
}
break;
case NovuComponentEnum.WIDGET:
- if (process.env.WIDGET_CONTEXTPATH) {
- contextPath += process.env.WIDGET_CONTEXTPATH + '/';
+ if (process.env.WIDGET_CONTEXT_PATH) {
+ contextPath += process.env.WIDGET_CONTEXT_PATH + '/';
}
break;
- case NovuComponentEnum.EMBEDED:
- if (process.env.WIDGET_EMBED_CONTEXTPATH) {
- contextPath += process.env.WIDGET_EMBED_CONTEXTPATH + '/';
- }
- break;
-
case NovuComponentEnum.WS:
- if (process.env.REACT_APP_WS_CONTEXTPATH) {
- contextPath += process.env.REACT_APP_WS_CONTEXTPATH + '/';
+ if (process.env.WS_CONTEXT_PATH) {
+ contextPath += process.env.WS_CONTEXT_PATH + '/';
}
break;
}
|
pinia
|
https://github.com/vuejs/pinia
|
efcfafdf1f4c7e921acfb03cde6ed459290f9e7f
|
dependabot-preview[bot]
|
2019-12-16 10:44:19
|
chore(deps-dev): bump rollup-plugin-terser from 5.1.2 to 5.1.3
|
Bumps [rollup-plugin-terser](https://github.com/TrySound/rollup-plugin-terser) from 5.1.2 to 5.1.3.
- [Release notes](https://github.com/TrySound/rollup-plugin-terser/releases)
- [Commits](https://github.com/TrySound/rollup-plugin-terser/compare/v5.1.2...v5.1.3)
|
chore(deps-dev): bump rollup-plugin-terser from 5.1.2 to 5.1.3
Bumps [rollup-plugin-terser](https://github.com/TrySound/rollup-plugin-terser) from 5.1.2 to 5.1.3.
- [Release notes](https://github.com/TrySound/rollup-plugin-terser/releases)
- [Commits](https://github.com/TrySound/rollup-plugin-terser/compare/v5.1.2...v5.1.3)
Signed-off-by: dependabot-preview[bot] <[email protected]>
|
diff --git a/yarn.lock b/yarn.lock
index 2f96d6f933..8ca27cba16 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -4120,14 +4120,14 @@ rollup-plugin-node-resolve@^5.2.0:
rollup-pluginutils "^2.8.1"
rollup-plugin-terser@^5.1.2:
- version "5.1.2"
- resolved "https://registry.yarnpkg.com/rollup-plugin-terser/-/rollup-plugin-terser-5.1.2.tgz#3e41256205cb75f196fc70d4634227d1002c255c"
- integrity sha512-sWKBCOS+vUkRtHtEiJPAf+WnBqk/C402fBD9AVHxSIXMqjsY7MnYWKYEUqGixtr0c8+1DjzUEPlNgOYQPVrS1g==
+ version "5.1.3"
+ resolved "https://registry.yarnpkg.com/rollup-plugin-terser/-/rollup-plugin-terser-5.1.3.tgz#5f4c4603b12b4f8d093f4b6f31c9aa5eba98a223"
+ integrity sha512-FuFuXE5QUJ7snyxHLPp/0LFXJhdomKlIx/aK7Tg88Yubsx/UU/lmInoJafXJ4jwVVNcORJ1wRUC5T9cy5yk0wA==
dependencies:
"@babel/code-frame" "^7.0.0"
jest-worker "^24.6.0"
rollup-pluginutils "^2.8.1"
- serialize-javascript "^1.7.0"
+ serialize-javascript "^2.1.2"
terser "^4.1.0"
rollup-plugin-typescript2@^0.25.2:
@@ -4242,11 +4242,16 @@ semver@^6.0.0, semver@^6.1.2, semver@^6.2.0, semver@^6.3.0:
resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d"
integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==
-serialize-javascript@^1.3.0, serialize-javascript@^1.7.0:
+serialize-javascript@^1.3.0:
version "1.9.1"
resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-1.9.1.tgz#cfc200aef77b600c47da9bb8149c943e798c2fdb"
integrity sha512-0Vb/54WJ6k5v8sSWN09S0ora+Hnr+cX40r9F170nT+mSkaxltoE/7R3OrIdBSUv1OoiobH1QoWQbCnAO+e8J1A==
+serialize-javascript@^2.1.2:
+ version "2.1.2"
+ resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-2.1.2.tgz#ecec53b0e0317bdc95ef76ab7074b7384785fa61"
+ integrity sha512-rs9OggEUF0V4jUSecXazOYsLfu7OGK2qIn3c7IPBiffz32XniEp/TX9Xmc9LQfK2nQ2QKHvZ2oygKUGU0lG4jQ==
+
set-blocking@^2.0.0, set-blocking@~2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7"
|
fastify
|
https://github.com/fastify/fastify
|
67f25aaa58c7f6aaf26400ae1740a615389be8f9
|
Gürgün Dayıoğlu
|
2024-05-26 15:40:09
|
refactor: change `reply.redirect()` signature (#5483)
|
* feat: change `reply.redirect()` signature
* feat: change `reply.redirect()` signature
* docs
* docs
* update message
* fix deprecation
* update message
|
refactor: change `reply.redirect()` signature (#5483)
* feat: change `reply.redirect()` signature
* feat: change `reply.redirect()` signature
* docs
* docs
* update message
* fix deprecation
* update message
|
diff --git a/docs/Reference/Reply.md b/docs/Reference/Reply.md
index 7b1135c4ad..33445554c3 100644
--- a/docs/Reference/Reply.md
+++ b/docs/Reference/Reply.md
@@ -17,7 +17,7 @@
- [.trailer(key, function)](#trailerkey-function)
- [.hasTrailer(key)](#hastrailerkey)
- [.removeTrailer(key)](#removetrailerkey)
- - [.redirect([code ,] dest)](#redirectcode--dest)
+ - [.redirect(dest, [code ,])](#redirectdest--code)
- [.callNotFound()](#callnotfound)
- [.getResponseTime()](#getresponsetime)
- [.type(contentType)](#typecontenttype)
@@ -64,8 +64,8 @@ since the request was received by Fastify.
- `.hasTrailer(key)` - Determine if a trailer has been set.
- `.removeTrailer(key)` - Remove the value of a previously set trailer.
- `.type(value)` - Sets the header `Content-Type`.
-- `.redirect([code,] dest)` - Redirect to the specified URL, the status code is
- optional (default to `302`).
+- `.redirect(dest, [code,])` - Redirect to the specified URL, the status code is
+ optional (defaults to `302`).
- `.callNotFound()` - Invokes the custom not found handler.
- `.serialize(payload)` - Serializes the specified payload using the default
JSON serializer or using the custom serializer (if one is set) and returns the
@@ -322,7 +322,7 @@ reply.getTrailer('server-timing') // undefined
```
-### .redirect([code ,] dest)
+### .redirect(dest, [code ,])
<a id="redirect"></a>
Redirects a request to the specified URL, the status code is optional, default
@@ -343,7 +343,7 @@ reply.redirect('/home')
Example (no `reply.code()` call) sets status code to `303` and redirects to
`/home`
```js
-reply.redirect(303, '/home')
+reply.redirect('/home', 303)
```
Example (`reply.code()` call) sets status code to `303` and redirects to `/home`
@@ -353,7 +353,7 @@ reply.code(303).redirect('/home')
Example (`reply.code()` call) sets status code to `302` and redirects to `/home`
```js
-reply.code(303).redirect(302, '/home')
+reply.code(303).redirect('/home', 302)
```
### .callNotFound()
diff --git a/docs/Reference/Warnings.md b/docs/Reference/Warnings.md
index 45b32781b6..ca55f1c413 100644
--- a/docs/Reference/Warnings.md
+++ b/docs/Reference/Warnings.md
@@ -21,6 +21,7 @@
- [FSTDEP018](#FSTDEP018)
- [FSTDEP019](#FSTDEP019)
- [FSTDEP020](#FSTDEP020)
+ - [FSTDEP021](#FSTDEP021)
## Warnings
@@ -84,3 +85,4 @@ Deprecation codes are further supported by the Node.js CLI options:
| <a id="FSTDEP018">FSTDEP018</a> | You are accessing the deprecated `request.routerMethod` property. | Use `request.routeOptions.method`. | [#4470](https://github.com/fastify/fastify/pull/4470) |
| <a id="FSTDEP019">FSTDEP019</a> | You are accessing the deprecated `reply.context` property. | Use `reply.routeOptions.config` or `reply.routeOptions.schema`. | [#5032](https://github.com/fastify/fastify/pull/5032) [#5084](https://github.com/fastify/fastify/pull/5084) |
| <a id="FSTDEP020">FSTDEP020</a> | You are using the deprecated `reply.getReponseTime()` method. | Use the `reply.elapsedTime` property instead. | [#5263](https://github.com/fastify/fastify/pull/5263) |
+| <a id="FSTDEP021">FSTDEP021</a> | The `reply.redirect()` method has a new signature: `reply.redirect(url: string, code?: number)`. It will be enforced in `fastify@v5`'. | [#5483](https://github.com/fastify/fastify/pull/5483) |
diff --git a/lib/reply.js b/lib/reply.js
index 015b71b098..4291970b13 100644
--- a/lib/reply.js
+++ b/lib/reply.js
@@ -55,7 +55,7 @@ const {
FST_ERR_MISSING_SERIALIZATION_FN,
FST_ERR_MISSING_CONTENTTYPE_SERIALIZATION_FN
} = require('./errors')
-const { FSTDEP010, FSTDEP013, FSTDEP019, FSTDEP020 } = require('./warnings')
+const { FSTDEP010, FSTDEP013, FSTDEP019, FSTDEP020, FSTDEP021 } = require('./warnings')
const toString = Object.prototype.toString
@@ -462,9 +462,15 @@ Reply.prototype.type = function (type) {
return this
}
-Reply.prototype.redirect = function (code, url) {
- if (typeof code === 'string') {
- url = code
+Reply.prototype.redirect = function (url, code) {
+ if (typeof url === 'number') {
+ FSTDEP021()
+ const temp = code
+ code = url
+ url = temp
+ }
+
+ if (!code) {
code = this[kReplyHasStatusCode] ? this.raw.statusCode : 302
}
diff --git a/lib/warnings.js b/lib/warnings.js
index 6c47a6bdea..51dc87e86d 100644
--- a/lib/warnings.js
+++ b/lib/warnings.js
@@ -16,6 +16,8 @@ const { createDeprecation, createWarning } = require('process-warning')
* - FSTDEP017
* - FSTDEP018
* - FSTDEP019
+ * - FSTDEP020
+ * - FSTDEP021
* - FSTWRN001
* - FSTSEC001
*/
@@ -85,6 +87,11 @@ const FSTDEP020 = createDeprecation({
message: 'You are using the deprecated "reply.getResponseTime()" method. Use the "reply.elapsedTime" property instead. Method "reply.getResponseTime()" will be removed in `fastify@5`.'
})
+const FSTDEP021 = createDeprecation({
+ code: 'FSTDEP021',
+ message: 'The `reply.redirect()` method has a new signature: `reply.redirect(url: string, code?: number)`. It will be enforced in `fastify@v5`'
+})
+
const FSTWRN001 = createWarning({
name: 'FastifyWarning',
code: 'FSTWRN001',
@@ -113,6 +120,7 @@ module.exports = {
FSTDEP018,
FSTDEP019,
FSTDEP020,
+ FSTDEP021,
FSTWRN001,
FSTSEC001
}
diff --git a/test/internals/reply.test.js b/test/internals/reply.test.js
index 3bb5e561e5..b06a8e2077 100644
--- a/test/internals/reply.test.js
+++ b/test/internals/reply.test.js
@@ -19,7 +19,7 @@ const {
} = require('../../lib/symbols')
const fs = require('node:fs')
const path = require('node:path')
-const { FSTDEP010, FSTDEP019, FSTDEP020 } = require('../../lib/warnings')
+const { FSTDEP010, FSTDEP019, FSTDEP020, FSTDEP021 } = require('../../lib/warnings')
const agent = new http.Agent({ keepAlive: false })
@@ -250,7 +250,7 @@ test('within an instance', t => {
})
fastify.get('/redirect-code', function (req, reply) {
- reply.redirect(301, '/')
+ reply.redirect('/', 301)
})
fastify.get('/redirect-code-before-call', function (req, reply) {
@@ -258,7 +258,7 @@ test('within an instance', t => {
})
fastify.get('/redirect-code-before-call-overwrite', function (req, reply) {
- reply.code(307).redirect(302, '/')
+ reply.code(307).redirect('/', 302)
})
fastify.get('/custom-serializer', function (req, reply) {
@@ -2094,6 +2094,36 @@ test('redirect to an invalid URL should not crash the server', async t => {
await fastify.close()
})
+test('redirect with deprecated signature should warn', t => {
+ t.plan(4)
+
+ process.removeAllListeners('warning')
+ process.on('warning', onWarning)
+ function onWarning (warning) {
+ t.equal(warning.name, 'DeprecationWarning')
+ t.equal(warning.code, FSTDEP021.code)
+ }
+
+ const fastify = Fastify()
+
+ fastify.get('/', (req, reply) => {
+ reply.redirect(302, '/new')
+ })
+
+ fastify.get('/new', (req, reply) => {
+ reply.send('new')
+ })
+
+ fastify.inject({ method: 'GET', url: '/' }, (err, res) => {
+ t.error(err)
+ t.pass()
+
+ process.removeListener('warning', onWarning)
+ })
+
+ FSTDEP021.emitted = false
+})
+
test('invalid response headers should not crash the server', async t => {
const fastify = Fastify()
fastify.route({
diff --git a/test/types/reply.test-d.ts b/test/types/reply.test-d.ts
index fd1f01daf2..505dc45f0c 100644
--- a/test/types/reply.test-d.ts
+++ b/test/types/reply.test-d.ts
@@ -30,7 +30,7 @@ const getHandler: RouteHandlerMethod = function (_request, reply) {
expectAssignable<() => { [key: string]: number | string | string[] | undefined }>(reply.getHeaders)
expectAssignable<(key: string) => FastifyReply>(reply.removeHeader)
expectAssignable<(key: string) => boolean>(reply.hasHeader)
- expectType<{(statusCode: number, url: string): FastifyReply; (url: string): FastifyReply }>(reply.redirect)
+ expectType<{(statusCode: number, url: string): FastifyReply;(url: string, statusCode?: number): FastifyReply;}>(reply.redirect)
expectType<() => FastifyReply>(reply.hijack)
expectType<() => void>(reply.callNotFound)
// Test reply.getResponseTime() deprecation
diff --git a/types/reply.d.ts b/types/reply.d.ts
index 7c18b78a76..2dfa52f894 100644
--- a/types/reply.d.ts
+++ b/types/reply.d.ts
@@ -57,10 +57,12 @@ export interface FastifyReply<
getHeaders(): Record<HttpHeader, number | string | string[] | undefined>;
removeHeader(key: HttpHeader): FastifyReply<RawServer, RawRequest, RawReply, RouteGeneric, ContextConfig, SchemaCompiler, TypeProvider>;
hasHeader(key: HttpHeader): boolean;
- writeEarlyHints(hints: Record<string, string | string[]>, callback?: () => void): void;
- // TODO: should consider refactoring the argument order for redirect. statusCode is optional so it should be after the required url param
+ /**
+ * @deprecated The `reply.redirect()` method has a new signature: `reply.reply.redirect(url: string, code?: number)`. It will be enforced in `fastify@v5`'.
+ */
redirect(statusCode: number, url: string): FastifyReply<RawServer, RawRequest, RawReply, RouteGeneric, ContextConfig, SchemaCompiler, TypeProvider>;
- redirect(url: string): FastifyReply<RawServer, RawRequest, RawReply, RouteGeneric, ContextConfig, SchemaCompiler, TypeProvider>;
+ redirect(url: string, statusCode?: number): FastifyReply<RawServer, RawRequest, RawReply, RouteGeneric, ContextConfig, SchemaCompiler, TypeProvider>;
+ writeEarlyHints(hints: Record<string, string | string[]>, callback?: () => void): void;
hijack(): FastifyReply<RawServer, RawRequest, RawReply, RouteGeneric, ContextConfig, SchemaCompiler, TypeProvider>;
callNotFound(): void;
/**
|
OpenTTD
|
https://github.com/OpenTTD/OpenTTD
|
607ef09fa565bde6939f5b3e36b467aaad588658
|
PeterN
|
2022-09-21 16:38:11
|
Fix: File list mouse hover behaviour. (#10040)
|
Hover highlight was visible even if the mouse pointer was in a different
window. Resolved by using OnMouseOver() instead of OnMouseLoop().
|
Fix: File list mouse hover behaviour. (#10040)
Hover highlight was visible even if the mouse pointer was in a different
window. Resolved by using OnMouseOver() instead of OnMouseLoop().
|
diff --git a/src/fios_gui.cpp b/src/fios_gui.cpp
index 3014bc00ecf60..de351680e3bab 100644
--- a/src/fios_gui.cpp
+++ b/src/fios_gui.cpp
@@ -721,11 +721,8 @@ struct SaveLoadWindow : public Window {
}
}
- void OnMouseLoop() override
+ void OnMouseOver(Point pt, int widget) override
{
- const Point pt{ _cursor.pos.x - this->left, _cursor.pos.y - this->top };
- const int widget = GetWidgetFromPos(this, pt.x, pt.y);
-
if (widget == WID_SL_DRIVES_DIRECTORIES_LIST) {
int y = this->vscroll->GetScrolledRowFromWidget(pt.y, this, WID_SL_DRIVES_DIRECTORIES_LIST, WD_FRAMERECT_TOP);
if (y == INT_MAX) return;
|
linkerd2
|
https://github.com/linkerd/linkerd2
|
c934ba0e36492e9243dff3391b9d40dc2319abc1
|
dependabot[bot]
|
2024-05-21 02:50:56
|
build(deps): bump prost-types from 0.12.4 to 0.12.6 (#12622)
|
Bumps [prost-types](https://github.com/tokio-rs/prost) from 0.12.4 to 0.12.6.
- [Release notes](https://github.com/tokio-rs/prost/releases)
- [Commits](https://github.com/tokio-rs/prost/compare/v0.12.4...v0.12.6)
---
|
build(deps): bump prost-types from 0.12.4 to 0.12.6 (#12622)
Bumps [prost-types](https://github.com/tokio-rs/prost) from 0.12.4 to 0.12.6.
- [Release notes](https://github.com/tokio-rs/prost/releases)
- [Commits](https://github.com/tokio-rs/prost/compare/v0.12.4...v0.12.6)
---
updated-dependencies:
- dependency-name: prost-types
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
|
diff --git a/Cargo.lock b/Cargo.lock
index 22ab5bc0e9395..94ba85a54454a 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1709,9 +1709,9 @@ dependencies = [
[[package]]
name = "prost"
-version = "0.12.4"
+version = "0.12.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d0f5d036824e4761737860779c906171497f6d55681139d8312388f8fe398922"
+checksum = "deb1435c188b76130da55f17a466d252ff7b1418b2ad3e037d127b94e3411f29"
dependencies = [
"bytes",
"prost-derive",
@@ -1719,9 +1719,9 @@ dependencies = [
[[package]]
name = "prost-derive"
-version = "0.12.4"
+version = "0.12.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "19de2de2a00075bf566bee3bd4db014b11587e84184d3f7a791bc17f1a8e9e48"
+checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1"
dependencies = [
"anyhow",
"itertools",
@@ -1732,9 +1732,9 @@ dependencies = [
[[package]]
name = "prost-types"
-version = "0.12.4"
+version = "0.12.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3235c33eb02c1f1e212abdbe34c78b264b038fb58ca612664343271e36e55ffe"
+checksum = "9091c90b0a32608e984ff2fa4091273cbdd755d54935c51d520887f4a1dbd5b0"
dependencies = [
"prost",
]
diff --git a/policy-controller/grpc/Cargo.toml b/policy-controller/grpc/Cargo.toml
index e1146f2e16ded..edc30ded5d9f7 100644
--- a/policy-controller/grpc/Cargo.toml
+++ b/policy-controller/grpc/Cargo.toml
@@ -14,7 +14,7 @@ hyper = { version = "0.14", features = ["http2", "server", "tcp"] }
futures = { version = "0.3", default-features = false }
linkerd-policy-controller-core = { path = "../core" }
maplit = "1"
-prost-types = "0.12.4"
+prost-types = "0.12.6"
tokio = { version = "1", features = ["macros"] }
tonic = { version = "0.10", default-features = false }
tracing = "0.1"
|
Java
|
https://github.com/TheAlgorithms/Java
|
8b92c3fdbeedb7ae0d3b5b6d79871af91cf7c2ea
|
yanglbme
|
2019-02-06 07:43:55
|
fix: remove unnecesary throw to fix #704
|
- Fix #704
- Thanks @lprone
|
fix: remove unnecesary throw to fix #704
- Fix #704
- Thanks @lprone
|
diff --git a/DataStructures/Heaps/EmptyHeapException.java b/DataStructures/Heaps/EmptyHeapException.java
index b7d853c56845..01668e2c849a 100644
--- a/DataStructures/Heaps/EmptyHeapException.java
+++ b/DataStructures/Heaps/EmptyHeapException.java
@@ -1,16 +1,15 @@
/**
- *
+ *
*/
-package heaps;
+package Heaps;
/**
* @author Nicolas Renard
* Exception to be thrown if the getElement method is used on an empty heap.
- *
*/
@SuppressWarnings("serial")
public class EmptyHeapException extends Exception {
-
+
public EmptyHeapException(String message) {
super(message);
}
diff --git a/DataStructures/Heaps/Heap.java b/DataStructures/Heaps/Heap.java
index 02b2ba270918..fe87d72a1db2 100644
--- a/DataStructures/Heaps/Heap.java
+++ b/DataStructures/Heaps/Heap.java
@@ -1,4 +1,4 @@
-package heaps;
+package Heaps;
/**
* Interface common to heap data structures.<br>
@@ -10,32 +10,31 @@
* max-heap).</p>
* <p>All heap-related operations (inserting or deleting an element, extracting the min or max) are performed in
* O(log n) time.</p>
+ *
* @author Nicolas Renard
- *
- *
*/
public interface Heap {
-
+
/**
- *
* @return the top element in the heap, the one with lowest key for min-heap or with
* the highest key for max-heap
- * @throws Exception if heap is empty
+ * @throws EmptyHeapException if heap is empty
*/
- public abstract HeapElement getElement() throws EmptyHeapException;
+ HeapElement getElement() throws EmptyHeapException;
+
/**
* Inserts an element in the heap. Adds it to then end and toggle it until it finds its
* right position.
- *
+ *
* @param element an instance of the HeapElement class.
*/
- public abstract void insertElement(HeapElement element);
-
+ void insertElement(HeapElement element);
+
/**
* Delete an element in the heap.
- *
+ *
* @param elementIndex int containing the position in the heap of the element to be deleted.
*/
- public abstract void deleteElement(int elementIndex);
+ void deleteElement(int elementIndex);
-}
+}
\ No newline at end of file
diff --git a/DataStructures/Heaps/HeapElement.java b/DataStructures/Heaps/HeapElement.java
index e0cc93ccbfe0..60640346b3cc 100644
--- a/DataStructures/Heaps/HeapElement.java
+++ b/DataStructures/Heaps/HeapElement.java
@@ -1,7 +1,7 @@
/**
- *
+ *
*/
-package heaps;
+package Heaps;
import java.lang.Double;
import java.lang.Object;
@@ -12,116 +12,110 @@
* or double, either primitive type or object) and any kind of IMMUTABLE object the user sees fit
* to carry any information he/she likes. Be aware that the use of a mutable object might
* jeopardize the integrity of this information. </p>
- * @author Nicolas Renard
*
+ * @author Nicolas Renard
*/
public class HeapElement {
private final double key;
private final Object additionalInfo;
-
+
// Constructors
/**
- *
- * @param key : a number of primitive type 'double'
+ * @param key : a number of primitive type 'double'
* @param info : any kind of IMMUTABLE object. May be null, since the purpose is only to carry
- * additional information of use for the user
+ * additional information of use for the user
*/
public HeapElement(double key, Object info) {
this.key = key;
this.additionalInfo = info;
}
-
+
/**
- *
- * @param key : a number of primitive type 'int'
+ * @param key : a number of primitive type 'int'
* @param info : any kind of IMMUTABLE object. May be null, since the purpose is only to carry
- * additional information of use for the user
+ * additional information of use for the user
*/
public HeapElement(int key, Object info) {
this.key = key;
this.additionalInfo = info;
}
-
+
/**
- *
- * @param key : a number of object type 'Integer'
+ * @param key : a number of object type 'Integer'
* @param info : any kind of IMMUTABLE object. May be null, since the purpose is only to carry
- * additional information of use for the user
+ * additional information of use for the user
*/
public HeapElement(Integer key, Object info) {
this.key = key;
this.additionalInfo = info;
}
-
+
/**
- *
- * @param key : a number of object type 'Double'
+ * @param key : a number of object type 'Double'
* @param info : any kind of IMMUTABLE object. May be null, since the purpose is only to carry
- * additional information of use for the user
+ * additional information of use for the user
*/
public HeapElement(Double key, Object info) {
this.key = key;
this.additionalInfo = info;
}
-
+
/**
- *
* @param key : a number of primitive type 'double'
*/
public HeapElement(double key) {
this.key = key;
this.additionalInfo = null;
}
-
+
/**
- *
* @param key : a number of primitive type 'int'
*/
public HeapElement(int key) {
this.key = key;
this.additionalInfo = null;
}
-
+
/**
- *
* @param key : a number of object type 'Integer'
*/
public HeapElement(Integer key) {
this.key = key;
this.additionalInfo = null;
}
-
+
/**
- *
* @param key : a number of object type 'Double'
*/
public HeapElement(Double key) {
this.key = key;
this.additionalInfo = null;
}
-
+
// Getters
+
/**
* @return the object containing the additional info provided by the user.
*/
public Object getInfo() {
return additionalInfo;
}
+
/**
* @return the key value of the element
*/
public double getKey() {
return key;
}
-
+
// Overridden object methods
-
+
public String toString() {
- return "Key: " + key + " - " +additionalInfo.toString();
+ return "Key: " + key + " - " + additionalInfo.toString();
}
+
/**
- *
* @param otherHeapElement
* @return true if the keys on both elements are identical and the additional info objects
* are identical.
diff --git a/DataStructures/Heaps/MaxHeap.java b/DataStructures/Heaps/MaxHeap.java
index 5f774e3534a8..302840c14d05 100644
--- a/DataStructures/Heaps/MaxHeap.java
+++ b/DataStructures/Heaps/MaxHeap.java
@@ -1,4 +1,4 @@
-package heaps;
+package Heaps;
import java.util.ArrayList;
import java.util.List;
@@ -6,66 +6,71 @@
/**
* Heap tree where a node's key is higher than or equal to its parent's and lower than or equal
* to its children's.
- * @author Nicolas Renard
*
+ * @author Nicolas Renard
*/
public class MaxHeap implements Heap {
-
+
private final List<HeapElement> maxHeap;
-
- public MaxHeap(List<HeapElement> listElements) throws Exception {
- maxHeap = new ArrayList<HeapElement>();
+
+ public MaxHeap(List<HeapElement> listElements) {
+ maxHeap = new ArrayList<>();
for (HeapElement heapElement : listElements) {
if (heapElement != null) insertElement(heapElement);
else System.out.println("Null element. Not added to heap");
}
if (maxHeap.size() == 0) System.out.println("No element has been added, empty heap.");
- }
-
- // Get the element at a given index. The key for the list is equal to index value - 1
+ }
+
+ /**
+ * Get the element at a given index. The key for the list is equal to index value - 1
+ *
+ * @param elementIndex index
+ * @return heapElement
+ */
public HeapElement getElement(int elementIndex) {
- if ((elementIndex <= 0) && (elementIndex > maxHeap.size())) throw new IndexOutOfBoundsException("Index out of heap range");
+ if ((elementIndex <= 0) || (elementIndex > maxHeap.size()))
+ throw new IndexOutOfBoundsException("Index out of heap range");
return maxHeap.get(elementIndex - 1);
}
-
+
// Get the key of the element at a given index
private double getElementKey(int elementIndex) {
return maxHeap.get(elementIndex - 1).getKey();
}
-
+
// Swaps two elements in the heap
private void swap(int index1, int index2) {
HeapElement temporaryElement = maxHeap.get(index1 - 1);
maxHeap.set(index1 - 1, maxHeap.get(index2 - 1));
maxHeap.set(index2 - 1, temporaryElement);
}
-
- // Toggle an element up to its right place as long as its key is lower than its parent's
+
+ // Toggle an element up to its right place as long as its key is lower than its parent's
private void toggleUp(int elementIndex) {
double key = maxHeap.get(elementIndex - 1).getKey();
- while (getElementKey((int) Math.floor(elementIndex/2)) < key) {
- swap(elementIndex, (int) Math.floor(elementIndex/2));
- elementIndex = (int) Math.floor(elementIndex/2);
+ while (getElementKey((int) Math.floor(elementIndex / 2)) < key) {
+ swap(elementIndex, (int) Math.floor(elementIndex / 2));
+ elementIndex = (int) Math.floor(elementIndex / 2);
}
}
-
+
// Toggle an element down to its right place as long as its key is higher
- // than any of its children's
+ // than any of its children's
private void toggleDown(int elementIndex) {
double key = maxHeap.get(elementIndex - 1).getKey();
- boolean wrongOrder = (key < getElementKey(elementIndex*2)) || (key < getElementKey(Math.min(elementIndex*2, maxHeap.size())));
- while ((2*elementIndex <= maxHeap.size()) && wrongOrder) {
+ boolean wrongOrder = (key < getElementKey(elementIndex * 2)) || (key < getElementKey(Math.min(elementIndex * 2, maxHeap.size())));
+ while ((2 * elementIndex <= maxHeap.size()) && wrongOrder) {
// Check whether it shall swap the element with its left child or its right one if any.
- if ((2*elementIndex < maxHeap.size()) && (getElementKey(elementIndex*2 + 1) > getElementKey(elementIndex*2))) {
- swap(elementIndex, 2*elementIndex + 1);
- elementIndex = 2*elementIndex + 1;
+ if ((2 * elementIndex < maxHeap.size()) && (getElementKey(elementIndex * 2 + 1) > getElementKey(elementIndex * 2))) {
+ swap(elementIndex, 2 * elementIndex + 1);
+ elementIndex = 2 * elementIndex + 1;
+ } else {
+ swap(elementIndex, 2 * elementIndex);
+ elementIndex = 2 * elementIndex;
}
- else {
- swap(elementIndex, 2*elementIndex);
- elementIndex = 2*elementIndex;
- }
- wrongOrder = (key < getElementKey(elementIndex*2)) || (key < getElementKey(Math.min(elementIndex*2, maxHeap.size())));
-
+ wrongOrder = (key < getElementKey(elementIndex * 2)) || (key < getElementKey(Math.min(elementIndex * 2, maxHeap.size())));
+
}
}
@@ -84,21 +89,23 @@ public void insertElement(HeapElement element) {
@Override
public void deleteElement(int elementIndex) {
- if (maxHeap.isEmpty())
- try {
- throw new EmptyHeapException("Attempt to delete an element from an empty heap");
- } catch (EmptyHeapException e) {
- e.printStackTrace();
- }
- if ((elementIndex > maxHeap.size()) && (elementIndex <= 0)) throw new IndexOutOfBoundsException("Index out of heap range");
+ if (maxHeap.isEmpty())
+ try {
+ throw new EmptyHeapException("Attempt to delete an element from an empty heap");
+ } catch (EmptyHeapException e) {
+ e.printStackTrace();
+ }
+ if ((elementIndex > maxHeap.size()) || (elementIndex <= 0))
+ throw new IndexOutOfBoundsException("Index out of heap range");
// The last element in heap replaces the one to be deleted
maxHeap.set(elementIndex - 1, getElement(maxHeap.size()));
maxHeap.remove(maxHeap.size());
// Shall the new element be moved up...
- if (getElementKey(elementIndex) > getElementKey((int) Math.floor(elementIndex/2))) toggleUp(elementIndex);
- // ... or down ?
- else if (((2*elementIndex <= maxHeap.size()) && (getElementKey(elementIndex) < getElementKey(elementIndex*2))) ||
- ((2*elementIndex < maxHeap.size()) && (getElementKey(elementIndex) < getElementKey(elementIndex*2)))) toggleDown(elementIndex);
+ if (getElementKey(elementIndex) > getElementKey((int) Math.floor(elementIndex / 2))) toggleUp(elementIndex);
+ // ... or down ?
+ else if (((2 * elementIndex <= maxHeap.size()) && (getElementKey(elementIndex) < getElementKey(elementIndex * 2))) ||
+ ((2 * elementIndex < maxHeap.size()) && (getElementKey(elementIndex) < getElementKey(elementIndex * 2))))
+ toggleDown(elementIndex);
}
@Override
@@ -109,7 +116,4 @@ public HeapElement getElement() throws EmptyHeapException {
throw new EmptyHeapException("Heap is empty. Error retrieving element");
}
}
-
-}
-
-
+}
\ No newline at end of file
diff --git a/DataStructures/Heaps/MinHeap.java b/DataStructures/Heaps/MinHeap.java
index fbf2b86ffc3e..5fca978f6549 100644
--- a/DataStructures/Heaps/MinHeap.java
+++ b/DataStructures/Heaps/MinHeap.java
@@ -1,7 +1,7 @@
/**
- *
+ *
*/
-package heaps;
+package Heaps;
import java.util.ArrayList;
import java.util.List;
@@ -9,66 +9,66 @@
/**
* Heap tree where a node's key is higher than or equal to its parent's and lower than or equal
* to its children's.
- * @author Nicolas Renard
*
+ * @author Nicolas Renard
*/
public class MinHeap implements Heap {
-
+
private final List<HeapElement> minHeap;
-
- public MinHeap(List<HeapElement> listElements) throws Exception {
- minHeap = new ArrayList<HeapElement>();
+
+ public MinHeap(List<HeapElement> listElements) {
+ minHeap = new ArrayList<>();
for (HeapElement heapElement : listElements) {
if (heapElement != null) insertElement(heapElement);
else System.out.println("Null element. Not added to heap");
}
if (minHeap.size() == 0) System.out.println("No element has been added, empty heap.");
}
-
+
// Get the element at a given index. The key for the list is equal to index value - 1
public HeapElement getElement(int elementIndex) {
- if ((elementIndex <= 0) && (elementIndex > minHeap.size())) throw new IndexOutOfBoundsException("Index out of heap range");
+ if ((elementIndex <= 0) || (elementIndex > minHeap.size()))
+ throw new IndexOutOfBoundsException("Index out of heap range");
return minHeap.get(elementIndex - 1);
}
-
+
// Get the key of the element at a given index
private double getElementKey(int elementIndex) {
return minHeap.get(elementIndex - 1).getKey();
}
-
+
// Swaps two elements in the heap
private void swap(int index1, int index2) {
HeapElement temporaryElement = minHeap.get(index1 - 1);
minHeap.set(index1 - 1, minHeap.get(index2 - 1));
minHeap.set(index2 - 1, temporaryElement);
}
-
- // Toggle an element up to its right place as long as its key is lower than its parent's
+
+ // Toggle an element up to its right place as long as its key is lower than its parent's
private void toggleUp(int elementIndex) {
double key = minHeap.get(elementIndex - 1).getKey();
- while (getElementKey((int) Math.floor(elementIndex/2)) > key) {
- swap(elementIndex, (int) Math.floor(elementIndex/2));
- elementIndex = (int) Math.floor(elementIndex/2);
+ while (getElementKey((int) Math.floor(elementIndex / 2)) > key) {
+ swap(elementIndex, (int) Math.floor(elementIndex / 2));
+ elementIndex = (int) Math.floor(elementIndex / 2);
}
}
-
+
// Toggle an element down to its right place as long as its key is higher
- // than any of its children's
+ // than any of its children's
private void toggleDown(int elementIndex) {
double key = minHeap.get(elementIndex - 1).getKey();
- boolean wrongOrder = (key > getElementKey(elementIndex*2)) || (key > getElementKey(Math.min(elementIndex*2, minHeap.size())));
- while ((2*elementIndex <= minHeap.size()) && wrongOrder) {
+ boolean wrongOrder = (key > getElementKey(elementIndex * 2)) || (key > getElementKey(Math.min(elementIndex * 2, minHeap.size())));
+ while ((2 * elementIndex <= minHeap.size()) && wrongOrder) {
// Check whether it shall swap the element with its left child or its right one if any.
- if ((2*elementIndex < minHeap.size()) && (getElementKey(elementIndex*2 + 1) < getElementKey(elementIndex*2))) {
- swap(elementIndex, 2*elementIndex + 1);
- elementIndex = 2*elementIndex + 1;
- }
- else {
- swap(elementIndex, 2*elementIndex);
- elementIndex = 2*elementIndex;
+ if ((2 * elementIndex < minHeap.size()) && (getElementKey(elementIndex * 2 + 1) < getElementKey(elementIndex * 2))) {
+ swap(elementIndex, 2 * elementIndex + 1);
+ elementIndex = 2 * elementIndex + 1;
+ } else {
+ swap(elementIndex, 2 * elementIndex);
+ elementIndex = 2 * elementIndex;
}
- wrongOrder = (key > getElementKey(elementIndex*2)) || (key > getElementKey(Math.min(elementIndex*2, minHeap.size())));
-
+ wrongOrder = (key > getElementKey(elementIndex * 2)) || (key > getElementKey(Math.min(elementIndex * 2, minHeap.size())));
+
}
}
@@ -87,23 +87,25 @@ public void insertElement(HeapElement element) {
@Override
public void deleteElement(int elementIndex) {
- if (minHeap.isEmpty())
- try {
- throw new EmptyHeapException("Attempt to delete an element from an empty heap");
- } catch (EmptyHeapException e) {
- e.printStackTrace();
- }
- if ((elementIndex > minHeap.size()) && (elementIndex <= 0)) throw new IndexOutOfBoundsException("Index out of heap range");
+ if (minHeap.isEmpty())
+ try {
+ throw new EmptyHeapException("Attempt to delete an element from an empty heap");
+ } catch (EmptyHeapException e) {
+ e.printStackTrace();
+ }
+ if ((elementIndex > minHeap.size()) || (elementIndex <= 0))
+ throw new IndexOutOfBoundsException("Index out of heap range");
// The last element in heap replaces the one to be deleted
minHeap.set(elementIndex - 1, getElement(minHeap.size()));
minHeap.remove(minHeap.size());
// Shall the new element be moved up...
- if (getElementKey(elementIndex) < getElementKey((int) Math.floor(elementIndex/2))) toggleUp(elementIndex);
- // ... or down ?
- else if (((2*elementIndex <= minHeap.size()) && (getElementKey(elementIndex) > getElementKey(elementIndex*2))) ||
- ((2*elementIndex < minHeap.size()) && (getElementKey(elementIndex) > getElementKey(elementIndex*2)))) toggleDown(elementIndex);
+ if (getElementKey(elementIndex) < getElementKey((int) Math.floor(elementIndex / 2))) toggleUp(elementIndex);
+ // ... or down ?
+ else if (((2 * elementIndex <= minHeap.size()) && (getElementKey(elementIndex) > getElementKey(elementIndex * 2))) ||
+ ((2 * elementIndex < minHeap.size()) && (getElementKey(elementIndex) > getElementKey(elementIndex * 2))))
+ toggleDown(elementIndex);
}
-
+
@Override
public HeapElement getElement() throws EmptyHeapException {
try {
@@ -112,4 +114,4 @@ public HeapElement getElement() throws EmptyHeapException {
throw new EmptyHeapException("Heap is empty. Error retrieving element");
}
}
-}
+}
\ No newline at end of file
diff --git a/DataStructures/Heaps/MinPriorityQueue.java b/DataStructures/Heaps/MinPriorityQueue.java
index 3dc2bd28083c..f117b932800b 100644
--- a/DataStructures/Heaps/MinPriorityQueue.java
+++ b/DataStructures/Heaps/MinPriorityQueue.java
@@ -1,13 +1,13 @@
-
+package Heaps;
/* Minimum Priority Queue
-* It is a part of heap data structure
-* A heap is a specific tree based data structure
-* in which all the nodes of tree are in a specific order.
-* that is the children are arranged in some
-* respect of their parents, can either be greater
-* or less than the parent. This makes it a min priority queue
-* or max priority queue.
-*/
+ * It is a part of heap data structure
+ * A heap is a specific tree based data structure
+ * in which all the nodes of tree are in a specific order.
+ * that is the children are arranged in some
+ * respect of their parents, can either be greater
+ * or less than the parent. This makes it a min priority queue
+ * or max priority queue.
+ */
// Functions: insert, delete, peek, isEmpty, print, heapSort, sink
@@ -16,15 +16,15 @@ public class MinPriorityQueue {
private int capacity;
private int size;
- // calss the constructor and initializes the capacity
+ // calss the constructor and initializes the capacity
MinPriorityQueue(int c) {
this.capacity = c;
this.size = 0;
this.heap = new int[c + 1];
}
- // inserts the key at the end and rearranges it
- // so that the binary heap is in appropriate order
+ // inserts the key at the end and rearranges it
+ // so that the binary heap is in appropriate order
public void insert(int key) {
if (this.isFull())
return;
@@ -41,41 +41,41 @@ public void insert(int key) {
this.size++;
}
- // returns the highest priority value
+ // returns the highest priority value
public int peek() {
return this.heap[1];
}
- // returns boolean value whether the heap is empty or not
+ // returns boolean value whether the heap is empty or not
public boolean isEmpty() {
if (0 == this.size)
return true;
return false;
}
- // returns boolean value whether the heap is full or not
+ // returns boolean value whether the heap is full or not
public boolean isFull() {
if (this.size == this.capacity)
return true;
return false;
}
- // prints the heap
+ // prints the heap
public void print() {
for (int i = 1; i <= this.capacity; i++)
System.out.print(this.heap[i] + " ");
System.out.println();
}
- // heap sorting can be done by performing
- // delete function to the number of times of the size of the heap
- // it returns reverse sort because it is a min priority queue
+ // heap sorting can be done by performing
+ // delete function to the number of times of the size of the heap
+ // it returns reverse sort because it is a min priority queue
public void heapSort() {
for (int i = 1; i < this.capacity; i++)
this.delete();
}
- // this function reorders the heap after every delete function
+ // this function reorders the heap after every delete function
private void sink() {
int k = 1;
while (2 * k <= this.size || 2 * k + 1 <= this.size) {
@@ -103,7 +103,7 @@ private void sink() {
}
}
- // deletes the highest priority value from the heap
+ // deletes the highest priority value from the heap
public int delete() {
int min = this.heap[1];
this.heap[1] = this.heap[this.size];
diff --git a/Dynamic Programming/LongestIncreasingSubsequence.java b/Dynamic Programming/LongestIncreasingSubsequence.java
index eaa574a40989..ccbb88468bd3 100644
--- a/Dynamic Programming/LongestIncreasingSubsequence.java
+++ b/Dynamic Programming/LongestIncreasingSubsequence.java
@@ -1,12 +1,11 @@
import java.util.Scanner;
/**
- *
* @author Afrizal Fikri (https://github.com/icalF)
- *
+ * @author Libin Yang (https://github.com/yanglbme)
*/
public class LongestIncreasingSubsequence {
- public static void main(String[] args) throws Exception {
+ public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
@@ -20,7 +19,7 @@ public static void main(String[] args) throws Exception {
}
private static int upperBound(int[] ar, int l, int r, int key) {
- while (l < r-1) {
+ while (l < r - 1) {
int m = (l + r) / 2;
if (ar[m] >= key)
r = m;
@@ -35,10 +34,12 @@ private static int LIS(int[] array) {
int N = array.length;
if (N == 0)
return 0;
-
+
int[] tail = new int[N];
- int length = 1; // always points empty slot in tail
-
+
+ // always points empty slot in tail
+ int length = 1;
+
tail[0] = array[0];
for (int i = 1; i < N; i++) {
@@ -46,17 +47,17 @@ private static int LIS(int[] array) {
if (array[i] < tail[0])
tail[0] = array[i];
- // array[i] extends largest subsequence
- else if (array[i] > tail[length-1])
+ // array[i] extends largest subsequence
+ else if (array[i] > tail[length - 1])
tail[length++] = array[i];
- // array[i] will become end candidate of an existing subsequence or
- // Throw away larger elements in all LIS, to make room for upcoming grater elements than array[i]
- // (and also, array[i] would have already appeared in one of LIS, identify the location and replace it)
+ // array[i] will become end candidate of an existing subsequence or
+ // Throw away larger elements in all LIS, to make room for upcoming grater elements than array[i]
+ // (and also, array[i] would have already appeared in one of LIS, identify the location and replace it)
else
- tail[upperBound(tail, -1, length-1, array[i])] = array[i];
+ tail[upperBound(tail, -1, length - 1, array[i])] = array[i];
}
-
+
return length;
}
}
\ No newline at end of file
diff --git a/Others/Dijkshtra.java b/Others/Dijkshtra.java
index e0bd6737a462..17f8391777aa 100644
--- a/Others/Dijkshtra.java
+++ b/Others/Dijkshtra.java
@@ -1,83 +1,82 @@
-/*
-@author : Mayank K Jha
+/**
+ * @author Mayank K Jha
+ */
-*/
-
-import java.io.IOException;
import java.util.Arrays;
import java.util.Scanner;
import java.util.Stack;
public class Dijkshtra {
- public static void main(String[] args) throws IOException {
+ public static void main(String[] args) {
Scanner in = new Scanner(System.in);
// n = Number of nodes or vertices
- int n = in.nextInt();
+ int n = in.nextInt();
// m = Number of Edges
- int m = in.nextInt();
+ int m = in.nextInt();
// Adjacency Matrix
- long w[][] = new long [n+1][n+1];
+ long[][] w = new long[n + 1][n + 1];
- //Initializing Matrix with Certain Maximum Value for path b/w any two vertices
+ // Initializing Matrix with Certain Maximum Value for path b/w any two vertices
for (long[] row : w) {
- Arrays.fill(row, 1000000l);
+ Arrays.fill(row, 1000000L);
}
/* From above,we Have assumed that,initially path b/w any two Pair of vertices is Infinite such that Infinite = 1000000l
For simplicity , We can also take path Value = Long.MAX_VALUE , but i have taken Max Value = 1000000l */
// Taking Input as Edge Location b/w a pair of vertices
- for(int i = 0; i < m; i++) {
- int x = in.nextInt(),y=in.nextInt();
- long cmp = in.nextLong();
-
- //Comparing previous edge value with current value - Cycle Case
- if(w[x][y] > cmp) {
- w[x][y] = cmp; w[y][x] = cmp;
- }
+ for (int i = 0; i < m; i++) {
+ int x = in.nextInt(), y = in.nextInt();
+ long cmp = in.nextLong();
+
+ // Comparing previous edge value with current value - Cycle Case
+ if (w[x][y] > cmp) {
+ w[x][y] = cmp;
+ w[y][x] = cmp;
+ }
}
- // Implementing Dijkshtra's Algorithm
- Stack<Integer> t = new Stack<Integer>();
+ // Implementing Dijkshtra's Algorithm
+ Stack<Integer> t = new Stack<>();
int src = in.nextInt();
- for(int i = 1; i <= n; i++) {
- if(i != src) {
+ for (int i = 1; i <= n; i++) {
+ if (i != src) {
t.push(i);
}
}
- Stack <Integer> p = new Stack<Integer>();
+ Stack<Integer> p = new Stack<>();
p.push(src);
w[src][src] = 0;
- while(!t.isEmpty()) {
+ while (!t.isEmpty()) {
int min = 989997979;
int loc = -1;
- for(int i = 0; i < t.size(); i++) {
+ for (int i = 0; i < t.size(); i++) {
w[src][t.elementAt(i)] = Math.min(w[src][t.elementAt(i)], w[src][p.peek()] + w[p.peek()][t.elementAt(i)]);
- if(w[src][t.elementAt(i)] <= min) {
+ if (w[src][t.elementAt(i)] <= min) {
min = (int) w[src][t.elementAt(i)];
loc = i;
}
}
p.push(t.elementAt(loc));
t.removeElementAt(loc);
- }
+ }
// Printing shortest path from the given source src
- for(int i = 1; i <= n; i++) {
- if(i != src && w[src][i] != 1000000l) {
- System.out.print(w[src][i] + " ");
+ for (int i = 1; i <= n; i++) {
+ if (i != src && w[src][i] != 1000000L) {
+ System.out.print(w[src][i] + " ");
+ }
+ // Printing -1 if there is no path b/w given pair of edges
+ else if (i != src) {
+ System.out.print("-1" + " ");
+ }
}
- // Printing -1 if there is no path b/w given pair of edges
- else if(i != src) {
- System.out.print("-1" + " ");
- }
- }
}
-}
+}
\ No newline at end of file
diff --git a/Others/Dijkstra.java b/Others/Dijkstra.java
index b3df65bfd2e3..e8ad2680fdbf 100644
--- a/Others/Dijkstra.java
+++ b/Others/Dijkstra.java
@@ -5,167 +5,174 @@
* Dijkstra's algorithm,is a graph search algorithm that solves the single-source
* shortest path problem for a graph with nonnegative edge path costs, producing
* a shortest path tree.
- *
+ * <p>
* NOTE: The inputs to Dijkstra's algorithm are a directed and weighted graph consisting
* of 2 or more nodes, generally represented by an adjacency matrix or list, and a start node.
- *
+ * <p>
* Original source of code: https://rosettacode.org/wiki/Dijkstra%27s_algorithm#Java
* Also most of the comments are from RosettaCode.
- *
*/
-//import java.io.*;
-import java.util.*;
+
+import java.util.*;
+
public class Dijkstra {
- private static final Graph.Edge[] GRAPH = {
- new Graph.Edge("a", "b", 7), //Distance from node "a" to node "b" is 7. In the current Graph there is no way to move the other way (e,g, from "b" to "a"), a new edge would be needed for that
- new Graph.Edge("a", "c", 9),
- new Graph.Edge("a", "f", 14),
- new Graph.Edge("b", "c", 10),
- new Graph.Edge("b", "d", 15),
- new Graph.Edge("c", "d", 11),
- new Graph.Edge("c", "f", 2),
- new Graph.Edge("d", "e", 6),
- new Graph.Edge("e", "f", 9),
- };
- private static final String START = "a";
- private static final String END = "e";
-
- /**
- * main function
- * Will run the code with "GRAPH" that was defined above.
- */
- public static void main(String[] args) {
- Graph g = new Graph(GRAPH);
- g.dijkstra(START);
- g.printPath(END);
- //g.printAllPaths();
- }
+ private static final Graph.Edge[] GRAPH = {
+ // Distance from node "a" to node "b" is 7.
+ // In the current Graph there is no way to move the other way (e,g, from "b" to "a"),
+ // a new edge would be needed for that
+ new Graph.Edge("a", "b", 7),
+ new Graph.Edge("a", "c", 9),
+ new Graph.Edge("a", "f", 14),
+ new Graph.Edge("b", "c", 10),
+ new Graph.Edge("b", "d", 15),
+ new Graph.Edge("c", "d", 11),
+ new Graph.Edge("c", "f", 2),
+ new Graph.Edge("d", "e", 6),
+ new Graph.Edge("e", "f", 9),
+ };
+ private static final String START = "a";
+ private static final String END = "e";
+
+ /**
+ * main function
+ * Will run the code with "GRAPH" that was defined above.
+ */
+ public static void main(String[] args) {
+ Graph g = new Graph(GRAPH);
+ g.dijkstra(START);
+ g.printPath(END);
+ //g.printAllPaths();
+ }
}
-
+
class Graph {
- private final Map<String, Vertex> graph; // mapping of vertex names to Vertex objects, built from a set of Edges
-
- /** One edge of the graph (only used by Graph constructor) */
- public static class Edge {
- public final String v1, v2;
- public final int dist;
- public Edge(String v1, String v2, int dist) {
- this.v1 = v1;
- this.v2 = v2;
- this.dist = dist;
- }
- }
-
- /** One vertex of the graph, complete with mappings to neighbouring vertices */
- public static class Vertex implements Comparable<Vertex> {
- public final String name;
- public int dist = Integer.MAX_VALUE; // MAX_VALUE assumed to be infinity
- public Vertex previous = null;
- public final Map<Vertex, Integer> neighbours = new HashMap<>();
-
- public Vertex(String name) {
- this.name = name;
- }
-
- private void printPath() {
- if (this == this.previous) {
- System.out.printf("%s", this.name);
- }
- else if (this.previous == null) {
- System.out.printf("%s(unreached)", this.name);
- }
- else {
- this.previous.printPath();
- System.out.printf(" -> %s(%d)", this.name, this.dist);
- }
- }
-
- public int compareTo(Vertex other) {
- if (dist == other.dist)
- return name.compareTo(other.name);
-
- return Integer.compare(dist, other.dist);
- }
-
- @Override public String toString() {
- return "(" + name + ", " + dist + ")";
- }
-}
-
- /** Builds a graph from a set of edges */
- public Graph(Edge[] edges) {
- graph = new HashMap<>(edges.length);
-
- //one pass to find all vertices
- for (Edge e : edges) {
- if (!graph.containsKey(e.v1)) graph.put(e.v1, new Vertex(e.v1));
- if (!graph.containsKey(e.v2)) graph.put(e.v2, new Vertex(e.v2));
- }
-
- //another pass to set neighbouring vertices
- for (Edge e : edges) {
- graph.get(e.v1).neighbours.put(graph.get(e.v2), e.dist);
- //graph.get(e.v2).neighbours.put(graph.get(e.v1), e.dist); // also do this for an undirected graph
- }
- }
-
- /** Runs dijkstra using a specified source vertex */
- public void dijkstra(String startName) {
- if (!graph.containsKey(startName)) {
- System.err.printf("Graph doesn't contain start vertex \"%s\"\n", startName);
- return;
- }
- final Vertex source = graph.get(startName);
- NavigableSet<Vertex> q = new TreeSet<>();
-
- // set-up vertices
- for (Vertex v : graph.values()) {
- v.previous = v == source ? source : null;
- v.dist = v == source ? 0 : Integer.MAX_VALUE;
- q.add(v);
- }
-
- dijkstra(q);
- }
-
- /** Implementation of dijkstra's algorithm using a binary heap. */
- private void dijkstra(final NavigableSet<Vertex> q) {
- Vertex u, v;
- while (!q.isEmpty()) {
-
- u = q.pollFirst(); // vertex with shortest distance (first iteration will return source)
- if (u.dist == Integer.MAX_VALUE) break; // we can ignore u (and any other remaining vertices) since they are unreachable
-
- //look at distances to each neighbour
- for (Map.Entry<Vertex, Integer> a : u.neighbours.entrySet()) {
- v = a.getKey(); //the neighbour in this iteration
-
- final int alternateDist = u.dist + a.getValue();
- if (alternateDist < v.dist) { // shorter path to neighbour found
- q.remove(v);
- v.dist = alternateDist;
- v.previous = u;
- q.add(v);
- }
- }
- }
- }
-
- /** Prints a path from the source to the specified vertex */
- public void printPath(String endName) {
- if (!graph.containsKey(endName)) {
- System.err.printf("Graph doesn't contain end vertex \"%s\"\n", endName);
- return;
- }
-
- graph.get(endName).printPath();
- System.out.println();
- }
- /** Prints the path from the source to every vertex (output order is not guaranteed) */
- public void printAllPaths() {
- for (Vertex v : graph.values()) {
- v.printPath();
- System.out.println();
- }
- }
-}
+ // mapping of vertex names to Vertex objects, built from a set of Edges
+ private final Map<String, Vertex> graph;
+
+ /** One edge of the graph (only used by Graph constructor) */
+ public static class Edge {
+ public final String v1, v2;
+ public final int dist;
+
+ public Edge(String v1, String v2, int dist) {
+ this.v1 = v1;
+ this.v2 = v2;
+ this.dist = dist;
+ }
+ }
+
+ /** One vertex of the graph, complete with mappings to neighbouring vertices */
+ public static class Vertex implements Comparable<Vertex> {
+ public final String name;
+ // MAX_VALUE assumed to be infinity
+ public int dist = Integer.MAX_VALUE;
+ public Vertex previous = null;
+ public final Map<Vertex, Integer> neighbours = new HashMap<>();
+
+ public Vertex(String name) {
+ this.name = name;
+ }
+
+ private void printPath() {
+ if (this == this.previous) {
+ System.out.printf("%s", this.name);
+ } else if (this.previous == null) {
+ System.out.printf("%s(unreached)", this.name);
+ } else {
+ this.previous.printPath();
+ System.out.printf(" -> %s(%d)", this.name, this.dist);
+ }
+ }
+
+ public int compareTo(Vertex other) {
+ if (dist == other.dist)
+ return name.compareTo(other.name);
+
+ return Integer.compare(dist, other.dist);
+ }
+
+ @Override
+ public String toString() {
+ return "(" + name + ", " + dist + ")";
+ }
+ }
+
+ /** Builds a graph from a set of edges */
+ public Graph(Edge[] edges) {
+ graph = new HashMap<>(edges.length);
+
+ // one pass to find all vertices
+ for (Edge e : edges) {
+ if (!graph.containsKey(e.v1)) graph.put(e.v1, new Vertex(e.v1));
+ if (!graph.containsKey(e.v2)) graph.put(e.v2, new Vertex(e.v2));
+ }
+
+ // another pass to set neighbouring vertices
+ for (Edge e : edges) {
+ graph.get(e.v1).neighbours.put(graph.get(e.v2), e.dist);
+ // graph.get(e.v2).neighbours.put(graph.get(e.v1), e.dist); // also do this for an undirected graph
+ }
+ }
+
+ /** Runs dijkstra using a specified source vertex */
+ public void dijkstra(String startName) {
+ if (!graph.containsKey(startName)) {
+ System.err.printf("Graph doesn't contain start vertex \"%s\"\n", startName);
+ return;
+ }
+ final Vertex source = graph.get(startName);
+ NavigableSet<Vertex> q = new TreeSet<>();
+
+ // set-up vertices
+ for (Vertex v : graph.values()) {
+ v.previous = v == source ? source : null;
+ v.dist = v == source ? 0 : Integer.MAX_VALUE;
+ q.add(v);
+ }
+
+ dijkstra(q);
+ }
+
+ /** Implementation of dijkstra's algorithm using a binary heap. */
+ private void dijkstra(final NavigableSet<Vertex> q) {
+ Vertex u, v;
+ while (!q.isEmpty()) {
+ // vertex with shortest distance (first iteration will return source)
+ u = q.pollFirst();
+ if (u.dist == Integer.MAX_VALUE)
+ break; // we can ignore u (and any other remaining vertices) since they are unreachable
+
+ // look at distances to each neighbour
+ for (Map.Entry<Vertex, Integer> a : u.neighbours.entrySet()) {
+ v = a.getKey(); // the neighbour in this iteration
+
+ final int alternateDist = u.dist + a.getValue();
+ if (alternateDist < v.dist) { // shorter path to neighbour found
+ q.remove(v);
+ v.dist = alternateDist;
+ v.previous = u;
+ q.add(v);
+ }
+ }
+ }
+ }
+
+ /** Prints a path from the source to the specified vertex */
+ public void printPath(String endName) {
+ if (!graph.containsKey(endName)) {
+ System.err.printf("Graph doesn't contain end vertex \"%s\"\n", endName);
+ return;
+ }
+
+ graph.get(endName).printPath();
+ System.out.println();
+ }
+
+ /** Prints the path from the source to every vertex (output order is not guaranteed) */
+ public void printAllPaths() {
+ for (Vertex v : graph.values()) {
+ v.printPath();
+ System.out.println();
+ }
+ }
+}
\ No newline at end of file
|
metamask-extension
|
https://github.com/MetaMask/metamask-extension
|
e5ae877fa63300d9cac9492be89e977bfa2f4418
|
Daniel
|
2024-11-06 19:33:37
|
chore: Remove STX opt in modal (#28291)
|
## **Description**
[This recent
PR](https://github.com/MetaMask/metamask-extension/pull/27885) enabled
STX by default for new users and only hid the STX opt in modal. The
purpose of this PR is to clean up unused code for the STX opt in modal.
## **Related issues**
|
chore: Remove STX opt in modal (#28291)
## **Description**
[This recent
PR](https://github.com/MetaMask/metamask-extension/pull/27885) enabled
STX by default for new users and only hid the STX opt in modal. The
purpose of this PR is to clean up unused code for the STX opt in modal.
## **Related issues**
Fixes:
## **Manual testing steps**
1. Install the extension from scratch
2. Be on Ethereum mainnet and have some funds there
3. You will not see any STX opt in modal
## **Screenshots/Recordings**
<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->
### **Before**
<!-- [screenshots/recordings] -->
### **After**
<!-- [screenshots/recordings] -->
## **Pre-merge author checklist**
- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
## **Pre-merge reviewer checklist**
- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
|
diff --git a/app/_locales/de/messages.json b/app/_locales/de/messages.json
index 9af24022bcb3..771deef4c28c 100644
--- a/app/_locales/de/messages.json
+++ b/app/_locales/de/messages.json
@@ -1620,9 +1620,6 @@
"editSpeedUpEditGasFeeModalTitle": {
"message": "Beschleunigung der Gasgebühr bearbeiten"
},
- "enable": {
- "message": "Aktivieren"
- },
"enableAutoDetect": {
"message": " Automatische Erkennung aktivieren"
},
@@ -4637,25 +4634,6 @@
"smartTransactions": {
"message": "Smart Transactions"
},
- "smartTransactionsBenefit1": {
- "message": "Erfolgsrate: 99,5 %"
- },
- "smartTransactionsBenefit2": {
- "message": "Spart Ihnen Geld"
- },
- "smartTransactionsBenefit3": {
- "message": "Updates in Echtzeit"
- },
- "smartTransactionsDescription": {
- "message": "Erzielen Sie mit Smart Transactions höhere Erfolgsraten, einen Frontrunning-Schutz und eine bessere Transparenz."
- },
- "smartTransactionsDescription2": {
- "message": "Nur auf Ethereum verfügbar. Sie können diese Funktion jederzeit in den Einstellungen aktivieren oder deaktivieren. $1",
- "description": "$1 is an external link to learn more about Smart Transactions"
- },
- "smartTransactionsOptItModalTitle": {
- "message": "Verbesserter Transaktionsschutz"
- },
"snapAccountCreated": {
"message": "Konto erstellt"
},
diff --git a/app/_locales/el/messages.json b/app/_locales/el/messages.json
index 308099b1c2b1..7ae594c8b9b8 100644
--- a/app/_locales/el/messages.json
+++ b/app/_locales/el/messages.json
@@ -1620,9 +1620,6 @@
"editSpeedUpEditGasFeeModalTitle": {
"message": "Επεξεργασία τελών επίσπευσης συναλλαγής"
},
- "enable": {
- "message": "Ενεργοποίηση"
- },
"enableAutoDetect": {
"message": " Ενεργοποίηση αυτόματου εντοπισμού"
},
@@ -4637,25 +4634,6 @@
"smartTransactions": {
"message": "Έξυπνες συναλλαγές"
},
- "smartTransactionsBenefit1": {
- "message": "Ποσοστό επιτυχίας 99,5%"
- },
- "smartTransactionsBenefit2": {
- "message": "Σας εξοικονομεί χρήματα"
- },
- "smartTransactionsBenefit3": {
- "message": "Ενημερώσεις σε πραγματικό χρόνο"
- },
- "smartTransactionsDescription": {
- "message": "Ξεκλειδώστε υψηλότερα ποσοστά επιτυχίας, προστασία σε \"προπορευόμενες συναλλαγές\" και καλύτερη ορατότητα με τις Έξυπνες Συναλλαγές."
- },
- "smartTransactionsDescription2": {
- "message": "Διατίθεται μόνο στο Ethereum. Ενεργοποιήστε ή απενεργοποιήστε το ανά πάσα στιγμή στις ρυθμίσεις. $1",
- "description": "$1 is an external link to learn more about Smart Transactions"
- },
- "smartTransactionsOptItModalTitle": {
- "message": "Ενισχυμένη Προστασία Συναλλαγών"
- },
"snapAccountCreated": {
"message": "Ο λογαριασμός δημιουργήθηκε"
},
diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json
index 409965f07ab9..ab6b06411731 100644
--- a/app/_locales/en/messages.json
+++ b/app/_locales/en/messages.json
@@ -1849,9 +1849,6 @@
"editSpendingCapSpecialCharError": {
"message": "Enter numbers only"
},
- "enable": {
- "message": "Enable"
- },
"enableAutoDetect": {
"message": " Enable autodetect"
},
@@ -5064,25 +5061,6 @@
"smartTransactions": {
"message": "Smart Transactions"
},
- "smartTransactionsBenefit1": {
- "message": "99.5% success rate"
- },
- "smartTransactionsBenefit2": {
- "message": "Saves you money"
- },
- "smartTransactionsBenefit3": {
- "message": "Real-time updates"
- },
- "smartTransactionsDescription": {
- "message": "Unlock higher success rates, frontrunning protection, and better visibility with Smart Transactions."
- },
- "smartTransactionsDescription2": {
- "message": "Only available on Ethereum. Enable or disable any time in settings. $1",
- "description": "$1 is an external link to learn more about Smart Transactions"
- },
- "smartTransactionsOptItModalTitle": {
- "message": "Enhanced Transaction Protection"
- },
"snapAccountCreated": {
"message": "Account created"
},
diff --git a/app/_locales/en_GB/messages.json b/app/_locales/en_GB/messages.json
index fc635e33a708..e8eb1e58ea71 100644
--- a/app/_locales/en_GB/messages.json
+++ b/app/_locales/en_GB/messages.json
@@ -1707,9 +1707,6 @@
"effortlesslyNavigateYourDigitalAssets": {
"message": "Effortlessly navigate your digital assets"
},
- "enable": {
- "message": "Enable"
- },
"enableAutoDetect": {
"message": " Enable autodetect"
},
@@ -4815,25 +4812,6 @@
"smartTransactions": {
"message": "Smart Transactions"
},
- "smartTransactionsBenefit1": {
- "message": "99.5% success rate"
- },
- "smartTransactionsBenefit2": {
- "message": "Saves you money"
- },
- "smartTransactionsBenefit3": {
- "message": "Real-time updates"
- },
- "smartTransactionsDescription": {
- "message": "Unlock higher success rates, frontrunning protection, and better visibility with Smart Transactions."
- },
- "smartTransactionsDescription2": {
- "message": "Only available on Ethereum. Enable or disable any time in settings. $1",
- "description": "$1 is an external link to learn more about Smart Transactions"
- },
- "smartTransactionsOptItModalTitle": {
- "message": "Enhanced Transaction Protection"
- },
"snapAccountCreated": {
"message": "Account created"
},
diff --git a/app/_locales/es/messages.json b/app/_locales/es/messages.json
index ada162b9a12b..0f774d8f6ba2 100644
--- a/app/_locales/es/messages.json
+++ b/app/_locales/es/messages.json
@@ -1617,9 +1617,6 @@
"editSpeedUpEditGasFeeModalTitle": {
"message": "Editar la tarifa de aceleración de gas"
},
- "enable": {
- "message": "Habilitar"
- },
"enableAutoDetect": {
"message": " Activar autodetección"
},
@@ -4634,25 +4631,6 @@
"smartTransactions": {
"message": "Transacciones inteligentes"
},
- "smartTransactionsBenefit1": {
- "message": "Índice de éxito del 99.5%"
- },
- "smartTransactionsBenefit2": {
- "message": "Le permite ahorrar dinero"
- },
- "smartTransactionsBenefit3": {
- "message": "Actualizaciones en tiempo real"
- },
- "smartTransactionsDescription": {
- "message": "Desbloquee índices de éxito más altos, protección contra frontrunning y mejor visibilidad con transacciones inteligentes."
- },
- "smartTransactionsDescription2": {
- "message": "Solo disponible en Ethereum. Active o desactive en cualquier momento en la configuración. $1",
- "description": "$1 is an external link to learn more about Smart Transactions"
- },
- "smartTransactionsOptItModalTitle": {
- "message": "Protección mejorada de transacciones"
- },
"snapAccountCreated": {
"message": "Cuenta creada"
},
diff --git a/app/_locales/fr/messages.json b/app/_locales/fr/messages.json
index 856638ba2b8a..985dfd44c9dd 100644
--- a/app/_locales/fr/messages.json
+++ b/app/_locales/fr/messages.json
@@ -1620,9 +1620,6 @@
"editSpeedUpEditGasFeeModalTitle": {
"message": "Modifier les gas fees d’accélération"
},
- "enable": {
- "message": "Activer"
- },
"enableAutoDetect": {
"message": " Activer la détection automatique"
},
@@ -4637,25 +4634,6 @@
"smartTransactions": {
"message": "Transactions intelligentes"
},
- "smartTransactionsBenefit1": {
- "message": "Taux de réussite de 99,5 %"
- },
- "smartTransactionsBenefit2": {
- "message": "Cela vous permet d’économiser de l’argent"
- },
- "smartTransactionsBenefit3": {
- "message": "Mises à jour en temps réel"
- },
- "smartTransactionsDescription": {
- "message": "Bénéficiez de taux de réussite plus élevés, d’une protection contre le « front running » et d’une meilleure visibilité grâce aux transactions intelligentes."
- },
- "smartTransactionsDescription2": {
- "message": "Disponible uniquement sur Ethereum. Vous pouvez activer ou désactiver cette option à tout moment dans les paramètres. $1",
- "description": "$1 is an external link to learn more about Smart Transactions"
- },
- "smartTransactionsOptItModalTitle": {
- "message": "Protection renforcée des transactions"
- },
"snapAccountCreated": {
"message": "Le compte a été créé"
},
diff --git a/app/_locales/hi/messages.json b/app/_locales/hi/messages.json
index 45e64a972e17..540023a75fac 100644
--- a/app/_locales/hi/messages.json
+++ b/app/_locales/hi/messages.json
@@ -1620,9 +1620,6 @@
"editSpeedUpEditGasFeeModalTitle": {
"message": "गैस फ़ीस स्पीड अप को बदलें"
},
- "enable": {
- "message": "चालू करें"
- },
"enableAutoDetect": {
"message": " ऑटो डिटेक्ट इनेबल करें"
},
@@ -4637,25 +4634,6 @@
"smartTransactions": {
"message": "स्मार्ट ट्रांसेक्शन"
},
- "smartTransactionsBenefit1": {
- "message": "99.5% सफलता दर"
- },
- "smartTransactionsBenefit2": {
- "message": "आपका पैसा बचाता है"
- },
- "smartTransactionsBenefit3": {
- "message": "रियल-टाइम अपडेट"
- },
- "smartTransactionsDescription": {
- "message": "स्मार्ट ट्रांसेक्शन के साथ उच्च सफलता दर, फ्रंटरनिंग सुरक्षा और बेहतर दृश्यता अनलॉक करें।"
- },
- "smartTransactionsDescription2": {
- "message": "केवल Ethereum पर उपलब्ध है। सेटिंग्स में किसी भी समय चालू करें या बंद करें। $1",
- "description": "$1 is an external link to learn more about Smart Transactions"
- },
- "smartTransactionsOptItModalTitle": {
- "message": "एनहांस्ड ट्रांसेक्शन प्रोटेक्शन"
- },
"snapAccountCreated": {
"message": "अकाउंट बनाया गया"
},
diff --git a/app/_locales/id/messages.json b/app/_locales/id/messages.json
index 6314d9ed3468..81f7d2a9c633 100644
--- a/app/_locales/id/messages.json
+++ b/app/_locales/id/messages.json
@@ -1620,9 +1620,6 @@
"editSpeedUpEditGasFeeModalTitle": {
"message": "Edit biaya gas percepatan"
},
- "enable": {
- "message": "Aktifkan"
- },
"enableAutoDetect": {
"message": " Aktifkan deteksi otomatis"
},
@@ -4637,25 +4634,6 @@
"smartTransactions": {
"message": "Transaksi Pintar"
},
- "smartTransactionsBenefit1": {
- "message": "Tingkat keberhasilan 99,5%"
- },
- "smartTransactionsBenefit2": {
- "message": "Menghemat uang Anda"
- },
- "smartTransactionsBenefit3": {
- "message": "Pembaruan waktu nyata"
- },
- "smartTransactionsDescription": {
- "message": "Raih tingkat keberhasilan yang lebih tinggi, perlindungan frontrunning, dan visibilitas yang lebih baik dengan Transaksi Pintar."
- },
- "smartTransactionsDescription2": {
- "message": "Hanya tersedia di Ethereum. Aktifkan atau nonaktifkan kapan saja di pengaturan. $1",
- "description": "$1 is an external link to learn more about Smart Transactions"
- },
- "smartTransactionsOptItModalTitle": {
- "message": "Peningkatan Perlindungan Transaksi"
- },
"snapAccountCreated": {
"message": "Akun dibuat"
},
diff --git a/app/_locales/ja/messages.json b/app/_locales/ja/messages.json
index 61730b2bc325..5787bb88c397 100644
--- a/app/_locales/ja/messages.json
+++ b/app/_locales/ja/messages.json
@@ -1620,9 +1620,6 @@
"editSpeedUpEditGasFeeModalTitle": {
"message": "高速化用のガス代を編集"
},
- "enable": {
- "message": "有効にする"
- },
"enableAutoDetect": {
"message": " 自動検出を有効にする"
},
@@ -4637,25 +4634,6 @@
"smartTransactions": {
"message": "スマートトランザクション"
},
- "smartTransactionsBenefit1": {
- "message": "99.5%の成功率"
- },
- "smartTransactionsBenefit2": {
- "message": "お金を節約できます"
- },
- "smartTransactionsBenefit3": {
- "message": "リアルタイムの最新情報"
- },
- "smartTransactionsDescription": {
- "message": "スマートトランザクションで、成功率を上げ、フロントランニングを防ぎ、可視性を高めましょう。"
- },
- "smartTransactionsDescription2": {
- "message": "イーサリアムでのみご利用いただけ、いつでも設定で有効・無効を切り替えられます。$1",
- "description": "$1 is an external link to learn more about Smart Transactions"
- },
- "smartTransactionsOptItModalTitle": {
- "message": "強化されたトランザクション保護"
- },
"snapAccountCreated": {
"message": "アカウントが作成されました"
},
diff --git a/app/_locales/ko/messages.json b/app/_locales/ko/messages.json
index 05c04fbd17a9..32d7bd4399b5 100644
--- a/app/_locales/ko/messages.json
+++ b/app/_locales/ko/messages.json
@@ -1620,9 +1620,6 @@
"editSpeedUpEditGasFeeModalTitle": {
"message": "가스비 가속 편집"
},
- "enable": {
- "message": "활성화"
- },
"enableAutoDetect": {
"message": " 자동 감지 활성화"
},
@@ -4637,25 +4634,6 @@
"smartTransactions": {
"message": "스마트 트랜잭션"
},
- "smartTransactionsBenefit1": {
- "message": "99.5% 성공률"
- },
- "smartTransactionsBenefit2": {
- "message": "비용 절감"
- },
- "smartTransactionsBenefit3": {
- "message": "실시간 업데이트"
- },
- "smartTransactionsDescription": {
- "message": "스마트 트랜잭션으로 선행거래를 방지하고 더 높은 성공률과 가시성을 확보하세요."
- },
- "smartTransactionsDescription2": {
- "message": "이더리움에서만 사용할 수 있습니다. 설정에서 언제든지 활성화하거나 비활성화할 수 있습니다. $1",
- "description": "$1 is an external link to learn more about Smart Transactions"
- },
- "smartTransactionsOptItModalTitle": {
- "message": "트랜잭션 보호 강화"
- },
"snapAccountCreated": {
"message": "계정 생성됨"
},
diff --git a/app/_locales/pt/messages.json b/app/_locales/pt/messages.json
index 4c02a9dc223e..4eecb941d36f 100644
--- a/app/_locales/pt/messages.json
+++ b/app/_locales/pt/messages.json
@@ -1620,9 +1620,6 @@
"editSpeedUpEditGasFeeModalTitle": {
"message": "Editar taxa de gás para aceleração"
},
- "enable": {
- "message": "Ativar"
- },
"enableAutoDetect": {
"message": " Ativar detecção automática"
},
@@ -4637,25 +4634,6 @@
"smartTransactions": {
"message": "Transações inteligentes"
},
- "smartTransactionsBenefit1": {
- "message": "99,5% de taxa de sucesso"
- },
- "smartTransactionsBenefit2": {
- "message": "Faz você economizar dinheiro"
- },
- "smartTransactionsBenefit3": {
- "message": "Atualizações em tempo real"
- },
- "smartTransactionsDescription": {
- "message": "Desbloqueie taxas de sucesso maiores, proteção contra front running e melhor visibilidade com as transações inteligentes."
- },
- "smartTransactionsDescription2": {
- "message": "Disponível somente na Ethereum. Ative ou desative a qualquer momento nas configurações. $1",
- "description": "$1 is an external link to learn more about Smart Transactions"
- },
- "smartTransactionsOptItModalTitle": {
- "message": "Proteção de transações aprimorada"
- },
"snapAccountCreated": {
"message": "Conta criada"
},
diff --git a/app/_locales/ru/messages.json b/app/_locales/ru/messages.json
index f1e5d27589c5..ce53cc239de5 100644
--- a/app/_locales/ru/messages.json
+++ b/app/_locales/ru/messages.json
@@ -1620,9 +1620,6 @@
"editSpeedUpEditGasFeeModalTitle": {
"message": "Изменить плату за газ за ускорение"
},
- "enable": {
- "message": "Включить"
- },
"enableAutoDetect": {
"message": " Включить автоопределение"
},
@@ -4637,25 +4634,6 @@
"smartTransactions": {
"message": "Умные транзакции"
},
- "smartTransactionsBenefit1": {
- "message": "Коэффициент успеха 99,5%"
- },
- "smartTransactionsBenefit2": {
- "message": "Экономит вам деньги"
- },
- "smartTransactionsBenefit3": {
- "message": "Обновления в реальном времени"
- },
- "smartTransactionsDescription": {
- "message": "Откройте для себя более высокие коэффициенты успеха, передовую защиту и лучшую прозрачность с помощью умных транзакций."
- },
- "smartTransactionsDescription2": {
- "message": "Доступно только на Ethereum. Включайте или отключайте в любое время в настройках. $1",
- "description": "$1 is an external link to learn more about Smart Transactions"
- },
- "smartTransactionsOptItModalTitle": {
- "message": "Улучшенная защита транзакций"
- },
"snapAccountCreated": {
"message": "Счет создан"
},
diff --git a/app/_locales/tl/messages.json b/app/_locales/tl/messages.json
index 76e91829fc2c..8909ac662e34 100644
--- a/app/_locales/tl/messages.json
+++ b/app/_locales/tl/messages.json
@@ -1620,9 +1620,6 @@
"editSpeedUpEditGasFeeModalTitle": {
"message": "I-edit ang pagpapabilis ng bayad sa gas"
},
- "enable": {
- "message": "Payagan"
- },
"enableAutoDetect": {
"message": " Paganahin ang autodetect"
},
@@ -4637,25 +4634,6 @@
"smartTransactions": {
"message": "Mga Smart Transaction"
},
- "smartTransactionsBenefit1": {
- "message": "99.5% tiyansa ng tagumpay"
- },
- "smartTransactionsBenefit2": {
- "message": "Makatitipid ng pera"
- },
- "smartTransactionsBenefit3": {
- "message": "Mga real-time na update"
- },
- "smartTransactionsDescription": {
- "message": "Mag-unlock na mas mataas na tiyansa ng tagumpay, proteksyon sa frontrunning, at mas mahusay na visibility sa mga Smart Transaction."
- },
- "smartTransactionsDescription2": {
- "message": "Available lamang sa Ethereum. I-enable o i-disable anumang oras sa mga setting. $1",
- "description": "$1 is an external link to learn more about Smart Transactions"
- },
- "smartTransactionsOptItModalTitle": {
- "message": "Pinahusay na Proteksyon sa Transaksyon"
- },
"snapAccountCreated": {
"message": "Nagawa ang account"
},
diff --git a/app/_locales/tr/messages.json b/app/_locales/tr/messages.json
index 3b1899614d70..8c4e44d3192e 100644
--- a/app/_locales/tr/messages.json
+++ b/app/_locales/tr/messages.json
@@ -1620,9 +1620,6 @@
"editSpeedUpEditGasFeeModalTitle": {
"message": "Hızlandırma gaz ücretini düzenle"
},
- "enable": {
- "message": "Etkinleştir"
- },
"enableAutoDetect": {
"message": " Otomatik algılamayı etkinleştir"
},
@@ -4637,25 +4634,6 @@
"smartTransactions": {
"message": "Akıllı İşlemler"
},
- "smartTransactionsBenefit1": {
- "message": "%99,5 başarı oranı"
- },
- "smartTransactionsBenefit2": {
- "message": "Paradan tasarruf sağlar"
- },
- "smartTransactionsBenefit3": {
- "message": "Gerçek zamanlı güncellemeler"
- },
- "smartTransactionsDescription": {
- "message": "Akıllı İşlemler ile daha yüksek başarı oranlarının, arkadan çalıştırma korumasının ve daha iyi görünürlüğün kilidini açın."
- },
- "smartTransactionsDescription2": {
- "message": "Sadece Ethereum'da mevcuttur. Dilediğiniz zaman ayarlar kısmında etkinleştirin veya devre dışı bırakın. $1",
- "description": "$1 is an external link to learn more about Smart Transactions"
- },
- "smartTransactionsOptItModalTitle": {
- "message": "İyileştirilmiş İşlem Koruması"
- },
"snapAccountCreated": {
"message": "Hesap oluşturuldu"
},
diff --git a/app/_locales/vi/messages.json b/app/_locales/vi/messages.json
index 4bfcba6dac1f..b741fe6eb536 100644
--- a/app/_locales/vi/messages.json
+++ b/app/_locales/vi/messages.json
@@ -1620,9 +1620,6 @@
"editSpeedUpEditGasFeeModalTitle": {
"message": "Chỉnh sửa phí gas tăng tốc"
},
- "enable": {
- "message": "Bật"
- },
"enableAutoDetect": {
"message": " Bật tự động phát hiện"
},
@@ -4637,25 +4634,6 @@
"smartTransactions": {
"message": "Giao dịch thông minh"
},
- "smartTransactionsBenefit1": {
- "message": "Tỷ lệ thành công 99,5%"
- },
- "smartTransactionsBenefit2": {
- "message": "Tiết kiệm tiền của bạn"
- },
- "smartTransactionsBenefit3": {
- "message": "Cập nhật theo thời gian thực"
- },
- "smartTransactionsDescription": {
- "message": "Đạt tỷ lệ thành công cao hơn, bảo vệ chống hành vi lợi dụng thông tin biết trước và khả năng hiển thị tốt hơn với Giao dịch thông minh."
- },
- "smartTransactionsDescription2": {
- "message": "Chỉ có sẵn trên Ethereum. Có thể bật/tắt bất cứ lúc nào trong phần Cài đặt. $1",
- "description": "$1 is an external link to learn more about Smart Transactions"
- },
- "smartTransactionsOptItModalTitle": {
- "message": "Tăng cường bảo vệ giao dịch"
- },
"snapAccountCreated": {
"message": "Tài khoản đã được tạo"
},
diff --git a/app/_locales/zh_CN/messages.json b/app/_locales/zh_CN/messages.json
index 80a31d532482..e5695cdfaecf 100644
--- a/app/_locales/zh_CN/messages.json
+++ b/app/_locales/zh_CN/messages.json
@@ -1620,9 +1620,6 @@
"editSpeedUpEditGasFeeModalTitle": {
"message": "编辑加速燃料费用"
},
- "enable": {
- "message": "启用"
- },
"enableAutoDetect": {
"message": " 启用自动检测"
},
@@ -4637,25 +4634,6 @@
"smartTransactions": {
"message": "智能交易"
},
- "smartTransactionsBenefit1": {
- "message": "99.5%的成功率"
- },
- "smartTransactionsBenefit2": {
- "message": "为您省钱"
- },
- "smartTransactionsBenefit3": {
- "message": "实时更新"
- },
- "smartTransactionsDescription": {
- "message": "通过智能交易解锁更高的成功率、抢先交易保护和更高的透明度。"
- },
- "smartTransactionsDescription2": {
- "message": "仅适用于以太坊。可随时在设置中启用或禁用。$1",
- "description": "$1 is an external link to learn more about Smart Transactions"
- },
- "smartTransactionsOptItModalTitle": {
- "message": "增强型交易保护"
- },
"snapAccountCreated": {
"message": "账户已创建"
},
diff --git a/app/scripts/controllers/preferences-controller.test.ts b/app/scripts/controllers/preferences-controller.test.ts
index a4b91a8d3b1a..25010cdd3a0f 100644
--- a/app/scripts/controllers/preferences-controller.test.ts
+++ b/app/scripts/controllers/preferences-controller.test.ts
@@ -733,7 +733,7 @@ describe('preferences controller', () => {
privacyMode: false,
showFiatInTestnets: false,
showTestNetworks: false,
- smartTransactionsOptInStatus: null,
+ smartTransactionsOptInStatus: true,
useNativeCurrencyAsPrimaryCurrency: true,
hideZeroBalanceTokens: false,
petnamesEnabled: true,
@@ -762,7 +762,7 @@ describe('preferences controller', () => {
showExtensionInFullSizeView: false,
showFiatInTestnets: false,
showTestNetworks: false,
- smartTransactionsOptInStatus: null,
+ smartTransactionsOptInStatus: true,
useNativeCurrencyAsPrimaryCurrency: true,
hideZeroBalanceTokens: false,
petnamesEnabled: true,
diff --git a/app/scripts/controllers/preferences-controller.ts b/app/scripts/controllers/preferences-controller.ts
index e1cdb2e8a4f6..bc7d03155f75 100644
--- a/app/scripts/controllers/preferences-controller.ts
+++ b/app/scripts/controllers/preferences-controller.ts
@@ -103,7 +103,7 @@ export type Preferences = {
showExtensionInFullSizeView: boolean;
showFiatInTestnets: boolean;
showTestNetworks: boolean;
- smartTransactionsOptInStatus: boolean | null;
+ smartTransactionsOptInStatus: boolean;
showNativeTokenAsMainBalance: boolean;
useNativeCurrencyAsPrimaryCurrency: boolean;
hideZeroBalanceTokens: boolean;
@@ -209,7 +209,7 @@ export const getDefaultPreferencesControllerState =
showExtensionInFullSizeView: false,
showFiatInTestnets: false,
showTestNetworks: false,
- smartTransactionsOptInStatus: null, // null means we will show the Smart Transactions opt-in modal to a user if they are eligible
+ smartTransactionsOptInStatus: true,
showNativeTokenAsMainBalance: false,
useNativeCurrencyAsPrimaryCurrency: true,
hideZeroBalanceTokens: false,
diff --git a/app/scripts/lib/backup.test.js b/app/scripts/lib/backup.test.js
index 7a322148c847..b3a7f176c2e6 100644
--- a/app/scripts/lib/backup.test.js
+++ b/app/scripts/lib/backup.test.js
@@ -165,7 +165,7 @@ const jsonData = JSON.stringify({
showExtensionInFullSizeView: false,
showFiatInTestnets: false,
showTestNetworks: true,
- smartTransactionsOptInStatus: false,
+ smartTransactionsOptInStatus: true,
useNativeCurrencyAsPrimaryCurrency: true,
showMultiRpcModal: false,
},
diff --git a/shared/modules/selectors/index.test.ts b/shared/modules/selectors/index.test.ts
index 9f0b1b201a5c..2e40d47db102 100644
--- a/shared/modules/selectors/index.test.ts
+++ b/shared/modules/selectors/index.test.ts
@@ -9,7 +9,6 @@ import {
getCurrentChainSupportsSmartTransactions,
getSmartTransactionsEnabled,
getIsSmartTransaction,
- getIsSmartTransactionsOptInModalAvailable,
getSmartTransactionsPreferenceEnabled,
} from '.';
@@ -70,7 +69,7 @@ describe('Selectors', () => {
};
describe('getSmartTransactionsOptInStatusForMetrics and getSmartTransactionsPreferenceEnabled', () => {
- const createMockOptInStatusState = (status: boolean | null) => {
+ const createMockOptInStatusState = (status: boolean) => {
return {
metamask: {
preferences: {
@@ -89,7 +88,6 @@ describe('Selectors', () => {
jestIt.each([
{ status: true, expected: true },
{ status: false, expected: false },
- { status: null, expected: null },
])(
'should return $expected if the smart transactions opt-in status is $status',
({ status, expected }) => {
@@ -113,7 +111,6 @@ describe('Selectors', () => {
jestIt.each([
{ status: true, expected: true },
{ status: false, expected: false },
- { status: null, expected: true },
])(
'should return $expected if the smart transactions opt-in status is $status',
({ status, expected }) => {
@@ -316,123 +313,4 @@ describe('Selectors', () => {
expect(result).toBe(false);
});
});
-
- describe('getIsSmartTransactionsOptInModalAvailable', () => {
- jestIt(
- 'returns true for Ethereum Mainnet + supported RPC URL + null opt-in status and non-zero balance',
- () => {
- const state = createMockState();
- const newState = {
- ...state,
- metamask: {
- ...state.metamask,
- preferences: {
- ...state.metamask.preferences,
- smartTransactionsOptInStatus: null,
- },
- },
- };
- expect(getIsSmartTransactionsOptInModalAvailable(newState)).toBe(true);
- },
- );
-
- jestIt(
- 'returns false for Polygon Mainnet + supported RPC URL + null opt-in status and non-zero balance',
- () => {
- const state = createMockState();
- const newState = {
- ...state,
- metamask: {
- ...state.metamask,
- preferences: {
- ...state.metamask.preferences,
- smartTransactionsOptInStatus: null,
- },
- ...mockNetworkState({ chainId: CHAIN_IDS.POLYGON }),
- },
- };
- expect(getIsSmartTransactionsOptInModalAvailable(newState)).toBe(false);
- },
- );
-
- jestIt(
- 'returns false for Ethereum Mainnet + unsupported RPC URL + null opt-in status and non-zero balance',
- () => {
- const state = createMockState();
- const newState = {
- ...state,
- metamask: {
- ...state.metamask,
- preferences: {
- ...state.metamask.preferences,
- smartTransactionsOptInStatus: null,
- },
- ...mockNetworkState({
- chainId: CHAIN_IDS.MAINNET,
- rpcUrl: 'https://mainnet.quiknode.pro/',
- }),
- },
- };
- expect(getIsSmartTransactionsOptInModalAvailable(newState)).toBe(false);
- },
- );
-
- jestIt(
- 'returns false for Ethereum Mainnet + supported RPC URL + true opt-in status and non-zero balance',
- () => {
- const state = createMockState();
- expect(getIsSmartTransactionsOptInModalAvailable(state)).toBe(false);
- },
- );
-
- jestIt(
- 'returns false for Ethereum Mainnet + supported RPC URL + null opt-in status and zero balance (0x0)',
- () => {
- const state = createMockState();
- const newState = {
- ...state,
- metamask: {
- ...state.metamask,
- preferences: {
- ...state.metamask.preferences,
- smartTransactionsOptInStatus: null,
- },
- accounts: {
- ...state.metamask.accounts,
- '0x123': {
- address: '0x123',
- balance: '0x0',
- },
- },
- },
- };
- expect(getIsSmartTransactionsOptInModalAvailable(newState)).toBe(false);
- },
- );
-
- jestIt(
- 'returns false for Ethereum Mainnet + supported RPC URL + null opt-in status and zero balance (0x00)',
- () => {
- const state = createMockState();
- const newState = {
- ...state,
- metamask: {
- ...state.metamask,
- preferences: {
- ...state.metamask.preferences,
- smartTransactionsOptInStatus: null,
- },
- accounts: {
- ...state.metamask.accounts,
- '0x123': {
- address: '0x123',
- balance: '0x00',
- },
- },
- },
- };
- expect(getIsSmartTransactionsOptInModalAvailable(newState)).toBe(false);
- },
- );
- });
});
diff --git a/shared/modules/selectors/smart-transactions.ts b/shared/modules/selectors/smart-transactions.ts
index a02fe63692b3..4fb6d56fc87d 100644
--- a/shared/modules/selectors/smart-transactions.ts
+++ b/shared/modules/selectors/smart-transactions.ts
@@ -7,21 +7,16 @@ import {
getCurrentChainId,
getCurrentNetwork,
accountSupportsSmartTx,
- getSelectedAccount,
getPreferences,
// TODO: Remove restricted import
// eslint-disable-next-line import/no-restricted-paths
} from '../../../ui/selectors/selectors'; // TODO: Migrate shared selectors to this file.
import { isProduction } from '../environment';
-// TODO: Remove restricted import
-// eslint-disable-next-line import/no-restricted-paths
-import { MultichainState } from '../../../ui/selectors/multichain';
-
type SmartTransactionsMetaMaskState = {
metamask: {
preferences: {
- smartTransactionsOptInStatus?: boolean | null;
+ smartTransactionsOptInStatus?: boolean;
};
internalAccounts: {
selectedAccount: string;
@@ -72,10 +67,8 @@ type SmartTransactionsMetaMaskState = {
*/
export const getSmartTransactionsOptInStatusInternal = createSelector(
getPreferences,
- (preferences: {
- smartTransactionsOptInStatus?: boolean | null;
- }): boolean | null => {
- return preferences?.smartTransactionsOptInStatus ?? null;
+ (preferences: { smartTransactionsOptInStatus?: boolean }): boolean => {
+ return preferences?.smartTransactionsOptInStatus ?? true;
},
);
@@ -93,7 +86,7 @@ export const getSmartTransactionsOptInStatusInternal = createSelector(
*/
export const getSmartTransactionsOptInStatusForMetrics = createSelector(
getSmartTransactionsOptInStatusInternal,
- (optInStatus: boolean | null): boolean | null => optInStatus,
+ (optInStatus: boolean): boolean => optInStatus,
);
/**
@@ -105,7 +98,7 @@ export const getSmartTransactionsOptInStatusForMetrics = createSelector(
*/
export const getSmartTransactionsPreferenceEnabled = createSelector(
getSmartTransactionsOptInStatusInternal,
- (optInStatus: boolean | null): boolean => {
+ (optInStatus: boolean): boolean => {
// In the absence of an explicit opt-in or opt-out,
// the Smart Transactions toggle is enabled.
const DEFAULT_SMART_TRANSACTIONS_ENABLED = true;
@@ -137,30 +130,6 @@ const getIsAllowedRpcUrlForSmartTransactions = (
return rpcUrl?.hostname?.endsWith('.infura.io');
};
-/**
- * Checks if the selected account has a non-zero balance.
- *
- * @param state - The state object containing account information.
- * @returns true if the selected account has a non-zero balance, otherwise false.
- */
-const hasNonZeroBalance = (state: SmartTransactionsMetaMaskState) => {
- const selectedAccount = getSelectedAccount(
- state as unknown as MultichainState,
- );
- return BigInt(selectedAccount?.balance || '0x0') > 0n;
-};
-
-export const getIsSmartTransactionsOptInModalAvailable = (
- state: SmartTransactionsMetaMaskState,
-) => {
- return (
- getCurrentChainSupportsSmartTransactions(state) &&
- getIsAllowedRpcUrlForSmartTransactions(state) &&
- getSmartTransactionsOptInStatusInternal(state) === null &&
- hasNonZeroBalance(state)
- );
-};
-
export const getSmartTransactionsEnabled = (
state: SmartTransactionsMetaMaskState,
): boolean => {
diff --git a/test/data/mock-state.json b/test/data/mock-state.json
index 2865478912f3..184787b07836 100644
--- a/test/data/mock-state.json
+++ b/test/data/mock-state.json
@@ -372,7 +372,7 @@
"showFiatInTestnets": false,
"showNativeTokenAsMainBalance": true,
"showTestNetworks": true,
- "smartTransactionsOptInStatus": false,
+ "smartTransactionsOptInStatus": true,
"tokenSortConfig": {
"key": "tokenFiatAmount",
"order": "dsc",
diff --git a/test/e2e/default-fixture.js b/test/e2e/default-fixture.js
index 95f35bf1694c..2d3d2999ed43 100644
--- a/test/e2e/default-fixture.js
+++ b/test/e2e/default-fixture.js
@@ -212,7 +212,7 @@ function defaultFixture(inputChainId = CHAIN_IDS.LOCALHOST) {
showExtensionInFullSizeView: false,
showFiatInTestnets: false,
showTestNetworks: false,
- smartTransactionsOptInStatus: false,
+ smartTransactionsOptInStatus: true,
showNativeTokenAsMainBalance: true,
petnamesEnabled: true,
showMultiRpcModal: false,
diff --git a/test/e2e/fixture-builder.js b/test/e2e/fixture-builder.js
index 4d7e1873bff4..334e2f74ceca 100644
--- a/test/e2e/fixture-builder.js
+++ b/test/e2e/fixture-builder.js
@@ -77,7 +77,7 @@ function onboardingFixture() {
showFiatInTestnets: false,
privacyMode: false,
showTestNetworks: false,
- smartTransactionsOptInStatus: false,
+ smartTransactionsOptInStatus: true,
showNativeTokenAsMainBalance: true,
petnamesEnabled: true,
showMultiRpcModal: false,
@@ -124,7 +124,7 @@ function onboardingFixture() {
[ETHERSCAN_SUPPORTED_CHAIN_IDS.GNOSIS]: true,
},
showTestNetworks: false,
- smartTransactionsOptInStatus: false,
+ smartTransactionsOptInStatus: true,
},
QueuedRequestController: {
queuedRequestCount: 0,
diff --git a/test/e2e/restore/MetaMaskUserData.json b/test/e2e/restore/MetaMaskUserData.json
index 846acc8164cd..7a687ec254c0 100644
--- a/test/e2e/restore/MetaMaskUserData.json
+++ b/test/e2e/restore/MetaMaskUserData.json
@@ -36,7 +36,7 @@
"showExtensionInFullSizeView": false,
"showFiatInTestnets": false,
"showTestNetworks": false,
- "smartTransactionsOptInStatus": false
+ "smartTransactionsOptInStatus": true
},
"theme": "light",
"useBlockie": false,
diff --git a/test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-background-state.json b/test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-background-state.json
index 6d77cd3ae351..1a871780591f 100644
--- a/test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-background-state.json
+++ b/test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-background-state.json
@@ -224,7 +224,7 @@
"showExtensionInFullSizeView": false,
"showFiatInTestnets": false,
"showTestNetworks": false,
- "smartTransactionsOptInStatus": false,
+ "smartTransactionsOptInStatus": true,
"showNativeTokenAsMainBalance": true,
"petnamesEnabled": true,
"showMultiRpcModal": "boolean",
diff --git a/test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-ui-state.json b/test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-ui-state.json
index e577bb71a6be..e8f8f81a6293 100644
--- a/test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-ui-state.json
+++ b/test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-ui-state.json
@@ -30,7 +30,7 @@
"showExtensionInFullSizeView": false,
"showFiatInTestnets": false,
"showTestNetworks": false,
- "smartTransactionsOptInStatus": false,
+ "smartTransactionsOptInStatus": true,
"showNativeTokenAsMainBalance": true,
"petnamesEnabled": true,
"showMultiRpcModal": "boolean",
diff --git a/test/e2e/tests/metrics/state-snapshots/errors-before-init-opt-in-background-state.json b/test/e2e/tests/metrics/state-snapshots/errors-before-init-opt-in-background-state.json
index 89b1b29100bb..1a51023a2ca1 100644
--- a/test/e2e/tests/metrics/state-snapshots/errors-before-init-opt-in-background-state.json
+++ b/test/e2e/tests/metrics/state-snapshots/errors-before-init-opt-in-background-state.json
@@ -128,7 +128,7 @@
"showExtensionInFullSizeView": false,
"showFiatInTestnets": false,
"showTestNetworks": false,
- "smartTransactionsOptInStatus": false,
+ "smartTransactionsOptInStatus": true,
"showNativeTokenAsMainBalance": true,
"petnamesEnabled": true,
"isRedesignedConfirmationsDeveloperEnabled": "boolean",
diff --git a/test/e2e/tests/metrics/state-snapshots/errors-before-init-opt-in-ui-state.json b/test/e2e/tests/metrics/state-snapshots/errors-before-init-opt-in-ui-state.json
index f13d3e078c64..bf7f87a16134 100644
--- a/test/e2e/tests/metrics/state-snapshots/errors-before-init-opt-in-ui-state.json
+++ b/test/e2e/tests/metrics/state-snapshots/errors-before-init-opt-in-ui-state.json
@@ -128,7 +128,7 @@
"showExtensionInFullSizeView": false,
"showFiatInTestnets": false,
"showTestNetworks": false,
- "smartTransactionsOptInStatus": false,
+ "smartTransactionsOptInStatus": true,
"showNativeTokenAsMainBalance": true,
"petnamesEnabled": true,
"isRedesignedConfirmationsDeveloperEnabled": "boolean",
diff --git a/test/integration/data/integration-init-state.json b/test/integration/data/integration-init-state.json
index 7949e19cfa51..a0ae3a8fb146 100644
--- a/test/integration/data/integration-init-state.json
+++ b/test/integration/data/integration-init-state.json
@@ -781,7 +781,7 @@
"showExtensionInFullSizeView": false,
"showFiatInTestnets": false,
"showTestNetworks": true,
- "smartTransactionsOptInStatus": false,
+ "smartTransactionsOptInStatus": true,
"petnamesEnabled": false,
"showConfirmationAdvancedDetails": false,
"showMultiRpcModal": false
diff --git a/test/integration/data/onboarding-completion-route.json b/test/integration/data/onboarding-completion-route.json
index e47d1379b2eb..b2c19536a138 100644
--- a/test/integration/data/onboarding-completion-route.json
+++ b/test/integration/data/onboarding-completion-route.json
@@ -223,7 +223,7 @@
"showExtensionInFullSizeView": false,
"showFiatInTestnets": false,
"showTestNetworks": false,
- "smartTransactionsOptInStatus": null,
+ "smartTransactionsOptInStatus": true,
"hideZeroBalanceTokens": false,
"petnamesEnabled": true,
"redesignedConfirmationsEnabled": true,
diff --git a/ui/ducks/metamask/metamask.js b/ui/ducks/metamask/metamask.js
index 9627608eb709..63ff92a11ccc 100644
--- a/ui/ducks/metamask/metamask.js
+++ b/ui/ducks/metamask/metamask.js
@@ -47,7 +47,7 @@ const initialState = {
showExtensionInFullSizeView: false,
showFiatInTestnets: false,
showTestNetworks: false,
- smartTransactionsOptInStatus: false,
+ smartTransactionsOptInStatus: true,
petnamesEnabled: true,
featureNotificationsEnabled: false,
privacyMode: false,
diff --git a/ui/pages/home/home.component.js b/ui/pages/home/home.component.js
index 37c147427ac5..9ac71dd6a766 100644
--- a/ui/pages/home/home.component.js
+++ b/ui/pages/home/home.component.js
@@ -13,7 +13,6 @@ import TermsOfUsePopup from '../../components/app/terms-of-use-popup';
import RecoveryPhraseReminder from '../../components/app/recovery-phrase-reminder';
import WhatsNewPopup from '../../components/app/whats-new-popup';
import { FirstTimeFlowType } from '../../../shared/constants/onboarding';
-import SmartTransactionsOptInModal from '../smart-transactions/components/smart-transactions-opt-in-modal';
///: END:ONLY_INCLUDE_IF
import HomeNotification from '../../components/app/home-notification';
import MultipleNotifications from '../../components/app/multiple-notifications';
@@ -155,7 +154,6 @@ export default class Home extends PureComponent {
hideWhatsNewPopup: PropTypes.func.isRequired,
announcementsToShow: PropTypes.bool.isRequired,
onboardedInThisUISession: PropTypes.bool,
- isSmartTransactionsOptInModalAvailable: PropTypes.bool.isRequired,
showMultiRpcModal: PropTypes.bool.isRequired,
///: END:ONLY_INCLUDE_IF
newNetworkAddedConfigurationId: PropTypes.string,
@@ -937,7 +935,6 @@ export default class Home extends PureComponent {
announcementsToShow,
firstTimeFlowType,
newNetworkAddedConfigurationId,
- isSmartTransactionsOptInModalAvailable,
showMultiRpcModal,
///: END:ONLY_INCLUDE_IF
} = this.props;
@@ -956,20 +953,11 @@ export default class Home extends PureComponent {
!process.env.IN_TEST &&
!newNetworkAddedConfigurationId;
- const showSmartTransactionsOptInModal =
- canSeeModals && isSmartTransactionsOptInModalAvailable;
-
const showWhatsNew =
- canSeeModals &&
- announcementsToShow &&
- showWhatsNewPopup &&
- !showSmartTransactionsOptInModal;
+ canSeeModals && announcementsToShow && showWhatsNewPopup;
const showMultiRpcEditModal =
- canSeeModals &&
- showMultiRpcModal &&
- !showSmartTransactionsOptInModal &&
- !showWhatsNew;
+ canSeeModals && showMultiRpcModal && !showWhatsNew;
const showTermsOfUse =
completedOnboarding && !onboardedInThisUISession && showTermsOfUsePopup;
@@ -991,11 +979,6 @@ export default class Home extends PureComponent {
{
///: BEGIN:ONLY_INCLUDE_IF(build-main,build-beta,build-flask)
}
- <SmartTransactionsOptInModal
- isOpen={showSmartTransactionsOptInModal}
- hideWhatsNewPopup={hideWhatsNewPopup}
- />
-
{showMultiRpcEditModal && <MultiRpcEditModal />}
{showWhatsNew ? <WhatsNewPopup onClose={hideWhatsNewPopup} /> : null}
{!showWhatsNew && showRecoveryPhraseReminder ? (
diff --git a/ui/pages/home/home.container.js b/ui/pages/home/home.container.js
index dfeb1a5e7cdb..9d4511021529 100644
--- a/ui/pages/home/home.container.js
+++ b/ui/pages/home/home.container.js
@@ -222,10 +222,6 @@ const mapStateToProps = (state) => {
custodianDeepLink: getCustodianDeepLink(state),
accountType: getAccountType(state),
///: END:ONLY_INCLUDE_IF
-
- // Set to false to prevent the opt-in modal from showing.
- // TODO(dbrans): Remove opt-in modal once default opt-in is stable.
- isSmartTransactionsOptInModalAvailable: false,
showMultiRpcModal: state.metamask.preferences.showMultiRpcModal,
};
};
diff --git a/ui/pages/settings/advanced-tab/__snapshots__/advanced-tab.component.test.js.snap b/ui/pages/settings/advanced-tab/__snapshots__/advanced-tab.component.test.js.snap
index e914c54fe4ca..1bbfe6d81743 100644
--- a/ui/pages/settings/advanced-tab/__snapshots__/advanced-tab.component.test.js.snap
+++ b/ui/pages/settings/advanced-tab/__snapshots__/advanced-tab.component.test.js.snap
@@ -99,34 +99,34 @@ exports[`AdvancedTab Component should match snapshot 1`] = `
class="settings-page__content-item-col"
>
<label
- class="toggle-button toggle-button--off"
+ class="toggle-button toggle-button--on"
tabindex="0"
>
<div
style="display: flex; width: 52px; align-items: center; justify-content: flex-start; position: relative; cursor: pointer; background-color: transparent; border: 0px; padding: 0px; user-select: none;"
>
<div
- style="width: 40px; height: 24px; padding: 0px; border-radius: 26px; display: flex; align-items: center; justify-content: center; background-color: rgb(132, 140, 150);"
+ style="width: 40px; height: 24px; padding: 0px; border-radius: 26px; display: flex; align-items: center; justify-content: center; background-color: rgb(67, 174, 252);"
>
<div
- style="font-size: 11px; display: flex; align-items: center; justify-content: center; font-family: 'Helvetica Neue', Helvetica, sans-serif; position: relative; color: rgb(250, 250, 250); margin-top: auto; margin-bottom: auto; line-height: 0; opacity: 0; width: 26px; height: 20px; left: 4px;"
+ style="font-size: 11px; display: flex; align-items: center; justify-content: center; font-family: 'Helvetica Neue', Helvetica, sans-serif; position: relative; color: rgb(250, 250, 250); margin-top: auto; margin-bottom: auto; line-height: 0; opacity: 1; width: 26px; height: 20px; left: 4px;"
/>
<div
- style="font-size: 11px; display: flex; align-items: center; justify-content: center; font-family: 'Helvetica Neue', Helvetica, sans-serif; position: relative; color: rgba(255, 255, 255, 0.6); bottom: 0px; margin-top: auto; margin-bottom: auto; padding-right: 5px; line-height: 0; width: 26px; height: 20px; opacity: 1;"
+ style="font-size: 11px; display: flex; align-items: center; justify-content: center; font-family: 'Helvetica Neue', Helvetica, sans-serif; position: relative; color: rgba(255, 255, 255, 0.6); bottom: 0px; margin-top: auto; margin-bottom: auto; padding-right: 5px; line-height: 0; width: 26px; height: 20px; opacity: 0;"
/>
</div>
<div
style="position: absolute; height: 100%; top: 0px; left: 0px; display: flex; flex: 1; align-self: stretch; align-items: center; justify-content: flex-start;"
>
<div
- style="width: 18px; height: 18px; display: flex; align-self: center; box-shadow: var(--shadow-size-xs) var(--color-shadow-default); border-radius: 50%; box-sizing: border-box; position: relative; background-color: rgb(255, 255, 255); left: 3px;"
+ style="width: 18px; height: 18px; display: flex; align-self: center; box-shadow: var(--shadow-size-xs) var(--color-shadow-default); border-radius: 50%; box-sizing: border-box; position: relative; background-color: rgb(255, 255, 255); left: 18px;"
/>
</div>
<input
data-testid="settings-page-stx-opt-in-toggle"
style="border: 0px; height: 1px; margin: -1px; overflow: hidden; padding: 0px; position: absolute; width: 1px;"
type="checkbox"
- value="false"
+ value="true"
/>
</div>
<div
diff --git a/ui/pages/smart-transactions/components/__snapshots__/smart-transactions-opt-in-modal.test.tsx.snap b/ui/pages/smart-transactions/components/__snapshots__/smart-transactions-opt-in-modal.test.tsx.snap
deleted file mode 100644
index cdd10e5d38fb..000000000000
--- a/ui/pages/smart-transactions/components/__snapshots__/smart-transactions-opt-in-modal.test.tsx.snap
+++ /dev/null
@@ -1,3 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`SmartTransactionsOptInModal displays the correct text in the modal 1`] = `<div />`;
diff --git a/ui/pages/smart-transactions/components/index.scss b/ui/pages/smart-transactions/components/index.scss
deleted file mode 100644
index c7c6ae34efe1..000000000000
--- a/ui/pages/smart-transactions/components/index.scss
+++ /dev/null
@@ -1,26 +0,0 @@
-.mm-smart-transactions-opt-in-modal {
- &__benefit {
- flex: 1;
- }
-
- &__icon {
- --size: 40px;
- }
-
- &__no-thanks-link {
- opacity: 75%;
-
- &:hover {
- color: var(--color-text-alternative) !important;
- text-decoration: none !important;
- }
- }
-
- .mm-modal-content {
- &__dialog {
- background-image: url('/images/smart-transactions/smart-transactions-opt-in-background.svg');
- background-position: -80px 16px;
- background-repeat: no-repeat;
- }
- }
-}
diff --git a/ui/pages/smart-transactions/components/smart-transactions-opt-in-modal.test.tsx b/ui/pages/smart-transactions/components/smart-transactions-opt-in-modal.test.tsx
deleted file mode 100644
index ab491ea05ea5..000000000000
--- a/ui/pages/smart-transactions/components/smart-transactions-opt-in-modal.test.tsx
+++ /dev/null
@@ -1,70 +0,0 @@
-import React from 'react';
-import { fireEvent } from '@testing-library/react';
-import thunk from 'redux-thunk';
-import configureMockStore from 'redux-mock-store';
-
-import {
- renderWithProvider,
- createSwapsMockStore,
-} from '../../../../test/jest';
-import { setSmartTransactionsPreferenceEnabled } from '../../../store/actions';
-import SmartTransactionsOptInModal from './smart-transactions-opt-in-modal';
-
-const middleware = [thunk];
-
-jest.mock('../../../store/actions');
-
-jest.mock('react-router-dom', () => ({
- ...jest.requireActual('react-router-dom'),
- useHistory: jest.fn(() => []),
-}));
-
-describe('SmartTransactionsOptInModal', () => {
- it('displays the correct text in the modal', () => {
- const store = configureMockStore(middleware)(createSwapsMockStore());
- const { getByText, container } = renderWithProvider(
- <SmartTransactionsOptInModal
- isOpen={true}
- hideWhatsNewPopup={jest.fn()}
- />,
- store,
- );
- expect(getByText('Enable')).toBeInTheDocument();
- expect(getByText('No thanks')).toBeInTheDocument();
- expect(container).toMatchSnapshot();
- });
-
- it('calls setSmartTransactionsOptInStatus with false when the "No thanks" link is clicked', () => {
- (setSmartTransactionsPreferenceEnabled as jest.Mock).mockImplementationOnce(
- () => jest.fn(),
- );
- const store = configureMockStore(middleware)(createSwapsMockStore());
- const { getByText } = renderWithProvider(
- <SmartTransactionsOptInModal
- isOpen={true}
- hideWhatsNewPopup={jest.fn()}
- />,
- store,
- );
- const noThanksLink = getByText('No thanks');
- fireEvent.click(noThanksLink);
- expect(setSmartTransactionsPreferenceEnabled).toHaveBeenCalledWith(false);
- });
-
- it('calls setSmartTransactionsOptInStatus with true when the "Enable" button is clicked', () => {
- (setSmartTransactionsPreferenceEnabled as jest.Mock).mockImplementationOnce(
- () => jest.fn(),
- );
- const store = configureMockStore(middleware)(createSwapsMockStore());
- const { getByText } = renderWithProvider(
- <SmartTransactionsOptInModal
- isOpen={true}
- hideWhatsNewPopup={jest.fn()}
- />,
- store,
- );
- const enableButton = getByText('Enable');
- fireEvent.click(enableButton);
- expect(setSmartTransactionsPreferenceEnabled).toHaveBeenCalledWith(true);
- });
-});
diff --git a/ui/pages/smart-transactions/components/smart-transactions-opt-in-modal.tsx b/ui/pages/smart-transactions/components/smart-transactions-opt-in-modal.tsx
deleted file mode 100644
index 2269018e2239..000000000000
--- a/ui/pages/smart-transactions/components/smart-transactions-opt-in-modal.tsx
+++ /dev/null
@@ -1,219 +0,0 @@
-import React, { useCallback, useEffect } from 'react';
-import { useDispatch } from 'react-redux';
-
-import { useI18nContext } from '../../../hooks/useI18nContext';
-import {
- TextColor,
- Display,
- FlexDirection,
- BlockSize,
- AlignItems,
- TextAlign,
- JustifyContent,
- TextVariant,
- IconColor,
- FontWeight,
-} from '../../../helpers/constants/design-system';
-import {
- Modal,
- ModalOverlay,
- Text,
- Box,
- Button,
- ButtonVariant,
- ModalHeader,
- ModalContent,
- ButtonLink,
- ButtonLinkSize,
- Icon,
- IconName,
-} from '../../../components/component-library';
-import { setSmartTransactionsPreferenceEnabled } from '../../../store/actions';
-import { SMART_TRANSACTIONS_LEARN_MORE_URL } from '../../../../shared/constants/smartTransactions';
-
-export type SmartTransactionsOptInModalProps = {
- isOpen: boolean;
- hideWhatsNewPopup: () => void;
-};
-
-const LearnMoreLink = () => {
- const t = useI18nContext();
- return (
- <ButtonLink
- size={ButtonLinkSize.Inherit}
- textProps={{
- variant: TextVariant.bodyMd,
- alignItems: AlignItems.flexStart,
- }}
- as="a"
- href={SMART_TRANSACTIONS_LEARN_MORE_URL}
- target="_blank"
- rel="noopener noreferrer"
- >
- {t('learnMoreUpperCaseWithDot')}
- </ButtonLink>
- );
-};
-
-const EnableSmartTransactionsButton = ({
- handleEnableButtonClick,
-}: {
- handleEnableButtonClick: () => void;
-}) => {
- const t = useI18nContext();
- return (
- <Button
- marginTop={8}
- variant={ButtonVariant.Primary}
- onClick={handleEnableButtonClick}
- width={BlockSize.Full}
- >
- {t('enable')}
- </Button>
- );
-};
-
-const NoThanksLink = ({
- handleNoThanksLinkClick,
-}: {
- handleNoThanksLinkClick: () => void;
-}) => {
- const t = useI18nContext();
- return (
- <Button
- marginTop={2}
- type="link"
- variant={ButtonVariant.Link}
- color={TextColor.textAlternative}
- onClick={handleNoThanksLinkClick}
- width={BlockSize.Full}
- className="mm-smart-transactions-opt-in-modal__no-thanks-link"
- >
- {t('noThanks')}
- </Button>
- );
-};
-
-const Description = () => {
- const t = useI18nContext();
- return (
- <Box display={Display.Flex} flexDirection={FlexDirection.Column}>
- <Text variant={TextVariant.bodyMd} marginTop={4}>
- {t('smartTransactionsDescription')}
- </Text>
- <Text variant={TextVariant.bodyMd} marginTop={4}>
- {t('smartTransactionsDescription2', [<LearnMoreLink />])}
- </Text>
- </Box>
- );
-};
-
-const Benefit = ({ text, iconName }: { text: string; iconName: IconName }) => {
- return (
- <Box
- display={Display.Flex}
- flexDirection={FlexDirection.Column}
- className="mm-smart-transactions-opt-in-modal__benefit"
- textAlign={TextAlign.Center}
- alignItems={AlignItems.center}
- justifyContent={JustifyContent.flexStart}
- >
- <Icon
- name={iconName}
- color={IconColor.primaryDefault}
- className="mm-smart-transactions-opt-in-modal__icon"
- />
- <Text
- variant={TextVariant.bodySm}
- fontWeight={FontWeight.Medium}
- marginTop={1}
- >
- {text}
- </Text>
- </Box>
- );
-};
-
-const Benefits = () => {
- const t = useI18nContext();
- return (
- <Box
- display={Display.Flex}
- flexDirection={FlexDirection.Row}
- justifyContent={JustifyContent.center}
- marginTop={4}
- paddingLeft={5}
- paddingRight={5}
- >
- <Benefit
- text={t('smartTransactionsBenefit1')}
- iconName={IconName.Confirmation}
- />
- <Benefit text={t('smartTransactionsBenefit2')} iconName={IconName.Coin} />
- <Benefit
- text={t('smartTransactionsBenefit3')}
- iconName={IconName.Clock}
- />
- </Box>
- );
-};
-
-export default function SmartTransactionsOptInModal({
- isOpen,
- hideWhatsNewPopup,
-}: SmartTransactionsOptInModalProps) {
- const t = useI18nContext();
- const dispatch = useDispatch();
-
- const handleEnableButtonClick = useCallback(() => {
- dispatch(setSmartTransactionsPreferenceEnabled(true));
- }, [dispatch]);
-
- const handleNoThanksLinkClick = useCallback(() => {
- // Set the Smart Transactions opt-in status to false, so the opt-in modal is not shown again.
- dispatch(setSmartTransactionsPreferenceEnabled(false));
- }, [dispatch]);
-
- useEffect(() => {
- if (!isOpen) {
- return;
- }
- // If the Smart Transactions Opt-In modal is open, hide the What's New popup,
- // because we don't want to show 2 modals at the same time.
- hideWhatsNewPopup();
- }, [isOpen, hideWhatsNewPopup]);
-
- return (
- <Modal
- isOpen={isOpen}
- onClose={handleEnableButtonClick}
- isClosedOnOutsideClick={false}
- isClosedOnEscapeKey={false}
- className="mm-modal__custom-scrollbar mm-smart-transactions-opt-in-modal"
- autoFocus={false}
- >
- <ModalOverlay />
- <ModalContent>
- <ModalHeader
- alignItems={AlignItems.center}
- justifyContent={JustifyContent.center}
- >
- {t('smartTransactionsOptItModalTitle')}
- </ModalHeader>
- <Box
- display={Display.Flex}
- flexDirection={FlexDirection.Column}
- paddingLeft={4}
- paddingRight={4}
- >
- <Benefits />
- <Description />
- <EnableSmartTransactionsButton
- handleEnableButtonClick={handleEnableButtonClick}
- />
- <NoThanksLink handleNoThanksLinkClick={handleNoThanksLinkClick} />
- </Box>
- </ModalContent>
- </Modal>
- );
-}
diff --git a/ui/pages/smart-transactions/index.scss b/ui/pages/smart-transactions/index.scss
index 8ef1b35cd611..508db455a16c 100644
--- a/ui/pages/smart-transactions/index.scss
+++ b/ui/pages/smart-transactions/index.scss
@@ -1,2 +1 @@
@import './smart-transaction-status-page/index';
-@import './components/index';
|
google-api-nodejs-client
|
https://github.com/googleapis/google-api-nodejs-client
|
8b40261d1dd8b8a4360a6e00515834228dc7ce76
|
Yoshi Automation
|
2025-01-29 06:20:58
|
feat(androidmanagement): update the API
|
#### androidmanagement:v1
The following keys were added:
- resources.signupUrls.methods.create.parameters.allowedDomains.description
- resources.signupUrls.methods.create.parameters.allowedDomains.location
- resources.signupUrls.methods.create.parameters.allowedDomains.repeated
- resources.signupUrls.methods.create.parameters.allowedDomains.type
- schemas.PersonalUsagePolicies.properties.privateSpacePolicy.description
- schemas.PersonalUsagePolicies.properties.privateSpacePolicy.enum
- schemas.PersonalUsagePolicies.properties.privateSpacePolicy.enumDescriptions
- schemas.PersonalUsagePolicies.properties.privateSpacePolicy.type
The following keys were changed:
- resources.signupUrls.methods.create.parameters.adminEmail.description
- schemas.ApplicationPolicy.properties.defaultPermissionPolicy.enumDescriptions
- schemas.ApplicationPolicy.properties.delegatedScopes.items.enumDescriptions
- schemas.EnrollmentToken.properties.allowPersonalUsage.enumDescriptions
- schemas.ExtensionConfig.description
- schemas.PermissionGrant.properties.policy.enumDescriptions
- schemas.Policy.properties.addUserDisabled.description
- schemas.Policy.properties.adjustVolumeDisabled.description
- schemas.Policy.properties.defaultPermissionPolicy.enumDescriptions
- schemas.Policy.properties.keyguardDisabled.description
- schemas.Policy.properties.setUserIconDisabled.description
- schemas.SigninDetail.properties.allowPersonalUsage.enumDescriptions
- schemas.WifiRoamingSetting.properties.wifiRoamingMode.enum
- schemas.WifiRoamingSetting.properties.wifiRoamingMode.enumDescriptions
|
feat(androidmanagement): update the API
#### androidmanagement:v1
The following keys were added:
- resources.signupUrls.methods.create.parameters.allowedDomains.description
- resources.signupUrls.methods.create.parameters.allowedDomains.location
- resources.signupUrls.methods.create.parameters.allowedDomains.repeated
- resources.signupUrls.methods.create.parameters.allowedDomains.type
- schemas.PersonalUsagePolicies.properties.privateSpacePolicy.description
- schemas.PersonalUsagePolicies.properties.privateSpacePolicy.enum
- schemas.PersonalUsagePolicies.properties.privateSpacePolicy.enumDescriptions
- schemas.PersonalUsagePolicies.properties.privateSpacePolicy.type
The following keys were changed:
- resources.signupUrls.methods.create.parameters.adminEmail.description
- schemas.ApplicationPolicy.properties.defaultPermissionPolicy.enumDescriptions
- schemas.ApplicationPolicy.properties.delegatedScopes.items.enumDescriptions
- schemas.EnrollmentToken.properties.allowPersonalUsage.enumDescriptions
- schemas.ExtensionConfig.description
- schemas.PermissionGrant.properties.policy.enumDescriptions
- schemas.Policy.properties.addUserDisabled.description
- schemas.Policy.properties.adjustVolumeDisabled.description
- schemas.Policy.properties.defaultPermissionPolicy.enumDescriptions
- schemas.Policy.properties.keyguardDisabled.description
- schemas.Policy.properties.setUserIconDisabled.description
- schemas.SigninDetail.properties.allowPersonalUsage.enumDescriptions
- schemas.WifiRoamingSetting.properties.wifiRoamingMode.enum
- schemas.WifiRoamingSetting.properties.wifiRoamingMode.enumDescriptions
|
diff --git a/discovery/androidmanagement-v1.json b/discovery/androidmanagement-v1.json
index c8923322e8..ac0df0e5b3 100644
--- a/discovery/androidmanagement-v1.json
+++ b/discovery/androidmanagement-v1.json
@@ -1142,10 +1142,16 @@
"parameterOrder": [],
"parameters": {
"adminEmail": {
- "description": "Optional. Email address used to prefill the admin field of the enterprise signup form. This value is a hint only and can be altered by the user.",
+ "description": "Optional. Email address used to prefill the admin field of the enterprise signup form. This value is a hint only and can be altered by the user. If allowedDomains is non-empty then this must belong to one of the allowedDomains.",
"location": "query",
"type": "string"
},
+ "allowedDomains": {
+ "description": "Optional. A list of domains that are permitted for the admin email. The IT admin cannot enter an email address with a domain name that is not in this list. Subdomains of domains in this list are not allowed but can be allowed by adding a second entry which has *. prefixed to the domain name (e.g. *.example.com). If the field is not present or is an empty list then the IT admin is free to use any valid domain name. Personal email domains are always allowed, but will result in the creation of a managed Google Play Accounts enterprise.",
+ "location": "query",
+ "repeated": true,
+ "type": "string"
+ },
"callbackUrl": {
"description": "The callback URL that the admin will be redirected to after successfully creating an enterprise. Before redirecting there the system will add a query parameter to this URL named enterpriseToken which will contain an opaque token to be used for the create enterprise request. The URL will be parsed then reformatted in order to add the enterpriseToken parameter, so there may be some minor formatting changes.",
"location": "query",
@@ -1168,7 +1174,7 @@
}
}
},
- "revision": "20240924",
+ "revision": "20250123",
"rootUrl": "https://androidmanagement.googleapis.com/",
"schemas": {
"AdbShellCommandEvent": {
@@ -1716,7 +1722,7 @@
"enumDescriptions": [
"Policy not specified. If no policy is specified for a permission at any level, then the PROMPT behavior is used by default.",
"Prompt the user to grant a permission.",
- "Automatically grant a permission.On Android 12 and above, Manifest.permission.READ_SMS (https://developer.android.com/reference/android/Manifest.permission#READ_SMS) and following sensor-related permissions can only be granted on fully managed devices: Manifest.permission.ACCESS_FINE_LOCATION (https://developer.android.com/reference/android/Manifest.permission#ACCESS_FINE_LOCATION) Manifest.permission.ACCESS_BACKGROUND_LOCATION (https://developer.android.com/reference/android/Manifest.permission#ACCESS_BACKGROUND_LOCATION) Manifest.permission.ACCESS_COARSE_LOCATION (https://developer.android.com/reference/android/Manifest.permission#ACCESS_COARSE_LOCATION) Manifest.permission.CAMERA (https://developer.android.com/reference/android/Manifest.permission#CAMERA) Manifest.permission.RECORD_AUDIO (https://developer.android.com/reference/android/Manifest.permission#RECORD_AUDIO) Manifest.permission.ACTIVITY_RECOGNITION (https://developer.android.com/reference/android/Manifest.permission#ACTIVITY_RECOGNITION) Manifest.permission.BODY_SENSORS (https://developer.android.com/reference/android/Manifest.permission#BODY_SENSORS)",
+ "Automatically grant a permission.On Android 12 and above, READ_SMS (https://developer.android.com/reference/android/Manifest.permission#READ_SMS) and following sensor-related permissions can only be granted on fully managed devices: ACCESS_FINE_LOCATION (https://developer.android.com/reference/android/Manifest.permission#ACCESS_FINE_LOCATION) ACCESS_BACKGROUND_LOCATION (https://developer.android.com/reference/android/Manifest.permission#ACCESS_BACKGROUND_LOCATION) ACCESS_COARSE_LOCATION (https://developer.android.com/reference/android/Manifest.permission#ACCESS_COARSE_LOCATION) CAMERA (https://developer.android.com/reference/android/Manifest.permission#CAMERA) RECORD_AUDIO (https://developer.android.com/reference/android/Manifest.permission#RECORD_AUDIO) ACTIVITY_RECOGNITION (https://developer.android.com/reference/android/Manifest.permission#ACTIVITY_RECOGNITION) BODY_SENSORS (https://developer.android.com/reference/android/Manifest.permission#BODY_SENSORS)",
"Automatically deny a permission."
],
"type": "string"
@@ -1738,15 +1744,15 @@
],
"enumDescriptions": [
"No delegation scope specified.",
- "Grants access to certificate installation and management.",
- "Grants access to managed configurations management.",
- "Grants access to blocking uninstallation.",
- "Grants access to permission policy and permission grant state.",
- "Grants access to package access state.",
- "Grants access for enabling system apps.",
+ "Grants access to certificate installation and management. This scope can be delegated to multiple applications.",
+ "Grants access to managed configurations management. This scope can be delegated to multiple applications.",
+ "Grants access to blocking uninstallation. This scope can be delegated to multiple applications.",
+ "Grants access to permission policy and permission grant state. This scope can be delegated to multiple applications.",
+ "Grants access to package access state. This scope can be delegated to multiple applications.",
+ "Grants access for enabling system apps. This scope can be delegated to multiple applications.",
"Grants access to network activity logs. Allows the delegated application to call setNetworkLoggingEnabled (https://developer.android.com/reference/android/app/admin/DevicePolicyManager#setNetworkLoggingEnabled%28android.content.ComponentName,%20boolean%29), isNetworkLoggingEnabled (https://developer.android.com/reference/android/app/admin/DevicePolicyManager#isNetworkLoggingEnabled%28android.content.ComponentName%29) and retrieveNetworkLogs (https://developer.android.com/reference/android/app/admin/DevicePolicyManager#retrieveNetworkLogs%28android.content.ComponentName,%20long%29) methods. This scope can be delegated to at most one application. Supported for fully managed devices on Android 10 and above. Supported for a work profile on Android 12 and above. When delegation is supported and set, NETWORK_ACTIVITY_LOGS is ignored.",
"Grants access to security logs. Allows the delegated application to call setSecurityLoggingEnabled (https://developer.android.com/reference/android/app/admin/DevicePolicyManager#setSecurityLoggingEnabled%28android.content.ComponentName,%20boolean%29), isSecurityLoggingEnabled (https://developer.android.com/reference/android/app/admin/DevicePolicyManager#isSecurityLoggingEnabled%28android.content.ComponentName%29), retrieveSecurityLogs (https://developer.android.com/reference/android/app/admin/DevicePolicyManager#retrieveSecurityLogs%28android.content.ComponentName%29) and retrievePreRebootSecurityLogs (https://developer.android.com/reference/android/app/admin/DevicePolicyManager#retrievePreRebootSecurityLogs%28android.content.ComponentName%29) methods. This scope can be delegated to at most one application. Supported for fully managed devices and company-owned devices with a work profile on Android 12 and above. When delegation is supported and set, SECURITY_LOGS is ignored.",
- "Grants access to selection of KeyChain certificates on behalf of requesting apps. Once granted, the delegated application will start receiving DelegatedAdminReceiver#onChoosePrivateKeyAlias (https://developer.android.com/reference/android/app/admin/DelegatedAdminReceiver#onChoosePrivateKeyAlias%28android.content.Context,%20android.content.Intent,%20int,%20android.net.Uri,%20java.lang.String%29). Allows the delegated application to call grantKeyPairToApp (https://developer.android.com/reference/android/app/admin/DevicePolicyManager#grantKeyPairToApp%28android.content.ComponentName,%20java.lang.String,%20java.lang.String%29) and revokeKeyPairFromApp (https://developer.android.com/reference/android/app/admin/DevicePolicyManager#revokeKeyPairFromApp%28android.content.ComponentName,%20java.lang.String,%20java.lang.String%29) methods. There can be at most one app that has this delegation. choosePrivateKeyRules must be empty and privateKeySelectionEnabled has no effect if certificate selection is delegated to an application."
+ "Grants access to selection of KeyChain certificates on behalf of requesting apps. Once granted, the delegated application will start receiving DelegatedAdminReceiver#onChoosePrivateKeyAlias (https://developer.android.com/reference/android/app/admin/DelegatedAdminReceiver#onChoosePrivateKeyAlias%28android.content.Context,%20android.content.Intent,%20int,%20android.net.Uri,%20java.lang.String%29). Allows the delegated application to call grantKeyPairToApp (https://developer.android.com/reference/android/app/admin/DevicePolicyManager#grantKeyPairToApp%28android.content.ComponentName,%20java.lang.String,%20java.lang.String%29) and revokeKeyPairFromApp (https://developer.android.com/reference/android/app/admin/DevicePolicyManager#revokeKeyPairFromApp%28android.content.ComponentName,%20java.lang.String,%20java.lang.String%29) methods. This scope can be delegated to at most one application. choosePrivateKeyRules must be empty and privateKeySelectionEnabled has no effect if certificate selection is delegated to an application."
],
"type": "string"
},
@@ -3087,7 +3093,7 @@
"Personal usage restriction is not specified",
"Personal usage is allowed",
"Personal usage is disallowed",
- "Device is not associated with a single user, and thus both personal usage and corporate identity authentication are not expected."
+ "Device is not associated with a single user, and thus both personal usage and corporate identity authentication are not expected. Important: This setting is mandatory for dedicated device enrollment and it is a breaking change. This change needs to be implemented before January 2025.For additional details see the dedicated device provisioning guide (https://developers.google.com/android/management/provision-device#company-owned_devices_for_work_use_only). "
],
"type": "string"
},
@@ -3216,7 +3222,7 @@
"type": "object"
},
"ExtensionConfig": {
- "description": "Configuration to enable an app as an extension app, with the capability of interacting with Android Device Policy offline. For Android versions 13 and above, extension apps are exempt from battery restrictions so will not be placed into the restricted App Standby Bucket (https://developer.android.com/topic/performance/appstandby#restricted-bucket). Extensions apps are also protected against users clearing their data or force-closing the application, although admins can continue to use the clear app data command on extension apps if needed for Android 13 and above.",
+ "description": "Configuration to enable an app as an extension app, with the capability of interacting with Android Device Policy offline. For Android versions 11 and above, extension apps are exempt from battery restrictions so will not be placed into the restricted App Standby Bucket (https://developer.android.com/topic/performance/appstandby#restricted-bucket). Extensions apps are also protected against users clearing their data or force-closing the application, although admins can continue to use the clear app data command on extension apps if needed for Android 11 and above.",
"id": "ExtensionConfig",
"properties": {
"notificationReceiver": {
@@ -4708,7 +4714,7 @@
"enumDescriptions": [
"Policy not specified. If no policy is specified for a permission at any level, then the PROMPT behavior is used by default.",
"Prompt the user to grant a permission.",
- "Automatically grant a permission.On Android 12 and above, Manifest.permission.READ_SMS (https://developer.android.com/reference/android/Manifest.permission#READ_SMS) and following sensor-related permissions can only be granted on fully managed devices: Manifest.permission.ACCESS_FINE_LOCATION (https://developer.android.com/reference/android/Manifest.permission#ACCESS_FINE_LOCATION) Manifest.permission.ACCESS_BACKGROUND_LOCATION (https://developer.android.com/reference/android/Manifest.permission#ACCESS_BACKGROUND_LOCATION) Manifest.permission.ACCESS_COARSE_LOCATION (https://developer.android.com/reference/android/Manifest.permission#ACCESS_COARSE_LOCATION) Manifest.permission.CAMERA (https://developer.android.com/reference/android/Manifest.permission#CAMERA) Manifest.permission.RECORD_AUDIO (https://developer.android.com/reference/android/Manifest.permission#RECORD_AUDIO) Manifest.permission.ACTIVITY_RECOGNITION (https://developer.android.com/reference/android/Manifest.permission#ACTIVITY_RECOGNITION) Manifest.permission.BODY_SENSORS (https://developer.android.com/reference/android/Manifest.permission#BODY_SENSORS)",
+ "Automatically grant a permission.On Android 12 and above, READ_SMS (https://developer.android.com/reference/android/Manifest.permission#READ_SMS) and following sensor-related permissions can only be granted on fully managed devices: ACCESS_FINE_LOCATION (https://developer.android.com/reference/android/Manifest.permission#ACCESS_FINE_LOCATION) ACCESS_BACKGROUND_LOCATION (https://developer.android.com/reference/android/Manifest.permission#ACCESS_BACKGROUND_LOCATION) ACCESS_COARSE_LOCATION (https://developer.android.com/reference/android/Manifest.permission#ACCESS_COARSE_LOCATION) CAMERA (https://developer.android.com/reference/android/Manifest.permission#CAMERA) RECORD_AUDIO (https://developer.android.com/reference/android/Manifest.permission#RECORD_AUDIO) ACTIVITY_RECOGNITION (https://developer.android.com/reference/android/Manifest.permission#ACTIVITY_RECOGNITION) BODY_SENSORS (https://developer.android.com/reference/android/Manifest.permission#BODY_SENSORS)",
"Automatically deny a permission."
],
"type": "string"
@@ -4815,6 +4821,20 @@
],
"type": "string"
},
+ "privateSpacePolicy": {
+ "description": "Optional. Controls whether a private space is allowed on the device.",
+ "enum": [
+ "PRIVATE_SPACE_POLICY_UNSPECIFIED",
+ "PRIVATE_SPACE_ALLOWED",
+ "PRIVATE_SPACE_DISALLOWED"
+ ],
+ "enumDescriptions": [
+ "Unspecified. Defaults to PRIVATE_SPACE_ALLOWED.",
+ "Users can create a private space profile.",
+ "Users cannot create a private space profile. Supported only for company-owned devices with a work profile. Caution: Any existing private space will be removed."
+ ],
+ "type": "string"
+ },
"screenCaptureDisabled": {
"description": "If true, screen capture is disabled for all users.",
"type": "boolean"
@@ -4834,11 +4854,11 @@
"type": "array"
},
"addUserDisabled": {
- "description": "Whether adding new users and profiles is disabled.",
+ "description": "Whether adding new users and profiles is disabled. For devices where managementMode is DEVICE_OWNER this field is ignored and the user is never allowed to add or remove users.",
"type": "boolean"
},
"adjustVolumeDisabled": {
- "description": "Whether adjusting the master volume is disabled. Also mutes the device.",
+ "description": "Whether adjusting the master volume is disabled. Also mutes the device. The setting has effect only on fully managed devices.",
"type": "boolean"
},
"advancedSecurityOverrides": {
@@ -5028,7 +5048,7 @@
"enumDescriptions": [
"Policy not specified. If no policy is specified for a permission at any level, then the PROMPT behavior is used by default.",
"Prompt the user to grant a permission.",
- "Automatically grant a permission.On Android 12 and above, Manifest.permission.READ_SMS (https://developer.android.com/reference/android/Manifest.permission#READ_SMS) and following sensor-related permissions can only be granted on fully managed devices: Manifest.permission.ACCESS_FINE_LOCATION (https://developer.android.com/reference/android/Manifest.permission#ACCESS_FINE_LOCATION) Manifest.permission.ACCESS_BACKGROUND_LOCATION (https://developer.android.com/reference/android/Manifest.permission#ACCESS_BACKGROUND_LOCATION) Manifest.permission.ACCESS_COARSE_LOCATION (https://developer.android.com/reference/android/Manifest.permission#ACCESS_COARSE_LOCATION) Manifest.permission.CAMERA (https://developer.android.com/reference/android/Manifest.permission#CAMERA) Manifest.permission.RECORD_AUDIO (https://developer.android.com/reference/android/Manifest.permission#RECORD_AUDIO) Manifest.permission.ACTIVITY_RECOGNITION (https://developer.android.com/reference/android/Manifest.permission#ACTIVITY_RECOGNITION) Manifest.permission.BODY_SENSORS (https://developer.android.com/reference/android/Manifest.permission#BODY_SENSORS)",
+ "Automatically grant a permission.On Android 12 and above, READ_SMS (https://developer.android.com/reference/android/Manifest.permission#READ_SMS) and following sensor-related permissions can only be granted on fully managed devices: ACCESS_FINE_LOCATION (https://developer.android.com/reference/android/Manifest.permission#ACCESS_FINE_LOCATION) ACCESS_BACKGROUND_LOCATION (https://developer.android.com/reference/android/Manifest.permission#ACCESS_BACKGROUND_LOCATION) ACCESS_COARSE_LOCATION (https://developer.android.com/reference/android/Manifest.permission#ACCESS_COARSE_LOCATION) CAMERA (https://developer.android.com/reference/android/Manifest.permission#CAMERA) RECORD_AUDIO (https://developer.android.com/reference/android/Manifest.permission#RECORD_AUDIO) ACTIVITY_RECOGNITION (https://developer.android.com/reference/android/Manifest.permission#ACTIVITY_RECOGNITION) BODY_SENSORS (https://developer.android.com/reference/android/Manifest.permission#BODY_SENSORS)",
"Automatically deny a permission."
],
"type": "string"
@@ -5093,7 +5113,7 @@
"type": "boolean"
},
"keyguardDisabled": {
- "description": "If true, this disables the Lock Screen (https://source.android.com/docs/core/display/multi_display/lock-screen) for primary and/or secondary displays.",
+ "description": "If true, this disables the Lock Screen (https://source.android.com/docs/core/display/multi_display/lock-screen) for primary and/or secondary displays. This policy is supported only in dedicated device management mode.",
"type": "boolean"
},
"keyguardDisabledFeatures": {
@@ -5359,7 +5379,7 @@
"type": "boolean"
},
"setUserIconDisabled": {
- "description": "Whether changing the user icon is disabled.",
+ "description": "Whether changing the user icon is disabled. The setting has effect only on fully managed devices.",
"type": "boolean"
},
"setWallpaperDisabled": {
@@ -5800,7 +5820,7 @@
"Personal usage restriction is not specified",
"Personal usage is allowed",
"Personal usage is disallowed",
- "Device is not associated with a single user, and thus both personal usage and corporate identity authentication are not expected."
+ "Device is not associated with a single user, and thus both personal usage and corporate identity authentication are not expected. Important: This setting is mandatory for dedicated device enrollment and it is a breaking change. This change needs to be implemented before January 2025.For additional details see the dedicated device provisioning guide (https://developers.google.com/android/management/provision-device#company-owned_devices_for_work_use_only). "
],
"type": "string"
},
@@ -6626,11 +6646,13 @@
"description": "Required. Wi-Fi roaming mode for the specified SSID.",
"enum": [
"WIFI_ROAMING_MODE_UNSPECIFIED",
+ "WIFI_ROAMING_DISABLED",
"WIFI_ROAMING_DEFAULT",
"WIFI_ROAMING_AGGRESSIVE"
],
"enumDescriptions": [
"Unspecified. Defaults to WIFI_ROAMING_DEFAULT.",
+ "Wi-Fi roaming is disabled. Supported on Android 15 and above on fully managed devices and work profiles on company-owned devices. A nonComplianceDetail with MANAGEMENT_MODE is reported for other management modes. A nonComplianceDetail with API_LEVEL is reported if the Android version is less than 15.",
"Default Wi-Fi roaming mode of the device.",
"Aggressive roaming mode which allows quicker Wi-Fi roaming. Supported on Android 15 and above on fully managed devices and work profiles on company-owned devices. A nonComplianceDetail with MANAGEMENT_MODE is reported for other management modes. A nonComplianceDetail with API_LEVEL is reported if the Android version is less than 15. A nonComplianceDetail with DEVICE_INCOMPATIBLE is reported if the device does not support aggressive roaming mode."
],
diff --git a/src/apis/androidmanagement/v1.ts b/src/apis/androidmanagement/v1.ts
index 4462554679..bb478d2f4b 100644
--- a/src/apis/androidmanagement/v1.ts
+++ b/src/apis/androidmanagement/v1.ts
@@ -1282,7 +1282,7 @@ export namespace androidmanagement_v1 {
termsAndConditions?: Schema$TermsAndConditions[];
}
/**
- * Configuration to enable an app as an extension app, with the capability of interacting with Android Device Policy offline. For Android versions 13 and above, extension apps are exempt from battery restrictions so will not be placed into the restricted App Standby Bucket (https://developer.android.com/topic/performance/appstandby#restricted-bucket). Extensions apps are also protected against users clearing their data or force-closing the application, although admins can continue to use the clear app data command on extension apps if needed for Android 13 and above.
+ * Configuration to enable an app as an extension app, with the capability of interacting with Android Device Policy offline. For Android versions 11 and above, extension apps are exempt from battery restrictions so will not be placed into the restricted App Standby Bucket (https://developer.android.com/topic/performance/appstandby#restricted-bucket). Extensions apps are also protected against users clearing their data or force-closing the application, although admins can continue to use the clear app data command on extension apps if needed for Android 11 and above.
*/
export interface Schema$ExtensionConfig {
/**
@@ -2209,6 +2209,10 @@ export namespace androidmanagement_v1 {
* Used together with personalApplications to control how apps in the personal profile are allowed or blocked.
*/
personalPlayStoreMode?: string | null;
+ /**
+ * Optional. Controls whether a private space is allowed on the device.
+ */
+ privateSpacePolicy?: string | null;
/**
* If true, screen capture is disabled for all users.
*/
@@ -2223,11 +2227,11 @@ export namespace androidmanagement_v1 {
*/
accountTypesWithManagementDisabled?: string[] | null;
/**
- * Whether adding new users and profiles is disabled.
+ * Whether adding new users and profiles is disabled. For devices where managementMode is DEVICE_OWNER this field is ignored and the user is never allowed to add or remove users.
*/
addUserDisabled?: boolean | null;
/**
- * Whether adjusting the master volume is disabled. Also mutes the device.
+ * Whether adjusting the master volume is disabled. Also mutes the device. The setting has effect only on fully managed devices.
*/
adjustVolumeDisabled?: boolean | null;
/**
@@ -2371,7 +2375,7 @@ export namespace androidmanagement_v1 {
*/
installUnknownSourcesAllowed?: boolean | null;
/**
- * If true, this disables the Lock Screen (https://source.android.com/docs/core/display/multi_display/lock-screen) for primary and/or secondary displays.
+ * If true, this disables the Lock Screen (https://source.android.com/docs/core/display/multi_display/lock-screen) for primary and/or secondary displays. This policy is supported only in dedicated device management mode.
*/
keyguardDisabled?: boolean | null;
/**
@@ -2515,7 +2519,7 @@ export namespace androidmanagement_v1 {
*/
setupActions?: Schema$SetupAction[];
/**
- * Whether changing the user icon is disabled.
+ * Whether changing the user icon is disabled. The setting has effect only on fully managed devices.
*/
setUserIconDisabled?: boolean | null;
/**
@@ -6767,9 +6771,13 @@ export namespace androidmanagement_v1 {
export interface Params$Resource$Signupurls$Create
extends StandardParameters {
/**
- * Optional. Email address used to prefill the admin field of the enterprise signup form. This value is a hint only and can be altered by the user.
+ * Optional. Email address used to prefill the admin field of the enterprise signup form. This value is a hint only and can be altered by the user. If allowedDomains is non-empty then this must belong to one of the allowedDomains.
*/
adminEmail?: string;
+ /**
+ * Optional. A list of domains that are permitted for the admin email. The IT admin cannot enter an email address with a domain name that is not in this list. Subdomains of domains in this list are not allowed but can be allowed by adding a second entry which has *. prefixed to the domain name (e.g. *.example.com). If the field is not present or is an empty list then the IT admin is free to use any valid domain name. Personal email domains are always allowed, but will result in the creation of a managed Google Play Accounts enterprise.
+ */
+ allowedDomains?: string[];
/**
* The callback URL that the admin will be redirected to after successfully creating an enterprise. Before redirecting there the system will add a query parameter to this URL named enterpriseToken which will contain an opaque token to be used for the create enterprise request. The URL will be parsed then reformatted in order to add the enterpriseToken parameter, so there may be some minor formatting changes.
*/
|
metersphere
|
https://github.com/metersphere/metersphere
|
a3a4642ca244da267bf7945efd87c50cc506ce9d
|
chenjianxing
|
2022-12-27 12:50:37
|
fix(测试跟踪): 功能用例导出多值输入自定义字段为空
|
--bug=1020958 --user=陈建星 【测试跟踪】github#20627,自定义设置功能用例模板字段为“多值输入框” ,然后通过excel导入,页面展示有问题 https://www.tapd.cn/55049933/s/1319859
|
fix(测试跟踪): 功能用例导出多值输入自定义字段为空
--bug=1020958 --user=陈建星 【测试跟踪】github#20627,自定义设置功能用例模板字段为“多值输入框” ,然后通过excel导入,页面展示有问题 https://www.tapd.cn/55049933/s/1319859
|
diff --git a/test-track/backend/src/main/java/io/metersphere/service/TestCaseService.java b/test-track/backend/src/main/java/io/metersphere/service/TestCaseService.java
index 77ac453e2086..b15a7cc9cca0 100644
--- a/test-track/backend/src/main/java/io/metersphere/service/TestCaseService.java
+++ b/test-track/backend/src/main/java/io/metersphere/service/TestCaseService.java
@@ -1739,7 +1739,9 @@ private void buildExportCustomField(Map<String, Map<String, String>> customSelec
List<String> results = new ArrayList<>();
List values = (List) value;
values.forEach(item -> {
- if (MapUtils.isNotEmpty(optionMap) && optionMap.containsKey(item.toString())) {
+ if (MapUtils.isEmpty(optionMap)) {
+ results.add(item.toString());
+ } else if (optionMap.containsKey(item.toString())) {
results.add(optionMap.get(item.toString()));
}
});
|
linkerd2
|
https://github.com/linkerd/linkerd2
|
3cb41f2fd83f0d55478ba5265e2f3249bcb6e435
|
dependabot[bot]
|
2022-01-26 16:13:05
|
build(deps): bump k8s.io/kube-aggregator from 0.23.2 to 0.23.3 (#7704)
|
Bumps [k8s.io/kube-aggregator](https://github.com/kubernetes/kube-aggregator) from 0.23.2 to 0.23.3.
- [Release notes](https://github.com/kubernetes/kube-aggregator/releases)
- [Commits](https://github.com/kubernetes/kube-aggregator/compare/v0.23.2...v0.23.3)
---
|
build(deps): bump k8s.io/kube-aggregator from 0.23.2 to 0.23.3 (#7704)
Bumps [k8s.io/kube-aggregator](https://github.com/kubernetes/kube-aggregator) from 0.23.2 to 0.23.3.
- [Release notes](https://github.com/kubernetes/kube-aggregator/releases)
- [Commits](https://github.com/kubernetes/kube-aggregator/compare/v0.23.2...v0.23.3)
---
updated-dependencies:
- dependency-name: k8s.io/kube-aggregator
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
|
diff --git a/go.mod b/go.mod
index 6e81b7a3ed91f..47287898080c7 100644
--- a/go.mod
+++ b/go.mod
@@ -41,13 +41,13 @@ require (
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.2.0
google.golang.org/protobuf v1.27.1
helm.sh/helm/v3 v3.8.0
- k8s.io/api v0.23.2
+ k8s.io/api v0.23.3
k8s.io/apiextensions-apiserver v0.23.2
- k8s.io/apimachinery v0.23.2
- k8s.io/client-go v0.23.2
- k8s.io/code-generator v0.23.2
+ k8s.io/apimachinery v0.23.3
+ k8s.io/client-go v0.23.3
+ k8s.io/code-generator v0.23.3
k8s.io/klog/v2 v2.40.1
- k8s.io/kube-aggregator v0.23.2
+ k8s.io/kube-aggregator v0.23.3
sigs.k8s.io/yaml v1.3.0
)
@@ -153,7 +153,7 @@ require (
k8s.io/cli-runtime v0.23.1 // indirect
k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c // indirect
k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 // indirect
- k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b // indirect
+ k8s.io/utils v0.0.0-20211116205334-6203023598ed // indirect
oras.land/oras-go v1.1.0 // indirect
sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6 // indirect
sigs.k8s.io/kustomize/api v0.10.1 // indirect
diff --git a/go.sum b/go.sum
index 6fe2446c1b0cd..224ddf7b5befd 100644
--- a/go.sum
+++ b/go.sum
@@ -1551,31 +1551,37 @@ honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9
honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
k8s.io/api v0.20.6/go.mod h1:X9e8Qag6JV/bL5G6bU8sdVRltWKmdHsFUGS3eVndqE8=
k8s.io/api v0.23.1/go.mod h1:WfXnOnwSqNtG62Y1CdjoMxh7r7u9QXGCkA1u0na2jgo=
-k8s.io/api v0.23.2 h1:62cpzreV3dCuj0hqPi8r4dyWh48ogMcyh+ga9jEGij4=
k8s.io/api v0.23.2/go.mod h1:sYuDb3flCtRPI8ghn6qFrcK5ZBu2mhbElxRE95qpwlI=
+k8s.io/api v0.23.3 h1:KNrME8KHGr12Ozjf8ytOewKzZh6hl/hHUZeHddT3a38=
+k8s.io/api v0.23.3/go.mod h1:w258XdGyvCmnBj/vGzQMj6kzdufJZVUwEM1U2fRJwSQ=
k8s.io/apiextensions-apiserver v0.23.1/go.mod h1:0qz4fPaHHsVhRApbtk3MGXNn2Q9M/cVWWhfHdY2SxiM=
k8s.io/apiextensions-apiserver v0.23.2 h1:N6CIVAhmF0ahgFKUMDdV/AUyckhUb4nIyVPohPtdUPk=
k8s.io/apiextensions-apiserver v0.23.2/go.mod h1:9cs7avT6+GfzbB0pambTvH11wcaR85QQg4ovl9s15UU=
k8s.io/apimachinery v0.20.6/go.mod h1:ejZXtW1Ra6V1O5H8xPBGz+T3+4gfkTCeExAHKU57MAc=
k8s.io/apimachinery v0.23.1/go.mod h1:SADt2Kl8/sttJ62RRsi9MIV4o8f5S3coArm0Iu3fBno=
-k8s.io/apimachinery v0.23.2 h1:dBmjCOeYBdg2ibcQxMuUq+OopZ9fjfLIR5taP/XKeTs=
k8s.io/apimachinery v0.23.2/go.mod h1:zDqeV0AK62LbCI0CI7KbWCAYdLg+E+8UXJ0rIz5gmS8=
+k8s.io/apimachinery v0.23.3 h1:7IW6jxNzrXTsP0c8yXz2E5Yx/WTzVPTsHIx/2Vm0cIk=
+k8s.io/apimachinery v0.23.3/go.mod h1:BEuFMMBaIbcOqVIJqNZJXGFTP4W6AycEpb5+m/97hrM=
k8s.io/apiserver v0.20.6/go.mod h1:QIJXNt6i6JB+0YQRNcS0hdRHJlMhflFmsBDeSgT1r8Q=
k8s.io/apiserver v0.23.1/go.mod h1:Bqt0gWbeM2NefS8CjWswwd2VNAKN6lUKR85Ft4gippY=
k8s.io/apiserver v0.23.2/go.mod h1:Kdt8gafkPev9Gfh+H6lCPbmRu42f7BfhOfHKKa3dtyU=
+k8s.io/apiserver v0.23.3/go.mod h1:3HhsTmC+Pn+Jctw+Ow0LHA4dQ4oXrQ4XJDzrVDG64T4=
k8s.io/cli-runtime v0.23.1 h1:vHUZrq1Oejs0WaJnxs09mLHKScvIIl2hMSthhS8o8Yo=
k8s.io/cli-runtime v0.23.1/go.mod h1:r9r8H/qfXo9w+69vwUL7LokKlLRKW5D6A8vUKCx+YL0=
k8s.io/client-go v0.20.6/go.mod h1:nNQMnOvEUEsOzRRFIIkdmYOjAZrC8bgq0ExboWSU1I0=
k8s.io/client-go v0.23.1/go.mod h1:6QSI8fEuqD4zgFK0xbdwfB/PthBsIxCJMa3s17WlcO0=
-k8s.io/client-go v0.23.2 h1:BNbOcxa99jxHH8mM1cPKGIrrKRnCSAfAtyonYGsbFtE=
k8s.io/client-go v0.23.2/go.mod h1:k3YbsWg6GWdHF1THHTQP88X9RhB1DWPo3Dq7KfU/D1c=
+k8s.io/client-go v0.23.3 h1:23QYUmCQ/W6hW78xIwm3XqZrrKZM+LWDqW2zfo+szJs=
+k8s.io/client-go v0.23.3/go.mod h1:47oMd+YvAOqZM7pcQ6neJtBiFH7alOyfunYN48VsmwE=
k8s.io/code-generator v0.19.7/go.mod h1:lwEq3YnLYb/7uVXLorOJfxg+cUu2oihFhHZ0n9NIla0=
k8s.io/code-generator v0.23.1/go.mod h1:V7yn6VNTCWW8GqodYCESVo95fuiEg713S8B7WacWZDA=
-k8s.io/code-generator v0.23.2 h1:KqIwRDwEZpjA0x7gr4S8LQgyT6iFnR57lksnxBha0g0=
k8s.io/code-generator v0.23.2/go.mod h1:S0Q1JVA+kSzTI1oUvbKAxZY/DYbA/ZUb4Uknog12ETk=
+k8s.io/code-generator v0.23.3 h1:NSAKIkvkL8OaWr5DrF9CXGBJjhMp3itplT/6fwHQcAY=
+k8s.io/code-generator v0.23.3/go.mod h1:S0Q1JVA+kSzTI1oUvbKAxZY/DYbA/ZUb4Uknog12ETk=
k8s.io/component-base v0.20.6/go.mod h1:6f1MPBAeI+mvuts3sIdtpjljHWBQ2cIy38oBIWMYnrM=
k8s.io/component-base v0.23.1/go.mod h1:6llmap8QtJIXGDd4uIWJhAq0Op8AtQo6bDW2RrNMTeo=
k8s.io/component-base v0.23.2/go.mod h1:wS9Z03MO3oJ0RU8bB/dbXTiluGju+SC/F5i660gxB8c=
+k8s.io/component-base v0.23.3/go.mod h1:1Smc4C60rWG7d3HjSYpIwEbySQ3YWg0uzH5a2AtaTLg=
k8s.io/component-helpers v0.23.1/go.mod h1:ZK24U+2oXnBPcas2KolLigVVN9g5zOzaHLkHiQMFGr0=
k8s.io/cri-api v0.20.6/go.mod h1:ew44AjNXwyn1s0U4xCKGodU7J1HzBeZ1MpGrpa5r8Yc=
k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
@@ -1589,8 +1595,8 @@ k8s.io/klog/v2 v2.4.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y=
k8s.io/klog/v2 v2.30.0/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0=
k8s.io/klog/v2 v2.40.1 h1:P4RRucWk/lFOlDdkAr3mc7iWFkgKrZY9qZMAgek06S4=
k8s.io/klog/v2 v2.40.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0=
-k8s.io/kube-aggregator v0.23.2 h1:6CoZZqNdFc9benrgSJJ0GQGgFtKjI0y3UwlBbioXtc8=
-k8s.io/kube-aggregator v0.23.2/go.mod h1:hoxP4rZREnjCJmrb0pHFPqm7+pkxoFjh8IpXL7OBWRA=
+k8s.io/kube-aggregator v0.23.3 h1:9IP+D+YzIbGor/TArN3pYf9Thj19wYhzLRGRrFaKFSs=
+k8s.io/kube-aggregator v0.23.3/go.mod h1:pt5QJ3QaIdhZzNlUvN5wndbM0LNT4BvhszGkzy2QdFo=
k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6/go.mod h1:UuqjUnNftUyPE5H64/qeyjQoUZhGpeFDVdxjTeEVN2o=
k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd/go.mod h1:WOJ3KddDSol4tAGcJo0Tvi+dK12EcqSLqcWsryKMpfM=
k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw=
@@ -1600,8 +1606,9 @@ k8s.io/kubectl v0.23.1/go.mod h1:Ui7dJKdUludF8yWAOSN7JZEkOuYixX5yF6E6NjoukKE=
k8s.io/metrics v0.23.1/go.mod h1:qXvsM1KANrc+ZZeFwj6Phvf0NLiC+d3RwcsLcdGc+xs=
k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
-k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b h1:wxEMGetGMur3J1xuGLQY7GEQYg9bZxKn3tKo5k/eYcs=
k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
+k8s.io/utils v0.0.0-20211116205334-6203023598ed h1:ck1fRPWPJWsMd8ZRFsWc6mh/zHp5fZ/shhbrgPUxDAE=
+k8s.io/utils v0.0.0-20211116205334-6203023598ed/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
oras.land/oras-go v1.1.0 h1:tfWM1RT7PzUwWphqHU6ptPU3ZhwVnSw/9nEGf519rYg=
oras.land/oras-go v1.1.0/go.mod h1:1A7vR/0KknT2UkJVWh+xMi95I/AhK8ZrxrnUSmXN0bQ=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
|
bytebase
|
https://github.com/bytebase/bytebase
|
ff2c5230aa7119e074db2bcc8475a7e23fadc039
|
boojack
|
2023-07-10 14:23:55
|
fix: encode export statement before btoa (#7005)
|
* fix: encode export statement when btoa
* chore: update
* chore: update test
|
fix: encode export statement before btoa (#7005)
* fix: encode export statement when btoa
* chore: update
* chore: update test
|
diff --git a/backend/api/v1/sql_service.go b/backend/api/v1/sql_service.go
index ec2571762b0230..59586cc897d498 100644
--- a/backend/api/v1/sql_service.go
+++ b/backend/api/v1/sql_service.go
@@ -8,6 +8,7 @@ import (
"encoding/json"
"fmt"
"io"
+ "net/url"
"reflect"
"strconv"
"strings"
@@ -1817,12 +1818,16 @@ func (s *SQLService) checkQueryRights(
isExport := exportFormat != v1pb.ExportRequest_FORMAT_UNSPECIFIED
for _, resource := range resourceList {
databaseResourceURL := fmt.Sprintf("instances/%s/databases/%s", instance.ResourceID, resource.Database)
+ statement, err := decodeBase64String(statement)
+ if err != nil {
+ return status.Errorf(codes.InvalidArgument, "failed to decode statement: %v", err)
+ }
attributes := map[string]any{
"request.time": time.Now(),
"resource.database": databaseResourceURL,
"resource.schema": resource.Schema,
"resource.table": resource.Table,
- "request.statement": base64.StdEncoding.EncodeToString([]byte(statement)),
+ "request.statement": statement,
"request.row_limit": limit,
}
@@ -2064,3 +2069,19 @@ func IsSQLReviewSupported(dbType db.Type) bool {
return false
}
}
+
+// decodeBase64String decodes a base64 string.
+func decodeBase64String(encodedString string) (string, error) {
+ decodedString, err := base64.StdEncoding.DecodeString(encodedString)
+ if err != nil {
+ return "", errors.Wrap(err, "failed to decode base64 string")
+ }
+
+ escapedString := url.QueryEscape(string(decodedString))
+ unescapedString, err := url.QueryUnescape(escapedString)
+ if err != nil {
+ return "", errors.Wrap(err, "failed to unescape string")
+ }
+
+ return unescapedString, nil
+}
diff --git a/backend/api/v1/sql_service_test.go b/backend/api/v1/sql_service_test.go
index 6e4081ccc04f9d..eebc06daf69f0d 100644
--- a/backend/api/v1/sql_service_test.go
+++ b/backend/api/v1/sql_service_test.go
@@ -188,3 +188,33 @@ func TestExportSQL(t *testing.T) {
a.Equal(test.want, string(got))
}
}
+
+func TestDecodeBase64String(t *testing.T) {
+ tests := []struct {
+ statement string
+ want string
+ }{
+ {
+ statement: "",
+ want: "",
+ },
+ {
+ statement: "U0VMRUNUIG5hbWUgRlJPTSBlbXBsb3llZTs=",
+ want: "SELECT name FROM employee;",
+ },
+ {
+ statement: "U0VMRUNUIG5hbWUgQVMg5aeT5ZCNIEZST00gZW1wbG95ZWU7",
+ want: "SELECT name AS 姓名 FROM employee;",
+ },
+ {
+ statement: "aGVsbG8g5ZOI5Za9IPCfkYs=",
+ want: "hello 哈喽 👋",
+ },
+ }
+
+ for _, test := range tests {
+ got, err := decodeBase64String(test.statement)
+ assert.NoError(t, err)
+ assert.Equal(t, test.want, got)
+ }
+}
diff --git a/frontend/src/components/Issue/logic/GrantRequestModeProvider.ts b/frontend/src/components/Issue/logic/GrantRequestModeProvider.ts
index 1d468dccb65808..afb21c9e27ed82 100644
--- a/frontend/src/components/Issue/logic/GrantRequestModeProvider.ts
+++ b/frontend/src/components/Issue/logic/GrantRequestModeProvider.ts
@@ -1,95 +1,16 @@
-import dayjs from "dayjs";
-import { cloneDeep } from "lodash-es";
import { defineComponent, onMounted } from "vue";
-import { GrantRequestContext, IssueCreate } from "@/types";
-import { useCurrentUserV1, useProjectV1Store } from "@/store";
-import { provideIssueLogic, useCommonLogic, useIssueLogic } from "./index";
-import { stringifyDatabaseResources } from "@/utils/issue/cel";
+import { useProjectV1Store } from "@/store";
+import { provideIssueLogic, useCommonLogic } from "./index";
export default defineComponent({
name: "GrantRequestModeProvider",
setup() {
- const { issue, createIssue } = useIssueLogic();
-
onMounted(() => {
useProjectV1Store().fetchProjectList();
});
- const doCreate = async () => {
- const currentUser = useCurrentUserV1();
- const issueCreate = cloneDeep(issue.value as IssueCreate);
-
- const context: GrantRequestContext = {
- ...{
- databaseResources: [],
- expireDays: 7,
- maxRowCount: 1000,
- statement: "",
- exportFormat: "CSV",
- },
- ...(issueCreate.createContext as GrantRequestContext),
- };
- const expression: string[] = [];
- if (context.role === "QUERIER") {
- if (
- Array.isArray(context.databaseResources) &&
- context.databaseResources.length > 0
- ) {
- const cel = stringifyDatabaseResources(context.databaseResources);
- expression.push(cel);
- }
- if (context.expireDays > 0) {
- expression.push(
- `request.time < timestamp("${dayjs()
- .add(context.expireDays, "days")
- .toISOString()}")`
- );
- }
- } else if (context.role === "EXPORTER") {
- if (
- !Array.isArray(context.databaseResources) ||
- context.databaseResources.length === 0
- ) {
- throw "Exporter must have at least one database";
- }
- if (
- Array.isArray(context.databaseResources) &&
- context.databaseResources.length > 0
- ) {
- const cel = stringifyDatabaseResources(context.databaseResources);
- expression.push(cel);
- }
- if (context.expireDays > 0) {
- expression.push(
- `request.time < timestamp("${dayjs()
- .add(context.expireDays, "days")
- .toISOString()}")`
- );
- }
- expression.push(`request.statement == "${btoa(context.statement)}"`);
- expression.push(`request.row_limit == ${context.maxRowCount}`);
- expression.push(`request.export_format == "${context.exportFormat}"`);
- } else {
- throw "Invalid role";
- }
-
- const celExpressionString = expression.join(" && ");
- issueCreate.payload = {
- grantRequest: {
- role: `roles/${context.role}`,
- user: currentUser.value.name,
- condition: {
- expression: celExpressionString,
- },
- },
- };
- issueCreate.createContext = {};
- createIssue(issueCreate);
- };
-
const logic = {
...useCommonLogic(),
- doCreate,
};
provideIssueLogic(logic);
return logic;
diff --git a/frontend/src/components/Issue/panel/RequestExportPanel/index.vue b/frontend/src/components/Issue/panel/RequestExportPanel/index.vue
index d2571167da006f..a83651eaa2ea61 100644
--- a/frontend/src/components/Issue/panel/RequestExportPanel/index.vue
+++ b/frontend/src/components/Issue/panel/RequestExportPanel/index.vue
@@ -427,7 +427,11 @@ const doCreateIssue = async () => {
expression.push(`request.export_format == "${state.exportFormat}"`);
expression.push(`request.row_limit == ${state.maxRowCount}`);
if (state.exportMethod === "SQL") {
- expression.push(`request.statement == "${btoa(state.statement)}"`);
+ expression.push(
+ `request.statement == "${btoa(
+ unescape(encodeURIComponent(state.statement))
+ )}"`
+ );
const cel = stringifyDatabaseResources([
{
databaseName: selectedDatabase.value!.name,
diff --git a/frontend/src/utils/issue/cel.ts b/frontend/src/utils/issue/cel.ts
index 5033519a9e81d5..7f26673296dc96 100644
--- a/frontend/src/utils/issue/cel.ts
+++ b/frontend/src/utils/issue/cel.ts
@@ -107,7 +107,9 @@ export const stringifyConditionExpression = (
}
if (conditionExpression.statement !== undefined) {
expression.push(
- `request.statement == "${btoa(conditionExpression.statement)}"`
+ `request.statement == "${btoa(
+ unescape(encodeURIComponent(conditionExpression.statement))
+ )}"`
);
}
if (conditionExpression.rowLimit !== undefined) {
@@ -245,7 +247,7 @@ export const convertFromCELString = async (
databaseResource.schema = right;
}
} else if (left === "request.statement") {
- const statement = atob(right);
+ const statement = decodeURIComponent(escape(window.atob(right)));
conditionExpression.statement = statement;
} else if (left === "request.export_format") {
conditionExpression.exportFormat = right;
@@ -329,7 +331,7 @@ export const convertFromExpr = (expr: Expr): ConditionExpression => {
databaseResource.schema = right;
}
} else if (left === "request.statement") {
- const statement = atob(right);
+ const statement = decodeURIComponent(escape(window.atob(right)));
conditionExpression.statement = statement;
} else if (left === "request.export_format") {
conditionExpression.exportFormat = right;
|
node
|
https://github.com/nodejs/node
|
b16a50d32d750cf8b9f4bed7d90b38d87d76c34a
|
Rich Trott
|
2016-01-02 05:39:51
|
test: clarify role of domains in test
|
Add a comment to clarify how the tests work and their purpose.
Also removes unnecessary assignment of domain module to a variable.
|
test: clarify role of domains in test
Add a comment to clarify how the tests work and their purpose.
Also removes unnecessary assignment of domain module to a variable.
PR-URL: https://github.com/nodejs/node/pull/4474
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Julien Gilli <[email protected]>
|
diff --git a/test/parallel/test-microtask-queue-integration-domain.js b/test/parallel/test-microtask-queue-integration-domain.js
index 89697ef7f711bb..f0d0196ac2f9a7 100644
--- a/test/parallel/test-microtask-queue-integration-domain.js
+++ b/test/parallel/test-microtask-queue-integration-domain.js
@@ -1,7 +1,13 @@
'use strict';
require('../common');
var assert = require('assert');
-var domain = require('domain');
+
+// Requiring the domain module here changes the function that is used by node to
+// call process.nextTick's callbacks to a variant that specifically handles
+// domains. We want to test this specific variant in this test, and so even if
+// the domain module is not used, this require call is needed and must not be
+// removed.
+require('domain');
var implementations = [
function(fn) {
diff --git a/test/parallel/test-microtask-queue-run-domain.js b/test/parallel/test-microtask-queue-run-domain.js
index 3e35cea15ed9dc..fb5139f71d65aa 100644
--- a/test/parallel/test-microtask-queue-run-domain.js
+++ b/test/parallel/test-microtask-queue-run-domain.js
@@ -1,7 +1,13 @@
'use strict';
require('../common');
var assert = require('assert');
-var domain = require('domain');
+
+// Requiring the domain module here changes the function that is used by node to
+// call process.nextTick's callbacks to a variant that specifically handles
+// domains. We want to test this specific variant in this test, and so even if
+// the domain module is not used, this require call is needed and must not be
+// removed.
+require('domain');
function enqueueMicrotask(fn) {
Promise.resolve().then(fn);
diff --git a/test/parallel/test-microtask-queue-run-immediate-domain.js b/test/parallel/test-microtask-queue-run-immediate-domain.js
index 5ce3ec59b6731b..4a7729ab98a062 100644
--- a/test/parallel/test-microtask-queue-run-immediate-domain.js
+++ b/test/parallel/test-microtask-queue-run-immediate-domain.js
@@ -1,7 +1,13 @@
'use strict';
require('../common');
var assert = require('assert');
-var domain = require('domain');
+
+// Requiring the domain module here changes the function that is used by node to
+// call process.nextTick's callbacks to a variant that specifically handles
+// domains. We want to test this specific variant in this test, and so even if
+// the domain module is not used, this require call is needed and must not be
+// removed.
+require('domain');
function enqueueMicrotask(fn) {
Promise.resolve().then(fn);
|
oh-my-posh
|
https://github.com/JanDeDobbeleer/oh-my-posh
|
908c9eafaccae015b6dc380bd968daa77958b430
|
dependabot[bot]
|
2024-07-15 06:31:01
|
chore: bump github/codeql-action from 3.25.11 to 3.25.12
|
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.25.11 to 3.25.12.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/b611370bb5703a7efb587f9d136a52ea24c5c38c...4fa2a7953630fd2f3fb380f21be14ede0169dd4f)
---
|
chore: bump github/codeql-action from 3.25.11 to 3.25.12
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.25.11 to 3.25.12.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/b611370bb5703a7efb587f9d136a52ea24c5c38c...4fa2a7953630fd2f3fb380f21be14ede0169dd4f)
---
updated-dependencies:
- dependency-name: github/codeql-action
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <[email protected]>
|
diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml
index 424b4a9eb1df..69642290374d 100644
--- a/.github/workflows/codeql.yml
+++ b/.github/workflows/codeql.yml
@@ -27,10 +27,10 @@ jobs:
- name: Checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- name: Initialize CodeQL
- uses: github/codeql-action/init@b611370bb5703a7efb587f9d136a52ea24c5c38c
+ uses: github/codeql-action/init@4fa2a7953630fd2f3fb380f21be14ede0169dd4f
with:
languages: go
- name: Autobuild
- uses: github/codeql-action/autobuild@b611370bb5703a7efb587f9d136a52ea24c5c38c
+ uses: github/codeql-action/autobuild@4fa2a7953630fd2f3fb380f21be14ede0169dd4f
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@b611370bb5703a7efb587f9d136a52ea24c5c38c
+ uses: github/codeql-action/analyze@4fa2a7953630fd2f3fb380f21be14ede0169dd4f
|
swc
|
https://github.com/swc-project/swc
|
99a63397b65dfe02bc2c864069edbffb84efa510
|
Niklas Mischkulnig
|
2025-01-31 20:08:16
|
fix(swc_core): Fix typo in swc_core feature (#9979)
|
- Fix typo in the `ecma_ast_serde` feature
- Add a `ecma_visit_serde` feature
|
fix(swc_core): Fix typo in swc_core feature (#9979)
- Fix typo in the `ecma_ast_serde` feature
- Add a `ecma_visit_serde` feature
|
diff --git a/.changeset/shy-apes-listen.md b/.changeset/shy-apes-listen.md
new file mode 100644
index 000000000000..95dfa1047b20
--- /dev/null
+++ b/.changeset/shy-apes-listen.md
@@ -0,0 +1,5 @@
+---
+swc_core: patch
+---
+
+fix: Fix typo in swc_core feature
diff --git a/crates/swc_core/Cargo.toml b/crates/swc_core/Cargo.toml
index a9064cb4cad4..6afb7e492f6a 100644
--- a/crates/swc_core/Cargo.toml
+++ b/crates/swc_core/Cargo.toml
@@ -88,8 +88,9 @@ common_concurrent = ["__common", "swc_common/concurrent"]
common_tty = ["__common", "swc_common/tty-emitter"]
# Enable swc_ecma_visit
-ecma_visit = ["__visit"]
-ecma_visit_path = ["__visit", "swc_ecma_visit/path"]
+ecma_visit = ["__visit"]
+ecma_visit_path = ["__visit", "swc_ecma_visit/path"]
+ecma_visit_serde = ["__visit", "swc_ecma_visit/serde-impl"]
# Enable `quote!` macro support.
ecma_quote = [
@@ -135,7 +136,7 @@ testing_transform = ["__ecma", "__testing_transform"]
# Enable swc_ecma_ast / swc_atoms support.
# TODO: currently both are enabled at once, we may want to separate them.
ecma_ast = ["__ecma", "swc_ecma_ast", "swc_atoms"]
-ecma_ast_serde = ["ecma_ast", "swc_ecma_ast/serde-impl", "swc_ecma_visit/serde"]
+ecma_ast_serde = ["ecma_ast", "swc_ecma_ast/serde-impl"]
# Enable swc_ecma_parser support.
ecma_parser = ["__parser"]
|
databend
|
https://github.com/databendlabs/databend
|
9455172484b16a6afcfb19de567412d39067bcee
|
ClSlaid
|
2023-02-21 08:18:08
|
ci: remove create catalog test
|
This PR addes new syntax along with its implementations, resulting
imcompatibility against old versions. The test should be resumed by
following PRs under this topic
|
ci: remove create catalog test
This PR addes new syntax along with its implementations, resulting
imcompatibility against old versions. The test should be resumed by
following PRs under this topic
Signed-off-by: ClSlaid <[email protected]>
|
diff --git a/tests/sqllogictests/suites/base/05_ddl/05_0029_ddl_create_catalog b/tests/sqllogictests/suites/base/05_ddl/05_0029_ddl_create_catalog
deleted file mode 100644
index b094604772a98..0000000000000
--- a/tests/sqllogictests/suites/base/05_ddl/05_0029_ddl_create_catalog
+++ /dev/null
@@ -1,19 +0,0 @@
-statement ok
-DROP CATALOG IF EXISTS ctl;
-
-query T
-SHOW CATALOGS;
-----
-default
-
-
-statement ok
-CREATE CATALOG ctl TYPE=ICEBERG CONNECTION=( URL='fs://tmp' );
-
-query T
-SHOW CATALOGS LIKE 'ctl';
-----
-ctl
-
-statement ok
-DROP CATALOG IF EXISTS ctl;
|
pure
|
https://github.com/pure-css/pure
|
44557348cd7be9deab1b847f1a518dff17e98bf6
|
dependabot[bot]
|
2023-02-13 23:21:41
|
chore(deps-dev): bump eslint from 8.33.0 to 8.34.0 (#1124)
|
Bumps [eslint](https://github.com/eslint/eslint) from 8.33.0 to 8.34.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.33.0...v8.34.0)
---
|
chore(deps-dev): bump eslint from 8.33.0 to 8.34.0 (#1124)
Bumps [eslint](https://github.com/eslint/eslint) from 8.33.0 to 8.34.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.33.0...v8.34.0)
---
updated-dependencies:
- dependency-name: eslint
dependency-type: direct:development
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
|
diff --git a/package-lock.json b/package-lock.json
index f5321deb4..262db7cae 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1522,9 +1522,9 @@
}
},
"node_modules/eslint": {
- "version": "8.33.0",
- "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.33.0.tgz",
- "integrity": "sha512-WjOpFQgKK8VrCnAtl8We0SUOy/oVZ5NHykyMiagV1M9r8IFpIJX7DduK6n1mpfhlG7T1NLWm2SuD8QB7KFySaA==",
+ "version": "8.34.0",
+ "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.34.0.tgz",
+ "integrity": "sha512-1Z8iFsucw+7kSqXNZVslXS8Ioa4u2KM7GPwuKtkTFAqZ/cHMcEaR+1+Br0wLlot49cNxIiZk5wp8EAbPcYZxTg==",
"dev": true,
"dependencies": {
"@eslint/eslintrc": "^1.4.1",
@@ -8943,9 +8943,9 @@
"dev": true
},
"eslint": {
- "version": "8.33.0",
- "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.33.0.tgz",
- "integrity": "sha512-WjOpFQgKK8VrCnAtl8We0SUOy/oVZ5NHykyMiagV1M9r8IFpIJX7DduK6n1mpfhlG7T1NLWm2SuD8QB7KFySaA==",
+ "version": "8.34.0",
+ "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.34.0.tgz",
+ "integrity": "sha512-1Z8iFsucw+7kSqXNZVslXS8Ioa4u2KM7GPwuKtkTFAqZ/cHMcEaR+1+Br0wLlot49cNxIiZk5wp8EAbPcYZxTg==",
"dev": true,
"requires": {
"@eslint/eslintrc": "^1.4.1",
|
leetcode
|
https://github.com/doocs/leetcode
|
9cee755cc1a454363459bad359f31cdbaeac1071
|
MaoLongLong
|
2021-10-19 06:45:38
|
feat: add go,cpp solutions to lc problem: No.0211
|
No.0211.Design Add and Search Words Data Structure
|
feat: add go,cpp solutions to lc problem: No.0211
No.0211.Design Add and Search Words Data Structure
|
diff --git a/solution/0200-0299/0211.Design Add and Search Words Data Structure/README.md b/solution/0200-0299/0211.Design Add and Search Words Data Structure/README.md
index 2af037472f2ea..30b40ba1d0a85 100644
--- a/solution/0200-0299/0211.Design Add and Search Words Data Structure/README.md
+++ b/solution/0200-0299/0211.Design Add and Search Words Data Structure/README.md
@@ -177,6 +177,144 @@ class WordDictionary {
*/
```
+### **Go**
+
+```go
+type WordDictionary struct {
+ root *trie
+}
+
+func Constructor() WordDictionary {
+ return WordDictionary{new(trie)}
+}
+
+func (this *WordDictionary) AddWord(word string) {
+ this.root.insert(word)
+}
+
+func (this *WordDictionary) Search(word string) bool {
+ n := len(word)
+
+ var dfs func(int, *trie) bool
+ dfs = func(i int, cur *trie) bool {
+ if i == n {
+ return cur.isEnd
+ }
+ c := word[i]
+ if c != '.' {
+ child := cur.children[c-'a']
+ if child != nil && dfs(i+1, child) {
+ return true
+ }
+ } else {
+ for _, child := range cur.children {
+ if child != nil && dfs(i+1, child) {
+ return true
+ }
+ }
+ }
+ return false
+ }
+
+ return dfs(0, this.root)
+}
+
+type trie struct {
+ children [26]*trie
+ isEnd bool
+}
+
+func (t *trie) insert(word string) {
+ cur := t
+ for _, c := range word {
+ c -= 'a'
+ if cur.children[c] == nil {
+ cur.children[c] = new(trie)
+ }
+ cur = cur.children[c]
+ }
+ cur.isEnd = true
+}
+
+/**
+ * Your WordDictionary object will be instantiated and called as such:
+ * obj := Constructor();
+ * obj.AddWord(word);
+ * param_2 := obj.Search(word);
+ */
+```
+
+### **C++**
+
+```cpp
+class trie {
+public:
+ vector<trie*> children;
+ bool is_end;
+
+ trie() {
+ children = vector<trie*>(26, nullptr);
+ is_end = false;
+ }
+
+ void insert(const string& word) {
+ trie* cur = this;
+ for (char c : word) {
+ c -= 'a';
+ if (cur->children[c] == nullptr) {
+ cur->children[c] = new trie;
+ }
+ cur = cur->children[c];
+ }
+ cur->is_end = true;
+ }
+};
+
+class WordDictionary {
+private:
+ trie* root;
+
+public:
+ WordDictionary() : root(new trie) {}
+
+ void addWord(string word) {
+ root->insert(word);
+ }
+
+ bool search(string word) {
+ return dfs(word, 0, root);
+ }
+
+private:
+ bool dfs(const string& word, int i, trie* cur) {
+ if (i == word.size()) {
+ return cur->is_end;
+ }
+ char c = word[i];
+ if (c != '.') {
+ trie* child = cur->children[c - 'a'];
+ if (child != nullptr && dfs(word, i + 1, child)) {
+ return true;
+ }
+ } else {
+ for (trie* child : cur->children) {
+ if (child != nullptr && dfs(word, i + 1, child)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+};
+
+/**
+ * Your WordDictionary object will be instantiated and called as such:
+ * WordDictionary* obj = new WordDictionary();
+ * obj->addWord(word);
+ * bool param_2 = obj->search(word);
+ */
+```
+
### **...**
```
diff --git a/solution/0200-0299/0211.Design Add and Search Words Data Structure/README_EN.md b/solution/0200-0299/0211.Design Add and Search Words Data Structure/README_EN.md
index 569e87086eece..ed2585bf07161 100644
--- a/solution/0200-0299/0211.Design Add and Search Words Data Structure/README_EN.md
+++ b/solution/0200-0299/0211.Design Add and Search Words Data Structure/README_EN.md
@@ -165,6 +165,144 @@ class WordDictionary {
*/
```
+### **Go**
+
+```go
+type WordDictionary struct {
+ root *trie
+}
+
+func Constructor() WordDictionary {
+ return WordDictionary{new(trie)}
+}
+
+func (this *WordDictionary) AddWord(word string) {
+ this.root.insert(word)
+}
+
+func (this *WordDictionary) Search(word string) bool {
+ n := len(word)
+
+ var dfs func(int, *trie) bool
+ dfs = func(i int, cur *trie) bool {
+ if i == n {
+ return cur.isEnd
+ }
+ c := word[i]
+ if c != '.' {
+ child := cur.children[c-'a']
+ if child != nil && dfs(i+1, child) {
+ return true
+ }
+ } else {
+ for _, child := range cur.children {
+ if child != nil && dfs(i+1, child) {
+ return true
+ }
+ }
+ }
+ return false
+ }
+
+ return dfs(0, this.root)
+}
+
+type trie struct {
+ children [26]*trie
+ isEnd bool
+}
+
+func (t *trie) insert(word string) {
+ cur := t
+ for _, c := range word {
+ c -= 'a'
+ if cur.children[c] == nil {
+ cur.children[c] = new(trie)
+ }
+ cur = cur.children[c]
+ }
+ cur.isEnd = true
+}
+
+/**
+ * Your WordDictionary object will be instantiated and called as such:
+ * obj := Constructor();
+ * obj.AddWord(word);
+ * param_2 := obj.Search(word);
+ */
+```
+
+### **C++**
+
+```cpp
+class trie {
+public:
+ vector<trie*> children;
+ bool is_end;
+
+ trie() {
+ children = vector<trie*>(26, nullptr);
+ is_end = false;
+ }
+
+ void insert(const string& word) {
+ trie* cur = this;
+ for (char c : word) {
+ c -= 'a';
+ if (cur->children[c] == nullptr) {
+ cur->children[c] = new trie;
+ }
+ cur = cur->children[c];
+ }
+ cur->is_end = true;
+ }
+};
+
+class WordDictionary {
+private:
+ trie* root;
+
+public:
+ WordDictionary() : root(new trie) {}
+
+ void addWord(string word) {
+ root->insert(word);
+ }
+
+ bool search(string word) {
+ return dfs(word, 0, root);
+ }
+
+private:
+ bool dfs(const string& word, int i, trie* cur) {
+ if (i == word.size()) {
+ return cur->is_end;
+ }
+ char c = word[i];
+ if (c != '.') {
+ trie* child = cur->children[c - 'a'];
+ if (child != nullptr && dfs(word, i + 1, child)) {
+ return true;
+ }
+ } else {
+ for (trie* child : cur->children) {
+ if (child != nullptr && dfs(word, i + 1, child)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+};
+
+/**
+ * Your WordDictionary object will be instantiated and called as such:
+ * WordDictionary* obj = new WordDictionary();
+ * obj->addWord(word);
+ * bool param_2 = obj->search(word);
+ */
+```
+
### **...**
```
diff --git a/solution/0200-0299/0211.Design Add and Search Words Data Structure/Solution.cpp b/solution/0200-0299/0211.Design Add and Search Words Data Structure/Solution.cpp
new file mode 100644
index 0000000000000..49e08ba25ab3e
--- /dev/null
+++ b/solution/0200-0299/0211.Design Add and Search Words Data Structure/Solution.cpp
@@ -0,0 +1,66 @@
+class trie {
+public:
+ vector<trie*> children;
+ bool is_end;
+
+ trie() {
+ children = vector<trie*>(26, nullptr);
+ is_end = false;
+ }
+
+ void insert(const string& word) {
+ trie* cur = this;
+ for (char c : word) {
+ c -= 'a';
+ if (cur->children[c] == nullptr) {
+ cur->children[c] = new trie;
+ }
+ cur = cur->children[c];
+ }
+ cur->is_end = true;
+ }
+};
+
+class WordDictionary {
+private:
+ trie* root;
+
+public:
+ WordDictionary() : root(new trie) {}
+
+ void addWord(string word) {
+ root->insert(word);
+ }
+
+ bool search(string word) {
+ return dfs(word, 0, root);
+ }
+
+private:
+ bool dfs(const string& word, int i, trie* cur) {
+ if (i == word.size()) {
+ return cur->is_end;
+ }
+ char c = word[i];
+ if (c != '.') {
+ trie* child = cur->children[c - 'a'];
+ if (child != nullptr && dfs(word, i + 1, child)) {
+ return true;
+ }
+ } else {
+ for (trie* child : cur->children) {
+ if (child != nullptr && dfs(word, i + 1, child)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+};
+
+/**
+ * Your WordDictionary object will be instantiated and called as such:
+ * WordDictionary* obj = new WordDictionary();
+ * obj->addWord(word);
+ * bool param_2 = obj->search(word);
+ */
diff --git a/solution/0200-0299/0211.Design Add and Search Words Data Structure/Solution.go b/solution/0200-0299/0211.Design Add and Search Words Data Structure/Solution.go
new file mode 100644
index 0000000000000..37614b3017373
--- /dev/null
+++ b/solution/0200-0299/0211.Design Add and Search Words Data Structure/Solution.go
@@ -0,0 +1,62 @@
+type WordDictionary struct {
+ root *trie
+}
+
+func Constructor() WordDictionary {
+ return WordDictionary{new(trie)}
+}
+
+func (this *WordDictionary) AddWord(word string) {
+ this.root.insert(word)
+}
+
+func (this *WordDictionary) Search(word string) bool {
+ n := len(word)
+
+ var dfs func(int, *trie) bool
+ dfs = func(i int, cur *trie) bool {
+ if i == n {
+ return cur.isEnd
+ }
+ c := word[i]
+ if c != '.' {
+ child := cur.children[c-'a']
+ if child != nil && dfs(i+1, child) {
+ return true
+ }
+ } else {
+ for _, child := range cur.children {
+ if child != nil && dfs(i+1, child) {
+ return true
+ }
+ }
+ }
+ return false
+ }
+
+ return dfs(0, this.root)
+}
+
+type trie struct {
+ children [26]*trie
+ isEnd bool
+}
+
+func (t *trie) insert(word string) {
+ cur := t
+ for _, c := range word {
+ c -= 'a'
+ if cur.children[c] == nil {
+ cur.children[c] = new(trie)
+ }
+ cur = cur.children[c]
+ }
+ cur.isEnd = true
+}
+
+/**
+ * Your WordDictionary object will be instantiated and called as such:
+ * obj := Constructor();
+ * obj.AddWord(word);
+ * param_2 := obj.Search(word);
+ */
|
servo
|
https://github.com/servo/servo
|
5079552f93a126f6a940b39751787a60b894215d
|
dependabot[bot]
|
2024-10-08 23:35:10
|
build(deps): bump cc from 1.1.24 to 1.1.28 (#33700)
|
Bumps [cc](https://github.com/rust-lang/cc-rs) from 1.1.24 to 1.1.28.
- [Release notes](https://github.com/rust-lang/cc-rs/releases)
- [Changelog](https://github.com/rust-lang/cc-rs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/cc-rs/compare/cc-v1.1.24...cc-v1.1.28)
---
|
build(deps): bump cc from 1.1.24 to 1.1.28 (#33700)
Bumps [cc](https://github.com/rust-lang/cc-rs) from 1.1.24 to 1.1.28.
- [Release notes](https://github.com/rust-lang/cc-rs/releases)
- [Changelog](https://github.com/rust-lang/cc-rs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/cc-rs/compare/cc-v1.1.24...cc-v1.1.28)
---
updated-dependencies:
- dependency-name: cc
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
|
diff --git a/Cargo.lock b/Cargo.lock
index beadc03195b09..c1acf58ee27a5 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -728,9 +728,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5"
[[package]]
name = "cc"
-version = "1.1.24"
+version = "1.1.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "812acba72f0a070b003d3697490d2b55b837230ae7c6c6497f05cc2ddbb8d938"
+checksum = "2e80e3b6a3ab07840e1cae9b0666a63970dc28e8ed5ffbcdacbfc760c281bfc1"
dependencies = [
"jobserver",
"libc",
|
components
|
https://github.com/angular/components
|
8934feb8c3e2d2f425929f30771701485648b736
|
Kristiyan Kostadinov
|
2020-06-29 21:15:22
|
fix(datepicker): not marking as dirty when invalid value is typed in (#19730)
|
Currently we only mark the datepicker's `ControlValueAccessor` as dirty if the value changed as a result of the user typing something in. The problem is that typing in an invalid value is parsed to `null` which is the same as the default value, causing it not to be marked as dirty. One small complication here that I've added a test for is that we shouldn't be dispatching change events when typing in invalid values.
|
fix(datepicker): not marking as dirty when invalid value is typed in (#19730)
Currently we only mark the datepicker's `ControlValueAccessor` as dirty if the value changed as a result of the user typing something in. The problem is that typing in an invalid value is parsed to `null` which is the same as the default value, causing it not to be marked as dirty. One small complication here that I've added a test for is that we shouldn't be dispatching change events when typing in invalid values.
Fixes #19726.
|
diff --git a/src/material/datepicker/datepicker-input-base.ts b/src/material/datepicker/datepicker-input-base.ts
index 3c0728540051..e3303b101f26 100644
--- a/src/material/datepicker/datepicker-input-base.ts
+++ b/src/material/datepicker/datepicker-input-base.ts
@@ -307,8 +307,16 @@ export abstract class MatDatepickerInputBase<S, D = ExtractDateTypeFromSelection
this._cvaOnChange(date);
this._valueChange.emit(date);
this.dateInput.emit(new MatDatepickerInputEvent(this, this._elementRef.nativeElement));
- } else if (lastValueWasValid !== this._lastValueValid) {
- this._validatorOnChange();
+ } else {
+ // Call the CVA change handler for invalid values
+ // since this is what marks the control as dirty.
+ if (value && !this.value) {
+ this._cvaOnChange(date);
+ }
+
+ if (lastValueWasValid !== this._lastValueValid) {
+ this._validatorOnChange();
+ }
}
}
diff --git a/src/material/datepicker/datepicker.spec.ts b/src/material/datepicker/datepicker.spec.ts
index eb096b76148f..4288a7b42fc2 100644
--- a/src/material/datepicker/datepicker.spec.ts
+++ b/src/material/datepicker/datepicker.spec.ts
@@ -763,6 +763,18 @@ describe('MatDatepicker', () => {
expect(inputEl.classList).toContain('ng-dirty');
}));
+ it('should mark input dirty after invalid value is typed in', () => {
+ let inputEl = fixture.debugElement.query(By.css('input'))!.nativeElement;
+
+ expect(inputEl.classList).toContain('ng-pristine');
+
+ inputEl.value = 'hello there';
+ dispatchFakeEvent(inputEl, 'input');
+ fixture.detectChanges();
+
+ expect(inputEl.classList).toContain('ng-dirty');
+ });
+
it('should not mark dirty after model change', fakeAsync(() => {
let inputEl = fixture.debugElement.query(By.css('input'))!.nativeElement;
@@ -1504,6 +1516,20 @@ describe('MatDatepicker', () => {
expect(valueDuringChangeEvent).toBe('1/1/2020');
});
+ it('should not fire dateInput when typing an invalid value', () => {
+ expect(testComponent.onDateInput).not.toHaveBeenCalled();
+
+ inputEl.value = 'a';
+ dispatchFakeEvent(inputEl, 'input');
+ fixture.detectChanges();
+ expect(testComponent.onDateInput).not.toHaveBeenCalled();
+
+ inputEl.value = 'b';
+ dispatchFakeEvent(inputEl, 'input');
+ fixture.detectChanges();
+ expect(testComponent.onDateInput).not.toHaveBeenCalled();
+ });
+
});
describe('with ISO 8601 strings as input', () => {
|
farm
|
https://github.com/farm-fe/farm
|
729bcf53759219b1c8f4a44d1108aae552f74914
|
Ming07
|
2024-05-13 16:48:05
|
refactor: optimize record manager (#1303)
|
- Modified the compilation hook to perform timing measurements only when the 'record' flag is set to true, reducing unnecessary compilation overhead.
|
refactor: optimize record manager (#1303)
- Modified the compilation hook to perform timing measurements only when the 'record' flag is set to true, reducing unnecessary compilation overhead.
Co-authored-by: brightwu <[email protected]>
|
diff --git a/crates/core/src/plugin/plugin_driver.rs b/crates/core/src/plugin/plugin_driver.rs
index 8906cf5c05..e79b5f8d12 100644
--- a/crates/core/src/plugin/plugin_driver.rs
+++ b/crates/core/src/plugin/plugin_driver.rs
@@ -59,6 +59,7 @@ macro_rules! hook_first {
) => {
pub fn $func_name(&self, $($arg: $ty),*) -> $ret_ty {
for plugin in &self.plugins {
+ if self.record {
let start_time = SystemTime::now()
.duration_since(UNIX_EPOCH)
.expect("Time went backwards")
@@ -69,12 +70,16 @@ macro_rules! hook_first {
.expect("hook_first get end_time failed")
.as_micros() as i64;
if ret.is_some() {
- if self.record {
let plugin_name = plugin.name().to_string();
$callback(&ret, plugin_name, start_time, end_time, $($arg),*);
- }
+ return Ok(ret);
+ }
+ }else {
+ let ret = plugin.$func_name($($arg),*)?;
+ if ret.is_some() {
return Ok(ret);
}
+ }
}
Ok(None)
@@ -96,18 +101,22 @@ macro_rules! hook_serial {
($func_name:ident, $param_ty:ty, $callback:expr) => {
pub fn $func_name(&self, param: $param_ty, context: &Arc<CompilationContext>) -> Result<()> {
for plugin in &self.plugins {
- let start_time = SystemTime::now()
- .duration_since(UNIX_EPOCH)
- .expect("Time went backwards")
- .as_micros() as i64;
- let ret = plugin.$func_name(param, context)?;
- let end_time = SystemTime::now()
- .duration_since(UNIX_EPOCH)
- .expect("hook_first get end_time failed")
- .as_micros() as i64;
- if ret.is_some() && self.record {
- let plugin_name = plugin.name().to_string();
- $callback(plugin_name, start_time, end_time, param, context);
+ if self.record {
+ let start_time = SystemTime::now()
+ .duration_since(UNIX_EPOCH)
+ .expect("Time went backwards")
+ .as_micros() as i64;
+ let ret = plugin.$func_name(param, context)?;
+ let end_time = SystemTime::now()
+ .duration_since(UNIX_EPOCH)
+ .expect("hook_first get end_time failed")
+ .as_micros() as i64;
+ if ret.is_some() {
+ let plugin_name = plugin.name().to_string();
+ $callback(plugin_name, start_time, end_time, param, context);
+ }
+ } else {
+ plugin.$func_name(param, context)?;
}
}
@@ -285,16 +294,28 @@ impl PluginDriver {
};
for plugin in &self.plugins {
- let start_time = SystemTime::now()
- .duration_since(UNIX_EPOCH)
- .expect("Time went backwards")
- .as_micros() as i64;
+ let start_time = if self.record {
+ Some(
+ SystemTime::now()
+ .duration_since(UNIX_EPOCH)
+ .expect("Time went backwards")
+ .as_micros() as i64,
+ )
+ } else {
+ None
+ };
// if the transform hook returns None, treat it as empty hook and ignore it
if let Some(plugin_result) = plugin.transform(¶m, context)? {
- let end_time = SystemTime::now()
- .duration_since(UNIX_EPOCH)
- .expect("hook_first get end_time failed")
- .as_micros() as i64;
+ let end_time = if self.record {
+ Some(
+ SystemTime::now()
+ .duration_since(UNIX_EPOCH)
+ .expect("hook_first get end_time failed")
+ .as_micros() as i64,
+ )
+ } else {
+ None
+ };
param.content = plugin_result.content;
param.module_type = plugin_result.module_type.unwrap_or(param.module_type);
@@ -314,9 +335,9 @@ impl PluginDriver {
source_maps: plugin_result.source_map.clone(),
module_type: param.module_type.clone(),
trigger: Trigger::Compiler,
- start_time,
- end_time,
- duration: end_time - start_time,
+ start_time: start_time.unwrap(),
+ end_time: end_time.unwrap(),
+ duration: end_time.unwrap() - start_time.unwrap(),
},
);
}
|
RSSHub
|
https://github.com/DIYgod/RSSHub
|
83da7c5085fbd59c56bc6f66060a2fbee758de25
|
dependabot[bot]
|
2024-08-30 23:35:48
|
chore(deps-dev): bump msw from 2.3.5 to 2.4.1 (#16589)
|
* chore(deps-dev): bump msw from 2.3.5 to 2.4.1
Bumps [msw](https://github.com/mswjs/msw) from 2.3.5 to 2.4.1.
- [Release notes](https://github.com/mswjs/msw/releases)
- [Changelog](https://github.com/mswjs/msw/blob/main/CHANGELOG.md)
- [Commits](https://github.com/mswjs/msw/compare/v2.3.5...v2.4.1)
---
|
chore(deps-dev): bump msw from 2.3.5 to 2.4.1 (#16589)
* chore(deps-dev): bump msw from 2.3.5 to 2.4.1
Bumps [msw](https://github.com/mswjs/msw) from 2.3.5 to 2.4.1.
- [Release notes](https://github.com/mswjs/msw/releases)
- [Changelog](https://github.com/mswjs/msw/blob/main/CHANGELOG.md)
- [Commits](https://github.com/mswjs/msw/compare/v2.3.5...v2.4.1)
---
updated-dependencies:
- dependency-name: msw
dependency-type: direct:development
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <[email protected]>
* chore: fix pnpm install
---------
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tony <[email protected]>
|
diff --git a/package.json b/package.json
index 6dc3ceadb4fb85..8b1b2b856df25a 100644
--- a/package.json
+++ b/package.json
@@ -183,7 +183,7 @@
"js-beautify": "1.15.1",
"lint-staged": "15.2.9",
"mockdate": "3.0.5",
- "msw": "2.3.5",
+ "msw": "2.4.1",
"prettier": "3.3.3",
"remark-parse": "11.0.0",
"supertest": "7.0.0",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 364a99d7a1c702..655d309be59e0e 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -403,8 +403,8 @@ importers:
specifier: 3.0.5
version: 3.0.5
msw:
- specifier: 2.3.5
- version: 2.3.5([email protected])
+ specifier: 2.4.1
+ version: 2.4.1([email protected])
prettier:
specifier: 3.3.3
version: 3.3.3
@@ -3406,10 +3406,6 @@ packages:
[email protected]:
resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==}
- [email protected]:
- resolution: {integrity: sha512-GGTKBX4SD7Wdb8mqeDLni2oaRGYQWjWHGKPQ24ZMnUtKfcsVoiv4uX8+LJr1K6U5VW2Lu1BwJnj7uiori0YtRw==}
- engines: {node: ^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0}
-
[email protected]:
resolution: {integrity: sha512-pCcEwRi+TKpMlxAQObHDQ56KawURgyAf6jtIY046fJ5tIv3zDe/LEIubckAO8fj6JnAxLdmWkUfNyulQ2iKdEw==}
engines: {node: '>=14.0.0'}
@@ -4277,13 +4273,16 @@ packages:
[email protected]:
resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==}
- [email protected]:
- resolution: {integrity: sha512-+GUI4gX5YC5Bv33epBrD+BGdmDvBg2XGruiWnI3GbIbRmMMBeZ5gs3mJ51OWSGHgJKztZ8AtZeYMMNMVrje2/Q==}
+ [email protected]:
+ resolution: {integrity: sha512-HXcoQPzYTwEmVk+BGIcRa0vLabBT+J20SSSeYh/QfajaK5ceA6dlD4ZZjfz2dqGEq4vRNCPLP6eXsB94KllPFg==}
engines: {node: '>=18'}
hasBin: true
peerDependencies:
+ graphql: '>= 16.8.x'
typescript: '>= 4.7.x'
peerDependenciesMeta:
+ graphql:
+ optional: true
typescript:
optional: true
@@ -9239,8 +9238,6 @@ snapshots:
[email protected]: {}
- [email protected]: {}
-
[email protected]:
dependencies:
gaxios: 6.7.1
@@ -10210,7 +10207,7 @@ snapshots:
[email protected]: {}
- [email protected]([email protected]):
+ [email protected]([email protected]):
dependencies:
'@bundled-es-modules/cookie': 2.0.0
'@bundled-es-modules/statuses': 1.0.1
@@ -10221,7 +10218,6 @@ snapshots:
'@types/cookie': 0.6.0
'@types/statuses': 2.0.5
chalk: 4.1.2
- graphql: 16.9.0
headers-polyfill: 4.0.3
is-node-process: 1.2.0
outvariant: 1.4.3
|
metamask-extension
|
https://github.com/MetaMask/metamask-extension
|
5974f8bbc72119d63f89f4ef326d63285ed0c438
|
Bowen Sanders
|
2024-03-21 03:21:02
|
fix: fix typo in snap install rejected metric (#23618)
|
## **Description**
Fixes a typo in the name for the `SnapInstallRejected` MetaMetrics
event.
[](https://codespaces.new/MetaMask/metamask-extension/pull/23618?quickstart=1)
|
fix: fix typo in snap install rejected metric (#23618)
## **Description**
Fixes a typo in the name for the `SnapInstallRejected` MetaMetrics
event.
[](https://codespaces.new/MetaMask/metamask-extension/pull/23618?quickstart=1)
|
diff --git a/shared/constants/metametrics.ts b/shared/constants/metametrics.ts
index 403468926551..d2eb32c55e1c 100644
--- a/shared/constants/metametrics.ts
+++ b/shared/constants/metametrics.ts
@@ -663,7 +663,7 @@ export enum MetaMetricsEventName {
///: BEGIN:ONLY_INCLUDE_IF(snaps)
SnapInstallStarted = 'Snap Install Started',
SnapInstallFailed = 'Snap Install Failed',
- SnapInstallRejected = 'Snap Update Rejected',
+ SnapInstallRejected = 'Snap Install Rejected',
SnapInstalled = 'Snap Installed',
SnapUninstalled = 'Snap Uninstalled',
SnapUpdateStarted = 'Snap Update Started',
|
marked
|
https://github.com/markedjs/marked
|
a6d4b79e7d3f800a6833661fd8211ab55c028110
|
dependabot[bot]
|
2022-08-08 21:03:45
|
chore(deps-dev): Bump @babel/preset-env from 7.18.9 to 7.18.10 (#2550)
|
Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.18.9 to 7.18.10.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.18.10/packages/babel-preset-env)
---
|
chore(deps-dev): Bump @babel/preset-env from 7.18.9 to 7.18.10 (#2550)
Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.18.9 to 7.18.10.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.18.10/packages/babel-preset-env)
---
updated-dependencies:
- dependency-name: "@babel/preset-env"
dependency-type: direct:development
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
|
diff --git a/package-lock.json b/package-lock.json
index 276c286a93..098f5786e5 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -13,7 +13,7 @@
},
"devDependencies": {
"@babel/core": "^7.18.9",
- "@babel/preset-env": "^7.18.9",
+ "@babel/preset-env": "^7.18.10",
"@markedjs/html-differ": "^4.0.2",
"@rollup/plugin-babel": "^5.3.1",
"@rollup/plugin-commonjs": "^22.0.1",
@@ -109,12 +109,12 @@
}
},
"node_modules/@babel/generator": {
- "version": "7.18.9",
- "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.18.9.tgz",
- "integrity": "sha512-wt5Naw6lJrL1/SGkipMiFxJjtyczUWTP38deiP1PO60HsBjDeKk08CGC3S8iVuvf0FmTdgKwU1KIXzSKL1G0Ug==",
+ "version": "7.18.12",
+ "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.18.12.tgz",
+ "integrity": "sha512-dfQ8ebCN98SvyL7IxNMCUtZQSq5R7kxgN+r8qYTGDmmSion1hX2C0zq2yo1bsCDhXixokv1SAWTZUMYbO/V5zg==",
"dev": true,
"dependencies": {
- "@babel/types": "^7.18.9",
+ "@babel/types": "^7.18.10",
"@jridgewell/gen-mapping": "^0.3.2",
"jsesc": "^2.5.1"
},
@@ -203,15 +203,13 @@
}
},
"node_modules/@babel/helper-define-polyfill-provider": {
- "version": "0.3.1",
- "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.3.1.tgz",
- "integrity": "sha512-J9hGMpJQmtWmj46B3kBHmL38UhJGhYX7eqkcq+2gsstyYt341HmPeWspihX43yVRA0mS+8GGk2Gckc7bY/HCmA==",
+ "version": "0.3.2",
+ "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.3.2.tgz",
+ "integrity": "sha512-r9QJJ+uDWrd+94BSPcP6/de67ygLtvVy6cK4luE6MOuDsZIdoaPBnfSpbO/+LTifjPckbKXRuI9BB/Z2/y3iTg==",
"dev": true,
"dependencies": {
- "@babel/helper-compilation-targets": "^7.13.0",
- "@babel/helper-module-imports": "^7.12.13",
- "@babel/helper-plugin-utils": "^7.13.0",
- "@babel/traverse": "^7.13.0",
+ "@babel/helper-compilation-targets": "^7.17.7",
+ "@babel/helper-plugin-utils": "^7.16.7",
"debug": "^4.1.1",
"lodash.debounce": "^4.0.8",
"resolve": "^1.14.2",
@@ -332,15 +330,15 @@
}
},
"node_modules/@babel/helper-remap-async-to-generator": {
- "version": "7.18.6",
- "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.18.6.tgz",
- "integrity": "sha512-z5wbmV55TveUPZlCLZvxWHtrjuJd+8inFhk7DG0WW87/oJuGDcjDiu7HIvGcpf5464L6xKCg3vNkmlVVz9hwyQ==",
+ "version": "7.18.9",
+ "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.18.9.tgz",
+ "integrity": "sha512-dI7q50YKd8BAv3VEfgg7PS7yD3Rtbi2J1XMXaalXO0W0164hYLnh8zpjRS0mte9MfVp/tltvr/cfdXPvJr1opA==",
"dev": true,
"dependencies": {
"@babel/helper-annotate-as-pure": "^7.18.6",
- "@babel/helper-environment-visitor": "^7.18.6",
- "@babel/helper-wrap-function": "^7.18.6",
- "@babel/types": "^7.18.6"
+ "@babel/helper-environment-visitor": "^7.18.9",
+ "@babel/helper-wrap-function": "^7.18.9",
+ "@babel/types": "^7.18.9"
},
"engines": {
"node": ">=6.9.0"
@@ -401,6 +399,15 @@
"node": ">=6.9.0"
}
},
+ "node_modules/@babel/helper-string-parser": {
+ "version": "7.18.10",
+ "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.18.10.tgz",
+ "integrity": "sha512-XtIfWmeNY3i4t7t4D2t02q50HvqHybPqW2ki1kosnvWCwuCMeo81Jf0gwr85jy/neUdg5XDdeFE/80DXiO+njw==",
+ "dev": true,
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
"node_modules/@babel/helper-validator-identifier": {
"version": "7.18.6",
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.18.6.tgz",
@@ -420,15 +427,15 @@
}
},
"node_modules/@babel/helper-wrap-function": {
- "version": "7.18.6",
- "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.18.6.tgz",
- "integrity": "sha512-I5/LZfozwMNbwr/b1vhhuYD+J/mU+gfGAj5td7l5Rv9WYmH6i3Om69WGKNmlIpsVW/mF6O5bvTKbvDQZVgjqOw==",
+ "version": "7.18.11",
+ "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.18.11.tgz",
+ "integrity": "sha512-oBUlbv+rjZLh2Ks9SKi4aL7eKaAXBWleHzU89mP0G6BMUlRxSckk9tSIkgDGydhgFxHuGSlBQZfnaD47oBEB7w==",
"dev": true,
"dependencies": {
- "@babel/helper-function-name": "^7.18.6",
- "@babel/template": "^7.18.6",
- "@babel/traverse": "^7.18.6",
- "@babel/types": "^7.18.6"
+ "@babel/helper-function-name": "^7.18.9",
+ "@babel/template": "^7.18.10",
+ "@babel/traverse": "^7.18.11",
+ "@babel/types": "^7.18.10"
},
"engines": {
"node": ">=6.9.0"
@@ -463,9 +470,9 @@
}
},
"node_modules/@babel/parser": {
- "version": "7.18.9",
- "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.18.9.tgz",
- "integrity": "sha512-9uJveS9eY9DJ0t64YbIBZICtJy8a5QrDEVdiLCG97fVLpDTpGX7t8mMSb6OWw6Lrnjqj4O8zwjELX3dhoMgiBg==",
+ "version": "7.18.11",
+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.18.11.tgz",
+ "integrity": "sha512-9JKn5vN+hDt0Hdqn1PiJ2guflwP+B6Ga8qbDuoF0PzzVhrzsKIJo8yGqVk6CmMHiMei9w1C1Bp9IMJSIK+HPIQ==",
"dev": true,
"bin": {
"parser": "bin/babel-parser.js"
@@ -507,14 +514,14 @@
}
},
"node_modules/@babel/plugin-proposal-async-generator-functions": {
- "version": "7.18.6",
- "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.18.6.tgz",
- "integrity": "sha512-WAz4R9bvozx4qwf74M+sfqPMKfSqwM0phxPTR6iJIi8robgzXwkEgmeJG1gEKhm6sDqT/U9aV3lfcqybIpev8w==",
+ "version": "7.18.10",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.18.10.tgz",
+ "integrity": "sha512-1mFuY2TOsR1hxbjCo4QL+qlIjV07p4H4EUYw2J/WCqsvFV6V9X9z9YhXbWndc/4fw+hYGlDT7egYxliMp5O6Ew==",
"dev": true,
"dependencies": {
- "@babel/helper-environment-visitor": "^7.18.6",
- "@babel/helper-plugin-utils": "^7.18.6",
- "@babel/helper-remap-async-to-generator": "^7.18.6",
+ "@babel/helper-environment-visitor": "^7.18.9",
+ "@babel/helper-plugin-utils": "^7.18.9",
+ "@babel/helper-remap-async-to-generator": "^7.18.9",
"@babel/plugin-syntax-async-generators": "^7.8.4"
},
"engines": {
@@ -1425,12 +1432,12 @@
}
},
"node_modules/@babel/plugin-transform-unicode-escapes": {
- "version": "7.18.6",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.18.6.tgz",
- "integrity": "sha512-XNRwQUXYMP7VLuy54cr/KS/WeL3AZeORhrmeZ7iewgu+X2eBqmpaLI/hzqr9ZxCeUoq0ASK4GUzSM0BDhZkLFw==",
+ "version": "7.18.10",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.18.10.tgz",
+ "integrity": "sha512-kKAdAI+YzPgGY/ftStBFXTI1LZFju38rYThnfMykS+IXy8BVx+res7s2fxf1l8I35DV2T97ezo6+SGrXz6B3iQ==",
"dev": true,
"dependencies": {
- "@babel/helper-plugin-utils": "^7.18.6"
+ "@babel/helper-plugin-utils": "^7.18.9"
},
"engines": {
"node": ">=6.9.0"
@@ -1456,9 +1463,9 @@
}
},
"node_modules/@babel/preset-env": {
- "version": "7.18.9",
- "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.18.9.tgz",
- "integrity": "sha512-75pt/q95cMIHWssYtyfjVlvI+QEZQThQbKvR9xH+F/Agtw/s4Wfc2V9Bwd/P39VtixB7oWxGdH4GteTTwYJWMg==",
+ "version": "7.18.10",
+ "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.18.10.tgz",
+ "integrity": "sha512-wVxs1yjFdW3Z/XkNfXKoblxoHgbtUF7/l3PvvP4m02Qz9TZ6uZGxRVYjSQeR87oQmHco9zWitW5J82DJ7sCjvA==",
"dev": true,
"dependencies": {
"@babel/compat-data": "^7.18.8",
@@ -1467,7 +1474,7 @@
"@babel/helper-validator-option": "^7.18.6",
"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.18.6",
"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.18.9",
- "@babel/plugin-proposal-async-generator-functions": "^7.18.6",
+ "@babel/plugin-proposal-async-generator-functions": "^7.18.10",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-proposal-class-static-block": "^7.18.6",
"@babel/plugin-proposal-dynamic-import": "^7.18.6",
@@ -1527,13 +1534,13 @@
"@babel/plugin-transform-sticky-regex": "^7.18.6",
"@babel/plugin-transform-template-literals": "^7.18.9",
"@babel/plugin-transform-typeof-symbol": "^7.18.9",
- "@babel/plugin-transform-unicode-escapes": "^7.18.6",
+ "@babel/plugin-transform-unicode-escapes": "^7.18.10",
"@babel/plugin-transform-unicode-regex": "^7.18.6",
"@babel/preset-modules": "^0.1.5",
- "@babel/types": "^7.18.9",
- "babel-plugin-polyfill-corejs2": "^0.3.1",
- "babel-plugin-polyfill-corejs3": "^0.5.2",
- "babel-plugin-polyfill-regenerator": "^0.3.1",
+ "@babel/types": "^7.18.10",
+ "babel-plugin-polyfill-corejs2": "^0.3.2",
+ "babel-plugin-polyfill-corejs3": "^0.5.3",
+ "babel-plugin-polyfill-regenerator": "^0.4.0",
"core-js-compat": "^3.22.1",
"semver": "^6.3.0"
},
@@ -1573,33 +1580,33 @@
}
},
"node_modules/@babel/template": {
- "version": "7.18.6",
- "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.18.6.tgz",
- "integrity": "sha512-JoDWzPe+wgBsTTgdnIma3iHNFC7YVJoPssVBDjiHfNlyt4YcunDtcDOUmfVDfCK5MfdsaIoX9PkijPhjH3nYUw==",
+ "version": "7.18.10",
+ "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.18.10.tgz",
+ "integrity": "sha512-TI+rCtooWHr3QJ27kJxfjutghu44DLnasDMwpDqCXVTal9RLp3RSYNh4NdBrRP2cQAoG9A8juOQl6P6oZG4JxA==",
"dev": true,
"dependencies": {
"@babel/code-frame": "^7.18.6",
- "@babel/parser": "^7.18.6",
- "@babel/types": "^7.18.6"
+ "@babel/parser": "^7.18.10",
+ "@babel/types": "^7.18.10"
},
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/traverse": {
- "version": "7.18.9",
- "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.18.9.tgz",
- "integrity": "sha512-LcPAnujXGwBgv3/WHv01pHtb2tihcyW1XuL9wd7jqh1Z8AQkTd+QVjMrMijrln0T7ED3UXLIy36P9Ao7W75rYg==",
+ "version": "7.18.11",
+ "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.18.11.tgz",
+ "integrity": "sha512-TG9PiM2R/cWCAy6BPJKeHzNbu4lPzOSZpeMfeNErskGpTJx6trEvFaVCbDvpcxwy49BKWmEPwiW8mrysNiDvIQ==",
"dev": true,
"dependencies": {
"@babel/code-frame": "^7.18.6",
- "@babel/generator": "^7.18.9",
+ "@babel/generator": "^7.18.10",
"@babel/helper-environment-visitor": "^7.18.9",
"@babel/helper-function-name": "^7.18.9",
"@babel/helper-hoist-variables": "^7.18.6",
"@babel/helper-split-export-declaration": "^7.18.6",
- "@babel/parser": "^7.18.9",
- "@babel/types": "^7.18.9",
+ "@babel/parser": "^7.18.11",
+ "@babel/types": "^7.18.10",
"debug": "^4.1.0",
"globals": "^11.1.0"
},
@@ -1608,11 +1615,12 @@
}
},
"node_modules/@babel/types": {
- "version": "7.18.9",
- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.18.9.tgz",
- "integrity": "sha512-WwMLAg2MvJmt/rKEVQBBhIVffMmnilX4oe0sRe7iPOHIGsqpruFHHdrfj4O1CMMtgMtCU4oPafZjDPCRgO57Wg==",
+ "version": "7.18.10",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.18.10.tgz",
+ "integrity": "sha512-MJvnbEiiNkpjo+LknnmRrqbY1GPUUggjv+wQVjetM/AONoupqRALB7I6jGqNUAZsKcRIEu2J6FRFvsczljjsaQ==",
"dev": true,
"dependencies": {
+ "@babel/helper-string-parser": "^7.18.10",
"@babel/helper-validator-identifier": "^7.18.6",
"to-fast-properties": "^2.0.0"
},
@@ -2507,13 +2515,13 @@
}
},
"node_modules/babel-plugin-polyfill-corejs2": {
- "version": "0.3.1",
- "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.3.1.tgz",
- "integrity": "sha512-v7/T6EQcNfVLfcN2X8Lulb7DjprieyLWJK/zOWH5DUYcAgex9sP3h25Q+DLsX9TloXe3y1O8l2q2Jv9q8UVB9w==",
+ "version": "0.3.2",
+ "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.3.2.tgz",
+ "integrity": "sha512-LPnodUl3lS0/4wN3Rb+m+UK8s7lj2jcLRrjho4gLw+OJs+I4bvGXshINesY5xx/apM+biTnQ9reDI8yj+0M5+Q==",
"dev": true,
"dependencies": {
- "@babel/compat-data": "^7.13.11",
- "@babel/helper-define-polyfill-provider": "^0.3.1",
+ "@babel/compat-data": "^7.17.7",
+ "@babel/helper-define-polyfill-provider": "^0.3.2",
"semver": "^6.1.1"
},
"peerDependencies": {
@@ -2521,12 +2529,12 @@
}
},
"node_modules/babel-plugin-polyfill-corejs3": {
- "version": "0.5.2",
- "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.5.2.tgz",
- "integrity": "sha512-G3uJih0XWiID451fpeFaYGVuxHEjzKTHtc9uGFEjR6hHrvNzeS/PX+LLLcetJcytsB5m4j+K3o/EpXJNb/5IEQ==",
+ "version": "0.5.3",
+ "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.5.3.tgz",
+ "integrity": "sha512-zKsXDh0XjnrUEW0mxIHLfjBfnXSMr5Q/goMe/fxpQnLm07mcOZiIZHBNWCMx60HmdvjxfXcalac0tfFg0wqxyw==",
"dev": true,
"dependencies": {
- "@babel/helper-define-polyfill-provider": "^0.3.1",
+ "@babel/helper-define-polyfill-provider": "^0.3.2",
"core-js-compat": "^3.21.0"
},
"peerDependencies": {
@@ -2534,12 +2542,12 @@
}
},
"node_modules/babel-plugin-polyfill-regenerator": {
- "version": "0.3.1",
- "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.3.1.tgz",
- "integrity": "sha512-Y2B06tvgHYt1x0yz17jGkGeeMr5FeKUu+ASJ+N6nB5lQ8Dapfg42i0OVrf8PNGJ3zKL4A23snMi1IRwrqqND7A==",
+ "version": "0.4.0",
+ "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.4.0.tgz",
+ "integrity": "sha512-RW1cnryiADFeHmfLS+WW/G431p1PsW5qdRdz0SDRi7TKcUgc7Oh/uXkT7MZ/+tGsT1BkczEAmD5XjUyJ5SWDTw==",
"dev": true,
"dependencies": {
- "@babel/helper-define-polyfill-provider": "^0.3.1"
+ "@babel/helper-define-polyfill-provider": "^0.3.2"
},
"peerDependencies": {
"@babel/core": "^7.0.0-0"
@@ -2592,9 +2600,9 @@
}
},
"node_modules/browserslist": {
- "version": "4.21.1",
- "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.1.tgz",
- "integrity": "sha512-Nq8MFCSrnJXSc88yliwlzQe3qNe3VntIjhsArW9IJOEPSHNx23FalwApUVbzAWABLhYJJ7y8AynWI/XM8OdfjQ==",
+ "version": "4.21.3",
+ "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.3.tgz",
+ "integrity": "sha512-898rgRXLAyRkM1GryrrBHGkqA5hlpkV5MhtZwg9QXeiyLUYs2k00Un05aX5l2/yJIOObYKOpS2JNo8nJDE7fWQ==",
"dev": true,
"funding": [
{
@@ -2607,10 +2615,10 @@
}
],
"dependencies": {
- "caniuse-lite": "^1.0.30001359",
- "electron-to-chromium": "^1.4.172",
- "node-releases": "^2.0.5",
- "update-browserslist-db": "^1.0.4"
+ "caniuse-lite": "^1.0.30001370",
+ "electron-to-chromium": "^1.4.202",
+ "node-releases": "^2.0.6",
+ "update-browserslist-db": "^1.0.5"
},
"bin": {
"browserslist": "cli.js"
@@ -2698,9 +2706,9 @@
}
},
"node_modules/caniuse-lite": {
- "version": "1.0.30001363",
- "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001363.tgz",
- "integrity": "sha512-HpQhpzTGGPVMnCjIomjt+jvyUu8vNFo3TaDiZ/RcoTrlOq/5+tC8zHdsbgFB6MxmaY+jCpsH09aD80Bb4Ow3Sg==",
+ "version": "1.0.30001374",
+ "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001374.tgz",
+ "integrity": "sha512-mWvzatRx3w+j5wx/mpFN5v5twlPrabG8NqX2c6e45LCpymdoGqNvRkRutFUqpRTXKFQFNQJasvK0YT7suW6/Hw==",
"dev": true,
"funding": [
{
@@ -3010,12 +3018,12 @@
}
},
"node_modules/core-js-compat": {
- "version": "3.23.3",
- "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.23.3.tgz",
- "integrity": "sha512-WSzUs2h2vvmKsacLHNTdpyOC9k43AEhcGoFlVgCY4L7aw98oSBKtPL6vD0/TqZjRWRQYdDSLkzZIni4Crbbiqw==",
+ "version": "3.24.1",
+ "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.24.1.tgz",
+ "integrity": "sha512-XhdNAGeRnTpp8xbD+sR/HFDK9CbeeeqXT6TuofXh3urqEevzkWmLRgrVoykodsw8okqo2pu1BOmuCKrHx63zdw==",
"dev": true,
"dependencies": {
- "browserslist": "^4.21.0",
+ "browserslist": "^4.21.3",
"semver": "7.0.0"
},
"funding": {
@@ -3372,9 +3380,9 @@
}
},
"node_modules/electron-to-chromium": {
- "version": "1.4.177",
- "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.177.tgz",
- "integrity": "sha512-FYPir3NSBEGexSZUEeht81oVhHfLFl6mhUKSkjHN/iB/TwEIt/WHQrqVGfTLN5gQxwJCQkIJBe05eOXjI7omgg==",
+ "version": "1.4.211",
+ "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.211.tgz",
+ "integrity": "sha512-BZSbMpyFQU0KBJ1JG26XGeFI3i4op+qOYGxftmZXFZoHkhLgsSv4DHDJfl8ogII3hIuzGt51PaZ195OVu0yJ9A==",
"dev": true
},
"node_modules/emoji-regex": {
@@ -5806,9 +5814,9 @@
}
},
"node_modules/node-releases": {
- "version": "2.0.5",
- "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.5.tgz",
- "integrity": "sha512-U9h1NLROZTq9uE1SNffn6WuPDg8icmi3ns4rEl/oTfIle4iLjTliCzgTsbaIFMq/Xn078/lfY/BL0GWZ+psK4Q==",
+ "version": "2.0.6",
+ "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.6.tgz",
+ "integrity": "sha512-PiVXnNuFm5+iYkLBNeq5211hvO38y63T0i2KKh2KnUs3RpzJ+JtODFjkD8yjLwnDkTYF1eKXheUwdssR+NRZdg==",
"dev": true
},
"node_modules/normalize-package-data": {
@@ -10045,9 +10053,9 @@
}
},
"node_modules/update-browserslist-db": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.4.tgz",
- "integrity": "sha512-jnmO2BEGUjsMOe/Fg9u0oczOe/ppIDZPebzccl1yDWGLFP16Pa1/RM5wEoKYPG2zstNcDuAStejyxsOuKINdGA==",
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.5.tgz",
+ "integrity": "sha512-dteFFpCyvuDdr9S/ff1ISkKt/9YZxKjI9WlRR99c180GaztJtRa/fn18FdxGVKVsnPY7/a/FDN68mcvUmP4U7Q==",
"dev": true,
"funding": [
{
@@ -10365,12 +10373,12 @@
}
},
"@babel/generator": {
- "version": "7.18.9",
- "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.18.9.tgz",
- "integrity": "sha512-wt5Naw6lJrL1/SGkipMiFxJjtyczUWTP38deiP1PO60HsBjDeKk08CGC3S8iVuvf0FmTdgKwU1KIXzSKL1G0Ug==",
+ "version": "7.18.12",
+ "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.18.12.tgz",
+ "integrity": "sha512-dfQ8ebCN98SvyL7IxNMCUtZQSq5R7kxgN+r8qYTGDmmSion1hX2C0zq2yo1bsCDhXixokv1SAWTZUMYbO/V5zg==",
"dev": true,
"requires": {
- "@babel/types": "^7.18.9",
+ "@babel/types": "^7.18.10",
"@jridgewell/gen-mapping": "^0.3.2",
"jsesc": "^2.5.1"
}
@@ -10432,15 +10440,13 @@
}
},
"@babel/helper-define-polyfill-provider": {
- "version": "0.3.1",
- "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.3.1.tgz",
- "integrity": "sha512-J9hGMpJQmtWmj46B3kBHmL38UhJGhYX7eqkcq+2gsstyYt341HmPeWspihX43yVRA0mS+8GGk2Gckc7bY/HCmA==",
+ "version": "0.3.2",
+ "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.3.2.tgz",
+ "integrity": "sha512-r9QJJ+uDWrd+94BSPcP6/de67ygLtvVy6cK4luE6MOuDsZIdoaPBnfSpbO/+LTifjPckbKXRuI9BB/Z2/y3iTg==",
"dev": true,
"requires": {
- "@babel/helper-compilation-targets": "^7.13.0",
- "@babel/helper-module-imports": "^7.12.13",
- "@babel/helper-plugin-utils": "^7.13.0",
- "@babel/traverse": "^7.13.0",
+ "@babel/helper-compilation-targets": "^7.17.7",
+ "@babel/helper-plugin-utils": "^7.16.7",
"debug": "^4.1.1",
"lodash.debounce": "^4.0.8",
"resolve": "^1.14.2",
@@ -10531,15 +10537,15 @@
"dev": true
},
"@babel/helper-remap-async-to-generator": {
- "version": "7.18.6",
- "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.18.6.tgz",
- "integrity": "sha512-z5wbmV55TveUPZlCLZvxWHtrjuJd+8inFhk7DG0WW87/oJuGDcjDiu7HIvGcpf5464L6xKCg3vNkmlVVz9hwyQ==",
+ "version": "7.18.9",
+ "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.18.9.tgz",
+ "integrity": "sha512-dI7q50YKd8BAv3VEfgg7PS7yD3Rtbi2J1XMXaalXO0W0164hYLnh8zpjRS0mte9MfVp/tltvr/cfdXPvJr1opA==",
"dev": true,
"requires": {
"@babel/helper-annotate-as-pure": "^7.18.6",
- "@babel/helper-environment-visitor": "^7.18.6",
- "@babel/helper-wrap-function": "^7.18.6",
- "@babel/types": "^7.18.6"
+ "@babel/helper-environment-visitor": "^7.18.9",
+ "@babel/helper-wrap-function": "^7.18.9",
+ "@babel/types": "^7.18.9"
}
},
"@babel/helper-replace-supers": {
@@ -10582,6 +10588,12 @@
"@babel/types": "^7.18.6"
}
},
+ "@babel/helper-string-parser": {
+ "version": "7.18.10",
+ "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.18.10.tgz",
+ "integrity": "sha512-XtIfWmeNY3i4t7t4D2t02q50HvqHybPqW2ki1kosnvWCwuCMeo81Jf0gwr85jy/neUdg5XDdeFE/80DXiO+njw==",
+ "dev": true
+ },
"@babel/helper-validator-identifier": {
"version": "7.18.6",
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.18.6.tgz",
@@ -10595,15 +10607,15 @@
"dev": true
},
"@babel/helper-wrap-function": {
- "version": "7.18.6",
- "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.18.6.tgz",
- "integrity": "sha512-I5/LZfozwMNbwr/b1vhhuYD+J/mU+gfGAj5td7l5Rv9WYmH6i3Om69WGKNmlIpsVW/mF6O5bvTKbvDQZVgjqOw==",
+ "version": "7.18.11",
+ "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.18.11.tgz",
+ "integrity": "sha512-oBUlbv+rjZLh2Ks9SKi4aL7eKaAXBWleHzU89mP0G6BMUlRxSckk9tSIkgDGydhgFxHuGSlBQZfnaD47oBEB7w==",
"dev": true,
"requires": {
- "@babel/helper-function-name": "^7.18.6",
- "@babel/template": "^7.18.6",
- "@babel/traverse": "^7.18.6",
- "@babel/types": "^7.18.6"
+ "@babel/helper-function-name": "^7.18.9",
+ "@babel/template": "^7.18.10",
+ "@babel/traverse": "^7.18.11",
+ "@babel/types": "^7.18.10"
}
},
"@babel/helpers": {
@@ -10629,9 +10641,9 @@
}
},
"@babel/parser": {
- "version": "7.18.9",
- "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.18.9.tgz",
- "integrity": "sha512-9uJveS9eY9DJ0t64YbIBZICtJy8a5QrDEVdiLCG97fVLpDTpGX7t8mMSb6OWw6Lrnjqj4O8zwjELX3dhoMgiBg==",
+ "version": "7.18.11",
+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.18.11.tgz",
+ "integrity": "sha512-9JKn5vN+hDt0Hdqn1PiJ2guflwP+B6Ga8qbDuoF0PzzVhrzsKIJo8yGqVk6CmMHiMei9w1C1Bp9IMJSIK+HPIQ==",
"dev": true
},
"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": {
@@ -10655,14 +10667,14 @@
}
},
"@babel/plugin-proposal-async-generator-functions": {
- "version": "7.18.6",
- "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.18.6.tgz",
- "integrity": "sha512-WAz4R9bvozx4qwf74M+sfqPMKfSqwM0phxPTR6iJIi8robgzXwkEgmeJG1gEKhm6sDqT/U9aV3lfcqybIpev8w==",
+ "version": "7.18.10",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.18.10.tgz",
+ "integrity": "sha512-1mFuY2TOsR1hxbjCo4QL+qlIjV07p4H4EUYw2J/WCqsvFV6V9X9z9YhXbWndc/4fw+hYGlDT7egYxliMp5O6Ew==",
"dev": true,
"requires": {
- "@babel/helper-environment-visitor": "^7.18.6",
- "@babel/helper-plugin-utils": "^7.18.6",
- "@babel/helper-remap-async-to-generator": "^7.18.6",
+ "@babel/helper-environment-visitor": "^7.18.9",
+ "@babel/helper-plugin-utils": "^7.18.9",
+ "@babel/helper-remap-async-to-generator": "^7.18.9",
"@babel/plugin-syntax-async-generators": "^7.8.4"
}
},
@@ -11246,12 +11258,12 @@
}
},
"@babel/plugin-transform-unicode-escapes": {
- "version": "7.18.6",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.18.6.tgz",
- "integrity": "sha512-XNRwQUXYMP7VLuy54cr/KS/WeL3AZeORhrmeZ7iewgu+X2eBqmpaLI/hzqr9ZxCeUoq0ASK4GUzSM0BDhZkLFw==",
+ "version": "7.18.10",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.18.10.tgz",
+ "integrity": "sha512-kKAdAI+YzPgGY/ftStBFXTI1LZFju38rYThnfMykS+IXy8BVx+res7s2fxf1l8I35DV2T97ezo6+SGrXz6B3iQ==",
"dev": true,
"requires": {
- "@babel/helper-plugin-utils": "^7.18.6"
+ "@babel/helper-plugin-utils": "^7.18.9"
}
},
"@babel/plugin-transform-unicode-regex": {
@@ -11265,9 +11277,9 @@
}
},
"@babel/preset-env": {
- "version": "7.18.9",
- "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.18.9.tgz",
- "integrity": "sha512-75pt/q95cMIHWssYtyfjVlvI+QEZQThQbKvR9xH+F/Agtw/s4Wfc2V9Bwd/P39VtixB7oWxGdH4GteTTwYJWMg==",
+ "version": "7.18.10",
+ "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.18.10.tgz",
+ "integrity": "sha512-wVxs1yjFdW3Z/XkNfXKoblxoHgbtUF7/l3PvvP4m02Qz9TZ6uZGxRVYjSQeR87oQmHco9zWitW5J82DJ7sCjvA==",
"dev": true,
"requires": {
"@babel/compat-data": "^7.18.8",
@@ -11276,7 +11288,7 @@
"@babel/helper-validator-option": "^7.18.6",
"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.18.6",
"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.18.9",
- "@babel/plugin-proposal-async-generator-functions": "^7.18.6",
+ "@babel/plugin-proposal-async-generator-functions": "^7.18.10",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-proposal-class-static-block": "^7.18.6",
"@babel/plugin-proposal-dynamic-import": "^7.18.6",
@@ -11336,13 +11348,13 @@
"@babel/plugin-transform-sticky-regex": "^7.18.6",
"@babel/plugin-transform-template-literals": "^7.18.9",
"@babel/plugin-transform-typeof-symbol": "^7.18.9",
- "@babel/plugin-transform-unicode-escapes": "^7.18.6",
+ "@babel/plugin-transform-unicode-escapes": "^7.18.10",
"@babel/plugin-transform-unicode-regex": "^7.18.6",
"@babel/preset-modules": "^0.1.5",
- "@babel/types": "^7.18.9",
- "babel-plugin-polyfill-corejs2": "^0.3.1",
- "babel-plugin-polyfill-corejs3": "^0.5.2",
- "babel-plugin-polyfill-regenerator": "^0.3.1",
+ "@babel/types": "^7.18.10",
+ "babel-plugin-polyfill-corejs2": "^0.3.2",
+ "babel-plugin-polyfill-corejs3": "^0.5.3",
+ "babel-plugin-polyfill-regenerator": "^0.4.0",
"core-js-compat": "^3.22.1",
"semver": "^6.3.0"
}
@@ -11370,40 +11382,41 @@
}
},
"@babel/template": {
- "version": "7.18.6",
- "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.18.6.tgz",
- "integrity": "sha512-JoDWzPe+wgBsTTgdnIma3iHNFC7YVJoPssVBDjiHfNlyt4YcunDtcDOUmfVDfCK5MfdsaIoX9PkijPhjH3nYUw==",
+ "version": "7.18.10",
+ "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.18.10.tgz",
+ "integrity": "sha512-TI+rCtooWHr3QJ27kJxfjutghu44DLnasDMwpDqCXVTal9RLp3RSYNh4NdBrRP2cQAoG9A8juOQl6P6oZG4JxA==",
"dev": true,
"requires": {
"@babel/code-frame": "^7.18.6",
- "@babel/parser": "^7.18.6",
- "@babel/types": "^7.18.6"
+ "@babel/parser": "^7.18.10",
+ "@babel/types": "^7.18.10"
}
},
"@babel/traverse": {
- "version": "7.18.9",
- "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.18.9.tgz",
- "integrity": "sha512-LcPAnujXGwBgv3/WHv01pHtb2tihcyW1XuL9wd7jqh1Z8AQkTd+QVjMrMijrln0T7ED3UXLIy36P9Ao7W75rYg==",
+ "version": "7.18.11",
+ "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.18.11.tgz",
+ "integrity": "sha512-TG9PiM2R/cWCAy6BPJKeHzNbu4lPzOSZpeMfeNErskGpTJx6trEvFaVCbDvpcxwy49BKWmEPwiW8mrysNiDvIQ==",
"dev": true,
"requires": {
"@babel/code-frame": "^7.18.6",
- "@babel/generator": "^7.18.9",
+ "@babel/generator": "^7.18.10",
"@babel/helper-environment-visitor": "^7.18.9",
"@babel/helper-function-name": "^7.18.9",
"@babel/helper-hoist-variables": "^7.18.6",
"@babel/helper-split-export-declaration": "^7.18.6",
- "@babel/parser": "^7.18.9",
- "@babel/types": "^7.18.9",
+ "@babel/parser": "^7.18.11",
+ "@babel/types": "^7.18.10",
"debug": "^4.1.0",
"globals": "^11.1.0"
}
},
"@babel/types": {
- "version": "7.18.9",
- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.18.9.tgz",
- "integrity": "sha512-WwMLAg2MvJmt/rKEVQBBhIVffMmnilX4oe0sRe7iPOHIGsqpruFHHdrfj4O1CMMtgMtCU4oPafZjDPCRgO57Wg==",
+ "version": "7.18.10",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.18.10.tgz",
+ "integrity": "sha512-MJvnbEiiNkpjo+LknnmRrqbY1GPUUggjv+wQVjetM/AONoupqRALB7I6jGqNUAZsKcRIEu2J6FRFvsczljjsaQ==",
"dev": true,
"requires": {
+ "@babel/helper-string-parser": "^7.18.10",
"@babel/helper-validator-identifier": "^7.18.6",
"to-fast-properties": "^2.0.0"
}
@@ -12090,33 +12103,33 @@
}
},
"babel-plugin-polyfill-corejs2": {
- "version": "0.3.1",
- "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.3.1.tgz",
- "integrity": "sha512-v7/T6EQcNfVLfcN2X8Lulb7DjprieyLWJK/zOWH5DUYcAgex9sP3h25Q+DLsX9TloXe3y1O8l2q2Jv9q8UVB9w==",
+ "version": "0.3.2",
+ "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.3.2.tgz",
+ "integrity": "sha512-LPnodUl3lS0/4wN3Rb+m+UK8s7lj2jcLRrjho4gLw+OJs+I4bvGXshINesY5xx/apM+biTnQ9reDI8yj+0M5+Q==",
"dev": true,
"requires": {
- "@babel/compat-data": "^7.13.11",
- "@babel/helper-define-polyfill-provider": "^0.3.1",
+ "@babel/compat-data": "^7.17.7",
+ "@babel/helper-define-polyfill-provider": "^0.3.2",
"semver": "^6.1.1"
}
},
"babel-plugin-polyfill-corejs3": {
- "version": "0.5.2",
- "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.5.2.tgz",
- "integrity": "sha512-G3uJih0XWiID451fpeFaYGVuxHEjzKTHtc9uGFEjR6hHrvNzeS/PX+LLLcetJcytsB5m4j+K3o/EpXJNb/5IEQ==",
+ "version": "0.5.3",
+ "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.5.3.tgz",
+ "integrity": "sha512-zKsXDh0XjnrUEW0mxIHLfjBfnXSMr5Q/goMe/fxpQnLm07mcOZiIZHBNWCMx60HmdvjxfXcalac0tfFg0wqxyw==",
"dev": true,
"requires": {
- "@babel/helper-define-polyfill-provider": "^0.3.1",
+ "@babel/helper-define-polyfill-provider": "^0.3.2",
"core-js-compat": "^3.21.0"
}
},
"babel-plugin-polyfill-regenerator": {
- "version": "0.3.1",
- "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.3.1.tgz",
- "integrity": "sha512-Y2B06tvgHYt1x0yz17jGkGeeMr5FeKUu+ASJ+N6nB5lQ8Dapfg42i0OVrf8PNGJ3zKL4A23snMi1IRwrqqND7A==",
+ "version": "0.4.0",
+ "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.4.0.tgz",
+ "integrity": "sha512-RW1cnryiADFeHmfLS+WW/G431p1PsW5qdRdz0SDRi7TKcUgc7Oh/uXkT7MZ/+tGsT1BkczEAmD5XjUyJ5SWDTw==",
"dev": true,
"requires": {
- "@babel/helper-define-polyfill-provider": "^0.3.1"
+ "@babel/helper-define-polyfill-provider": "^0.3.2"
}
},
"balanced-match": {
@@ -12163,15 +12176,15 @@
}
},
"browserslist": {
- "version": "4.21.1",
- "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.1.tgz",
- "integrity": "sha512-Nq8MFCSrnJXSc88yliwlzQe3qNe3VntIjhsArW9IJOEPSHNx23FalwApUVbzAWABLhYJJ7y8AynWI/XM8OdfjQ==",
+ "version": "4.21.3",
+ "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.3.tgz",
+ "integrity": "sha512-898rgRXLAyRkM1GryrrBHGkqA5hlpkV5MhtZwg9QXeiyLUYs2k00Un05aX5l2/yJIOObYKOpS2JNo8nJDE7fWQ==",
"dev": true,
"requires": {
- "caniuse-lite": "^1.0.30001359",
- "electron-to-chromium": "^1.4.172",
- "node-releases": "^2.0.5",
- "update-browserslist-db": "^1.0.4"
+ "caniuse-lite": "^1.0.30001370",
+ "electron-to-chromium": "^1.4.202",
+ "node-releases": "^2.0.6",
+ "update-browserslist-db": "^1.0.5"
}
},
"buffer-from": {
@@ -12234,9 +12247,9 @@
}
},
"caniuse-lite": {
- "version": "1.0.30001363",
- "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001363.tgz",
- "integrity": "sha512-HpQhpzTGGPVMnCjIomjt+jvyUu8vNFo3TaDiZ/RcoTrlOq/5+tC8zHdsbgFB6MxmaY+jCpsH09aD80Bb4Ow3Sg==",
+ "version": "1.0.30001374",
+ "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001374.tgz",
+ "integrity": "sha512-mWvzatRx3w+j5wx/mpFN5v5twlPrabG8NqX2c6e45LCpymdoGqNvRkRutFUqpRTXKFQFNQJasvK0YT7suW6/Hw==",
"dev": true
},
"cardinal": {
@@ -12477,12 +12490,12 @@
}
},
"core-js-compat": {
- "version": "3.23.3",
- "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.23.3.tgz",
- "integrity": "sha512-WSzUs2h2vvmKsacLHNTdpyOC9k43AEhcGoFlVgCY4L7aw98oSBKtPL6vD0/TqZjRWRQYdDSLkzZIni4Crbbiqw==",
+ "version": "3.24.1",
+ "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.24.1.tgz",
+ "integrity": "sha512-XhdNAGeRnTpp8xbD+sR/HFDK9CbeeeqXT6TuofXh3urqEevzkWmLRgrVoykodsw8okqo2pu1BOmuCKrHx63zdw==",
"dev": true,
"requires": {
- "browserslist": "^4.21.0",
+ "browserslist": "^4.21.3",
"semver": "7.0.0"
},
"dependencies": {
@@ -12742,9 +12755,9 @@
}
},
"electron-to-chromium": {
- "version": "1.4.177",
- "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.177.tgz",
- "integrity": "sha512-FYPir3NSBEGexSZUEeht81oVhHfLFl6mhUKSkjHN/iB/TwEIt/WHQrqVGfTLN5gQxwJCQkIJBe05eOXjI7omgg==",
+ "version": "1.4.211",
+ "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.211.tgz",
+ "integrity": "sha512-BZSbMpyFQU0KBJ1JG26XGeFI3i4op+qOYGxftmZXFZoHkhLgsSv4DHDJfl8ogII3hIuzGt51PaZ195OVu0yJ9A==",
"dev": true
},
"emoji-regex": {
@@ -14525,9 +14538,9 @@
}
},
"node-releases": {
- "version": "2.0.5",
- "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.5.tgz",
- "integrity": "sha512-U9h1NLROZTq9uE1SNffn6WuPDg8icmi3ns4rEl/oTfIle4iLjTliCzgTsbaIFMq/Xn078/lfY/BL0GWZ+psK4Q==",
+ "version": "2.0.6",
+ "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.6.tgz",
+ "integrity": "sha512-PiVXnNuFm5+iYkLBNeq5211hvO38y63T0i2KKh2KnUs3RpzJ+JtODFjkD8yjLwnDkTYF1eKXheUwdssR+NRZdg==",
"dev": true
},
"normalize-package-data": {
@@ -17595,9 +17608,9 @@
"dev": true
},
"update-browserslist-db": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.4.tgz",
- "integrity": "sha512-jnmO2BEGUjsMOe/Fg9u0oczOe/ppIDZPebzccl1yDWGLFP16Pa1/RM5wEoKYPG2zstNcDuAStejyxsOuKINdGA==",
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.5.tgz",
+ "integrity": "sha512-dteFFpCyvuDdr9S/ff1ISkKt/9YZxKjI9WlRR99c180GaztJtRa/fn18FdxGVKVsnPY7/a/FDN68mcvUmP4U7Q==",
"dev": true,
"requires": {
"escalade": "^3.1.1",
diff --git a/package.json b/package.json
index 4c1cf7fd04..b7f29341f8 100644
--- a/package.json
+++ b/package.json
@@ -43,7 +43,7 @@
],
"devDependencies": {
"@babel/core": "^7.18.9",
- "@babel/preset-env": "^7.18.9",
+ "@babel/preset-env": "^7.18.10",
"@markedjs/html-differ": "^4.0.2",
"@rollup/plugin-babel": "^5.3.1",
"@rollup/plugin-commonjs": "^22.0.1",
|
pyroscope
|
https://github.com/grafana/pyroscope
|
267beeb8f2d5317518904b44ad0a6e3a6a34fe83
|
Pyroscope Bot [email protected]
|
2022-08-09 22:22:52
|
chore(release): publish
|
- @pyroscope/[email protected]
- @pyroscope/[email protected]
- @pyroscope/[email protected]
|
chore(release): publish
- @pyroscope/[email protected]
- @pyroscope/[email protected]
- @pyroscope/[email protected]
|
diff --git a/packages/pyroscope-flamegraph/CHANGELOG.md b/packages/pyroscope-flamegraph/CHANGELOG.md
index d222fd63c6..0881bc1e71 100644
--- a/packages/pyroscope-flamegraph/CHANGELOG.md
+++ b/packages/pyroscope-flamegraph/CHANGELOG.md
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [0.18.3](https://github.com/pyroscope-io/pyroscope/compare/@pyroscope/[email protected]...@pyroscope/[email protected]) (2022-08-09)
+
+**Note:** Version bump only for package @pyroscope/flamegraph
+
+
+
+
+
## [0.18.2](https://github.com/pyroscope-io/pyroscope/compare/@pyroscope/[email protected]...@pyroscope/[email protected]) (2022-08-08)
diff --git a/packages/pyroscope-flamegraph/package.json b/packages/pyroscope-flamegraph/package.json
index cf901a1523..627027304f 100644
--- a/packages/pyroscope-flamegraph/package.json
+++ b/packages/pyroscope-flamegraph/package.json
@@ -1,6 +1,6 @@
{
"name": "@pyroscope/flamegraph",
- "version": "0.18.2",
+ "version": "0.18.3",
"main": "dist/index.node.js",
"browser": "dist/index.js",
"_types": "since we are importing stuff from webapp (ui components), tsc ends up generating a weird file tree",
diff --git a/packages/pyroscope-panel-plugin/CHANGELOG.md b/packages/pyroscope-panel-plugin/CHANGELOG.md
index f912456f46..c92d73e5a9 100644
--- a/packages/pyroscope-panel-plugin/CHANGELOG.md
+++ b/packages/pyroscope-panel-plugin/CHANGELOG.md
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [1.3.47](https://github.com/pyroscope-io/pyroscope/compare/@pyroscope/[email protected]...@pyroscope/[email protected]) (2022-08-09)
+
+**Note:** Version bump only for package @pyroscope/panel-plugin
+
+
+
+
+
## [1.3.46](https://github.com/pyroscope-io/pyroscope/compare/@pyroscope/[email protected]...@pyroscope/[email protected]) (2022-08-08)
**Note:** Version bump only for package @pyroscope/panel-plugin
diff --git a/packages/pyroscope-panel-plugin/package.json b/packages/pyroscope-panel-plugin/package.json
index 470bdbfb47..a0d59ee91a 100644
--- a/packages/pyroscope-panel-plugin/package.json
+++ b/packages/pyroscope-panel-plugin/package.json
@@ -1,6 +1,6 @@
{
"name": "@pyroscope/panel-plugin",
- "version": "1.3.46",
+ "version": "1.3.47",
"scripts": {
"test": "jest",
"build": "NODE_ENV=production webpack --config ../../scripts/webpack/webpack.panel.ts",
@@ -10,6 +10,6 @@
"dependencies": {
"@grafana/data": "^8.3.1",
"@grafana/runtime": "^8.3.1",
- "@pyroscope/flamegraph": "^0.18.2"
+ "@pyroscope/flamegraph": "^0.18.3"
}
}
diff --git a/webapp/CHANGELOG.md b/webapp/CHANGELOG.md
index 0bfd5ba7ba..abdc2f0ea3 100644
--- a/webapp/CHANGELOG.md
+++ b/webapp/CHANGELOG.md
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [1.29.1](https://github.com/pyroscope-io/pyroscope/compare/@pyroscope/[email protected]...@pyroscope/[email protected]) (2022-08-09)
+
+**Note:** Version bump only for package @pyroscope/webapp
+
+
+
+
+
# [1.29.0](https://github.com/pyroscope-io/pyroscope/compare/@pyroscope/[email protected]...@pyroscope/[email protected]) (2022-08-08)
diff --git a/webapp/package.json b/webapp/package.json
index 5ce10a7182..427cf1c38c 100644
--- a/webapp/package.json
+++ b/webapp/package.json
@@ -1,6 +1,6 @@
{
"name": "@pyroscope/webapp",
- "version": "1.29.0",
+ "version": "1.29.1",
"private": true,
"scripts": {
"test": "echo \"Error: run tests from root\" && exit 1",
@@ -13,7 +13,7 @@
"build:webapp": "NODE_ENV=production webpack --config ../scripts/webpack/webpack.prod.ts"
},
"dependencies": {
- "@pyroscope/flamegraph": "^0.18.2",
+ "@pyroscope/flamegraph": "^0.18.3",
"@pyroscope/models": "^0.4.2"
}
}
|
generator-jhipster
|
https://github.com/jhipster/generator-jhipster
|
7261d5681c5048970d6ecfdeb4f592b4b520bf88
|
dependabot[bot]
|
2022-02-25 10:35:14
|
chore(deps-dev): bump @types/node in /generators/client/templates/vue
|
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.11.25 to 16.11.26.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)
---
|
chore(deps-dev): bump @types/node in /generators/client/templates/vue
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.11.25 to 16.11.26.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)
---
updated-dependencies:
- dependency-name: "@types/node"
dependency-type: direct:development
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <[email protected]>
|
diff --git a/generators/client/templates/vue/package.json b/generators/client/templates/vue/package.json
index d3c0849f69e9..6fe6f915fdb5 100644
--- a/generators/client/templates/vue/package.json
+++ b/generators/client/templates/vue/package.json
@@ -22,7 +22,7 @@
"devDependencies": {
"@rushstack/eslint-patch": "1.1.0",
"@types/jest": "27.4.1",
- "@types/node": "16.11.25",
+ "@types/node": "16.11.26",
"@types/sinon": "10.0.11",
"@types/vuelidate": "0.7.15",
"@vue/eslint-config-prettier": "7.0.0",
|
youki
|
https://github.com/youki-dev/youki
|
7c82c39968284d9d46238317b0609b1a76f162cd
|
dependabot[bot]
|
2023-06-14 06:41:50
|
chore(deps): bump cranelift-control from 0.96.3 to 0.96.4
|
Bumps [cranelift-control](https://github.com/bytecodealliance/wasmtime) from 0.96.3 to 0.96.4.
- [Release notes](https://github.com/bytecodealliance/wasmtime/releases)
- [Changelog](https://github.com/bytecodealliance/wasmtime/blob/main/docs/WASI-some-possible-changes.md)
- [Commits](https://github.com/bytecodealliance/wasmtime/commits)
---
|
chore(deps): bump cranelift-control from 0.96.3 to 0.96.4
Bumps [cranelift-control](https://github.com/bytecodealliance/wasmtime) from 0.96.3 to 0.96.4.
- [Release notes](https://github.com/bytecodealliance/wasmtime/releases)
- [Changelog](https://github.com/bytecodealliance/wasmtime/blob/main/docs/WASI-some-possible-changes.md)
- [Commits](https://github.com/bytecodealliance/wasmtime/commits)
---
updated-dependencies:
- dependency-name: cranelift-control
dependency-type: indirect
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <[email protected]>
|
diff --git a/Cargo.lock b/Cargo.lock
index d023a17c5..bf38ac4f2 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -671,9 +671,9 @@ checksum = "eb65884d17a1fa55990dd851c43c140afb4c06c3312cf42cfa1222c3b23f9561"
[[package]]
name = "cranelift-control"
-version = "0.96.3"
+version = "0.96.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9a0cea8abc90934d0a7ee189a29fd35fecd5c40f59ae7e6aab1805e8ab1a535e"
+checksum = "da66a68b1f48da863d1d53209b8ddb1a6236411d2d72a280ffa8c2f734f7219e"
dependencies = [
"arbitrary",
]
|
RSSHub
|
https://github.com/DIYgod/RSSHub
|
0855c9fb8006950811d0b9e30ae72d868f13143a
|
Manu
|
2022-11-10 18:19:05
|
docs: Add PikaPods.com as deployment option (#11256)
|
* Add PikaPods.com as deployment option
* docs: fix wording
|
docs: Add PikaPods.com as deployment option (#11256)
* Add PikaPods.com as deployment option
* docs: fix wording
|
diff --git a/docs/en/install/README.md b/docs/en/install/README.md
index cccf377ce471ca..75e4608faeb15b 100644
--- a/docs/en/install/README.md
+++ b/docs/en/install/README.md
@@ -307,6 +307,12 @@ Heroku [no longer](https://blog.heroku.com/next-chapter) offers free product pla
[](https://vercel.com/import/project?template=https://github.com/DIYgod/RSSHub)
+## Deploy to PikaPods
+
+Run RSSHub from just $1/month. Includes automatic updates and $5 free starting credit.
+
+[](https://www.pikapods.com/pods?run=rsshub)
+
## Deploy to Google App Engine(GAE)
### Before You Begin
diff --git a/docs/install/README.md b/docs/install/README.md
index 545bcaef466fb9..a8a4e3e5d65b83 100644
--- a/docs/install/README.md
+++ b/docs/install/README.md
@@ -312,6 +312,12 @@ Heroku [不再](https://blog.heroku.com/next-chapter) 提供免费服务。
[](https://vercel.com/import/project?template=https://github.com/DIYgod/RSSHub)
+## 部署到 PikaPods
+
+每月只需 1 美元即可运行 RSSHub。包括自动更新和 5 美元的免费起始额度。
+
+[](https://www.pikapods.com/pods?run=rsshub)
+
## 部署到 Google App Engine
### 准备
|
deno
|
https://github.com/denoland/deno
|
44238955fb3c70074e7bc8191efdf3e0143bed16
|
Divy Srivastava
|
2024-08-28 18:03:15
|
fix(ext/node): throw when loading `cpu-features` module (#25257)
|
It crashes because of NAN usage, we want to trigger the fallback case in
ssh2 by throwing an error.
Fixes https://github.com/denoland/deno/issues/25236
|
fix(ext/node): throw when loading `cpu-features` module (#25257)
It crashes because of NAN usage, we want to trigger the fallback case in
ssh2 by throwing an error.
Fixes https://github.com/denoland/deno/issues/25236
|
diff --git a/ext/node/polyfills/01_require.js b/ext/node/polyfills/01_require.js
index 7eb549134fe599..c29073901994b6 100644
--- a/ext/node/polyfills/01_require.js
+++ b/ext/node/polyfills/01_require.js
@@ -1121,6 +1121,9 @@ Module._extensions[".json"] = function (module, filename) {
// Native extension for .node
Module._extensions[".node"] = function (module, filename) {
+ if (filename.endsWith("cpufeatures.node")) {
+ throw new Error("Using cpu-features module is currently not supported");
+ }
module.exports = op_napi_open(
filename,
globalThis,
|
biome
|
https://github.com/biomejs/biome
|
139158f3d30effa35501b78f49fa90e4b7979900
|
l3ops
|
2022-04-29 14:48:51
|
fix(ci): fix the release workflows for the CLI and LSP (#2516)
|
* fix(ci): fix the release workflows for the CLI and LSP
* revert the version of the vscode extension
* fix variable injection expression
|
fix(ci): fix the release workflows for the CLI and LSP (#2516)
* fix(ci): fix the release workflows for the CLI and LSP
* revert the version of the vscode extension
* fix variable injection expression
|
diff --git a/.github/workflows/release_cli.yml b/.github/workflows/release_cli.yml
index 87c1771f8438..211ae4a86af2 100644
--- a/.github/workflows/release_cli.yml
+++ b/.github/workflows/release_cli.yml
@@ -39,7 +39,7 @@ jobs:
- name: Check prerelease status
id: prerelease
- if: env.nightly == 'true' || steps.version.outputs.type == 'prerelease' || steps.version.outputs.type == 'prepatch' || steps.version.outputs.type == 'premajor' || steps.version.outputs.type == 'preminor'
+ if: env.nightly == 'true'
run: echo "prerelease=true" >> $GITHUB_ENV
- name: Check version status
@@ -84,6 +84,22 @@ jobs:
with:
fetch-depth: 1
+ - name: Install Node.js
+ uses: actions/setup-node@v3
+ with:
+ node-version: 14.x
+
+ - name: Set release infos
+ if: needs.check.outputs.prerelease == 'true'
+ run: |
+ echo "prerelease=true" >> $GITHUB_ENV
+ node npm/rome/scripts/update-nightly-version.mjs >> $GITHUB_ENV
+ - name: Set release infos
+ if: needs.check.outputs.prerelease != 'true'
+ run: |
+ echo "prerelease=false" >> $GITHUB_ENV
+ echo "version=${{ needs.check.outputs.version }}" >> $GITHUB_ENV
+
- name: Install Rust toolchain
run: rustup target add ${{ matrix.target }}
@@ -129,16 +145,6 @@ jobs:
path: ./dist/rome-*
if-no-files-found: error
- - name: Install Node.js
- uses: actions/setup-node@v3
- with:
- node-version: 14.x
-
- - name: Set release infos
- run: |
- echo "version=${{ needs.check.outputs.version }}" >> $GITHUB_ENV
- echo "prerelease=${{ needs.check.outputs.prerelease }}" >> $GITHUB_ENV
-
publish:
name: Publish
runs-on: ubuntu-latest
@@ -158,6 +164,9 @@ jobs:
node-version: 14.x
registry-url: 'https://registry.npmjs.org'
+ - name: Set release infos
+ if: needs.build.outputs.prerelease == 'true'
+ run: node npm/rome/scripts/update-nightly-version.mjs
- name: Generate npm packages
run: node npm/rome/scripts/generate-packages.mjs
diff --git a/.github/workflows/release_lsp.yml b/.github/workflows/release_lsp.yml
index 132df19dec37..807986f7f2e6 100644
--- a/.github/workflows/release_lsp.yml
+++ b/.github/workflows/release_lsp.yml
@@ -113,11 +113,13 @@ jobs:
- name: Copy LSP binary
if: matrix.os == 'windows-2022'
run: |
+ mkdir dist
mkdir editors/vscode/server
cp target/${{ matrix.target }}/release/rome_lsp.exe editors/vscode/server/rome_lsp.exe
- name: Copy LSP binary
if: matrix.os != 'windows-2022'
run: |
+ mkdir dist
mkdir editors/vscode/server
cp target/${{ matrix.target }}/release/rome_lsp editors/vscode/server/rome_lsp
diff --git a/editors/vscode/package-lock.json b/editors/vscode/package-lock.json
index 35274c446854..5764ad4d3386 100644
--- a/editors/vscode/package-lock.json
+++ b/editors/vscode/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "rome",
- "version": "0.6.0",
+ "version": "0.4.2",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "rome",
- "version": "0.6.0",
+ "version": "0.4.2",
"license": "MIT",
"dependencies": {
"vscode-languageclient": "^8.0.0-next.13"
diff --git a/editors/vscode/package.json b/editors/vscode/package.json
index 617f2f069bb8..ff40d8596ad9 100644
--- a/editors/vscode/package.json
+++ b/editors/vscode/package.json
@@ -3,7 +3,7 @@
"publisher": "rome",
"displayName": "Rome",
"description": "Rome LSP VS Code Extension",
- "version": "0.6.0",
+ "version": "0.4.2",
"icon": "icon.png",
"activationEvents": [
"onLanguage:javascript",
@@ -156,4 +156,4 @@
"vsce": "^2.7.0",
"esbuild": "^0.14.27"
}
-}
+}
\ No newline at end of file
diff --git a/npm/rome/scripts/update-nightly-version.mjs b/npm/rome/scripts/update-nightly-version.mjs
new file mode 100644
index 000000000000..4234fc5344ae
--- /dev/null
+++ b/npm/rome/scripts/update-nightly-version.mjs
@@ -0,0 +1,27 @@
+import { resolve } from "node:path";
+import { fileURLToPath } from "node:url";
+import * as fs from "node:fs";
+
+const ROMECLI_ROOT = resolve(fileURLToPath(import.meta.url), "../..");
+const MANIFEST_PATH = resolve(ROMECLI_ROOT, "package.json");
+
+const rootManifest = JSON.parse(
+ fs.readFileSync(MANIFEST_PATH).toString("utf-8"),
+);
+
+let version = rootManifest["version"];
+if (!version.includes("-")) {
+ version += "-next";
+}
+
+if (typeof process.env.GITHUB_SHA !== "string" || process.env.GITHUB_SHA === "") {
+ throw new Error("GITHUB_SHA environment variable is undefined");
+}
+
+version += `.${process.env.GITHUB_SHA.substring(0, 7)}`;
+rootManifest["version"] = version;
+
+const content = JSON.stringify(rootManifest);
+fs.writeFileSync(MANIFEST_PATH, content);
+
+console.log(`version="${version}"`);
|
sentry
|
https://github.com/getsentry/sentry
|
c921a6258e3efc6da7a82549ba96c7c24c34197b
|
Dameli Ushbayeva
|
2023-04-06 22:10:55
|
fix(issues-platform): Read initial state of the project options (#47024)
|
This sets the initial project options state for issues platform options
|
fix(issues-platform): Read initial state of the project options (#47024)
This sets the initial project options state for issues platform options
|
diff --git a/static/app/views/settings/projectPerformance/projectPerformance.tsx b/static/app/views/settings/projectPerformance/projectPerformance.tsx
index 12f2be0b85027b..9e0bebce506077 100644
--- a/static/app/views/settings/projectPerformance/projectPerformance.tsx
+++ b/static/app/views/settings/projectPerformance/projectPerformance.tsx
@@ -414,6 +414,10 @@ class ProjectPerformance extends AsyncView<Props, State> {
initialData={{
performanceIssueCreationRate:
this.state.project.performanceIssueCreationRate,
+ performanceIssueSendToPlatform:
+ this.state.project.performanceIssueSendToPlatform,
+ performanceIssueCreationThroughPlatform:
+ this.state.project.performanceIssueCreationThroughPlatform,
}}
apiMethod="PUT"
apiEndpoint={projectEndpoint}
|
swc
|
https://github.com/swc-project/swc
|
7053bb16ce19ba476760b7fe0b1627d1210d6e18
|
Austaras
|
2024-05-13 10:29:48
|
fix(es/compat): Avoid reserved name for private method (#8949)
|
**Description:**
Following development should follow babel/babel#16261 to avoid separate `WeakMap` for each individual private method
**Related issue:**
- Closes #8948.
|
fix(es/compat): Avoid reserved name for private method (#8949)
**Description:**
Following development should follow babel/babel#16261 to avoid separate `WeakMap` for each individual private method
**Related issue:**
- Closes #8948.
|
diff --git a/crates/swc_ecma_ast/src/ident.rs b/crates/swc_ecma_ast/src/ident.rs
index e5bded9fa04b..97ed0ed65f58 100644
--- a/crates/swc_ecma_ast/src/ident.rs
+++ b/crates/swc_ecma_ast/src/ident.rs
@@ -425,6 +425,8 @@ static RESSERVED_IN_STRICT_MODE: phf::Set<&str> = phf_set!(
"yield",
);
+static RESSERVED_IN_STRICT_BIND: phf::Set<&str> = phf_set!("eval", "arguments",);
+
static RESERVED_IN_ES3: phf::Set<&str> = phf_set!(
"abstract",
"boolean",
@@ -457,12 +459,19 @@ pub trait IdentExt: AsRef<str> {
}
fn is_reserved_in_strict_bind(&self) -> bool {
- ["eval", "arguments"].contains(&self.as_ref())
+ RESSERVED_IN_STRICT_BIND.contains(self.as_ref())
}
fn is_reserved_in_es3(&self) -> bool {
RESERVED_IN_ES3.contains(self.as_ref())
}
+
+ fn is_reserved_in_any(&self) -> bool {
+ RESERVED.contains(self.as_ref())
+ || RESSERVED_IN_STRICT_MODE.contains(self.as_ref())
+ || RESSERVED_IN_STRICT_BIND.contains(self.as_ref())
+ || RESERVED_IN_ES3.contains(self.as_ref())
+ }
}
impl IdentExt for Atom {}
diff --git a/crates/swc_ecma_compat_es2022/src/class_properties/mod.rs b/crates/swc_ecma_compat_es2022/src/class_properties/mod.rs
index 054745604a15..f386302ba7d1 100644
--- a/crates/swc_ecma_compat_es2022/src/class_properties/mod.rs
+++ b/crates/swc_ecma_compat_es2022/src/class_properties/mod.rs
@@ -1,9 +1,6 @@
use swc_common::{
- collections::{AHashMap, AHashSet},
- comments::Comments,
- errors::HANDLER,
- util::take::Take,
- Mark, Span, Spanned, SyntaxContext, DUMMY_SP,
+ collections::AHashMap, comments::Comments, errors::HANDLER, util::take::Take, Mark, Span,
+ Spanned, SyntaxContext, DUMMY_SP,
};
use swc_ecma_ast::*;
use swc_ecma_transforms_base::{helper, perf::Check};
@@ -530,7 +527,6 @@ impl<C: Comments> ClassProperties<C> {
let mut super_ident = None;
class.body.visit_mut_with(&mut BrandCheckHandler {
- names: &mut AHashSet::default(),
private: &self.private,
});
@@ -806,7 +802,13 @@ impl<C: Comments> ClassProperties<C> {
match method.kind {
MethodKind::Getter => format!("get_{}", method.key.id.sym).into(),
MethodKind::Setter => format!("set_{}", method.key.id.sym).into(),
- MethodKind::Method => method.key.id.sym.clone(),
+ MethodKind::Method => {
+ if method.key.id.is_reserved_in_any() {
+ format!("__{}", method.key.id.sym).into()
+ } else {
+ method.key.id.sym.clone()
+ }
+ }
},
method
.span
diff --git a/crates/swc_ecma_compat_es2022/src/class_properties/private_field.rs b/crates/swc_ecma_compat_es2022/src/class_properties/private_field.rs
index c72e31ca04fc..2f96a111ae04 100644
--- a/crates/swc_ecma_compat_es2022/src/class_properties/private_field.rs
+++ b/crates/swc_ecma_compat_es2022/src/class_properties/private_field.rs
@@ -2,10 +2,8 @@ use std::iter;
use swc_atoms::JsWord;
use swc_common::{
- collections::{AHashMap, AHashSet},
- errors::HANDLER,
- util::take::Take,
- Mark, Spanned, SyntaxContext, DUMMY_SP,
+ collections::AHashMap, errors::HANDLER, util::take::Take, Mark, Spanned, SyntaxContext,
+ DUMMY_SP,
};
use swc_ecma_ast::*;
use swc_ecma_transforms_base::helper;
@@ -83,9 +81,6 @@ impl PrivateKind {
}
pub(super) struct BrandCheckHandler<'a> {
- /// Private names used for brand checks.
- pub names: &'a mut AHashSet<JsWord>,
-
pub private: &'a PrivateRecord,
}
@@ -117,8 +112,6 @@ impl VisitMut for BrandCheckHandler<'_> {
}
}
- self.names.insert(n.id.sym.clone());
-
let (mark, kind, class_name) = self.private.get(&n.id);
if mark == Mark::root() {
@@ -596,7 +589,11 @@ impl<'a> PrivateAccessVisitor<'a> {
}
let method_name = Ident::new(
- n.id.sym.clone(),
+ if n.id.is_reserved_in_any() {
+ format!("__{}", n.id.sym).into()
+ } else {
+ n.id.sym.clone()
+ },
n.id.span.with_ctxt(SyntaxContext::empty()).apply_mark(mark),
);
let ident = Ident::new(format!("_{}", n.id.sym).into(), n.id.span.apply_mark(mark));
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/loose_keyword_method.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/loose_keyword_method.js
new file mode 100644
index 000000000000..2dc61406e46e
--- /dev/null
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/loose_keyword_method.js
@@ -0,0 +1,24 @@
+var _switch = /*#__PURE__*/ _class_private_field_loose_key("_switch"), _bar = /*#__PURE__*/ _class_private_field_loose_key("_bar");
+class TestCls {
+ foo() {
+ _class_private_field_loose_base(this, _bar)[_bar]();
+ _class_private_field_loose_base(this, _switch)[_switch]();
+ }
+ constructor(){
+ Object.defineProperty(this, _switch, {
+ value: __switch
+ });
+ Object.defineProperty(this, _bar, {
+ value: bar
+ });
+ }
+}
+function __switch() {
+ console.log("#switch called");
+}
+function bar() {
+ console.log("#bar called");
+}
+export { TestCls };
+let a = new TestCls;
+a.foo();
diff --git a/crates/swc_ecma_transforms_compat/tests/class-properties/issue-8948/input.js b/crates/swc_ecma_transforms_compat/tests/class-properties/issue-8948/input.js
new file mode 100644
index 000000000000..1ac174f9e046
--- /dev/null
+++ b/crates/swc_ecma_transforms_compat/tests/class-properties/issue-8948/input.js
@@ -0,0 +1,16 @@
+class TestCls {
+ foo() {
+ this.#bar();
+ this.#switch();
+ }
+ #switch() {
+ console.log("#switch called");
+ }
+
+ #bar() {
+ console.log("#bar called");
+ }
+}
+
+let a = new TestCls();
+a.foo();
diff --git a/crates/swc_ecma_transforms_compat/tests/class-properties/issue-8948/output.js b/crates/swc_ecma_transforms_compat/tests/class-properties/issue-8948/output.js
new file mode 100644
index 000000000000..787b18303894
--- /dev/null
+++ b/crates/swc_ecma_transforms_compat/tests/class-properties/issue-8948/output.js
@@ -0,0 +1,19 @@
+var _switch = /*#__PURE__*/ new WeakSet(), _bar = /*#__PURE__*/ new WeakSet();
+class TestCls {
+ foo() {
+ _class_private_method_get(this, _bar, bar).call(this);
+ _class_private_method_get(this, _switch, __switch).call(this);
+ }
+ constructor(){
+ _class_private_method_init(this, _switch);
+ _class_private_method_init(this, _bar);
+ }
+}
+function __switch() {
+ console.log("#switch called");
+}
+function bar() {
+ console.log("#bar called");
+}
+let a = new TestCls();
+a.foo();
diff --git a/crates/swc_ecma_transforms_compat/tests/es2022_class_properties.rs b/crates/swc_ecma_transforms_compat/tests/es2022_class_properties.rs
index aa0f9ff31e4f..5ceb869d1f48 100644
--- a/crates/swc_ecma_transforms_compat/tests/es2022_class_properties.rs
+++ b/crates/swc_ecma_transforms_compat/tests/es2022_class_properties.rs
@@ -4831,6 +4831,46 @@ class Cl {
"#
);
+test!(
+ syntax(),
+ |t| {
+ let unresolved_mark = Mark::new();
+ let top_level_mark = Mark::new();
+
+ chain!(
+ resolver(unresolved_mark, top_level_mark, false),
+ class_properties(
+ Some(t.comments.clone()),
+ class_properties::Config {
+ private_as_properties: true,
+ ..Default::default()
+ },
+ unresolved_mark,
+ )
+ )
+ },
+ loose_keyword_method,
+ r##"
+class TestCls{
+ foo(){
+ this.#bar()
+ this.#switch()
+ }
+ #switch(){
+ console.log("#switch called")
+ }
+
+ #bar(){
+ console.log("#bar called")
+ }
+}
+export {TestCls}
+
+let a = new TestCls
+a.foo()
+"##
+);
+
#[testing::fixture("tests/classes/**/exec.js")]
fn exec(input: PathBuf) {
let src = read_to_string(input).unwrap();
|
unleash
|
https://github.com/Unleash/unleash
|
c4efaf827626ea30737ecfa88a883ee265a152fe
|
olav
|
2022-02-04 16:02:02
|
refactor: remove enzyme (#664)
|
* refactor: mock SVG imports in tests
* refactor: remove enzyme
|
refactor: remove enzyme (#664)
* refactor: mock SVG imports in tests
* refactor: remove enzyme
|
diff --git a/frontend/package.json b/frontend/package.json
index aeb074f10663..9aa2d78d8e9e 100644
--- a/frontend/package.json
+++ b/frontend/package.json
@@ -45,8 +45,6 @@
"@testing-library/user-event": "13.5.0",
"@types/debounce": "1.2.1",
"@types/deep-diff": "1.0.1",
- "@types/enzyme": "3.10.11",
- "@types/enzyme-adapter-react-16": "1.0.6",
"@types/jest": "27.4.0",
"@types/node": "14.18.10",
"@types/react": "17.0.39",
@@ -64,9 +62,6 @@
"date-fns": "2.28.0",
"debounce": "1.2.1",
"deep-diff": "1.0.2",
- "enzyme": "3.11.0",
- "enzyme-adapter-react-16": "1.15.6",
- "enzyme-to-json": "3.6.2",
"fast-json-patch": "3.1.0",
"fetch-mock": "9.11.0",
"http-proxy-middleware": "2.0.2",
@@ -83,6 +78,7 @@
"react-redux": "7.2.6",
"react-router-dom": "5.3.0",
"react-scripts": "4.0.3",
+ "react-test-renderer": "^16.14.0",
"react-timeago": "6.2.1",
"redux": "4.1.2",
"redux-devtools-extension": "2.13.9",
@@ -95,12 +91,10 @@
},
"jest": {
"moduleNameMapper": {
- "\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/src/__mocks__/fileMock.js",
+ "\\.(jpg|jpeg|png|gif|eot|otf|webp|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/src/__mocks__/fileMock.js",
+ "\\.svg": "<rootDir>/src/__mocks__/svgMock.js",
"\\.(css|scss)$": "identity-obj-proxy"
- },
- "snapshotSerializers": [
- "enzyme-to-json/serializer"
- ]
+ }
},
"browserslist": {
"production": [
diff --git a/frontend/src/__mocks__/svgMock.js b/frontend/src/__mocks__/svgMock.js
new file mode 100644
index 000000000000..13afca51d6fd
--- /dev/null
+++ b/frontend/src/__mocks__/svgMock.js
@@ -0,0 +1,2 @@
+export default 'SvgrURL'
+export const ReactComponent = 'div'
diff --git a/frontend/src/setupTests.ts b/frontend/src/setupTests.ts
index 80c5e9667818..38f5024be96c 100644
--- a/frontend/src/setupTests.ts
+++ b/frontend/src/setupTests.ts
@@ -1,6 +1,3 @@
import '@testing-library/jest-dom'
-import { configure } from 'enzyme';
-import Adapter from 'enzyme-adapter-react-16';
process.env.TZ = 'UTC';
-configure({ adapter: new Adapter() });
diff --git a/frontend/yarn.lock b/frontend/yarn.lock
index 804eb4d36e7f..1318ba78926b 100644
--- a/frontend/yarn.lock
+++ b/frontend/yarn.lock
@@ -1959,13 +1959,6 @@
dependencies:
"@babel/types" "^7.3.0"
-"@types/cheerio@*", "@types/cheerio@^0.22.22":
- version "0.22.28"
- resolved "https://registry.npmjs.org/@types/cheerio/-/cheerio-0.22.28.tgz"
- integrity sha512-ehUMGSW5IeDxJjbru4awKYMlKGmo1wSSGUVqXtYwlgmUM8X1a0PZttEIm6yEY7vHsY/hh6iPnklF213G0UColw==
- dependencies:
- "@types/node" "*"
-
"@types/[email protected]":
version "1.2.1"
resolved "https://registry.npmjs.org/@types/debounce/-/debounce-1.2.1.tgz"
@@ -1976,29 +1969,6 @@
resolved "https://registry.yarnpkg.com/@types/deep-diff/-/deep-diff-1.0.1.tgz#eae15119c68b72b541731872a2883da89dc39396"
integrity sha512-cZIq2GFcPmW0/M7dtLuphyoU8f3zpTcBgV+wkFFJ0CK0lwRVGGLaBSJZ98qs4LjtLimPq1Bb2VJnhGn6SEE4IA==
-"@types/[email protected]":
- version "1.0.6"
- resolved "https://registry.npmjs.org/@types/enzyme-adapter-react-16/-/enzyme-adapter-react-16-1.0.6.tgz"
- integrity sha512-VonDkZ15jzqDWL8mPFIQnnLtjwebuL9YnDkqeCDYnB4IVgwUm0mwKkqhrxLL6mb05xm7qqa3IE95m8CZE9imCg==
- dependencies:
- "@types/enzyme" "*"
-
-"@types/enzyme@*":
- version "3.10.8"
- resolved "https://registry.npmjs.org/@types/enzyme/-/enzyme-3.10.8.tgz"
- integrity sha512-vlOuzqsTHxog6PV79+tvOHFb6hq4QZKMq1lLD9MaWD1oec2lHTKndn76XOpSwCA0oFTaIbKVPrgM3k78Jjd16g==
- dependencies:
- "@types/cheerio" "*"
- "@types/react" "*"
-
-"@types/[email protected]":
- version "3.10.11"
- resolved "https://registry.yarnpkg.com/@types/enzyme/-/enzyme-3.10.11.tgz#8924bd92cc63ac1843e215225dfa8f71555fe814"
- integrity sha512-LEtC7zXsQlbGXWGcnnmOI7rTyP+i1QzQv4Va91RKXDEukLDaNyxu0rXlfMiGEhJwfgTPCTb0R+Pnlj//oM9e/w==
- dependencies:
- "@types/cheerio" "*"
- "@types/react" "*"
-
"@types/eslint@^7.2.6":
version "7.2.8"
resolved "https://registry.npmjs.org/@types/eslint/-/eslint-7.2.8.tgz"
@@ -2671,7 +2641,7 @@ aggregate-error@^3.0.0:
clean-stack "^2.0.0"
indent-string "^4.0.0"
-airbnb-prop-types@^2.15.0, airbnb-prop-types@^2.16.0:
+airbnb-prop-types@^2.15.0:
version "2.16.0"
resolved "https://registry.npmjs.org/airbnb-prop-types/-/airbnb-prop-types-2.16.0.tgz"
integrity sha512-7WHOFolP/6cS96PhKNrslCLMYAI8yB1Pp6u6XmxozQOiZbsI5ycglZr5cHhBFfuRcQQjzCMith5ZPZdYiJCxUg==
@@ -2856,11 +2826,6 @@ arr-union@^3.1.0:
resolved "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz"
integrity sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=
-array-filter@^1.0.0:
- version "1.0.0"
- resolved "https://registry.npmjs.org/array-filter/-/array-filter-1.0.0.tgz"
- integrity sha1-uveeYubvTCpMC4MSMtr/7CUfnYM=
-
[email protected]:
version "1.1.1"
resolved "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz"
@@ -3736,30 +3701,6 @@ check-types@^11.1.1:
resolved "https://registry.npmjs.org/check-types/-/check-types-11.1.2.tgz"
integrity sha512-tzWzvgePgLORb9/3a0YenggReLKAIb2owL03H2Xdoe5pKcUyWRSEQ8xfCar8t2SIAuEDwtmx2da1YB52YuHQMQ==
-cheerio-select-tmp@^0.1.0:
- version "0.1.1"
- resolved "https://registry.npmjs.org/cheerio-select-tmp/-/cheerio-select-tmp-0.1.1.tgz"
- integrity sha512-YYs5JvbpU19VYJyj+F7oYrIE2BOll1/hRU7rEy/5+v9BzkSo3bK81iAeeQEMI92vRIxz677m72UmJUiVwwgjfQ==
- dependencies:
- css-select "^3.1.2"
- css-what "^4.0.0"
- domelementtype "^2.1.0"
- domhandler "^4.0.0"
- domutils "^2.4.4"
-
-cheerio@^1.0.0-rc.3:
- version "1.0.0-rc.5"
- resolved "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.5.tgz"
- integrity sha512-yoqps/VCaZgN4pfXtenwHROTp8NG6/Hlt4Jpz2FEP0ZJQ+ZUkVDd0hAPDNKhj3nakpfPt/CNs57yEtxD1bXQiw==
- dependencies:
- cheerio-select-tmp "^0.1.0"
- dom-serializer "~1.2.0"
- domhandler "^4.0.0"
- entities "~2.1.0"
- htmlparser2 "^6.0.0"
- parse5 "^6.0.0"
- parse5-htmlparser2-tree-adapter "^6.0.0"
-
"chokidar@>=3.0.0 <4.0.0":
version "3.5.2"
resolved "https://registry.npmjs.org/chokidar/-/chokidar-3.5.2.tgz"
@@ -4013,7 +3954,7 @@ combined-stream@^1.0.6, combined-stream@~1.0.6:
dependencies:
delayed-stream "~1.0.0"
-commander@^2.19.0, commander@^2.20.0:
+commander@^2.20.0:
version "2.20.3"
resolved "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz"
integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==
@@ -4399,17 +4340,6 @@ css-select@^2.0.0, css-select@^2.0.2:
domutils "^1.7.0"
nth-check "^1.0.2"
-css-select@^3.1.2:
- version "3.1.2"
- resolved "https://registry.npmjs.org/css-select/-/css-select-3.1.2.tgz"
- integrity sha512-qmss1EihSuBNWNNhHjxzxSfJoFBM/lERB/Q4EnsJQQC62R2evJDW481091oAdOr9uh46/0n4nrg0It5cAnj1RA==
- dependencies:
- boolbase "^1.0.0"
- css-what "^4.0.0"
- domhandler "^4.0.0"
- domutils "^2.4.3"
- nth-check "^2.0.0"
-
[email protected]:
version "1.0.0-alpha.37"
resolved "https://registry.npmjs.org/css-tree/-/css-tree-1.0.0-alpha.37.tgz"
@@ -4439,11 +4369,6 @@ css-what@^3.2.1:
resolved "https://registry.npmjs.org/css-what/-/css-what-3.4.2.tgz"
integrity sha512-ACUm3L0/jiZTqfzRM3Hi9Q8eZqd6IK37mMWPLz9PJxkLWllYeRf+EHUSHYEtFop2Eqytaq1FizFVh7XfBnXCDQ==
-css-what@^4.0.0:
- version "4.0.0"
- resolved "https://registry.npmjs.org/css-what/-/css-what-4.0.0.tgz"
- integrity sha512-teijzG7kwYfNVsUh2H/YN62xW3KK9YhXEgSlbxMlcyjPNvdKJqFx5lrwlJgoFP1ZHlB89iGDlo/JyshKeRhv5A==
-
css.escape@^1.5.1:
version "1.5.1"
resolved "https://registry.npmjs.org/css.escape/-/css.escape-1.5.1.tgz"
@@ -4879,11 +4804,6 @@ dir-glob@^3.0.1:
dependencies:
path-type "^4.0.0"
[email protected]:
- version "1.0.0"
- resolved "https://registry.npmjs.org/discontinuous-range/-/discontinuous-range-1.0.0.tgz"
- integrity sha1-44Mx8IRLukm5qctxx3FYWqsbxlo=
-
[email protected]:
version "14.0.1"
resolved "https://registry.npmjs.org/dnd-core/-/dnd-core-14.0.1.tgz"
@@ -4970,15 +4890,6 @@ dom-serializer@0:
domelementtype "^2.0.1"
entities "^2.0.0"
-dom-serializer@^1.0.1, dom-serializer@~1.2.0:
- version "1.2.0"
- resolved "https://registry.npmjs.org/dom-serializer/-/dom-serializer-1.2.0.tgz"
- integrity sha512-n6kZFH/KlCrqs/1GHMOd5i2fd/beQHuehKdWvNNffbGHTr/almdhuVvTVFb3V7fglz+nC50fFusu3lY33h12pA==
- dependencies:
- domelementtype "^2.0.1"
- domhandler "^4.0.0"
- entities "^2.0.0"
-
domain-browser@^1.1.1:
version "1.2.0"
resolved "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz"
@@ -4989,7 +4900,7 @@ domelementtype@1, domelementtype@^1.3.1:
resolved "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz"
integrity sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==
-domelementtype@^2.0.1, domelementtype@^2.1.0, domelementtype@^2.2.0:
+domelementtype@^2.0.1:
version "2.2.0"
resolved "https://registry.npmjs.org/domelementtype/-/domelementtype-2.2.0.tgz"
integrity sha512-DtBMo82pv1dFtUmHyr48beiuq792Sxohr+8Hm9zoxklYPfa6n0Z3Byjj2IV7bmr2IyqClnqEQhfgHJJ5QF0R5A==
@@ -5008,13 +4919,6 @@ domhandler@^2.3.0:
dependencies:
domelementtype "1"
-domhandler@^4.0.0, domhandler@^4.1.0:
- version "4.1.0"
- resolved "https://registry.npmjs.org/domhandler/-/domhandler-4.1.0.tgz"
- integrity sha512-/6/kmsGlMY4Tup/nGVutdrK9yQi4YjWVcVeoQmixpzjOUK1U7pQkvAPHBJeUxOgxF0J8f8lwCJSlCfD0V4CMGQ==
- dependencies:
- domelementtype "^2.2.0"
-
domutils@^1.5.1, domutils@^1.7.0:
version "1.7.0"
resolved "https://registry.npmjs.org/domutils/-/domutils-1.7.0.tgz"
@@ -5023,15 +4927,6 @@ domutils@^1.5.1, domutils@^1.7.0:
dom-serializer "0"
domelementtype "1"
-domutils@^2.4.3, domutils@^2.4.4:
- version "2.5.1"
- resolved "https://registry.npmjs.org/domutils/-/domutils-2.5.1.tgz"
- integrity sha512-hO1XwHMGAthA/1KL7c83oip/6UWo3FlUNIuWiWKltoiQ5oCOiqths8KknvY2jpOohUoUgnwa/+Rm7UpwpSbY/Q==
- dependencies:
- dom-serializer "^1.0.1"
- domelementtype "^2.2.0"
- domhandler "^4.1.0"
-
dot-case@^3.0.4:
version "3.0.4"
resolved "https://registry.npmjs.org/dot-case/-/dot-case-3.0.4.tgz"
@@ -5176,84 +5071,6 @@ entities@^2.0.0:
resolved "https://registry.npmjs.org/entities/-/entities-2.2.0.tgz"
integrity sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==
-entities@~2.1.0:
- version "2.1.0"
- resolved "https://registry.npmjs.org/entities/-/entities-2.1.0.tgz"
- integrity sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w==
-
[email protected]:
- version "1.15.6"
- resolved "https://registry.npmjs.org/enzyme-adapter-react-16/-/enzyme-adapter-react-16-1.15.6.tgz"
- integrity sha512-yFlVJCXh8T+mcQo8M6my9sPgeGzj85HSHi6Apgf1Cvq/7EL/J9+1JoJmJsRxZgyTvPMAqOEpRSu/Ii/ZpyOk0g==
- dependencies:
- enzyme-adapter-utils "^1.14.0"
- enzyme-shallow-equal "^1.0.4"
- has "^1.0.3"
- object.assign "^4.1.2"
- object.values "^1.1.2"
- prop-types "^15.7.2"
- react-is "^16.13.1"
- react-test-renderer "^16.0.0-0"
- semver "^5.7.0"
-
-enzyme-adapter-utils@^1.14.0:
- version "1.14.0"
- resolved "https://registry.npmjs.org/enzyme-adapter-utils/-/enzyme-adapter-utils-1.14.0.tgz"
- integrity sha512-F/z/7SeLt+reKFcb7597IThpDp0bmzcH1E9Oabqv+o01cID2/YInlqHbFl7HzWBl4h3OdZYedtwNDOmSKkk0bg==
- dependencies:
- airbnb-prop-types "^2.16.0"
- function.prototype.name "^1.1.3"
- has "^1.0.3"
- object.assign "^4.1.2"
- object.fromentries "^2.0.3"
- prop-types "^15.7.2"
- semver "^5.7.1"
-
-enzyme-shallow-equal@^1.0.1, enzyme-shallow-equal@^1.0.4:
- version "1.0.4"
- resolved "https://registry.npmjs.org/enzyme-shallow-equal/-/enzyme-shallow-equal-1.0.4.tgz"
- integrity sha512-MttIwB8kKxypwHvRynuC3ahyNc+cFbR8mjVIltnmzQ0uKGqmsfO4bfBuLxb0beLNPhjblUEYvEbsg+VSygvF1Q==
- dependencies:
- has "^1.0.3"
- object-is "^1.1.2"
-
[email protected]:
- version "3.6.2"
- resolved "https://registry.npmjs.org/enzyme-to-json/-/enzyme-to-json-3.6.2.tgz"
- integrity sha512-Ynm6Z6R6iwQ0g2g1YToz6DWhxVnt8Dy1ijR2zynRKxTyBGA8rCDXU3rs2Qc4OKvUvc2Qoe1bcFK6bnPs20TrTg==
- dependencies:
- "@types/cheerio" "^0.22.22"
- lodash "^4.17.21"
- react-is "^16.12.0"
-
[email protected]:
- version "3.11.0"
- resolved "https://registry.npmjs.org/enzyme/-/enzyme-3.11.0.tgz"
- integrity sha512-Dw8/Gs4vRjxY6/6i9wU0V+utmQO9kvh9XLnz3LIudviOnVYDEe2ec+0k+NQoMamn1VrjKgCUOWj5jG/5M5M0Qw==
- dependencies:
- array.prototype.flat "^1.2.3"
- cheerio "^1.0.0-rc.3"
- enzyme-shallow-equal "^1.0.1"
- function.prototype.name "^1.1.2"
- has "^1.0.3"
- html-element-map "^1.2.0"
- is-boolean-object "^1.0.1"
- is-callable "^1.1.5"
- is-number-object "^1.0.4"
- is-regex "^1.0.5"
- is-string "^1.0.5"
- is-subset "^0.1.1"
- lodash.escape "^4.0.1"
- lodash.isequal "^4.5.0"
- object-inspect "^1.7.0"
- object-is "^1.0.2"
- object.assign "^4.1.0"
- object.entries "^1.1.1"
- object.values "^1.1.1"
- raf "^3.4.1"
- rst-selector-parser "^2.2.3"
- string.prototype.trim "^1.2.1"
-
errno@^0.1.3, errno@~0.1.7:
version "0.1.8"
resolved "https://registry.npmjs.org/errno/-/errno-0.1.8.tgz"
@@ -6150,7 +5967,7 @@ function-bind@^1.1.1:
resolved "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz"
integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==
-function.prototype.name@^1.1.2, function.prototype.name@^1.1.3:
+function.prototype.name@^1.1.2:
version "1.1.4"
resolved "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.4.tgz"
integrity sha512-iqy1pIotY/RmhdFZygSSlW0wko2yxkSCKqsuv4pr8QESohpYyG/Z7B/XXvPRKTJS//960rgguE5mSRUsDdaJrQ==
@@ -6530,14 +6347,6 @@ html-comment-regex@^1.1.0:
resolved "https://registry.npmjs.org/html-comment-regex/-/html-comment-regex-1.1.2.tgz"
integrity sha512-P+M65QY2JQ5Y0G9KKdlDpo0zK+/OHptU5AaBwUfAIDJZk1MYf32Frm84EcOytfJE0t5JvkAnKlmjsXDnWzCJmQ==
-html-element-map@^1.2.0:
- version "1.3.0"
- resolved "https://registry.npmjs.org/html-element-map/-/html-element-map-1.3.0.tgz"
- integrity sha512-AqCt/m9YaiMwaaAyOPdq4Ga0cM+jdDWWGueUMkdROZcTeClaGpN0AQeyGchZhTegQoABmc6+IqH7oCR/8vhQYg==
- dependencies:
- array-filter "^1.0.0"
- call-bind "^1.0.2"
-
html-encoding-sniffer@^2.0.1:
version "2.0.1"
resolved "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz"
@@ -6595,16 +6404,6 @@ htmlparser2@^3.10.1:
inherits "^2.0.1"
readable-stream "^3.1.1"
-htmlparser2@^6.0.0:
- version "6.0.1"
- resolved "https://registry.npmjs.org/htmlparser2/-/htmlparser2-6.0.1.tgz"
- integrity sha512-GDKPd+vk4jvSuvCbyuzx/unmXkk090Azec7LovXP8as1Hn8q9p3hbjmDGbUqqhknw0ajwit6LiiWqfiTUPMK7w==
- dependencies:
- domelementtype "^2.0.1"
- domhandler "^4.0.0"
- domutils "^2.4.4"
- entities "^2.0.0"
-
http-deceiver@^1.2.7:
version "1.2.7"
resolved "https://registry.npmjs.org/http-deceiver/-/http-deceiver-1.2.7.tgz"
@@ -6955,7 +6754,7 @@ is-binary-path@~2.1.0:
dependencies:
binary-extensions "^2.0.0"
-is-boolean-object@^1.0.1, is-boolean-object@^1.1.0:
+is-boolean-object@^1.1.0:
version "1.1.0"
resolved "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.0.tgz"
integrity sha512-a7Uprx8UtD+HWdyYwnD1+ExtTgqQtD2k/1yJgtXP6wnMm8byhkoTZRl+95LLThpzNZJ5aEvi46cdH+ayMFRwmA==
@@ -6967,7 +6766,7 @@ is-buffer@^1.1.5:
resolved "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz"
integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==
-is-callable@^1.1.4, is-callable@^1.1.5, is-callable@^1.2.3:
+is-callable@^1.1.4, is-callable@^1.2.3:
version "1.2.3"
resolved "https://registry.npmjs.org/is-callable/-/is-callable-1.2.3.tgz"
integrity sha512-J1DcMe8UYTBSrKezuIUTUwjXsho29693unXM2YhJUTR2txK/eG47bvNa/wipPFmZFgr/N6f1GA66dv0mEyTIyQ==
@@ -7194,7 +6993,7 @@ is-potential-custom-element-name@^1.0.0:
resolved "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.0.tgz"
integrity sha1-DFLlS8yjkbssSUsh6GJtczbG45c=
-is-regex@^1.0.4, is-regex@^1.0.5, is-regex@^1.1.0, is-regex@^1.1.2:
+is-regex@^1.0.4, is-regex@^1.1.0, is-regex@^1.1.2:
version "1.1.2"
resolved "https://registry.npmjs.org/is-regex/-/is-regex-1.1.2.tgz"
integrity sha512-axvdhb5pdhEVThqJzYXwMlVuZwC+FF2DpcOhTS+y/8jVq4trxyPgfcwIxIKiyeuLlSQYKkmUaPQJ8ZE4yNKXDg==
@@ -8203,21 +8002,11 @@ lodash.debounce@^4.0.8:
resolved "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz"
integrity sha1-gteb/zCmfEAF/9XiUVMArZyk168=
-lodash.escape@^4.0.1:
- version "4.0.1"
- resolved "https://registry.npmjs.org/lodash.escape/-/lodash.escape-4.0.1.tgz"
- integrity sha1-yQRGkMIeBClL6qUXcS/e0fqI3pg=
-
lodash.flatten@^4.4.0:
version "4.4.0"
resolved "https://registry.npmjs.org/lodash.flatten/-/lodash.flatten-4.4.0.tgz"
integrity sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8=
-lodash.flattendeep@^4.4.0:
- version "4.4.0"
- resolved "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz"
- integrity sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI=
-
[email protected]:
version "3.5.0"
resolved "https://registry.npmjs.org/lodash.flow/-/lodash.flow-3.5.0.tgz"
@@ -8619,11 +8408,6 @@ mkdirp@^1.0.3, mkdirp@^1.0.4:
resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz"
integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==
-moo@^0.5.0:
- version "0.5.1"
- resolved "https://registry.npmjs.org/moo/-/moo-0.5.1.tgz"
- integrity sha512-I1mnb5xn4fO80BH9BLcF0yLypy2UKl+Cb01Fu0hJRkJjlCRtxZMWkTdAtDd5ZqCOxtCkhmRwyI57vWT+1iZ67w==
-
move-concurrently@^1.0.1:
version "1.0.1"
resolved "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz"
@@ -8723,16 +8507,6 @@ natural-compare@^1.4.0:
resolved "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz"
integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=
-nearley@^2.7.10:
- version "2.20.1"
- resolved "https://registry.npmjs.org/nearley/-/nearley-2.20.1.tgz"
- integrity sha512-+Mc8UaAebFzgV+KpI5n7DasuuQCHA89dmwm7JXw3TV43ukfNQ9DnBH3Mdb2g/I4Fdxc26pwimBWvjIw0UAILSQ==
- dependencies:
- commander "^2.19.0"
- moo "^0.5.0"
- railroad-diagrams "^1.0.0"
- randexp "0.4.6"
-
[email protected]:
version "0.6.2"
resolved "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz"
@@ -8892,13 +8666,6 @@ nth-check@^1.0.2:
dependencies:
boolbase "~1.0.0"
-nth-check@^2.0.0:
- version "2.0.0"
- resolved "https://registry.npmjs.org/nth-check/-/nth-check-2.0.0.tgz"
- integrity sha512-i4sc/Kj8htBrAiH1viZ0TgU8Y5XqCaV/FziYK6TBczxmeKm3AEFWqqF3195yKudrarqy7Zu80Ra5dobFjn9X/Q==
- dependencies:
- boolbase "^1.0.0"
-
num2fraction@^1.2.2:
version "1.2.2"
resolved "https://registry.npmjs.org/num2fraction/-/num2fraction-1.2.2.tgz"
@@ -8928,12 +8695,12 @@ object-copy@^0.1.0:
define-property "^0.2.5"
kind-of "^3.0.3"
-object-inspect@^1.7.0, object-inspect@^1.9.0:
+object-inspect@^1.9.0:
version "1.9.0"
resolved "https://registry.npmjs.org/object-inspect/-/object-inspect-1.9.0.tgz"
integrity sha512-i3Bp9iTqwhaLZBxGkRfo5ZbE07BQRT7MGu8+nNgwW9ItGp1TzCTw2DLEoWwjClxBjOFI/hWljTAmYGCEwmtnOw==
-object-is@^1.0.1, object-is@^1.0.2, object-is@^1.1.2:
+object-is@^1.0.1, object-is@^1.1.2:
version "1.1.5"
resolved "https://registry.npmjs.org/object-is/-/object-is-1.1.5.tgz"
integrity sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw==
@@ -8963,7 +8730,7 @@ object.assign@^4.1.0, object.assign@^4.1.2:
has-symbols "^1.0.1"
object-keys "^1.1.1"
-object.entries@^1.1.0, object.entries@^1.1.1, object.entries@^1.1.2, object.entries@^1.1.3:
+object.entries@^1.1.0, object.entries@^1.1.2, object.entries@^1.1.3:
version "1.1.3"
resolved "https://registry.npmjs.org/object.entries/-/object.entries-1.1.3.tgz"
integrity sha512-ym7h7OZebNS96hn5IJeyUmaWhaSM4SVtAPPfNLQEI2MYWCO2egsITb9nab2+i/Pwibx+R0mtn+ltKJXRSeTMGg==
@@ -8973,7 +8740,7 @@ object.entries@^1.1.0, object.entries@^1.1.1, object.entries@^1.1.2, object.entr
es-abstract "^1.18.0-next.1"
has "^1.0.3"
-object.fromentries@^2.0.3, object.fromentries@^2.0.4:
+object.fromentries@^2.0.4:
version "2.0.4"
resolved "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.4.tgz"
integrity sha512-EsFBshs5RUUpQEY1D4q/m59kMfz4YJvxuNCJcv/jWwOJr34EaVnG11ZrZa0UHB3wnzV1wx8m58T4hQL8IuNXlQ==
@@ -8999,7 +8766,7 @@ object.pick@^1.3.0:
dependencies:
isobject "^3.0.1"
-object.values@^1.1.0, object.values@^1.1.1, object.values@^1.1.2, object.values@^1.1.3:
+object.values@^1.1.0, object.values@^1.1.1, object.values@^1.1.3:
version "1.1.3"
resolved "https://registry.npmjs.org/object.values/-/object.values-1.1.3.tgz"
integrity sha512-nkF6PfDB9alkOUxpf1HNm/QlkeW3SReqL5WXeBLpEJJnlPSvRaDQpW3gQTksTN3fgJX4hL42RzKyOin6ff3tyw==
@@ -9250,14 +9017,7 @@ parse-json@^5.0.0:
json-parse-even-better-errors "^2.3.0"
lines-and-columns "^1.1.6"
-parse5-htmlparser2-tree-adapter@^6.0.0:
- version "6.0.1"
- resolved "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-6.0.1.tgz"
- integrity sha512-qPuWvbLgvDGilKc5BoicRovlT4MtYT6JfJyBOMDsKoiT+GiuP5qyrPCnR9HcPECIJJmZh5jRndyNThnhhb/vlA==
- dependencies:
- parse5 "^6.0.1"
-
[email protected], parse5@^6.0.0, parse5@^6.0.1:
[email protected]:
version "6.0.1"
resolved "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz"
integrity sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==
@@ -10425,24 +10185,11 @@ raf@^3.4.1:
dependencies:
performance-now "^2.1.0"
-railroad-diagrams@^1.0.0:
- version "1.0.0"
- resolved "https://registry.npmjs.org/railroad-diagrams/-/railroad-diagrams-1.0.0.tgz"
- integrity sha1-635iZ1SN3t+4mcG5Dlc3RVnN234=
-
ramda@~0.27.1:
version "0.27.1"
resolved "https://registry.npmjs.org/ramda/-/ramda-0.27.1.tgz"
integrity sha512-PgIdVpn5y5Yns8vqb8FzBUEYn98V3xcPgawAkkgj0YJ0qDsnHCiNmZYfOGMgOvoB0eWFLpYbhxUR3mxfDIMvpw==
[email protected]:
- version "0.4.6"
- resolved "https://registry.npmjs.org/randexp/-/randexp-0.4.6.tgz"
- integrity sha512-80WNmd9DA0tmZrw9qQa62GPPWfuXJknrmVmLcxvq4uZBdYqb1wYoKTmnlGUchvVWe0XiLupYkBoXVOxz3C8DYQ==
- dependencies:
- discontinuous-range "1.0.0"
- ret "~0.1.10"
-
randombytes@^2.0.0, randombytes@^2.0.1, randombytes@^2.0.5, randombytes@^2.1.0:
version "2.1.0"
resolved "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz"
@@ -10547,7 +10294,7 @@ react-error-overlay@^6.0.9:
resolved "https://registry.npmjs.org/react-error-overlay/-/react-error-overlay-6.0.9.tgz"
integrity sha512-nQTTcUu+ATDbrSD1BZHr5kgSD4oF8OFjxun8uAaL8RwPBacGBNPf/yAuVVdx17N8XNzRDMrZ9XcKZHCjPW+9ew==
-react-is@^16.12.0, react-is@^16.13.1, react-is@^16.6.0, react-is@^16.7.0, react-is@^16.8.1, react-is@^16.8.6:
+react-is@^16.13.1, react-is@^16.6.0, react-is@^16.7.0, react-is@^16.8.1, react-is@^16.8.6:
version "16.13.1"
resolved "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz"
integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==
@@ -10680,9 +10427,9 @@ [email protected]:
optionalDependencies:
fsevents "^2.1.3"
-react-test-renderer@^16.0.0-0:
+react-test-renderer@^16.14.0:
version "16.14.0"
- resolved "https://registry.npmjs.org/react-test-renderer/-/react-test-renderer-16.14.0.tgz"
+ resolved "https://registry.yarnpkg.com/react-test-renderer/-/react-test-renderer-16.14.0.tgz#e98360087348e260c56d4fe2315e970480c228ae"
integrity sha512-L8yPjqPE5CZO6rKsKXRO/rVPiaCOy0tQQJbC+UjPNlobl5mad59lvPjwFsQHTvL03caVDIVr9x9/OSgDe6I5Eg==
dependencies:
object-assign "^4.1.1"
@@ -11214,14 +10961,6 @@ rollup@^1.31.1:
"@types/node" "*"
acorn "^7.1.0"
-rst-selector-parser@^2.2.3:
- version "2.2.3"
- resolved "https://registry.npmjs.org/rst-selector-parser/-/rst-selector-parser-2.2.3.tgz"
- integrity sha1-gbIw6i/MYGbInjRy3nlChdmwPZE=
- dependencies:
- lodash.flattendeep "^4.4.0"
- nearley "^2.7.10"
-
rsvp@^4.8.4:
version "4.8.5"
resolved "https://registry.npmjs.org/rsvp/-/rsvp-4.8.5.tgz"
@@ -11324,7 +11063,7 @@ saxes@^5.0.1:
scheduler@^0.19.1:
version "0.19.1"
- resolved "https://registry.npmjs.org/scheduler/-/scheduler-0.19.1.tgz"
+ resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.19.1.tgz#4f3e2ed2c1a7d65681f4c854fa8c5a1ccb40f196"
integrity sha512-n/zwRWRYSUj0/3g/otKDRPMh6qv2SYMWNq85IEa8iZyAv8od9zDYpGSnpBEjNgcMNq6Scbu5KfIPxNF72R/2EA==
dependencies:
loose-envify "^1.1.0"
@@ -11377,7 +11116,7 @@ selfsigned@^1.10.8:
dependencies:
node-forge "^0.10.0"
-"semver@2 || 3 || 4 || 5", semver@^5.4.1, semver@^5.5.0, semver@^5.5.1, semver@^5.6.0, semver@^5.7.0, semver@^5.7.1:
+"semver@2 || 3 || 4 || 5", semver@^5.4.1, semver@^5.5.0, semver@^5.5.1, semver@^5.6.0:
version "5.7.1"
resolved "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz"
integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==
@@ -11917,15 +11656,6 @@ string.prototype.matchall@^4.0.4:
regexp.prototype.flags "^1.3.1"
side-channel "^1.0.4"
-string.prototype.trim@^1.2.1:
- version "1.2.4"
- resolved "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.4.tgz"
- integrity sha512-hWCk/iqf7lp0/AgTF7/ddO1IWtSNPASjlzCicV5irAVdE1grjsneK26YG6xACMBEdCvO8fUST0UzDMh/2Qy+9Q==
- dependencies:
- call-bind "^1.0.2"
- define-properties "^1.1.3"
- es-abstract "^1.18.0-next.2"
-
string.prototype.trimend@^1.0.4:
version "1.0.4"
resolved "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz"
|
turborepo
|
https://github.com/vercel/turborepo
|
d968f7bf9b31481616a294221c4ff9db598331e1
|
Donny/강동윤
|
2023-12-22 08:45:24
|
perf: Use `&'static str` instead of `String` if possible (#6845)
|
### Description
The proc-macro generates all calls, so we don't need to allocate.
### Testing Instructions
Closes PACK-2177
|
perf: Use `&'static str` instead of `String` if possible (#6845)
### Description
The proc-macro generates all calls, so we don't need to allocate.
### Testing Instructions
Closes PACK-2177
|
diff --git a/crates/turbo-tasks/src/native_function.rs b/crates/turbo-tasks/src/native_function.rs
index 658b0c8549874..453a4aa63acfd 100644
--- a/crates/turbo-tasks/src/native_function.rs
+++ b/crates/turbo-tasks/src/native_function.rs
@@ -70,7 +70,7 @@ impl NativeFunction {
}
}
- pub fn register(&'static self, global_name: &str) {
+ pub fn register(&'static self, global_name: &'static str) {
register_function(global_name, self);
}
}
diff --git a/crates/turbo-tasks/src/registry.rs b/crates/turbo-tasks/src/registry.rs
index d722728dd9e0c..b120b99e149b8 100644
--- a/crates/turbo-tasks/src/registry.rs
+++ b/crates/turbo-tasks/src/registry.rs
@@ -11,42 +11,43 @@ use crate::{
};
static FUNCTION_ID_FACTORY: IdFactory<FunctionId> = IdFactory::new();
-static FUNCTIONS_BY_NAME: Lazy<DashMap<String, FunctionId>> = Lazy::new(DashMap::new);
+static FUNCTIONS_BY_NAME: Lazy<DashMap<&'static str, FunctionId>> = Lazy::new(DashMap::new);
static FUNCTIONS_BY_VALUE: Lazy<DashMap<&'static NativeFunction, FunctionId>> =
Lazy::new(DashMap::new);
-static FUNCTIONS: Lazy<NoMoveVec<(&'static NativeFunction, String)>> = Lazy::new(NoMoveVec::new);
+static FUNCTIONS: Lazy<NoMoveVec<(&'static NativeFunction, &'static str)>> =
+ Lazy::new(NoMoveVec::new);
static VALUE_TYPE_ID_FACTORY: IdFactory<ValueTypeId> = IdFactory::new();
-static VALUE_TYPES_BY_NAME: Lazy<DashMap<String, ValueTypeId>> = Lazy::new(DashMap::new);
+static VALUE_TYPES_BY_NAME: Lazy<DashMap<&'static str, ValueTypeId>> = Lazy::new(DashMap::new);
static VALUE_TYPES_BY_VALUE: Lazy<DashMap<&'static ValueType, ValueTypeId>> =
Lazy::new(DashMap::new);
-static VALUE_TYPES: Lazy<NoMoveVec<(&'static ValueType, String)>> = Lazy::new(NoMoveVec::new);
+static VALUE_TYPES: Lazy<NoMoveVec<(&'static ValueType, &'static str)>> = Lazy::new(NoMoveVec::new);
static TRAIT_TYPE_ID_FACTORY: IdFactory<TraitTypeId> = IdFactory::new();
-static TRAIT_TYPES_BY_NAME: Lazy<DashMap<String, TraitTypeId>> = Lazy::new(DashMap::new);
+static TRAIT_TYPES_BY_NAME: Lazy<DashMap<&'static str, TraitTypeId>> = Lazy::new(DashMap::new);
static TRAIT_TYPES_BY_VALUE: Lazy<DashMap<&'static TraitType, TraitTypeId>> =
Lazy::new(DashMap::new);
-static TRAIT_TYPES: Lazy<NoMoveVec<(&'static TraitType, String)>> = Lazy::new(NoMoveVec::new);
+static TRAIT_TYPES: Lazy<NoMoveVec<(&'static TraitType, &'static str)>> = Lazy::new(NoMoveVec::new);
fn register_thing<
K: From<usize> + Deref<Target = usize> + Sync + Send + Copy,
V: Clone + Hash + Ord + Eq + Sync + Send + Copy,
const INITIAL_CAPACITY_BITS: u32,
>(
- global_name: &str,
+ global_name: &'static str,
value: V,
id_factory: &IdFactory<K>,
- store: &NoMoveVec<(V, String), INITIAL_CAPACITY_BITS>,
- map_by_name: &DashMap<String, K>,
+ store: &NoMoveVec<(V, &'static str), INITIAL_CAPACITY_BITS>,
+ map_by_name: &DashMap<&'static str, K>,
map_by_value: &DashMap<V, K>,
) {
if let Entry::Vacant(e) = map_by_value.entry(value) {
let new_id = id_factory.get();
// SAFETY: this is a fresh id
unsafe {
- store.insert(*new_id, (value, global_name.to_string()));
+ store.insert(*new_id, (value, global_name));
}
- map_by_name.insert(global_name.to_string(), new_id);
+ map_by_name.insert(global_name, new_id);
e.insert(new_id);
}
}
@@ -65,7 +66,7 @@ fn get_thing_id<
}
}
-pub fn register_function(global_name: &str, func: &'static NativeFunction) {
+pub fn register_function(global_name: &'static str, func: &'static NativeFunction) {
register_thing(
global_name,
func,
@@ -89,10 +90,10 @@ pub fn get_function(id: FunctionId) -> &'static NativeFunction {
}
pub fn get_function_global_name(id: FunctionId) -> &'static str {
- &FUNCTIONS.get(*id).unwrap().1
+ FUNCTIONS.get(*id).unwrap().1
}
-pub fn register_value_type(global_name: &str, ty: &'static ValueType) {
+pub fn register_value_type(global_name: &'static str, ty: &'static ValueType) {
register_thing(
global_name,
ty,
@@ -116,10 +117,10 @@ pub fn get_value_type(id: ValueTypeId) -> &'static ValueType {
}
pub fn get_value_type_global_name(id: ValueTypeId) -> &'static str {
- &VALUE_TYPES.get(*id).unwrap().1
+ VALUE_TYPES.get(*id).unwrap().1
}
-pub fn register_trait_type(global_name: &str, ty: &'static TraitType) {
+pub fn register_trait_type(global_name: &'static str, ty: &'static TraitType) {
register_thing(
global_name,
ty,
@@ -143,5 +144,5 @@ pub fn get_trait(id: TraitTypeId) -> &'static TraitType {
}
pub fn get_trait_type_global_name(id: TraitTypeId) -> &'static str {
- &TRAIT_TYPES.get(*id).unwrap().1
+ TRAIT_TYPES.get(*id).unwrap().1
}
diff --git a/crates/turbo-tasks/src/value_type.rs b/crates/turbo-tasks/src/value_type.rs
index 1a637f935ddd9..14a5d57ea4f77 100644
--- a/crates/turbo-tasks/src/value_type.rs
+++ b/crates/turbo-tasks/src/value_type.rs
@@ -192,7 +192,7 @@ impl ValueType {
self.traits.iter().copied()
}
- pub fn register(&'static self, global_name: &str) {
+ pub fn register(&'static self, global_name: &'static str) {
register_value_type(global_name, self)
}
}
@@ -251,7 +251,7 @@ impl TraitType {
self.default_trait_methods.insert(name, native_fn);
}
- pub fn register(&'static self, global_name: &str) {
+ pub fn register(&'static self, global_name: &'static str) {
register_trait_type(global_name, self);
}
}
|
RxJava
|
https://github.com/ReactiveX/RxJava
|
8f51c27eb799f88cba710e0b5f316217e99e3cb9
|
dependabot[bot]
|
2025-01-27 14:34:04
|
chore(deps): bump ru.vyarus.animalsniffer from 1.7.2 to 2.0.0 (#7826)
|
Bumps ru.vyarus.animalsniffer from 1.7.2 to 2.0.0.
---
|
chore(deps): bump ru.vyarus.animalsniffer from 1.7.2 to 2.0.0 (#7826)
Bumps ru.vyarus.animalsniffer from 1.7.2 to 2.0.0.
---
updated-dependencies:
- dependency-name: ru.vyarus.animalsniffer
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
|
diff --git a/build.gradle b/build.gradle
index 60fd78db78..8e4eedfb68 100644
--- a/build.gradle
+++ b/build.gradle
@@ -4,7 +4,7 @@ plugins {
id("eclipse")
id("jacoco")
id("maven-publish")
- id("ru.vyarus.animalsniffer") version "1.7.2"
+ id("ru.vyarus.animalsniffer") version "2.0.0"
id("me.champeau.gradle.jmh") version "0.5.3"
id("com.github.hierynomus.license") version "0.16.1"
id("biz.aQute.bnd.builder") version "6.4.0"
|
pngquant
|
https://github.com/kornelski/pngquant
|
68a1bb0870624a54b053483daa10fc0cb85584dc
|
Levente Polyak
|
2021-08-08 00:01:53
|
fix: avoid unchecked nullptr deref on invalid lcms transform
|
On invalid data the requested transform from lcms may return nun
successfully. Hence we need to check the return value and early
the function to avoid a segfault.
To distinguish the concrete error, a new error code (45) has been
introduced.
|
fix: avoid unchecked nullptr deref on invalid lcms transform
On invalid data the requested transform from lcms may return nun
successfully. Hence we need to check the return value and early
the function to avoid a segfault.
To distinguish the concrete error, a new error code (45) has been
introduced.
Signed-off-by: Levente Polyak <[email protected]>
|
diff --git a/rust/ffi.rs b/rust/ffi.rs
index a57030d0..80126986 100644
--- a/rust/ffi.rs
+++ b/rust/ffi.rs
@@ -31,6 +31,7 @@ pub enum pngquant_error {
LIBPNG_FATAL_ERROR = 25,
WRONG_INPUT_COLOR_TYPE = 26,
LIBPNG_INIT_ERROR = 35,
+ LCMS_FATAL_ERROR = 45,
TOO_LARGE_FILE = 98,
TOO_LOW_QUALITY = 99,
}
diff --git a/rwpng.c b/rwpng.c
index df814ade..8405a3a2 100644
--- a/rwpng.c
+++ b/rwpng.c
@@ -376,6 +376,12 @@ static pngquant_error rwpng_read_image24_libpng(FILE *infile, png24_image *mainp
hOutProfile, TYPE_RGBA_8,
INTENT_PERCEPTUAL,
omp_get_max_threads() > 1 ? cmsFLAGS_NOCACHE : 0);
+ if(!hTransform) {
+ png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
+ cmsCloseProfile(hOutProfile);
+ cmsCloseProfile(hInProfile);
+ return LCMS_FATAL_ERROR;
+ }
#pragma omp parallel for \
if (mainprog_ptr->height*mainprog_ptr->width > 8000) \
diff --git a/rwpng.h b/rwpng.h
index dc935502..856029b7 100644
--- a/rwpng.h
+++ b/rwpng.h
@@ -32,6 +32,7 @@ typedef enum {
LIBPNG_FATAL_ERROR = 25,
WRONG_INPUT_COLOR_TYPE = 26,
LIBPNG_INIT_ERROR = 35,
+ LCMS_FATAL_ERROR = 45,
TOO_LARGE_FILE = 98,
TOO_LOW_QUALITY = 99,
} pngquant_error;
|
playwright
|
https://github.com/microsoft/playwright
|
120aaa777e98e6c69a916603c2683cb868e6018c
|
Dmitry Gozman
|
2023-03-25 03:33:49
|
fix(test runner): do not show TimeoutError for unhandled rejection (#21971)
|
Unhandled error/rejection interrupts current test and produces a
TimeoutError for it that should be ignored.
|
fix(test runner): do not show TimeoutError for unhandled rejection (#21971)
Unhandled error/rejection interrupts current test and produces a
TimeoutError for it that should be ignored.
|
diff --git a/packages/playwright-test/src/worker/testInfo.ts b/packages/playwright-test/src/worker/testInfo.ts
index 7d0c68954418f..9626552a04fae 100644
--- a/packages/playwright-test/src/worker/testInfo.ts
+++ b/packages/playwright-test/src/worker/testInfo.ts
@@ -53,6 +53,7 @@ export class TestInfoImpl implements TestInfo {
readonly _traceEvents: trace.TraceEvent[] = [];
readonly _onTestFailureImmediateCallbacks = new Map<() => Promise<void>, string>(); // fn -> title
_didTimeout = false;
+ _wasInterrupted = false;
_lastStepId = 0;
// ------------ TestInfo fields ------------
@@ -184,7 +185,7 @@ export class TestInfoImpl implements TestInfo {
const timeoutError = await this._timeoutManager.runWithTimeout(cb);
// When interrupting, we arrive here with a timeoutError, but we should not
// consider it a timeout.
- if (this.status !== 'interrupted' && timeoutError && !this._didTimeout) {
+ if (!this._wasInterrupted && timeoutError && !this._didTimeout) {
this._didTimeout = true;
this.errors.push(timeoutError);
// Do not overwrite existing failure upon hook/teardown timeout.
@@ -254,6 +255,15 @@ export class TestInfoImpl implements TestInfo {
return step;
}
+ _interrupt() {
+ // Mark as interrupted so we can ignore TimeoutError thrown by interrupt() call.
+ this._wasInterrupted = true;
+ this._timeoutManager.interrupt();
+ // Do not overwrite existing failure (for example, unhandled rejection) with "interrupted".
+ if (this.status === 'passed')
+ this.status = 'interrupted';
+ }
+
_failWithError(error: TestInfoError, isHardError: boolean) {
// Do not overwrite any previous hard errors.
// Some (but not all) scenarios include:
diff --git a/packages/playwright-test/src/worker/workerMain.ts b/packages/playwright-test/src/worker/workerMain.ts
index 32944326f2eb4..0c2fcc9015974 100644
--- a/packages/playwright-test/src/worker/workerMain.ts
+++ b/packages/playwright-test/src/worker/workerMain.ts
@@ -99,12 +99,7 @@ export class WorkerMain extends ProcessRunner {
private _stop(): Promise<void> {
if (!this._isStopped) {
this._isStopped = true;
-
- // Interrupt current action.
- this._currentTest?._timeoutManager.interrupt();
-
- if (this._currentTest && this._currentTest.status === 'passed')
- this._currentTest.status = 'interrupted';
+ this._currentTest?._interrupt();
}
return this._runFinished;
}
diff --git a/tests/playwright-test/basic.spec.ts b/tests/playwright-test/basic.spec.ts
index 2565c1a9d6288..cd56a0fd2d3d0 100644
--- a/tests/playwright-test/basic.spec.ts
+++ b/tests/playwright-test/basic.spec.ts
@@ -394,6 +394,24 @@ test('test.{skip,fixme} should define a skipped test', async ({ runInlineTest })
expect(result.output).not.toContain('%%dontseethis');
});
+test('should report unhandled error during test and not report timeout', async ({ runInlineTest }) => {
+ const result = await runInlineTest({
+ 'a.test.ts': `
+ import { test, expect } from '@playwright/test';
+ test('unhandled rejection', async () => {
+ setTimeout(() => {
+ throw new Error('Unhandled');
+ }, 0);
+ await new Promise(f => setTimeout(f, 100));
+ });
+ `,
+ });
+ expect(result.exitCode).toBe(1);
+ expect(result.failed).toBe(1);
+ expect(result.output).toContain('Error: Unhandled');
+ expect(result.output).not.toContain('Test timeout of 30000ms exceeded');
+});
+
test('should report unhandled rejection during worker shutdown', async ({ runInlineTest }) => {
const result = await runInlineTest({
'a.test.ts': `
|
azerothcore-wotlk
|
https://github.com/azerothcore/azerothcore-wotlk
|
df77b5f4f79dfee4dee4f01e7258e1b4e7c1b7e2
|
天鹿
|
2023-04-24 16:43:07
|
chore(core): cleanup code p3 (#16073)
|
* Update MMapMgr.cpp
* Update UpdateFetcher.cpp
* Update AuctionHouseMgr.cpp
* Update AuctionHouseMgr.h
* Update BattlegroundAV.cpp
* Update ChannelMgr.cpp
* Update ThreatMgr.h
* Update Player.h
* Update PlayerSettings.cpp
* Update ObjectMgr.cpp
* Update Guild.cpp
* Update Guild.h
* Update Map.cpp
* Update World.cpp
* Update boss_nefarian.cpp
* Update boss_prince_malchezaar.cpp
* Update boss_venoxis.cpp
* Update zone_elwynn_forest.cpp
* Update zulfarrak.cpp
* Update boss_novos.cpp
|
chore(core): cleanup code p3 (#16073)
* Update MMapMgr.cpp
* Update UpdateFetcher.cpp
* Update AuctionHouseMgr.cpp
* Update AuctionHouseMgr.h
* Update BattlegroundAV.cpp
* Update ChannelMgr.cpp
* Update ThreatMgr.h
* Update Player.h
* Update PlayerSettings.cpp
* Update ObjectMgr.cpp
* Update Guild.cpp
* Update Guild.h
* Update Map.cpp
* Update World.cpp
* Update boss_nefarian.cpp
* Update boss_prince_malchezaar.cpp
* Update boss_venoxis.cpp
* Update zone_elwynn_forest.cpp
* Update zulfarrak.cpp
* Update boss_novos.cpp
|
diff --git a/src/common/Collision/Management/MMapMgr.cpp b/src/common/Collision/Management/MMapMgr.cpp
index e1e64ac9f4d779..622220c5a39943 100644
--- a/src/common/Collision/Management/MMapMgr.cpp
+++ b/src/common/Collision/Management/MMapMgr.cpp
@@ -253,7 +253,7 @@ namespace MMAP
// unload all tiles from given map
MMapData* mmap = itr->second;
- for (auto i : mmap->loadedTileRefs)
+ for (auto& i : mmap->loadedTileRefs)
{
uint32 x = (i.first >> 16);
uint32 y = (i.first & 0x0000FFFF);
diff --git a/src/server/database/Updater/UpdateFetcher.cpp b/src/server/database/Updater/UpdateFetcher.cpp
index 97811954dfb2c4..3e128ebb56fa60 100644
--- a/src/server/database/Updater/UpdateFetcher.cpp
+++ b/src/server/database/Updater/UpdateFetcher.cpp
@@ -252,7 +252,7 @@ UpdateResult UpdateFetcher::Update(bool const redundancyChecks,
// Fill hash to name cache
HashToFileNameStorage hashToName;
- for (auto entry : applied)
+ for (auto& entry : applied)
hashToName.insert(std::make_pair(entry.second.hash, entry.first));
size_t importedUpdates = 0;
diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp
index 540158b39948dc..3fd3a373bd73e0 100644
--- a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp
+++ b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp
@@ -37,7 +37,7 @@ constexpr auto AH_MINIMUM_DEPOSIT = 100;
// Proof of concept, we should shift the info we're obtaining in here into AuctionEntry probably
static bool SortAuction(AuctionEntry* left, AuctionEntry* right, AuctionSortOrderVector& sortOrder, Player* player, bool checkMinBidBuyout)
{
- for (auto thisOrder : sortOrder)
+ for (auto& thisOrder : sortOrder)
{
switch (thisOrder.sortOrder)
{
@@ -908,7 +908,7 @@ bool AuctionHouseObject::BuildListAuctionItems(WorldPacket& data, Player* player
}
}
- for (auto auction : auctionShortlist)
+ for (auto& auction : auctionShortlist)
{
// Add the item if no search term or if entered search term was found
if (count < 50 && totalcount >= listfrom)
diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.h b/src/server/game/AuctionHouse/AuctionHouseMgr.h
index 829aa3c453d9a5..7c8fa5a4614057 100644
--- a/src/server/game/AuctionHouse/AuctionHouseMgr.h
+++ b/src/server/game/AuctionHouse/AuctionHouseMgr.h
@@ -133,7 +133,7 @@ class AuctionHouseObject
AuctionHouseObject() { _next = _auctionsMap.begin(); }
~AuctionHouseObject()
{
- for (auto & itr : _auctionsMap)
+ for (auto& itr : _auctionsMap)
delete itr.second;
}
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp
index 114b7d3c9c1a6f..c445ce9582361d 100644
--- a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp
@@ -1579,7 +1579,7 @@ void BattlegroundAV::ResetBGSubclass()
bool BattlegroundAV::IsBothMinesControlledByTeam(TeamId teamId) const
{
- for (auto mine : m_Mine_Owner)
+ for (auto& mine : m_Mine_Owner)
if (mine != teamId)
return false;
diff --git a/src/server/game/Chat/Channels/ChannelMgr.cpp b/src/server/game/Chat/Channels/ChannelMgr.cpp
index bd1f0a95212cc3..0e74a451af7722 100644
--- a/src/server/game/Chat/Channels/ChannelMgr.cpp
+++ b/src/server/game/Chat/Channels/ChannelMgr.cpp
@@ -106,7 +106,7 @@ void ChannelMgr::LoadChannels()
++count;
} while (result->NextRow());
- for (auto pair : toDelete)
+ for (auto& pair : toDelete)
{
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHANNEL);
stmt->SetData(0, pair.first);
diff --git a/src/server/game/Combat/ThreatMgr.h b/src/server/game/Combat/ThreatMgr.h
index 846a1fd2893a0e..bcc6d161421baf 100644
--- a/src/server/game/Combat/ThreatMgr.h
+++ b/src/server/game/Combat/ThreatMgr.h
@@ -259,7 +259,7 @@ class ThreatMgr
if (threatList.empty())
return;
- for (auto ref : threatList)
+ for (auto& ref : threatList)
{
if (predicate(ref->getTarget()))
{
diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h
index 98c25642652d63..ead737bce630a9 100644
--- a/src/server/game/Entities/Player/Player.h
+++ b/src/server/game/Entities/Player/Player.h
@@ -1801,7 +1801,7 @@ class Player : public Unit, public GridObject<Player>
{
Unit::SetPvP(state);
if (!m_Controlled.empty())
- for (auto itr : m_Controlled)
+ for (auto& itr : m_Controlled)
itr->SetPvP(state);
}
void UpdatePvP(bool state, bool _override = false);
diff --git a/src/server/game/Entities/Player/PlayerSettings.cpp b/src/server/game/Entities/Player/PlayerSettings.cpp
index 19f1619873a3ed..7e45d03db76e3f 100644
--- a/src/server/game/Entities/Player/PlayerSettings.cpp
+++ b/src/server/game/Entities/Player/PlayerSettings.cpp
@@ -48,7 +48,7 @@ void Player::_LoadCharacterSettings(PreparedQueryResult result)
uint32 count = 0;
- for (auto token : tokens)
+ for (auto& token : tokens)
{
if (token.empty())
{
@@ -95,11 +95,11 @@ void Player::_SavePlayerSettings(CharacterDatabaseTransaction trans)
return;
}
- for (auto itr : m_charSettingsMap)
+ for (auto& itr : m_charSettingsMap)
{
std::ostringstream data;
- for (auto setting : itr.second)
+ for (auto& setting : itr.second)
{
data << setting.value << ' ';
}
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index 5f1221fec8b834..e3176547d513fb 100644
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -948,7 +948,7 @@ void ObjectMgr::LoadCreatureCustomIDs()
std::string stringCreatureIds = sConfigMgr->GetOption<std::string>("Creatures.CustomIDs", "");
std::vector<std::string_view> CustomCreatures = Acore::Tokenize(stringCreatureIds, ',', false);
- for (auto itr : CustomCreatures)
+ for (auto& itr : CustomCreatures)
{
_creatureCustomIDsStore.push_back(Acore::StringTo<uint32>(itr).value());
}
@@ -1296,7 +1296,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
const_cast<CreatureTemplate*>(cInfo)->DamageModifier *= Creature::_GetDamageMod(cInfo->rank);
// Hack for modules
- for (auto itr : _creatureCustomIDsStore)
+ for (auto& itr : _creatureCustomIDsStore)
{
if (cInfo->Entry == itr)
return;
diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp
index aabe0c9c6a9eaa..85344f670ad354 100644
--- a/src/server/game/Guilds/Guild.cpp
+++ b/src/server/game/Guilds/Guild.cpp
@@ -1388,7 +1388,7 @@ void Guild::HandleSetRankInfo(WorldSession* session, uint8 rankId, std::string_v
rankInfo->SetRights(rights);
_SetRankBankMoneyPerDay(rankId, moneyPerDay);
- for (auto rightsAndSlot : rightsAndSlots)
+ for (auto& rightsAndSlot : rightsAndSlots)
_SetRankBankTabRightsAndSlots(rankId, rightsAndSlot);
_BroadcastEvent(GE_RANK_UPDATED, ObjectGuid::Empty, std::to_string(rankId), rankInfo->GetName(), std::to_string(m_ranks.size()));
@@ -2382,7 +2382,7 @@ void Guild::_CreateNewBankTab()
trans->Append(stmt);
++tabId;
- for (auto & m_rank : m_ranks)
+ for (auto& m_rank : m_ranks)
m_rank.CreateMissingTabsIfNeeded(tabId, trans, false);
CharacterDatabase.CommitTransaction(trans);
diff --git a/src/server/game/Guilds/Guild.h b/src/server/game/Guilds/Guild.h
index a4d8732352deee..3ed7e10ccbef56 100644
--- a/src/server/game/Guilds/Guild.h
+++ b/src/server/game/Guilds/Guild.h
@@ -393,7 +393,7 @@ class Guild
}
inline Member* GetMember(std::string_view name)
{
- for (auto & m_member : m_members)
+ for (auto& m_member : m_members)
if (m_member.second.GetName() == name)
return &m_member.second;
diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp
index 0b7520676ccea9..26c35ffdfed0c5 100644
--- a/src/server/game/Maps/Map.cpp
+++ b/src/server/game/Maps/Map.cpp
@@ -3820,7 +3820,7 @@ void Map::DoForAllPlayers(std::function<void(Player*)> exec)
bool Map::CanReachPositionAndGetValidCoords(WorldObject const* source, PathGenerator *path, float &destX, float &destY, float &destZ, bool failOnCollision, bool failOnSlopes) const
{
G3D::Vector3 prevPath = path->GetStartPosition();
- for (auto & vector : path->GetPath())
+ for (auto& vector : path->GetPath())
{
float x = vector.x;
float y = vector.y;
diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp
index ca0b3c20671269..61fe44ddb83356 100644
--- a/src/server/game/World/World.cpp
+++ b/src/server/game/World/World.cpp
@@ -1560,7 +1560,7 @@ void World::SetInitialWorldSettings()
sIPLocation->Load();
std::vector<uint32> mapIds;
- for (auto const map : sMapStore)
+ for (auto const& map : sMapStore)
{
mapIds.emplace_back(map->MapID);
}
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp
index e50e27af610780..8ebc9569b02e74 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp
@@ -1243,7 +1243,7 @@ class spell_shadowblink : public SpellScript
return;
}
- for (auto itr : spellPos)
+ for (auto& itr : spellPos)
{
float distTarget = target->GetDistance2d(itr.second.m_positionX, itr.second.m_positionY);
if (distTarget <= 30.f)
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp
index 5d9e76d65d1927..4394515042c376 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp
@@ -248,7 +248,7 @@ struct boss_malchezaar : public BossAI
void EnfeebleResetHealth()
{
- for (auto targets : _enfeebleTargets)
+ for (auto& targets : _enfeebleTargets)
{
if (Unit* target = ObjectAccessor::GetUnit(*me, targets.first))
{
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp
index eea96fa2412785..339ce76d9c95b4 100644
--- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp
@@ -131,7 +131,7 @@ class boss_venoxis : public CreatureScript
if (!cobraList.empty())
{
- for (auto cobras : cobraList)
+ for (auto& cobras : cobraList)
{
cobras->SetInCombatWithZone();
}
diff --git a/src/server/scripts/EasternKingdoms/zone_elwynn_forest.cpp b/src/server/scripts/EasternKingdoms/zone_elwynn_forest.cpp
index 97d60a0327a709..4936c6b3997e71 100644
--- a/src/server/scripts/EasternKingdoms/zone_elwynn_forest.cpp
+++ b/src/server/scripts/EasternKingdoms/zone_elwynn_forest.cpp
@@ -101,7 +101,7 @@ struct npc_cameron : public ScriptedAI
Acore::Containers::RandomShuffle(MovePosPositions);
// first we break formation because children will need to move on their own now
- for (auto guid : _childrenGUIDs)
+ for (auto& guid : _childrenGUIDs)
if (Creature* child = ObjectAccessor::GetCreature(*me, guid))
if (child->GetFormation())
child->GetFormation()->RemoveMember(child);
@@ -228,7 +228,7 @@ struct npc_cameron : public ScriptedAI
// If Formation was disbanded, remake.
if (!me->GetFormation()->IsFormed())
- for (auto guid : _childrenGUIDs)
+ for (auto& guid : _childrenGUIDs)
if (Creature* child = ObjectAccessor::GetCreature(*me, guid))
child->SearchFormation();
diff --git a/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp b/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp
index 608b9446b278ab..ce7a3af228113c 100644
--- a/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp
+++ b/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp
@@ -573,7 +573,7 @@ class npc_shadowpriest_sezziz : public CreatureScript
if (_summonAddsTimer <= diff)
{
- for (auto itr : shadowpriestSezzizAdds[_summmonAddsCount])
+ for (auto& itr : shadowpriestSezzizAdds[_summmonAddsCount])
{
if (Creature* add = me->SummonCreature(itr.first, itr.second, TEMPSUMMON_DEAD_DESPAWN, 10 * IN_MILLISECONDS))
{
diff --git a/src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp b/src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp
index 8d63edb50f24f2..7a7cabec9c715f 100644
--- a/src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp
+++ b/src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp
@@ -132,7 +132,7 @@ class boss_novos : public CreatureScript
me->CastSpell(me, SPELL_ARCANE_FIELD, true);
me->CastSpell(me, SPELL_DESPAWN_CRYSTAL_HANDLER, true);
- for (auto itr : npcSummon)
+ for (auto& itr : npcSummon)
{
uint32 summonEntry;
Position summonPos;
|
superset
|
https://github.com/apache/superset
|
7faa5c6aff3e5cc963309104376f4ee713450764
|
Kamil Gabryjelski
|
2021-09-07 14:49:07
|
perf(dashboard): reduce rerenders of DragDroppable (#16525)
|
* perf(dashboard): reduce rerenders of DragDroppable
* lint fix
|
perf(dashboard): reduce rerenders of DragDroppable (#16525)
* perf(dashboard): reduce rerenders of DragDroppable
* lint fix
|
diff --git a/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.tsx b/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.tsx
index cc897b8df5740..d16e76174d7a6 100644
--- a/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.tsx
+++ b/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.tsx
@@ -18,7 +18,7 @@
*/
/* eslint-env browser */
import cx from 'classnames';
-import React, { FC } from 'react';
+import React, { FC, useCallback, useMemo } from 'react';
import { JsonObject, styled, css } from '@superset-ui/core';
import ErrorBoundary from 'src/components/ErrorBoundary';
import BuilderComponentPane from 'src/dashboard/components/BuilderComponentPane';
@@ -157,15 +157,14 @@ const DashboardBuilder: FC<DashboardBuilderProps> = () => {
state => state.dashboardState.fullSizeChartId,
);
- const handleChangeTab = ({
- pathToTabIndex,
- }: {
- pathToTabIndex: string[];
- }) => {
- dispatch(setDirectPathToChild(pathToTabIndex));
- };
+ const handleChangeTab = useCallback(
+ ({ pathToTabIndex }: { pathToTabIndex: string[] }) => {
+ dispatch(setDirectPathToChild(pathToTabIndex));
+ },
+ [dispatch],
+ );
- const handleDeleteTopLevelTabs = () => {
+ const handleDeleteTopLevelTabs = useCallback(() => {
dispatch(deleteTopLevelTabs());
const firstTab = getDirectPathToTabIndex(
@@ -173,7 +172,12 @@ const DashboardBuilder: FC<DashboardBuilderProps> = () => {
0,
);
dispatch(setDirectPathToChild(firstTab));
- };
+ }, [dashboardLayout, dispatch]);
+
+ const handleDrop = useCallback(
+ dropResult => dispatch(handleComponentDrop(dropResult)),
+ [dispatch],
+ );
const dashboardRoot = dashboardLayout[DASHBOARD_ROOT_ID];
const rootChildId = dashboardRoot.children[0];
@@ -217,6 +221,54 @@ const DashboardBuilder: FC<DashboardBuilderProps> = () => {
const filterBarHeight = `calc(100vh - ${offset}px)`;
const filterBarOffset = dashboardFiltersOpen ? 0 : barTopOffset + 20;
+ const draggableStyle = useMemo(
+ () => ({
+ marginLeft: dashboardFiltersOpen || editMode ? 0 : -32,
+ }),
+ [dashboardFiltersOpen, editMode],
+ );
+
+ const renderDraggableContent = useCallback(
+ ({ dropIndicatorProps }: { dropIndicatorProps: JsonObject }) => (
+ <div>
+ {!hideDashboardHeader && <DashboardHeader />}
+ {dropIndicatorProps && <div {...dropIndicatorProps} />}
+ {!isReport && topLevelTabs && (
+ <WithPopoverMenu
+ shouldFocus={shouldFocusTabs}
+ menuItems={[
+ <IconButton
+ icon={<Icons.FallOutlined iconSize="xl" />}
+ label="Collapse tab content"
+ onClick={handleDeleteTopLevelTabs}
+ />,
+ ]}
+ editMode={editMode}
+ >
+ {/* @ts-ignore */}
+ <DashboardComponent
+ id={topLevelTabs?.id}
+ parentId={DASHBOARD_ROOT_ID}
+ depth={DASHBOARD_ROOT_DEPTH + 1}
+ index={0}
+ renderTabContent={false}
+ renderHoverMenu={false}
+ onChangeTab={handleChangeTab}
+ />
+ </WithPopoverMenu>
+ )}
+ </div>
+ ),
+ [
+ editMode,
+ handleChangeTab,
+ handleDeleteTopLevelTabs,
+ hideDashboardHeader,
+ isReport,
+ topLevelTabs,
+ ],
+ );
+
return (
<StyledDiv>
{nativeFiltersEnabled && !editMode && (
@@ -244,45 +296,13 @@ const DashboardBuilder: FC<DashboardBuilderProps> = () => {
depth={DASHBOARD_ROOT_DEPTH}
index={0}
orientation="column"
- onDrop={dropResult => dispatch(handleComponentDrop(dropResult))}
+ onDrop={handleDrop}
editMode={editMode}
// you cannot drop on/displace tabs if they already exist
disableDragDrop={!!topLevelTabs}
- style={{
- marginLeft: dashboardFiltersOpen || editMode ? 0 : -32,
- }}
+ style={draggableStyle}
>
- {({ dropIndicatorProps }: { dropIndicatorProps: JsonObject }) => (
- <div>
- {!hideDashboardHeader && <DashboardHeader />}
- {dropIndicatorProps && <div {...dropIndicatorProps} />}
- {!isReport && topLevelTabs && (
- <WithPopoverMenu
- shouldFocus={shouldFocusTabs}
- menuItems={[
- <IconButton
- icon={<Icons.FallOutlined iconSize="xl" />}
- label="Collapse tab content"
- onClick={handleDeleteTopLevelTabs}
- />,
- ]}
- editMode={editMode}
- >
- {/*
- // @ts-ignore */}
- <DashboardComponent
- id={topLevelTabs?.id}
- parentId={DASHBOARD_ROOT_ID}
- depth={DASHBOARD_ROOT_DEPTH + 1}
- index={0}
- renderTabContent={false}
- renderHoverMenu={false}
- onChangeTab={handleChangeTab}
- />
- </WithPopoverMenu>
- )}
- </div>
- )}
+ {renderDraggableContent}
</DragDroppable>
</StyledHeader>
<StyledContent fullSizeChartId={fullSizeChartId}>
diff --git a/superset-frontend/src/dashboard/components/DashboardGrid.jsx b/superset-frontend/src/dashboard/components/DashboardGrid.jsx
index 9fb0fb5fd55e5..ad03859fa4da5 100644
--- a/superset-frontend/src/dashboard/components/DashboardGrid.jsx
+++ b/superset-frontend/src/dashboard/components/DashboardGrid.jsx
@@ -38,6 +38,16 @@ const propTypes = {
const defaultProps = {};
+const renderDraggableContentBottom = dropProps =>
+ dropProps.dropIndicatorProps && (
+ <div className="drop-indicator drop-indicator--bottom" />
+ );
+
+const renderDraggableContentTop = dropProps =>
+ dropProps.dropIndicatorProps && (
+ <div className="drop-indicator drop-indicator--top" />
+ );
+
class DashboardGrid extends React.PureComponent {
constructor(props) {
super(props);
@@ -144,11 +154,7 @@ class DashboardGrid extends React.PureComponent {
className="empty-droptarget"
editMode
>
- {({ dropIndicatorProps }) =>
- dropIndicatorProps && (
- <div className="drop-indicator drop-indicator--bottom" />
- )
- }
+ {renderDraggableContentBottom}
</DragDroppable>
)}
@@ -181,11 +187,7 @@ class DashboardGrid extends React.PureComponent {
className="empty-droptarget"
editMode
>
- {({ dropIndicatorProps }) =>
- dropIndicatorProps && (
- <div className="drop-indicator drop-indicator--top" />
- )
- }
+ {renderDraggableContentTop}
</DragDroppable>
)}
diff --git a/superset-frontend/src/dashboard/components/dnd/DragDroppable.jsx b/superset-frontend/src/dashboard/components/dnd/DragDroppable.jsx
index a841be7827174..a29d0475e53b4 100644
--- a/superset-frontend/src/dashboard/components/dnd/DragDroppable.jsx
+++ b/superset-frontend/src/dashboard/components/dnd/DragDroppable.jsx
@@ -66,7 +66,7 @@ const defaultProps = {
};
// export unwrapped component for testing
-export class UnwrappedDragDroppable extends React.Component {
+export class UnwrappedDragDroppable extends React.PureComponent {
constructor(props) {
super(props);
this.state = {
diff --git a/superset-frontend/src/dashboard/components/gridComponents/Tab.jsx b/superset-frontend/src/dashboard/components/gridComponents/Tab.jsx
index faa1e046eff7a..17691b842bc68 100644
--- a/superset-frontend/src/dashboard/components/gridComponents/Tab.jsx
+++ b/superset-frontend/src/dashboard/components/gridComponents/Tab.jsx
@@ -74,6 +74,16 @@ const TabTitleContainer = styled.div`
`}
`;
+const renderDraggableContentBottom = dropProps =>
+ dropProps.dropIndicatorProps && (
+ <div className="drop-indicator drop-indicator--bottom" />
+ );
+
+const renderDraggableContentTop = dropProps =>
+ dropProps.dropIndicatorProps && (
+ <div className="drop-indicator drop-indicator--top" />
+ );
+
export default class Tab extends React.PureComponent {
constructor(props) {
super(props);
@@ -148,11 +158,7 @@ export default class Tab extends React.PureComponent {
editMode
className="empty-droptarget"
>
- {({ dropIndicatorProps }) =>
- dropIndicatorProps && (
- <div className="drop-indicator drop-indicator--top" />
- )
- }
+ {renderDraggableContentTop}
</DragDroppable>
)}
{tabComponent.children.map((componentId, componentIndex) => (
@@ -184,11 +190,7 @@ export default class Tab extends React.PureComponent {
editMode
className="empty-droptarget"
>
- {({ dropIndicatorProps }) =>
- dropIndicatorProps && (
- <div className="drop-indicator drop-indicator--bottom" />
- )
- }
+ {renderDraggableContentBottom}
</DragDroppable>
)}
</div>
diff --git a/superset-frontend/src/dashboard/components/gridComponents/Tabs.jsx b/superset-frontend/src/dashboard/components/gridComponents/Tabs.jsx
index 9916520c76116..1966dd5ff0eea 100644
--- a/superset-frontend/src/dashboard/components/gridComponents/Tabs.jsx
+++ b/superset-frontend/src/dashboard/components/gridComponents/Tabs.jsx
@@ -129,6 +129,7 @@ export class Tabs extends React.PureComponent {
this.handleDeleteComponent = this.handleDeleteComponent.bind(this);
this.handleDeleteTab = this.handleDeleteTab.bind(this);
this.handleDropOnTab = this.handleDropOnTab.bind(this);
+ this.handleDrop = this.handleDrop.bind(this);
}
componentDidMount() {
@@ -281,6 +282,12 @@ export class Tabs extends React.PureComponent {
}
}
+ handleDrop(dropResult) {
+ if (dropResult.dragging.type !== TABS_TYPE) {
+ this.props.handleComponentDrop(dropResult);
+ }
+ }
+
render() {
const {
depth,
@@ -292,7 +299,6 @@ export class Tabs extends React.PureComponent {
onResizeStart,
onResize,
onResizeStop,
- handleComponentDrop,
renderTabContent,
renderHoverMenu,
isComponentVisible: isCurrentTabVisible,
@@ -315,11 +321,7 @@ export class Tabs extends React.PureComponent {
orientation="row"
index={index}
depth={depth}
- onDrop={dropResult => {
- if (dropResult.dragging.type !== TABS_TYPE) {
- handleComponentDrop(dropResult);
- }
- }}
+ onDrop={this.handleDrop}
editMode={editMode}
>
{({
|
go-redis
|
https://github.com/redis/go-redis
|
8c695488a247283d92e4d03c1774d9e2c4583244
|
fengyun.rui
|
2023-12-17 18:50:23
|
fix: add Cmder annotation (#2816)
|
* fix: add Cmder annotation
|
fix: add Cmder annotation (#2816)
* fix: add Cmder annotation
Signed-off-by: rfyiamcool <[email protected]>
* fix: add Cmder annotation
Signed-off-by: rfyiamcool <[email protected]>
---------
Signed-off-by: rfyiamcool <[email protected]>
Co-authored-by: ofekshenawa <[email protected]>
|
diff --git a/command.go b/command.go
index ea1bd927d..3dd475fa2 100644
--- a/command.go
+++ b/command.go
@@ -18,10 +18,22 @@ import (
)
type Cmder interface {
+ // command name.
+ // e.g. "set k v ex 10" -> "set", "cluster info" -> "cluster".
Name() string
+
+ // full command name.
+ // e.g. "set k v ex 10" -> "set", "cluster info" -> "cluster info".
FullName() string
+
+ // all args of the command.
+ // e.g. "set k v ex 10" -> "[set k v ex 10]".
Args() []interface{}
+
+ // format request and response string.
+ // e.g. "set k v ex 10" -> "set k v ex 10: OK", "get k" -> "get k: v".
String() string
+
stringArg(int) string
firstKeyPos() int8
SetFirstKeyPos(int8)
|
reaction
|
https://github.com/reactioncommerce/reaction
|
085aa2f0976d63db6c8296e0e7ab9adc0a5b902c
|
dependabot[bot]
|
2021-08-04 10:01:08
|
chore(deps): bump browserslist from 4.12.0 to 4.16.7
|
Bumps [browserslist](https://github.com/browserslist/browserslist) from 4.12.0 to 4.16.7.
- [Release notes](https://github.com/browserslist/browserslist/releases)
- [Changelog](https://github.com/browserslist/browserslist/blob/main/CHANGELOG.md)
- [Commits](https://github.com/browserslist/browserslist/compare/4.12.0...4.16.7)
---
|
chore(deps): bump browserslist from 4.12.0 to 4.16.7
Bumps [browserslist](https://github.com/browserslist/browserslist) from 4.12.0 to 4.16.7.
- [Release notes](https://github.com/browserslist/browserslist/releases)
- [Changelog](https://github.com/browserslist/browserslist/blob/main/CHANGELOG.md)
- [Commits](https://github.com/browserslist/browserslist/compare/4.12.0...4.16.7)
---
updated-dependencies:
- dependency-name: browserslist
dependency-type: indirect
...
Signed-off-by: dependabot[bot] <[email protected]>
|
diff --git a/package-lock.json b/package-lock.json
index a549891a7b8..3edc2a0c8c2 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -3460,15 +3460,36 @@
}
},
"browserslist": {
- "version": "4.12.0",
- "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.12.0.tgz",
- "integrity": "sha512-UH2GkcEDSI0k/lRkuDSzFl9ZZ87skSy9w2XAn1MsZnL+4c4rqbBd3e82UWHbYDpztABrPBhZsTEeuxVfHppqDg==",
+ "version": "4.16.7",
+ "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.16.7.tgz",
+ "integrity": "sha512-7I4qVwqZltJ7j37wObBe3SoTz+nS8APaNcrBOlgoirb6/HbEU2XxW/LpUDTCngM6iauwFqmRTuOMfyKnFGY5JA==",
"dev": true,
"requires": {
- "caniuse-lite": "^1.0.30001043",
- "electron-to-chromium": "^1.3.413",
- "node-releases": "^1.1.53",
- "pkg-up": "^2.0.0"
+ "caniuse-lite": "^1.0.30001248",
+ "colorette": "^1.2.2",
+ "electron-to-chromium": "^1.3.793",
+ "escalade": "^3.1.1",
+ "node-releases": "^1.1.73"
+ },
+ "dependencies": {
+ "caniuse-lite": {
+ "version": "1.0.30001248",
+ "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001248.tgz",
+ "integrity": "sha512-NwlQbJkxUFJ8nMErnGtT0QTM2TJ33xgz4KXJSMIrjXIbDVdaYueGyjOrLKRtJC+rTiWfi6j5cnZN1NBiSBJGNw==",
+ "dev": true
+ },
+ "electron-to-chromium": {
+ "version": "1.3.795",
+ "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.795.tgz",
+ "integrity": "sha512-4TPxrLf9Fzsi4rVgTlDm+ubxoXm3/TN67/LGHx/a4UkVubKILa6L26O6eTnHewixG/knzU9L3lLmfL39eElwlQ==",
+ "dev": true
+ },
+ "node-releases": {
+ "version": "1.1.73",
+ "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.73.tgz",
+ "integrity": "sha512-uW7fodD6pyW2FZNZnp/Z3hvWKeEW1Y8R1+1CnErE8cXFXzl5blBOoVB41CvMer6P6Q0S5FXDwcHgFd1Wj0U9zg==",
+ "dev": true
+ }
}
},
"bser": {
@@ -3578,12 +3599,6 @@
"quick-lru": "^4.0.1"
}
},
- "caniuse-lite": {
- "version": "1.0.30001077",
- "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001077.tgz",
- "integrity": "sha512-AEzsGvjBJL0lby/87W96PyEvwN0GsYvk5LHsglLg9tW37K4BqvAvoSCdWIE13OZQ8afupqZ73+oL/1LkedN8hA==",
- "dev": true
- },
"capture-exit": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/capture-exit/-/capture-exit-2.0.0.tgz",
@@ -3740,6 +3755,12 @@
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
},
+ "colorette": {
+ "version": "1.2.2",
+ "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.2.2.tgz",
+ "integrity": "sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w==",
+ "dev": true
+ },
"colors": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz",
@@ -4331,12 +4352,6 @@
"safer-buffer": "^2.1.0"
}
},
- "electron-to-chromium": {
- "version": "1.3.460",
- "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.460.tgz",
- "integrity": "sha512-9nOPN0KoGUim2cDV2I1JWoWnxfC9o8z0ictsPnpNPhJD8NVZVW8DDacyrmIobwgY6Xaxn0TgVuUYXXmov8mPGg==",
- "dev": true
- },
"emoji-regex": {
"version": "8.0.0",
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
@@ -9139,12 +9154,6 @@
}
}
},
- "node-releases": {
- "version": "1.1.58",
- "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.58.tgz",
- "integrity": "sha512-NxBudgVKiRh/2aPWMgPR7bPTX0VPmGx5QBwCtdHitnqFE5/O8DeBXuIMH1nwNnw/aMo6AjOrpsHzfY3UbUJ7yg==",
- "dev": true
- },
"normalize-package-data": {
"version": "2.5.0",
"resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz",
@@ -13201,66 +13210,6 @@
}
}
},
- "pkg-up": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/pkg-up/-/pkg-up-2.0.0.tgz",
- "integrity": "sha1-yBmscoBZpGHKscOImivjxJoATX8=",
- "dev": true,
- "requires": {
- "find-up": "^2.1.0"
- },
- "dependencies": {
- "find-up": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz",
- "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=",
- "dev": true,
- "requires": {
- "locate-path": "^2.0.0"
- }
- },
- "locate-path": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz",
- "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=",
- "dev": true,
- "requires": {
- "p-locate": "^2.0.0",
- "path-exists": "^3.0.0"
- }
- },
- "p-limit": {
- "version": "1.3.0",
- "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz",
- "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==",
- "dev": true,
- "requires": {
- "p-try": "^1.0.0"
- }
- },
- "p-locate": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz",
- "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=",
- "dev": true,
- "requires": {
- "p-limit": "^1.1.0"
- }
- },
- "p-try": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz",
- "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=",
- "dev": true
- },
- "path-exists": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz",
- "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=",
- "dev": true
- }
- }
- },
"please-upgrade-node": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz",
|
zitadel
|
https://github.com/zitadel/zitadel
|
d2f4196146137238a44340d6e7bb7018e88ce1c1
|
Nabeel Sulieman
|
2023-02-16 01:18:30
|
docs(overview): Grammar/Language Tweaks (#5159)
|
Minor grammar/language update
Suggestions to improve the readability/flow of the Production Setup section.
|
docs(overview): Grammar/Language Tweaks (#5159)
Minor grammar/language update
Suggestions to improve the readability/flow of the Production Setup section.
Co-authored-by: Florian Forster <[email protected]>
|
diff --git a/docs/docs/self-hosting/deploy/overview.mdx b/docs/docs/self-hosting/deploy/overview.mdx
index e9bd80b0c49..c9acfa57a1b 100644
--- a/docs/docs/self-hosting/deploy/overview.mdx
+++ b/docs/docs/self-hosting/deploy/overview.mdx
@@ -25,9 +25,9 @@ The easiest way to use ZITADEL is to run one of our container releases
# Production Setup
-As soon as you successfully created your first test environment using one of the deployment guides in this section,
+After you have successfully created your first test environment using one of the deployment guides in this section,
you might want to configure ZITADEL for production and embed it into your system landscape.
To do so, jump straight to the [production setup guide](/docs/self-hosting/manage/production).
-To achieving high availability, we recommend to use a [Kubernetes](https://kubernetes.io/docs/home/) Cluster.
+To achieve high availability, we recommend using a [Kubernetes](https://kubernetes.io/docs/home/) Cluster.
We have an official [Helm chart](https://artifacthub.io/packages/helm/zitadel/zitadel) for easy deployment and maintenance.
|
dashboard
|
https://github.com/kubernetes/dashboard
|
06c08121942a12111ab9160aceb7d6739b7430ca
|
dependabot[bot]
|
2024-10-31 09:55:26
|
chore(deps-dev): bump @typescript-eslint/eslint-plugin in /modules/web (#9613)
|
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 8.11.0 to 8.12.2.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.12.2/packages/eslint-plugin)
---
|
chore(deps-dev): bump @typescript-eslint/eslint-plugin in /modules/web (#9613)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 8.11.0 to 8.12.2.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.12.2/packages/eslint-plugin)
---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
dependency-type: direct:development
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
|
diff --git a/modules/web/package.json b/modules/web/package.json
index cde844d61005..0178b117d124 100644
--- a/modules/web/package.json
+++ b/modules/web/package.json
@@ -106,7 +106,7 @@
"@types/js-yaml": "4.0.9",
"@types/lodash-es": "4.17.12",
"@types/node": "22.7.9",
- "@typescript-eslint/eslint-plugin": "8.11.0",
+ "@typescript-eslint/eslint-plugin": "8.12.2",
"@typescript-eslint/parser": "8.11.0",
"codelyzer": "6.0.2",
"concurrently": "9.0.1",
diff --git a/modules/web/yarn.lock b/modules/web/yarn.lock
index a0f751614191..07fca2961c53 100644
--- a/modules/web/yarn.lock
+++ b/modules/web/yarn.lock
@@ -6848,15 +6848,15 @@ __metadata:
languageName: node
linkType: hard
-"@typescript-eslint/eslint-plugin@npm:8.11.0":
- version: 8.11.0
- resolution: "@typescript-eslint/eslint-plugin@npm:8.11.0"
+"@typescript-eslint/eslint-plugin@npm:8.12.2":
+ version: 8.12.2
+ resolution: "@typescript-eslint/eslint-plugin@npm:8.12.2"
dependencies:
"@eslint-community/regexpp": ^4.10.0
- "@typescript-eslint/scope-manager": 8.11.0
- "@typescript-eslint/type-utils": 8.11.0
- "@typescript-eslint/utils": 8.11.0
- "@typescript-eslint/visitor-keys": 8.11.0
+ "@typescript-eslint/scope-manager": 8.12.2
+ "@typescript-eslint/type-utils": 8.12.2
+ "@typescript-eslint/utils": 8.12.2
+ "@typescript-eslint/visitor-keys": 8.12.2
graphemer: ^1.4.0
ignore: ^5.3.1
natural-compare: ^1.4.0
@@ -6867,7 +6867,7 @@ __metadata:
peerDependenciesMeta:
typescript:
optional: true
- checksum: 5cfc337a957b1c1a868f0f05ed278d4b631aab3aad037c1ca52f458973dee53c2f79db5cb3ac0278d3a4d2846560335212e347c4b978efd84811d6c910e93975
+ checksum: a1707704d91cd525ece0cf5a978f17cb309bb8918d65ded349e18b0aa364f585555d018a365cb0ab9450f273912fc07fae5600f34294e637151b244ba4485bc2
languageName: node
linkType: hard
@@ -6920,18 +6920,28 @@ __metadata:
languageName: node
linkType: hard
-"@typescript-eslint/type-utils@npm:8.11.0":
- version: 8.11.0
- resolution: "@typescript-eslint/type-utils@npm:8.11.0"
+"@typescript-eslint/scope-manager@npm:8.12.2":
+ version: 8.12.2
+ resolution: "@typescript-eslint/scope-manager@npm:8.12.2"
dependencies:
- "@typescript-eslint/typescript-estree": 8.11.0
- "@typescript-eslint/utils": 8.11.0
+ "@typescript-eslint/types": 8.12.2
+ "@typescript-eslint/visitor-keys": 8.12.2
+ checksum: dd960238f1cf0f24e6c16525f0cbdb6cf65bfc3cfe650f376ecda2583c378c2e3a7eb4c2d57e04e009626d009018226b722a670ca283086c2a6cc1931c2268d8
+ languageName: node
+ linkType: hard
+
+"@typescript-eslint/type-utils@npm:8.12.2":
+ version: 8.12.2
+ resolution: "@typescript-eslint/type-utils@npm:8.12.2"
+ dependencies:
+ "@typescript-eslint/typescript-estree": 8.12.2
+ "@typescript-eslint/utils": 8.12.2
debug: ^4.3.4
ts-api-utils: ^1.3.0
peerDependenciesMeta:
typescript:
optional: true
- checksum: 74704ee811de343ea2d349a16eec53b6cc8f2b5720510bf327e10667304c48410af78b9ec7aee5d43924a3f6c268cc2cddb7a0606f20c62391b0d7045d8b6264
+ checksum: a8f540d84674c4919d6f038848add5b4d41ef39cdf572734a13b75f0f797b00d45903b179dc7c25f7ae7690f9dbaf115e5bda596d9e439b1a0a8d7f9d799260e
languageName: node
linkType: hard
@@ -6949,6 +6959,13 @@ __metadata:
languageName: node
linkType: hard
+"@typescript-eslint/types@npm:8.12.2":
+ version: 8.12.2
+ resolution: "@typescript-eslint/types@npm:8.12.2"
+ checksum: b0f7effdac842428b15d76710295a8b4f1fe1ff14e40fbb10c8f571c11fd517d75d76decbecf90412bc5eabce0cd4ac0acf53d6b0d8ba2bdde86ab3b627bdac2
+ languageName: node
+ linkType: hard
+
"@typescript-eslint/typescript-estree@npm:5.62.0":
version: 5.62.0
resolution: "@typescript-eslint/typescript-estree@npm:5.62.0"
@@ -6986,6 +7003,25 @@ __metadata:
languageName: node
linkType: hard
+"@typescript-eslint/typescript-estree@npm:8.12.2":
+ version: 8.12.2
+ resolution: "@typescript-eslint/typescript-estree@npm:8.12.2"
+ dependencies:
+ "@typescript-eslint/types": 8.12.2
+ "@typescript-eslint/visitor-keys": 8.12.2
+ debug: ^4.3.4
+ fast-glob: ^3.3.2
+ is-glob: ^4.0.3
+ minimatch: ^9.0.4
+ semver: ^7.6.0
+ ts-api-utils: ^1.3.0
+ peerDependenciesMeta:
+ typescript:
+ optional: true
+ checksum: 923d297ba891cbaf4f00618db2313123238657b179f56a5d42d02a4e6433c513f73a9dd9aa62cd2c5b9fb2c5912a59319eb0a14ef2403792e15757142722309a
+ languageName: node
+ linkType: hard
+
"@typescript-eslint/utils@npm:5.62.0":
version: 5.62.0
resolution: "@typescript-eslint/utils@npm:5.62.0"
@@ -7004,17 +7040,17 @@ __metadata:
languageName: node
linkType: hard
-"@typescript-eslint/utils@npm:8.11.0":
- version: 8.11.0
- resolution: "@typescript-eslint/utils@npm:8.11.0"
+"@typescript-eslint/utils@npm:8.12.2":
+ version: 8.12.2
+ resolution: "@typescript-eslint/utils@npm:8.12.2"
dependencies:
"@eslint-community/eslint-utils": ^4.4.0
- "@typescript-eslint/scope-manager": 8.11.0
- "@typescript-eslint/types": 8.11.0
- "@typescript-eslint/typescript-estree": 8.11.0
+ "@typescript-eslint/scope-manager": 8.12.2
+ "@typescript-eslint/types": 8.12.2
+ "@typescript-eslint/typescript-estree": 8.12.2
peerDependencies:
eslint: ^8.57.0 || ^9.0.0
- checksum: 0a6286fb6c6aaf497bcd5657e4f8167f29c32bb913e4feab3822c504f537ac30975d626dff442cc691e040384ad197313b5685d79296fc8a42ed6c827dcb52fc
+ checksum: 7ae4ef40d0961642fc31644c47e05f751369b47f3d9f5ea4e6c6eaa09d534efc6a2ea89f12368eed7dc8b32a7378e533f84379f70f2acd85418815f63b249b18
languageName: node
linkType: hard
@@ -7038,6 +7074,16 @@ __metadata:
languageName: node
linkType: hard
+"@typescript-eslint/visitor-keys@npm:8.12.2":
+ version: 8.12.2
+ resolution: "@typescript-eslint/visitor-keys@npm:8.12.2"
+ dependencies:
+ "@typescript-eslint/types": 8.12.2
+ eslint-visitor-keys: ^3.4.3
+ checksum: 97b919a0f0982e16a46ed568ae195906ec4aed7db358308d2311e9829ceb7f521e4a2017b3bdedad264ee61fdf08d3d12ada7d5622f13b20ac324118fe5b8447
+ languageName: node
+ linkType: hard
+
"@ungap/structured-clone@npm:^1.2.0":
version: 1.2.0
resolution: "@ungap/structured-clone@npm:1.2.0"
@@ -14314,7 +14360,7 @@ __metadata:
"@types/js-yaml": 4.0.9
"@types/lodash-es": 4.17.12
"@types/node": 22.7.9
- "@typescript-eslint/eslint-plugin": 8.11.0
+ "@typescript-eslint/eslint-plugin": 8.12.2
"@typescript-eslint/parser": 8.11.0
ace-builds: 1.36.3
codelyzer: 6.0.2
|
sentry
|
https://github.com/getsentry/sentry
|
b812f8cfd7f31940bd813294dbfceeeed0af57c9
|
Ivan Dlugos
|
2024-06-04 14:09:23
|
feat: PowerShell support (frontend) (#67576)
|
Adds a new SDK to the frontend: PowerShell
backend PR: https://github.com/getsentry/sentry/pull/67577
|
feat: PowerShell support (frontend) (#67576)
Adds a new SDK to the frontend: PowerShell
backend PR: https://github.com/getsentry/sentry/pull/67577
Resolves:
* https://github.com/getsentry/sentry-powershell/issues/43
### Legal Boilerplate
Look, I get it. The entity doing business as "Sentry" was incorporated
in the State of Delaware in 2015 as Functional Software, Inc. and is
gonna need some rights from me in order to utilize my contributions in
this here PR. So here's the deal: I retain all rights, title and
interest in and to my contributions, and by keeping this boilerplate
intact I confirm that Sentry can use, modify, copy, and redistribute my
contributions, under Sentry's choice of terms.
---------
Co-authored-by: Josh Ferge <[email protected]>
Co-authored-by: ArthurKnaus <[email protected]>
Co-authored-by: ArthurKnaus <[email protected]>
Co-authored-by: Bruno Garcia <[email protected]>
|
diff --git a/README.md b/README.md
index 83fa3a6b952f64..575e52ca0c4204 100644
--- a/README.md
+++ b/README.md
@@ -41,6 +41,7 @@ Sentry is a developer-first error tracking and performance monitoring platform t
- [Elixir](https://github.com/getsentry/sentry-elixir)
- [Unity](https://github.com/getsentry/sentry-unity)
- [Unreal Engine](https://github.com/getsentry/sentry-unreal)
+- [PowerShell](https://github.com/getsentry/sentry-powershell)
# Resources
diff --git a/static/app/components/events/interfaces/frame/usePrismTokensSourceContext.tsx b/static/app/components/events/interfaces/frame/usePrismTokensSourceContext.tsx
index ebabdd45329cc7..7fc3e56077d458 100644
--- a/static/app/components/events/interfaces/frame/usePrismTokensSourceContext.tsx
+++ b/static/app/components/events/interfaces/frame/usePrismTokensSourceContext.tsx
@@ -39,6 +39,7 @@ const BLOCK_COMMENT_SYNTAX_BY_LANGUAGE: Record<string, BlockCommentSyntax[]> = {
julia: [{start: '#=', end: '=#'}],
lua: [{start: '--[[', end: ']]'}],
perl: [{start: {example: '=comment', search: /^\s*?=\S+/m}, end: '=cut'}],
+ powershell: [{start: '<#', end: '#>'}],
python: [
{start: '"""', end: '"""'},
{start: "'''", end: "'''"},
diff --git a/static/app/data/platformCategories.tsx b/static/app/data/platformCategories.tsx
index 9dab215df06779..a014fdd51ffd03 100644
--- a/static/app/data/platformCategories.tsx
+++ b/static/app/data/platformCategories.tsx
@@ -89,6 +89,7 @@ export const backend: PlatformKey[] = [
'php-laravel',
'php-monolog',
'php-symfony',
+ 'powershell',
'python',
'python-aiohttp',
'python-asgi',
diff --git a/static/app/data/platformPickerCategories.tsx b/static/app/data/platformPickerCategories.tsx
index eb773e12d5d773..eff2cc6a6d4e02 100644
--- a/static/app/data/platformPickerCategories.tsx
+++ b/static/app/data/platformPickerCategories.tsx
@@ -79,6 +79,7 @@ const server: Set<PlatformKey> = new Set([
'php',
'php-laravel',
'php-symfony',
+ 'powershell',
'python',
'python-aiohttp',
'python-asgi',
diff --git a/static/app/data/platforms.tsx b/static/app/data/platforms.tsx
index 7445569ef85797..32372422f7234d 100644
--- a/static/app/data/platforms.tsx
+++ b/static/app/data/platforms.tsx
@@ -466,6 +466,13 @@ export const platforms: PlatformIntegration[] = [
language: 'php',
link: 'https://docs.sentry.io/platforms/php/guides/symfony/',
},
+ {
+ id: 'powershell',
+ name: 'PowerShell',
+ type: 'language',
+ language: 'powershell',
+ link: 'https://docs.sentry.io/platforms/powershell/',
+ },
{
id: 'python',
name: 'Python',
diff --git a/static/app/gettingStartedDocs/powershell/powershell.spec.tsx b/static/app/gettingStartedDocs/powershell/powershell.spec.tsx
new file mode 100644
index 00000000000000..f7c6b908a4fadd
--- /dev/null
+++ b/static/app/gettingStartedDocs/powershell/powershell.spec.tsx
@@ -0,0 +1,35 @@
+import {renderWithOnboardingLayout} from 'sentry-test/onboarding/renderWithOnboardingLayout';
+import {screen} from 'sentry-test/reactTestingLibrary';
+import {textWithMarkupMatcher} from 'sentry-test/utils';
+
+import docs from './powershell';
+
+describe('powershell onboarding docs', function () {
+ it('renders docs correctly', async function () {
+ renderWithOnboardingLayout(docs, {
+ releaseRegistry: {
+ 'sentry.dotnet.powershell': {
+ version: '1.99.9',
+ },
+ },
+ });
+
+ // Renders main headings
+ expect(screen.getByRole('heading', {name: 'Install'})).toBeInTheDocument();
+ expect(screen.getByRole('heading', {name: 'Configure SDK'})).toBeInTheDocument();
+ expect(screen.getByRole('heading', {name: 'Verify'})).toBeInTheDocument();
+ expect(
+ screen.getByRole('heading', {name: 'Performance Monitoring'})
+ ).toBeInTheDocument();
+ expect(screen.getByRole('heading', {name: 'Samples'})).toBeInTheDocument();
+
+ // Renders SDK version from registry
+ expect(
+ await screen.findByText(
+ textWithMarkupMatcher(
+ /Install-Module -Name Sentry -Repository PSGallery -RequiredVersion 1\.99\.9/
+ )
+ )
+ ).toBeInTheDocument();
+ });
+});
diff --git a/static/app/gettingStartedDocs/powershell/powershell.tsx b/static/app/gettingStartedDocs/powershell/powershell.tsx
new file mode 100644
index 00000000000000..eee09153dded87
--- /dev/null
+++ b/static/app/gettingStartedDocs/powershell/powershell.tsx
@@ -0,0 +1,197 @@
+import ExternalLink from 'sentry/components/links/externalLink';
+import List from 'sentry/components/list';
+import ListItem from 'sentry/components/list/listItem';
+import altCrashReportCallout from 'sentry/components/onboarding/gettingStartedDoc/feedback/altCrashReportCallout';
+import {StepType} from 'sentry/components/onboarding/gettingStartedDoc/step';
+import type {
+ Docs,
+ DocsParams,
+ OnboardingConfig,
+} from 'sentry/components/onboarding/gettingStartedDoc/types';
+import {
+ getCrashReportApiIntroduction,
+ getCrashReportInstallDescription,
+} from 'sentry/components/onboarding/gettingStartedDoc/utils/feedbackOnboarding';
+import {t, tct} from 'sentry/locale';
+import {getPackageVersion} from 'sentry/utils/gettingStartedDocs/getPackageVersion';
+
+type Params = DocsParams;
+
+const getConfigureSnippet = (params: Params) => `
+# You need to import the module once in a script.
+Import-Module Sentry
+
+# Start the Sentry SDK with the default options.
+# It may be helpful when investigating issues with your setup to pass \`-Debug\` to \`Start-Sentry\`.
+# This enables debug logging (\`Write-Debug\`) for the Sentry client.
+# We enable it here for demonstration purposes when first trying Sentry.
+# You shouldn't do this in your applications unless you're troubleshooting issues with Sentry.
+Start-Sentry -Debug {
+ # A Sentry Data Source Name (DSN) is required.
+ # See https://docs.sentry.io/product/sentry-basics/dsn-explainer/
+ # You can set it in the SENTRY_DSN environment variable, or you can set it in code here.
+ $_.Dsn = '${params.dsn}'
+
+ # This option will enable Sentry's tracing features. You still need to start transactions and spans.
+ # For example, setting the rate to 0.1 would capture 10% of transactions.
+ $_.TracesSampleRate = 1.0
+}
+
+# Later on in your production script, you should omit the \`-Debug\` flag.:
+Start-Sentry {
+ $_.Dsn = '${params.dsn}'
+ $_.TracesSampleRate = 0.1
+}`;
+
+const getPerformanceMonitoringSnippet = () => `
+# Transaction can be started by providing, at minimum, the name and the operation
+$transaction = Start-SentryTransaction 'test-transaction-name' 'test-transaction-operation'
+
+# Transactions can have child spans (and those spans can have child spans as well)
+$span = $transaction.StartChild("test-child-operation")
+# ...
+# (Perform the operation represented by the span/transaction)
+# ...
+$span.Finish() # Mark the span as finished
+
+$span = $transaction.StartChild("another-span")
+# ...
+$span.Finish()
+
+$transaction.Finish() # Mark the transaction as finished and send it to Sentry`;
+
+const onboarding: OnboardingConfig = {
+ introduction: () =>
+ t(
+ 'Sentry for PowerShell module supports PowerShell 7.2+ on Windows, macOS, and Linux as well as Windows PowerShell 5.1+.'
+ ),
+ install: params => [
+ {
+ type: StepType.INSTALL,
+ description: t('Install the module:'),
+ configurations: [
+ {
+ partialLoading: params.sourcePackageRegistries.isLoading,
+ code: [
+ {
+ language: 'powershell',
+ label: 'Install Module',
+ value: 'powershellget',
+ code: `Install-Module -Name Sentry -Repository PSGallery -RequiredVersion ${getPackageVersion(params, 'sentry.dotnet.powershell', '0.0.2')} -Force`,
+ },
+ ],
+ },
+ ],
+ },
+ ],
+ configure: params => [
+ {
+ type: StepType.CONFIGURE,
+ description: t('Initialize the SDK as early as possible.'),
+ configurations: [
+ {
+ language: 'powershell',
+ code: getConfigureSnippet(params),
+ },
+ ],
+ },
+ ],
+ verify: () => [
+ {
+ type: StepType.VERIFY,
+ description: t('Verify Sentry is correctly configured by sending a message:'),
+ configurations: [
+ {
+ language: 'powershell',
+ code: '"Something went wrong" | Out-Sentry',
+ },
+ ],
+ },
+ {
+ title: t('Performance Monitoring'),
+ description: t(
+ 'You can measure the performance of your code by capturing transactions and spans.'
+ ),
+ configurations: [
+ {
+ language: 'powershell',
+ code: getPerformanceMonitoringSnippet(),
+ },
+ ],
+ additionalInfo: tct(
+ 'Check out [link:the documentation] to learn more about the API and instrumentations.',
+ {
+ link: (
+ <ExternalLink href="https://docs.sentry.io/platforms/powershell/performance/instrumentation/" />
+ ),
+ }
+ ),
+ },
+ {
+ title: t('Samples'),
+ description: t('You can find sample usage of the SDK:'),
+ configurations: [
+ {
+ description: (
+ <List symbol="bullet">
+ <ListItem>
+ {tct('[link:Samples in the [code:powershell] SDK repository]', {
+ link: (
+ <ExternalLink href="https://github.com/getsentry/sentry-powershell/tree/main/samples" />
+ ),
+ code: <code />,
+ })}
+ </ListItem>
+ <ListItem>
+ {tct(
+ '[link:Many more samples in the [code:dotnet] SDK repository] [strong:(C#)]',
+ {
+ link: (
+ <ExternalLink href="https://github.com/getsentry/sentry-dotnet/tree/main/samples" />
+ ),
+ code: <code />,
+ strong: <strong />,
+ }
+ )}
+ </ListItem>
+ </List>
+ ),
+ },
+ ],
+ },
+ ],
+};
+
+export const powershellFeedbackOnboarding: OnboardingConfig = {
+ introduction: () => getCrashReportApiIntroduction(),
+ install: () => [
+ {
+ type: StepType.INSTALL,
+ description: getCrashReportInstallDescription(),
+ configurations: [
+ {
+ code: [
+ {
+ label: 'PowerShell',
+ value: 'powershell',
+ language: 'powershell',
+ code: `$eventId = "An event that will receive user feedback." | Out-Sentry
+[Sentry.SentrySdk]::CaptureUserFeedback($eventId, "[email protected]", "It broke.", "The User")`,
+ },
+ ],
+ },
+ ],
+ additionalInfo: altCrashReportCallout(),
+ },
+ ],
+ configure: () => [],
+ verify: () => [],
+ nextSteps: () => [],
+};
+
+const docs: Docs = {
+ onboarding,
+ feedbackOnboardingCrashApi: powershellFeedbackOnboarding,
+};
+
+export default docs;
diff --git a/static/app/types/project.tsx b/static/app/types/project.tsx
index dc9da9fe752a06..2a48b18031d390 100644
--- a/static/app/types/project.tsx
+++ b/static/app/types/project.tsx
@@ -243,6 +243,7 @@ export type PlatformKey =
| 'php-monolog'
| 'php-symfony'
| 'php-symfony2'
+ | 'powershell'
| 'python'
| 'python-aiohttp'
| 'python-asgi'
diff --git a/static/app/utils/docs.tsx b/static/app/utils/docs.tsx
index 2e7a0fc70c0adc..2e44bb5ebf8975 100644
--- a/static/app/utils/docs.tsx
+++ b/static/app/utils/docs.tsx
@@ -14,6 +14,7 @@ const platforms = [
'node',
'perl',
'php',
+ 'powershell',
'python',
'react-native',
'ruby',
@@ -32,6 +33,7 @@ const performancePlatforms: DocPlatform[] = [
'javascript',
'node',
'php',
+ 'powershell',
'python',
'react-native',
'ruby',
diff --git a/static/app/utils/fileExtension.tsx b/static/app/utils/fileExtension.tsx
index d5e98d9589518a..f019791a397047 100644
--- a/static/app/utils/fileExtension.tsx
+++ b/static/app/utils/fileExtension.tsx
@@ -22,6 +22,7 @@ const FILE_EXTENSION_TO_PLATFORM = {
fs: 'fsharp',
vb: 'visualbasic',
ps1: 'powershell',
+ psd1: 'powershell',
psm1: 'powershell',
kt: 'kotlin',
dart: 'dart',
|
talos
|
https://github.com/siderolabs/talos
|
0ec17e41692f651039bc747523321b0deb6885fc
|
Andrew Rynhard
|
2019-07-25 21:08:31
|
feat: run rootfs from squashfs
|
This change moves the rootfs to a squashfs image.
|
feat: run rootfs from squashfs
This change moves the rootfs to a squashfs image.
Signed-off-by: Andrew Rynhard <[email protected]>
|
diff --git a/.drone.yml b/.drone.yml
index e726b7c6042..ad0b1ced691 100644
--- a/.drone.yml
+++ b/.drone.yml
@@ -35,17 +35,6 @@ steps:
depends_on:
- fetch
- - name: build-init
- image: autonomy/build-container:latest
- pull: always
- environment:
- BUILDKIT_HOST: tcp://buildkitd.ci.svc:1234
- BINDIR: /usr/local/bin
- commands:
- - make initramfs
- depends_on:
- - lint
-
- name: build-machined
image: autonomy/build-container:latest
pull: always
@@ -141,6 +130,20 @@ steps:
- build-trustd
- build-ntpd
+ - name: initramfs
+ image: autonomy/build-container:latest
+ pull: always
+ environment:
+ BUILDKIT_HOST: tcp://buildkitd.ci.svc:1234
+ BINDIR: /usr/local/bin
+ commands:
+ - make initramfs
+ volumes:
+ - name: dockersock
+ path: /var/run
+ depends_on:
+ - rootfs
+
- name: installer
image: autonomy/build-container:latest
pull: always
@@ -154,6 +157,7 @@ steps:
path: /var/run
depends_on:
- rootfs
+ - initramfs
- name: talos-image
image: autonomy/build-container:latest
@@ -168,7 +172,6 @@ steps:
path: /var/run
depends_on:
- rootfs
- - build-init
- name: test
image: autonomy/build-container:latest
diff --git a/Dockerfile b/Dockerfile
index 7920a235958..5008468c62c 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -32,6 +32,7 @@ RUN protoc -I./proto --go_out=plugins=grpc:proto proto/api.proto
WORKDIR /machined
COPY ./internal/app/machined/proto ./proto
RUN protoc -I./proto --go_out=plugins=grpc:proto proto/api.proto
+
FROM scratch AS generate
COPY --from=generate-build /osd/proto/api.pb.go /internal/app/osd/proto/
COPY --from=generate-build /trustd/proto/api.pb.go /internal/app/trustd/proto/
@@ -61,6 +62,7 @@ ARG VERSION_PKG="github.com/talos-systems/talos/internal/pkg/version"
WORKDIR /src/internal/app/init
RUN go build -a -ldflags "-s -w -X ${VERSION_PKG}.Name=Talos -X ${VERSION_PKG}.SHA=${SHA} -X ${VERSION_PKG}.Tag=${TAG}" -o /init
RUN chmod +x /init
+
FROM scratch AS init
COPY --from=init-build /init /init
@@ -71,8 +73,9 @@ ARG SHA
ARG TAG
ARG VERSION_PKG="github.com/talos-systems/talos/internal/pkg/version"
WORKDIR /src/internal/app/machined
-RUN --mount=type=cache,target=/root/.cache go build -a -ldflags "-s -w -X ${VERSION_PKG}.Name=Server -X ${VERSION_PKG}.SHA=${SHA} -X ${VERSION_PKG}.Tag=${TAG}" -o /machined
+RUN --mount=type=cache,target=/.cache go build -a -ldflags "-s -w -X ${VERSION_PKG}.Name=Server -X ${VERSION_PKG}.SHA=${SHA} -X ${VERSION_PKG}.Tag=${TAG}" -o /machined
RUN chmod +x /machined
+
FROM scratch AS machined
COPY --from=machined-build /machined /machined
@@ -85,6 +88,7 @@ ARG VERSION_PKG="github.com/talos-systems/talos/internal/pkg/version"
WORKDIR /src/internal/app/ntpd
RUN go build -a -ldflags "-s -w -X ${VERSION_PKG}.Name=Server -X ${VERSION_PKG}.SHA=${SHA} -X ${VERSION_PKG}.Tag=${TAG}" -o /ntpd
RUN chmod +x /ntpd
+
FROM scratch AS ntpd
COPY --from=ntpd-build /ntpd /ntpd
ENTRYPOINT ["/ntpd"]
@@ -98,6 +102,7 @@ ARG VERSION_PKG="github.com/talos-systems/talos/internal/pkg/version"
WORKDIR /src/internal/app/osd
RUN --mount=type=cache,target=/.cache go build -a -ldflags "-s -w -X ${VERSION_PKG}.Name=Server -X ${VERSION_PKG}.SHA=${SHA} -X ${VERSION_PKG}.Tag=${TAG}" -o /osd
RUN chmod +x /osd
+
FROM scratch AS osd
COPY --from=osd-build /osd /osd
ENTRYPOINT ["/osd"]
@@ -111,6 +116,7 @@ ARG VERSION_PKG="github.com/talos-systems/talos/internal/pkg/version"
WORKDIR /src/internal/app/proxyd
RUN --mount=type=cache,target=/.cache go build -a -ldflags "-s -w -X ${VERSION_PKG}.Name=Server -X ${VERSION_PKG}.SHA=${SHA} -X ${VERSION_PKG}.Tag=${TAG}" -o /proxyd
RUN chmod +x /proxyd
+
FROM scratch AS proxyd
COPY --from=proxyd-build /proxyd /proxyd
ENTRYPOINT ["/proxyd"]
@@ -124,6 +130,7 @@ ARG VERSION_PKG="github.com/talos-systems/talos/internal/pkg/version"
WORKDIR /src/internal/app/trustd
RUN --mount=type=cache,target=/.cache go build -a -ldflags "-s -w -X ${VERSION_PKG}.Name=Server -X ${VERSION_PKG}.SHA=${SHA} -X ${VERSION_PKG}.Tag=${TAG}" -o /trustd
RUN chmod +x /trustd
+
FROM scratch AS trustd
COPY --from=trustd-build /trustd /trustd
ENTRYPOINT ["/trustd"]
@@ -137,6 +144,7 @@ ARG VERSION_PKG="github.com/talos-systems/talos/internal/pkg/version"
WORKDIR /src/cmd/osctl
RUN --mount=type=cache,target=/.cache GOOS=linux GOARCH=amd64 go build -a -ldflags "-s -w -X ${VERSION_PKG}.Name=Client -X ${VERSION_PKG}.SHA=${SHA} -X ${VERSION_PKG}.Tag=${TAG}" -o /osctl-linux-amd64
RUN chmod +x /osctl-linux-amd64
+
FROM scratch AS osctl-linux
COPY --from=osctl-linux-build /osctl-linux-amd64 /osctl-linux-amd64
@@ -147,42 +155,19 @@ ARG VERSION_PKG="github.com/talos-systems/talos/internal/pkg/version"
WORKDIR /src/cmd/osctl
RUN --mount=type=cache,target=/.cache GOOS=darwin GOARCH=amd64 go build -a -ldflags "-s -w -X ${VERSION_PKG}.Name=Client -X ${VERSION_PKG}.SHA=${SHA} -X ${VERSION_PKG}.Tag=${TAG}" -o /osctl-darwin-amd64
RUN chmod +x /osctl-darwin-amd64
+
FROM scratch AS osctl-darwin
COPY --from=osctl-darwin-build /osctl-darwin-amd64 /osctl-darwin-amd64
# The kernel target is the linux kernel.
FROM scratch AS kernel
-COPY --from=docker.io/autonomy/kernel:ebaa167 /boot/vmlinuz /vmlinuz
-COPY --from=docker.io/autonomy/kernel:ebaa167 /boot/vmlinux /vmlinux
+COPY --from=docker.io/autonomy/kernel:a135947 /boot/vmlinuz /vmlinuz
+COPY --from=docker.io/autonomy/kernel:a135947 /boot/vmlinux /vmlinux
-# The initramfs target provides the Talos initramfs image.
+# The rootfs target provides the Talos rootfs.
-FROM tools AS initramfs-build
-COPY --from=docker.io/autonomy/fhs:8467184 / /rootfs
-COPY --from=docker.io/autonomy/ca-certificates:20f39f7 / /rootfs
-COPY --from=docker.io/autonomy/dosfstools:767dee6 / /rootfs
-COPY --from=docker.io/autonomy/musl:9bc7430 / /rootfs
-COPY --from=docker.io/autonomy/syslinux:85e1f9c / /rootfs
-COPY --from=docker.io/autonomy/xfsprogs:5e50579 / /rootfs
-COPY ./hack/cleanup.sh /toolchain/bin/cleanup.sh
-RUN cleanup.sh /rootfs
-
-FROM scratch AS initramfs-base
-COPY --from=initramfs-build /rootfs /
-COPY --from=init /init /init
-
-FROM build AS initramfs-archive
-COPY --from=initramfs-base / /initramfs
-WORKDIR /initramfs
-RUN set -o pipefail && find . 2>/dev/null | cpio -H newc -o | xz -v -C crc32 -0 -e -T 0 -z >/initramfs.xz
-
-FROM scratch AS initramfs
-COPY --from=initramfs-archive /initramfs.xz /initramfs.xz
-
-# The rootfs target provides the Talos rootfs image.
-
-FROM tools AS rootfs-build
+FROM build AS rootfs-base
COPY --from=docker.io/autonomy/fhs:8467184 / /rootfs
COPY --from=docker.io/autonomy/ca-certificates:20f39f7 / /rootfs
COPY --from=docker.io/autonomy/containerd:03821f9 / /rootfs
@@ -197,35 +182,61 @@ COPY --from=docker.io/autonomy/runc:c79f79d / /rootfs
COPY --from=docker.io/autonomy/socat:032c783 / /rootfs
COPY --from=docker.io/autonomy/syslinux:85e1f9c / /rootfs
COPY --from=docker.io/autonomy/xfsprogs:5e50579 / /rootfs
-COPY --from=docker.io/autonomy/images:150048d / /rootfs
COPY --from=docker.io/autonomy/kubeadm:8607389 / /rootfs
COPY --from=docker.io/autonomy/crictl:ddbeea1 / /rootfs
COPY --from=docker.io/autonomy/base:f9a4941 /toolchain/lib/libblkid.* /rootfs/lib
COPY --from=docker.io/autonomy/base:f9a4941 /toolchain/lib/libuuid.* /rootfs/lib
COPY --from=docker.io/autonomy/base:f9a4941 /toolchain/lib/libkmod.* /rootfs/lib
-COPY --from=docker.io/autonomy/kernel:ebaa167 /lib/modules /rootfs/lib/modules
-COPY --from=machined /machined /rootfs/sbin/machined
-COPY images/*.tar /rootfs/usr/images
+COPY --from=docker.io/autonomy/kernel:a135947 /lib/modules /rootfs/lib/modules
+COPY --from=machined /machined /rootfs/sbin/init
+COPY images/ntpd.tar /rootfs/usr/images/
+COPY images/osd.tar /rootfs/usr/images/
+COPY images/proxyd.tar /rootfs/usr/images/
+COPY images/trustd.tar /rootfs/usr/images/
+RUN touch /rootfs/etc/resolv.conf
+RUN touch /rootfs/etc/hosts
+RUN touch /rootfs/etc/os-release
+RUN mkdir -pv /rootfs/{boot,usr/local/share}
+RUN mkdir -pv /rootfs/{etc/kubernetes/manifests,etc/cni,usr/libexec/kubernetes}
+RUN ln -s /etc/ssl /rootfs/etc/pki
+RUN ln -s /etc/ssl /rootfs/usr/share/ca-certificates
+RUN ln -s /etc/ssl /rootfs/usr/local/share/ca-certificates
+RUN ln -s /etc/ssl /rootfs/etc/ca-certificates
COPY ./hack/cleanup.sh /toolchain/bin/cleanup.sh
RUN cleanup.sh /rootfs
-FROM scratch AS rootfs-base
-COPY --from=rootfs-build /rootfs /
-
-FROM build AS rootfs-archive
-COPY --from=rootfs-base / /rootfs
-WORKDIR /rootfs
-RUN tar -cpzf /rootfs.tar.gz .
+FROM rootfs-base AS rootfs-squashfs
+COPY --from=rootfs / /rootfs
+RUN mksquashfs /rootfs /rootfs.sqsh -all-root -noappend -comp xz -Xdict-size 100%
FROM scratch AS rootfs
-COPY --from=rootfs-archive /rootfs.tar.gz /rootfs.tar.gz
+COPY --from=rootfs-base /rootfs /
+
+# The initramfs target provides the Talos initramfs image.
+
+FROM build AS initramfs-archive
+WORKDIR /initramfs
+COPY --from=docker.io/autonomy/fhs:8467184 / /initramfs
+COPY --from=docker.io/autonomy/ca-certificates:20f39f7 / /initramfs
+COPY --from=docker.io/autonomy/dosfstools:767dee6 / /initramfs
+COPY --from=docker.io/autonomy/musl:9bc7430 / /initramfs
+COPY --from=docker.io/autonomy/syslinux:85e1f9c / /initramfs
+COPY --from=docker.io/autonomy/xfsprogs:5e50579 / /initramfs
+COPY ./hack/cleanup.sh /toolchain/bin/cleanup.sh
+RUN cleanup.sh /initramfs
+COPY --from=rootfs-squashfs /rootfs.sqsh .
+COPY --from=init /init .
+RUN set -o pipefail && find . 2>/dev/null | cpio -H newc -o | xz -v -C crc32 -0 -e -T 0 -z >/initramfs.xz
+
+FROM scratch AS initramfs
+COPY --from=initramfs-archive /initramfs.xz /initramfs.xz
# The talos target generates a docker image that can be used to run Talos
# in containers.
FROM scratch AS talos
-COPY --from=rootfs-base / /
-ENTRYPOINT ["/sbin/machined"]
+COPY --from=rootfs / /
+ENTRYPOINT ["/sbin/init"]
# The installer target generates an image that can be used to install Talos to
# various environments.
@@ -244,9 +255,8 @@ COPY --from=hashicorp/packer:1.4.2 /bin/packer /bin/packer
COPY hack/installer/packer.json /packer.json
COPY hack/installer/entrypoint.sh /bin/entrypoint.sh
COPY --from=kernel /vmlinuz /usr/install/vmlinuz
-COPY --from=initramfs-base /usr/lib/syslinux/ /usr/lib/syslinux
+COPY --from=rootfs /usr/lib/syslinux/ /usr/lib/syslinux
COPY --from=initramfs /initramfs.xz /usr/install/initramfs.xz
-COPY --from=rootfs /rootfs.tar.gz /usr/install/rootfs.tar.gz
COPY --from=osctl-linux-build /osctl-linux-amd64 /bin/osctl
ARG TAG
ENV VERSION ${TAG}
@@ -256,7 +266,7 @@ ENTRYPOINT ["entrypoint.sh"]
FROM base AS test-runner
RUN unlink /etc/ssl
-COPY --from=rootfs-base / /
+COPY --from=rootfs / /
COPY hack/golang/test.sh /bin
ARG TESTPKGS
RUN --security=insecure --mount=type=cache,target=/tmp --mount=type=cache,target=/.cache /bin/test.sh ${TESTPKGS}
diff --git a/Makefile b/Makefile
index f36d65a9a85..9c5b4d28777 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-TOOLS ?= autonomy/tools:b4e3778
+TOOLS ?= autonomy/tools:b473afb
# TODO(andrewrynhard): Move this logic to a shell script.
BUILDKIT_VERSION ?= master@sha256:455f06ede03149051ce2734d9639c28aed1b6e8b8a0c607cb813e29b469a07d6
@@ -137,7 +137,7 @@ initramfs: buildkitd
$(COMMON_ARGS)
.PHONY: rootfs
-rootfs: buildkitd machined osd trustd proxyd ntpd
+rootfs: buildkitd
@$(BINDIR)/buildctl --addr $(BUILDKIT_HOST) \
build \
--output type=local,dest=build \
diff --git a/cmd/osctl/cmd/install_linux.go b/cmd/osctl/cmd/install_linux.go
index a8457661ab3..eb00ea65cf8 100644
--- a/cmd/osctl/cmd/install_linux.go
+++ b/cmd/osctl/cmd/install_linux.go
@@ -37,13 +37,6 @@ var installCmd = &cobra.Command{
Install: &userdata.Install{
Force: true,
ExtraKernelArgs: extraKernelArgs,
- Root: &userdata.RootDevice{
- Rootfs: "file:///usr/install/rootfs.tar.gz",
- InstallDevice: userdata.InstallDevice{
- Device: device,
- Size: 2048 * 1000 * 1000,
- },
- },
Data: &userdata.InstallDevice{
Device: device,
Size: 512 * 1000 * 1000,
@@ -71,7 +64,7 @@ var installCmd = &cobra.Command{
}
cmdline := kernel.NewDefaultCmdline()
- cmdline.Append("initrd", filepath.Join("/", constants.RootAPartitionLabel, "initramfs.xz"))
+ cmdline.Append("initrd", filepath.Join("/", "default", "initramfs.xz"))
cmdline.Append(constants.KernelParamPlatform, platform)
cmdline.Append(constants.KernelParamUserData, endpoint)
if err = cmdline.AppendAll(data.Install.ExtraKernelArgs); err != nil {
diff --git a/docs/content/configuration/userdata.md b/docs/content/configuration/userdata.md
index 2510210c353..672b859057a 100644
--- a/docs/content/configuration/userdata.md
+++ b/docs/content/configuration/userdata.md
@@ -369,43 +369,6 @@ install:
**Note** The asset name **must** be named `initramfs.xz`.
-### Root
-#### Device
-
-The device name to use for the `/` partition. This should be specified as the
-unpartitioned block device.
-
-```yaml
-install:
- root:
- device: <name of device to use>
-```
-
-#### Size
-
-The size of the `/` partition in bytes. If this parameter is omitted, a default
-value of 2GB will be used.
-
-```yaml
-install:
- root:
- size: <size in bytes>
-```
-
-#### Rootfs
-
-This parameter can be used to specify a custom root filesystem to use. If this
-parameter is omitted, the most recent Talos release will be used ( fetched from
-github releases ).
-
-```yaml
-install:
- root:
- rootfs: <path or url to rootfs.tar.gz>
-```
-
-**Note:** The asset name **must** be named `rootfs.tar.gz`.
-
### Data
#### Device
diff --git a/go.mod b/go.mod
index fb836628975..e1016492364 100644
--- a/go.mod
+++ b/go.mod
@@ -89,6 +89,7 @@ require (
google.golang.org/appengine v1.5.0 // indirect
google.golang.org/genproto v0.0.0-20190508193815-b515fa19cec8 // indirect
google.golang.org/grpc v1.20.1
+ gopkg.in/freddierice/go-losetup.v1 v1.0.0-20170407175016-fc9adea44124
gopkg.in/fsnotify.v1 v1.4.7
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
diff --git a/go.sum b/go.sum
index c6c068b43f0..7d62021d398 100644
--- a/go.sum
+++ b/go.sum
@@ -309,6 +309,8 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/freddierice/go-losetup.v1 v1.0.0-20170407175016-fc9adea44124 h1:aPcd9iBdqpFyYkoGRQbQd+asp162GIRDvAVB0FhLxhc=
+gopkg.in/freddierice/go-losetup.v1 v1.0.0-20170407175016-fc9adea44124/go.mod h1:6LXpUYtVsrx91XiupFRJ8jVKOqLZf5PrbEVSGHta/84=
gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4=
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
diff --git a/hack/installer/entrypoint.sh b/hack/installer/entrypoint.sh
index 015f7265e4d..7d5dea7503d 100755
--- a/hack/installer/entrypoint.sh
+++ b/hack/installer/entrypoint.sh
@@ -42,7 +42,6 @@ function create_iso() {
cp -v /usr/install/initramfs.xz /mnt/initramfs.xz
mkdir -p /mnt/usr/install
- cp -v /usr/install/rootfs.tar.gz /mnt/usr/install/rootfs.tar.gz
cp -v /usr/install/vmlinuz /mnt/usr/install/vmlinuz
cp -v /usr/install/initramfs.xz /mnt/usr/install/initramfs.xz
diff --git a/internal/app/init/internal/platform/baremetal/baremetal.go b/internal/app/init/internal/platform/baremetal/baremetal.go
index 78a123acfeb..60af11c675f 100644
--- a/internal/app/init/internal/platform/baremetal/baremetal.go
+++ b/internal/app/init/internal/platform/baremetal/baremetal.go
@@ -85,7 +85,7 @@ func (b *BareMetal) Install(data *userdata.UserData) (err error) {
return errors.Errorf("failed to find %s in kernel parameters", constants.KernelParamUserData)
}
cmdline := kernel.NewDefaultCmdline()
- cmdline.Append("initrd", filepath.Join("/", constants.CurrentRootPartitionLabel(), "initramfs.xz"))
+ cmdline.Append("initrd", filepath.Join("/", "default", "initramfs.xz"))
cmdline.Append(constants.KernelParamPlatform, "bare-metal")
cmdline.Append(constants.KernelParamUserData, *endpoint)
diff --git a/internal/app/init/internal/platform/cloud/packet/packet.go b/internal/app/init/internal/platform/cloud/packet/packet.go
index dd78c82528c..ed9d0ee3497 100644
--- a/internal/app/init/internal/platform/cloud/packet/packet.go
+++ b/internal/app/init/internal/platform/cloud/packet/packet.go
@@ -46,7 +46,7 @@ func (p *Packet) Install(data *userdata.UserData) (err error) {
return errors.Errorf("failed to find %s in kernel parameters", constants.KernelParamUserData)
}
cmdline := kernel.NewDefaultCmdline()
- cmdline.Append("initrd", filepath.Join("/", constants.CurrentRootPartitionLabel(), "initramfs.xz"))
+ cmdline.Append("initrd", filepath.Join("/", "default", "initramfs.xz"))
cmdline.Append(constants.KernelParamPlatform, "packet")
cmdline.Append(constants.KernelParamUserData, *endpoint)
diff --git a/internal/app/init/internal/platform/iso/iso.go b/internal/app/init/internal/platform/iso/iso.go
index e8b4d373379..4381219530f 100644
--- a/internal/app/init/internal/platform/iso/iso.go
+++ b/internal/app/init/internal/platform/iso/iso.go
@@ -52,13 +52,6 @@ func (i *ISO) UserData() (data *userdata.UserData, err error) {
Size: 512 * 1000 * 1000,
},
},
- Root: &userdata.RootDevice{
- Rootfs: "file:///rootfs.tar.gz",
- InstallDevice: userdata.InstallDevice{
- Device: "/dev/sda",
- Size: 2048 * 1000 * 1000,
- },
- },
Data: &userdata.InstallDevice{
Device: "/dev/sda",
Size: 2048 * 1000 * 1000,
@@ -82,7 +75,7 @@ func (i *ISO) Prepare(data *userdata.UserData) (err error) {
return err
}
- for _, f := range []string{"/tmp/usr/install/vmlinuz", "/tmp/usr/install/initramfs.xz", "/tmp/usr/install/rootfs.tar.gz"} {
+ for _, f := range []string{"/tmp/usr/install/vmlinuz", "/tmp/usr/install/initramfs.xz"} {
source, err := ioutil.ReadFile(f)
if err != nil {
return err
@@ -105,7 +98,7 @@ func (i *ISO) Install(data *userdata.UserData) error {
}
cmdline := kernel.NewDefaultCmdline()
- cmdline.Append("initrd", filepath.Join("/", constants.CurrentRootPartitionLabel(), "initramfs.xz"))
+ cmdline.Append("initrd", filepath.Join("/", "default", "initramfs.xz"))
cmdline.Append(constants.KernelParamPlatform, "bare-metal")
cmdline.Append(constants.KernelParamUserData, endpoint)
diff --git a/internal/app/machined/main.go b/internal/app/machined/main.go
index 24a618beb9a..ef677147016 100644
--- a/internal/app/machined/main.go
+++ b/internal/app/machined/main.go
@@ -140,7 +140,19 @@ func root() (err error) {
}
}
+ if err = unix.Mount("/var/hosts", "/etc/hosts", "", unix.MS_BIND, ""); err != nil {
+ return errors.Wrap(err, "failed to create bind mount for /etc/hosts")
+ }
if err = unix.Mount("/var/resolv.conf", "/etc/resolv.conf", "", unix.MS_BIND, ""); err != nil {
+ return errors.Wrap(err, "failed to create bind mount for /etc/resolv.conf")
+ }
+ if err = unix.Mount("/var/os-release", "/etc/os-release", "", unix.MS_BIND, ""); err != nil {
+ return errors.Wrap(err, "failed to create bind mount for /etc/os-release")
+ }
+ }
+
+ for _, p := range []string{"/var/log", "/var/lib/kubelet", "/var/log/pods"} {
+ if err = os.MkdirAll(p, 0700); err != nil {
return err
}
}
diff --git a/internal/app/machined/pkg/system/services/kubeadm.go b/internal/app/machined/pkg/system/services/kubeadm.go
index f35bbe443ea..8f19332bcec 100644
--- a/internal/app/machined/pkg/system/services/kubeadm.go
+++ b/internal/app/machined/pkg/system/services/kubeadm.go
@@ -12,6 +12,8 @@ import (
"strings"
"sync"
+ containerdapi "github.com/containerd/containerd"
+ "github.com/containerd/containerd/namespaces"
"github.com/containerd/containerd/oci"
criconstants "github.com/containerd/cri/pkg/constants"
specs "github.com/opencontainers/runtime-spec/specs-go"
@@ -39,34 +41,29 @@ func (k *Kubeadm) ID(data *userdata.UserData) string {
// PreFunc implements the Service interface.
// nolint: gocyclo
func (k *Kubeadm) PreFunc(ctx context.Context, data *userdata.UserData) (err error) {
- reqs := []*containerd.ImportRequest{
- {
- Path: "/usr/images/hyperkube.tar",
- },
- {
- Path: "/usr/images/coredns.tar",
- },
- {
- Path: "/usr/images/pause.tar",
- },
- }
-
- // Write out all certs we've been provided
if data.Services.Kubeadm.IsControlPlane() {
- reqs = append(reqs, &containerd.ImportRequest{Path: "/usr/images/etcd.tar"})
-
if err = kubeadm.WritePKIFiles(data); err != nil {
return err
}
}
- if err = containerd.Import(criconstants.K8sContainerdNamespace, reqs...); err != nil {
+ if err = kubeadm.WriteConfig(data); err != nil {
return err
}
- if err = kubeadm.WriteConfig(data); err != nil {
+ containerdctx := namespaces.WithNamespace(ctx, "k8s.io")
+ client, err := containerdapi.New(constants.ContainerdAddress)
+ if err != nil {
return err
}
+ // nolint: errcheck
+ defer client.Close()
+
+ // Pull the image and unpack it.
+
+ if _, err = client.Pull(containerdctx, constants.KubernetesImage, containerdapi.WithPullUnpack); err != nil {
+ return fmt.Errorf("failed to pull image %q: %v", constants.KubernetesImage, err)
+ }
// Run kubeadm init phase certs all. This should fill in whatever gaps
// we have in the provided certs.
diff --git a/internal/app/machined/pkg/system/services/osd.go b/internal/app/machined/pkg/system/services/osd.go
index 3de114a3b3f..c756ee84768 100644
--- a/internal/app/machined/pkg/system/services/osd.go
+++ b/internal/app/machined/pkg/system/services/osd.go
@@ -70,8 +70,6 @@ func (o *OSD) Runner(data *userdata.UserData) (runner.Runner, error) {
mounts := []specs.Mount{
{Type: "bind", Destination: "/tmp", Source: "/tmp", Options: []string{"rbind", "rshared", "rw"}},
{Type: "bind", Destination: constants.UserDataPath, Source: constants.UserDataPath, Options: []string{"rbind", "ro"}},
- {Type: "bind", Destination: "/var/run", Source: "/var/run", Options: []string{"rbind", "rw"}},
- {Type: "bind", Destination: "/run", Source: "/run", Options: []string{"rbind", "rw"}},
{Type: "bind", Destination: constants.ContainerdAddress, Source: constants.ContainerdAddress, Options: []string{"bind", "ro"}},
{Type: "bind", Destination: "/etc/kubernetes", Source: "/etc/kubernetes", Options: []string{"bind", "rw"}},
{Type: "bind", Destination: "/etc/ssl", Source: "/etc/ssl", Options: []string{"bind", "ro"}},
diff --git a/internal/pkg/blockdevice/bootloader/syslinux/syslinux.go b/internal/pkg/blockdevice/bootloader/syslinux/syslinux.go
index 5ee5c846010..c87c232c389 100644
--- a/internal/pkg/blockdevice/bootloader/syslinux/syslinux.go
+++ b/internal/pkg/blockdevice/bootloader/syslinux/syslinux.go
@@ -6,13 +6,14 @@ package syslinux
import (
"bytes"
- "errors"
"io/ioutil"
"log"
"os"
"os/exec"
"path/filepath"
"text/template"
+
+ "github.com/pkg/errors"
)
const syslinuxCfgTpl = `DEFAULT {{ .Default }}
@@ -111,7 +112,7 @@ func Install(base string, config interface{}) (err error) {
}
if err = cmd("extlinux", "--install", filepath.Dir(paths[0])); err != nil {
- return err
+ return errors.Wrap(err, "failed to install extlinux")
}
return nil
diff --git a/internal/pkg/constants/constants.go b/internal/pkg/constants/constants.go
index 6d437948414..23a963a6282 100644
--- a/internal/pkg/constants/constants.go
+++ b/internal/pkg/constants/constants.go
@@ -8,7 +8,6 @@ import (
"time"
"github.com/containerd/containerd/defaults"
- "github.com/talos-systems/talos/internal/pkg/kernel"
"k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/v1beta1"
"k8s.io/kubernetes/cmd/kubeadm/app/constants"
)
@@ -53,14 +52,6 @@ const (
// the data path.
DataMountPoint = "/var"
- // RootAPartitionLabel is the label of the partition to use for mounting at
- // the root path.
- RootAPartitionLabel = "ROOT-A"
-
- // RootBPartitionLabel is the label of the partition to use for mounting at
- // the root path.
- RootBPartitionLabel = "ROOT-B"
-
// RootMountPoint is the label of the partition to use for mounting at
// the root path.
RootMountPoint = "/"
@@ -161,7 +152,7 @@ const (
InitramfsAsset = "initramfs.xz"
// RootfsAsset defines a well known name for our rootfs filename
- RootfsAsset = "rootfs.tar.gz"
+ RootfsAsset = "rootfs.sqsh"
// NodeCertFile is the filename where the current Talos Node Certificate may be found
NodeCertFile = "/var/talos-node.crt"
@@ -185,37 +176,3 @@ const (
const (
ContainerdAddress = defaults.DefaultAddress
)
-
-// CurrentRootPartitionLabel returns the label of the currently active root
-// partition.
-func CurrentRootPartitionLabel() string {
- var param *string
- if param = kernel.Cmdline().Get(KernelCurrentRoot).First(); param == nil {
- return RootAPartitionLabel
- }
-
- switch *param {
- case RootBPartitionLabel:
- return RootBPartitionLabel
- case RootAPartitionLabel:
- fallthrough
- default:
- return RootAPartitionLabel
- }
-}
-
-// NextRootPartitionLabel returns the label of the currently active root
-// partition.
-func NextRootPartitionLabel() string {
- current := CurrentRootPartitionLabel()
- switch current {
- case RootAPartitionLabel:
- return RootBPartitionLabel
- case RootBPartitionLabel:
- return RootAPartitionLabel
- }
-
- // We should never reach this since CurrentRootPartitionLabel is guaranteed
- // to return one of the two possible labels.
- return "UNKNOWN"
-}
diff --git a/internal/pkg/install/install.go b/internal/pkg/install/install.go
index 4331f20bcb5..55877e3a986 100644
--- a/internal/pkg/install/install.go
+++ b/internal/pkg/install/install.go
@@ -52,9 +52,6 @@ func Install(args string, data *userdata.UserData) (err error) {
case constants.DataPartitionLabel:
// Do nothing
continue
- case constants.NextRootPartitionLabel():
- // Do nothing
- continue
}
// Handles the download and extraction of assets
@@ -69,12 +66,12 @@ func Install(args string, data *userdata.UserData) (err error) {
}
syslinuxcfg := &syslinux.Cfg{
- Default: constants.CurrentRootPartitionLabel(),
+ Default: "default",
Labels: []*syslinux.Label{
{
- Root: constants.CurrentRootPartitionLabel(),
- Kernel: filepath.Join("/", constants.CurrentRootPartitionLabel(), filepath.Base(data.Install.Boot.Kernel)),
- Initrd: filepath.Join("/", constants.CurrentRootPartitionLabel(), filepath.Base(data.Install.Boot.Initramfs)),
+ Root: "default",
+ Kernel: filepath.Join("/", "default", filepath.Base(data.Install.Boot.Kernel)),
+ Initrd: filepath.Join("/", "default", filepath.Base(data.Install.Boot.Initramfs)),
Append: args,
},
},
@@ -82,7 +79,6 @@ func Install(args string, data *userdata.UserData) (err error) {
if err = syslinux.Install(filepath.Join(constants.NewRoot, constants.BootMountPoint), syslinuxcfg); err != nil {
return err
}
-
if err = ioutil.WriteFile(filepath.Join(constants.NewRoot, constants.BootMountPoint, "installed"), []byte{}, 0400); err != nil {
return err
}
diff --git a/internal/pkg/install/mount.go b/internal/pkg/install/mount.go
index 3b92df9db5d..4dc4a4ff334 100644
--- a/internal/pkg/install/mount.go
+++ b/internal/pkg/install/mount.go
@@ -40,11 +40,9 @@ func Mount(data *userdata.UserData) (err error) {
// nolint: dupl
func mountpoints(devpath string) (mountpoints *mount.Points, err error) {
mountpoints = mount.NewMountPoints()
- for _, name := range []string{constants.CurrentRootPartitionLabel(), constants.DataPartitionLabel, constants.BootPartitionLabel} {
+ for _, name := range []string{constants.DataPartitionLabel, constants.BootPartitionLabel} {
var target string
switch name {
- case constants.CurrentRootPartitionLabel():
- target = constants.RootMountPoint
case constants.DataPartitionLabel:
target = constants.DataMountPoint
case constants.BootPartitionLabel:
diff --git a/internal/pkg/install/prepare.go b/internal/pkg/install/prepare.go
index 03e77cbd70e..2f0d766be33 100644
--- a/internal/pkg/install/prepare.go
+++ b/internal/pkg/install/prepare.go
@@ -10,9 +10,7 @@ import (
"log"
"net/url"
"os"
- "path"
"path/filepath"
- "runtime"
"strconv"
"strings"
"unsafe"
@@ -48,9 +46,6 @@ var (
// TODO(andrewrynhard): We need to setup infrastructure for publishing artifacts and not depend on GitHub.
DefaultURLBase = "https://github.com/talos-systems/talos/releases/download/" + version.Tag
- // DefaultRootfsURL is the URL to the rootfs.
- DefaultRootfsURL = DefaultURLBase + "/rootfs.tar.gz"
-
// DefaultKernelURL is the URL to the kernel.
DefaultKernelURL = DefaultURLBase + "/vmlinuz"
@@ -79,9 +74,6 @@ func Prepare(data *userdata.UserData) (err error) {
// Verify that the target device(s) can satisify the requested options.
- if err = VerifyRootDevice(data); err != nil {
- return errors.Wrap(err, "failed to prepare root device")
- }
if err = VerifyDataDevice(data); err != nil {
return errors.Wrap(err, "failed to prepare data device")
}
@@ -136,33 +128,6 @@ func ExecuteManifest(data *userdata.UserData, manifest *Manifest) (err error) {
return nil
}
-// VerifyRootDevice verifies the supplied root device options.
-func VerifyRootDevice(data *userdata.UserData) (err error) {
- if data.Install == nil || data.Install.Root == nil {
- return errors.New("a root device is required")
- }
-
- if data.Install.Root.Device == "" {
- return errors.New("a root device is required")
- }
-
- if data.Install.Root.Size == 0 {
- data.Install.Root.Size = DefaultSizeRootDevice
- }
-
- if data.Install.Root.Rootfs == "" {
- data.Install.Root.Rootfs = DefaultRootfsURL
- }
-
- if !data.Install.Force {
- if err = VerifyDiskAvailability(constants.CurrentRootPartitionLabel()); err != nil {
- return errors.Wrap(err, "failed to verify disk availability")
- }
- }
-
- return nil
-}
-
// VerifyDataDevice verifies the supplied data device options.
func VerifyDataDevice(data *userdata.UserData) (err error) {
// Set data device to root device if not specified
@@ -171,10 +136,7 @@ func VerifyDataDevice(data *userdata.UserData) (err error) {
}
if data.Install.Data.Device == "" {
- // We can safely assume root device is defined at this point
- // because VerifyRootDevice should have been called first in
- // in the chain
- data.Install.Data.Device = data.Install.Root.Device
+ return errors.New("a data device is required")
}
if data.Install.Data.Size == 0 {
@@ -197,10 +159,10 @@ func VerifyBootDevice(data *userdata.UserData) (err error) {
}
if data.Install.Boot.Device == "" {
- // We can safely assume root device is defined at this point
- // because VerifyRootDevice should have been called first in
+ // We can safely assume data device is defined at this point
+ // because VerifyDataDevice should have been called first in
// in the chain
- data.Install.Boot.Device = data.Install.Root.Device
+ data.Install.Boot.Device = data.Install.Data.Device
}
if data.Install.Boot.Size == 0 {
@@ -282,9 +244,6 @@ func NewManifest(data *userdata.UserData) (manifest *Manifest) {
// Initialize any slices we need. Note that a boot paritition is not
// required.
- if manifest.Targets[data.Install.Root.Device] == nil {
- manifest.Targets[data.Install.Root.Device] = []*Target{}
- }
if manifest.Targets[data.Install.Data.Device] == nil {
manifest.Targets[data.Install.Data.Device] = []*Target{}
}
@@ -300,51 +259,27 @@ func NewManifest(data *userdata.UserData) (manifest *Manifest) {
Assets: []*Asset{
{
Source: data.Install.Boot.Kernel,
- Destination: filepath.Join("/", constants.CurrentRootPartitionLabel(), filepath.Base(data.Install.Boot.Kernel)),
+ Destination: filepath.Join("/", "default", filepath.Base(data.Install.Boot.Kernel)),
},
{
Source: data.Install.Boot.Initramfs,
- Destination: filepath.Join("/", constants.CurrentRootPartitionLabel(), filepath.Base(data.Install.Boot.Initramfs)),
+ Destination: filepath.Join("/", "default", filepath.Base(data.Install.Boot.Initramfs)),
},
},
- MountPoint: path.Join(constants.NewRoot, constants.BootMountPoint),
+ MountPoint: filepath.Join(constants.NewRoot, constants.BootMountPoint),
}
}
- rootATarget := &Target{
- Device: data.Install.Root.Device,
- Label: constants.RootAPartitionLabel,
- Size: data.Install.Root.Size,
- Force: data.Install.Force,
- Test: false,
- Assets: []*Asset{
- {
- Source: data.Install.Root.Rootfs,
- Destination: filepath.Base(data.Install.Root.Rootfs),
- },
- },
- MountPoint: path.Join(constants.NewRoot, constants.RootMountPoint),
- }
-
- rootBTarget := &Target{
- Device: data.Install.Root.Device,
- Label: constants.RootBPartitionLabel,
- Size: data.Install.Root.Size,
- Force: data.Install.Force,
- Test: false,
- MountPoint: path.Join(constants.NewRoot, constants.RootMountPoint),
- }
-
dataTarget := &Target{
Device: data.Install.Data.Device,
Label: constants.DataPartitionLabel,
Size: data.Install.Data.Size,
Force: data.Install.Force,
Test: false,
- MountPoint: path.Join(constants.NewRoot, constants.DataMountPoint),
+ MountPoint: filepath.Join(constants.NewRoot, constants.DataMountPoint),
}
- for _, target := range []*Target{bootTarget, rootATarget, rootBTarget, dataTarget} {
+ for _, target := range []*Target{bootTarget, dataTarget} {
if target == nil {
continue
}
@@ -414,18 +349,6 @@ func (t *Target) Partition(bd *blockdevice.BlockDevice) (err error) {
// EFI System Partition
typeID := "C12A7328-F81F-11D2-BA4B-00A0C93EC93B"
opts = append(opts, partition.WithPartitionType(typeID), partition.WithPartitionName(t.Label), partition.WithLegacyBIOSBootableAttribute(true))
- case constants.CurrentRootPartitionLabel():
- // Root Partition
- var typeID string
- switch runtime.GOARCH {
- case "386":
- typeID = "44479540-F297-41B2-9AF7-D131D5F0458A"
- case "amd64":
- typeID = "4F68BCE3-E8CD-4DB1-96E7-FBCAF984B709"
- default:
- return errors.Errorf("%s", "unsupported cpu architecture")
- }
- opts = append(opts, partition.WithPartitionType(typeID), partition.WithPartitionName(t.Label))
case constants.DataPartitionLabel:
// Data Partition
typeID := "AF3DC60F-8384-7247-8E79-3D69D8477DE4"
diff --git a/internal/pkg/install/prepare_test.go b/internal/pkg/install/prepare_test.go
index f9fd69497e3..0bc2c350cb1 100644
--- a/internal/pkg/install/prepare_test.go
+++ b/internal/pkg/install/prepare_test.go
@@ -33,7 +33,7 @@ func (suite *validateSuite) TestNewManifest() {
suite.Require().NoError(err)
manifests := NewManifest(data)
- assert.Equal(suite.T(), 4, len(manifests.Targets["/dev/sda"]))
+ assert.Equal(suite.T(), 2, len(manifests.Targets["/dev/sda"]))
}
func (suite *validateSuite) TestVerifyDevice() {
@@ -42,22 +42,17 @@ func (suite *validateSuite) TestVerifyDevice() {
err := yaml.Unmarshal([]byte(testConfig), data)
suite.Require().NoError(err)
- suite.Require().NoError(VerifyRootDevice(data))
suite.Require().NoError(VerifyBootDevice(data))
suite.Require().NoError(VerifyDataDevice(data))
- // No impact because we can infer all data from
- // data.install.Root.Device and defaults
+ // No impact because we can infer all data from the data device and
+ // defaults.
data.Install.Boot = nil
suite.Require().NoError(VerifyBootDevice(data))
- // No impact because we can infer all data from
- // data.install.Root.Device and defaults
- data.Install.Data = nil
+ data.Install.Data = &userdata.InstallDevice{
+ Device: "/dev/sda",
+ }
suite.Require().NoError(VerifyDataDevice(data))
- // Root is our base for the partitions, so
- // hard fail here
- data.Install.Root = nil
- suite.Require().Error(VerifyRootDevice(data))
}
func (suite *validateSuite) TestTargetInstall() {
@@ -171,9 +166,6 @@ install:
boot:
device: /dev/sda
size: 1024000000
- root:
- device: /dev/sda
- size: 1024000000
data:
device: /dev/sda
size: 1024000000
diff --git a/internal/pkg/mount/mount.go b/internal/pkg/mount/mount.go
index f7727d04561..201b6e11fa7 100644
--- a/internal/pkg/mount/mount.go
+++ b/internal/pkg/mount/mount.go
@@ -84,6 +84,7 @@ func WithRetry(mountpoint *Point, setters ...Option) (err error) {
}
target := path.Join(opts.Prefix, mountpoint.target)
+
if err = os.MkdirAll(target, os.ModeDir); err != nil {
return errors.Errorf("error creating mount point directory %s: %v", target, err)
}
diff --git a/internal/pkg/rootfs/cni/cni.go b/internal/pkg/rootfs/cni/cni.go
index e953c503a17..092cb5c1de0 100644
--- a/internal/pkg/rootfs/cni/cni.go
+++ b/internal/pkg/rootfs/cni/cni.go
@@ -5,37 +5,12 @@
package cni
import (
- "os"
- "path"
-
specs "github.com/opencontainers/runtime-spec/specs-go"
"github.com/pkg/errors"
"github.com/talos-systems/talos/internal/pkg/constants"
"github.com/talos-systems/talos/pkg/userdata"
)
-// Setup prepares the root file system for the requested CNI plugin.
-func Setup(s string, data *userdata.UserData) error {
- paths := []string{"/etc/cni/net.d"}
-
- switch data.Services.Init.CNI {
- case constants.CNICalico:
- paths = append(paths, "/run/calico", "/var/lib/calico")
- case constants.CNIFlannel:
- paths = append(paths, "/run/flannel")
- default:
- return errors.Errorf("unknown CNI %s", data.Services.Init.CNI)
- }
-
- for _, p := range paths {
- if err := os.MkdirAll(path.Join(s, p), os.ModeDir); err != nil {
- return errors.Wrapf(err, "failed to create directory %s", path.Join(s, p))
- }
- }
-
- return nil
-}
-
// Mounts returns the set of mounts required by the requested CNI plugin. All
// paths are relative to the root file system after switching the root.
func Mounts(data *userdata.UserData) ([]specs.Mount, error) {
diff --git a/internal/pkg/rootfs/etc/etc.go b/internal/pkg/rootfs/etc/etc.go
index 182e6beb06c..24a2cc9f38b 100644
--- a/internal/pkg/rootfs/etc/etc.go
+++ b/internal/pkg/rootfs/etc/etc.go
@@ -58,13 +58,11 @@ func Hosts(s, hostname, ip string) (err error) {
return
}
- if err := ioutil.WriteFile("/run/hosts", writer.Bytes(), 0644); err != nil {
- return fmt.Errorf("write /etc/hosts: %v", err)
+ if err := ioutil.WriteFile(filepath.Join(s, "/var/hosts"), writer.Bytes(), 0644); err != nil {
+ return fmt.Errorf("write /var/hosts: %v", err)
}
- // The kubelet wants to manage /etc/hosts. Create a symlink there that
- // points to a writable file.
- return createSymlink("/run/hosts", filepath.Join(s, "/etc/hosts"))
+ return nil
}
// ResolvConf copies the resolv.conf generated in the early boot to the new
@@ -80,28 +78,7 @@ func ResolvConf(s string) (err error) {
return err
}
- // We need to create this here since the rootfs is writable at this point,
- // and the file must exist when bind mounting later.
- dummy := filepath.Join(s, "/etc/resolv.conf")
- if _, err = os.Create(dummy); err != nil {
- return err
- }
-
- return nil
-}
-
-func createSymlink(source string, target string) (err error) {
- if _, err = os.Lstat(target); err == nil {
- if err = os.Remove(target); err != nil {
- return fmt.Errorf("remove symlink %s: %v", target, err)
- }
- }
- if err = os.Symlink(source, target); err != nil {
- return fmt.Errorf("symlink %s -> %s: %v", target, source, err)
- }
-
return nil
-
}
// OSRelease renders a valid /etc/os-release file and writes it to disk. The
@@ -135,8 +112,8 @@ func OSRelease(s string) (err error) {
return
}
- if err := ioutil.WriteFile(path.Join(s, "/etc/os-release"), writer.Bytes(), 0644); err != nil {
- return fmt.Errorf("write /etc/os-release: %v", err)
+ if err := ioutil.WriteFile(path.Join(s, "/var/os-release"), writer.Bytes(), 0644); err != nil {
+ return fmt.Errorf("write /var/os-release: %v", err)
}
return nil
diff --git a/internal/pkg/rootfs/mount/mount.go b/internal/pkg/rootfs/mount/mount.go
index ea1b6f23781..c4adebe26d6 100644
--- a/internal/pkg/rootfs/mount/mount.go
+++ b/internal/pkg/rootfs/mount/mount.go
@@ -21,6 +21,7 @@ import (
"github.com/talos-systems/talos/internal/pkg/mount/cgroups"
"github.com/talos-systems/talos/pkg/userdata"
"golang.org/x/sys/unix"
+ "gopkg.in/freddierice/go-losetup.v1"
)
// Initializer represents the early boot initialization control.
@@ -79,7 +80,7 @@ func (i *Initializer) MoveSpecial() (err error) {
iter := i.special.Iter()
for iter.Next() {
mountpoint := mount.NewMountPoint(iter.Value().Target(), iter.Value().Target(), "", unix.MS_MOVE, "")
- if err := mount.WithRetry(mountpoint, mount.WithPrefix(i.prefix)); err != nil {
+ if err = mount.WithRetry(mountpoint, mount.WithPrefix(i.prefix)); err != nil {
return errors.Errorf("error moving mount point %s: %v", iter.Value().Target(), err)
}
}
@@ -87,11 +88,11 @@ func (i *Initializer) MoveSpecial() (err error) {
return iter.Err()
}
- if err := mount.WithRetry(mount.NewMountPoint("tmpfs", "/dev/shm", "tmpfs", unix.MS_NOSUID|unix.MS_NOEXEC|unix.MS_NODEV|unix.MS_RELATIME, ""), mount.WithPrefix(i.prefix)); err != nil {
+ if err = mount.WithRetry(mount.NewMountPoint("tmpfs", "/dev/shm", "tmpfs", unix.MS_NOSUID|unix.MS_NOEXEC|unix.MS_NODEV|unix.MS_RELATIME, ""), mount.WithPrefix(i.prefix)); err != nil {
return errors.Errorf("error mounting mount point %s: %v", "/dev/shm", err)
}
- if err := mount.WithRetry(mount.NewMountPoint("devpts", "/dev/pts", "devpts", unix.MS_NOSUID|unix.MS_NOEXEC, "ptmxmode=000,mode=620,gid=5"), mount.WithPrefix(i.prefix)); err != nil {
+ if err = mount.WithRetry(mount.NewMountPoint("devpts", "/dev/pts", "devpts", unix.MS_NOSUID|unix.MS_NOEXEC, "ptmxmode=000,mode=620,gid=5"), mount.WithPrefix(i.prefix)); err != nil {
return errors.Errorf("error mounting mount point %s: %v", "/dev/pts", err)
}
@@ -100,7 +101,18 @@ func (i *Initializer) MoveSpecial() (err error) {
// InitOwned initializes and mounts the OS owned block devices in the early boot
// stage.
+//
+// nolint: gocyclo
func (i *Initializer) InitOwned() (err error) {
+ var dev losetup.Device
+ dev, err = losetup.Attach("/"+constants.RootfsAsset, 0, true)
+ if err != nil {
+ return err
+ }
+ m := mount.NewMountPoint(dev.Path(), "/", "squashfs", unix.MS_RDONLY, "")
+ if err = mount.WithRetry(m, mount.WithPrefix(i.prefix), mount.WithReadOnly(true), mount.WithShared(true)); err != nil {
+ return errors.Wrap(err, "failed to mount squashfs")
+ }
var owned *mount.Points
if owned, err = mountpoints(); err != nil {
return errors.Errorf("error initializing owned block devices: %v", err)
@@ -155,14 +167,8 @@ func ExtraDevices(data *userdata.UserData) (err error) {
func (i *Initializer) MountOwned() (err error) {
iter := i.owned.Iter()
for iter.Next() {
- if iter.Key() == constants.CurrentRootPartitionLabel() {
- if err = mount.WithRetry(iter.Value(), mount.WithPrefix(i.prefix), mount.WithReadOnly(true), mount.WithShared(true)); err != nil {
- return errors.Errorf("error mounting partitions: %v", err)
- }
- } else {
- if err = mount.WithRetry(iter.Value(), mount.WithPrefix(i.prefix)); err != nil {
- return errors.Errorf("error mounting partitions: %v", err)
- }
+ if err = mount.WithRetry(iter.Value(), mount.WithPrefix(i.prefix)); err != nil {
+ return errors.Errorf("error mounting partitions: %v", err)
}
}
if iter.Err() != nil {
@@ -191,17 +197,14 @@ func (i *Initializer) UnmountOwned() (err error) {
// https://github.com/karelzak/util-linux/blob/master/sys-utils/switch_root.c.
// nolint: gocyclo
func (i *Initializer) Switch() (err error) {
- // Unmount the ROOT and DATA block devices.
if err = i.UnmountOwned(); err != nil {
return err
}
- // Mount the ROOT and DATA block devices at the new root.
if err = i.MountOwned(); err != nil {
return errors.Wrap(err, "error mounting block device")
}
- // Move the special mount points to the new root.
if err = i.MoveSpecial(); err != nil {
return errors.Wrap(err, "error moving special devices")
}
@@ -234,8 +237,10 @@ func (i *Initializer) Switch() (err error) {
return errors.Wrap(err, "error deleting initramfs")
}
- if err = unix.Exec("/sbin/machined", []string{"/sbin/machined"}, []string{}); err != nil {
- return errors.Wrap(err, "error executing /sbin/machined")
+ // Note that /sbin/init is machined. We call it init since this is the
+ // convention.
+ if err = unix.Exec("/sbin/init", []string{"/sbin/init"}, []string{}); err != nil {
+ return errors.Wrap(err, "error executing /sbin/init")
}
return nil
@@ -244,12 +249,9 @@ func (i *Initializer) Switch() (err error) {
// nolint: dupl
func mountpoints() (mountpoints *mount.Points, err error) {
mountpoints = mount.NewMountPoints()
- for _, name := range []string{constants.CurrentRootPartitionLabel(), constants.DataPartitionLabel, constants.BootPartitionLabel} {
+ for _, name := range []string{constants.DataPartitionLabel, constants.BootPartitionLabel} {
var target string
switch name {
- case constants.CurrentRootPartitionLabel():
- log.Printf("using root parititon with label %s", name)
- target = constants.RootMountPoint
case constants.DataPartitionLabel:
target = constants.DataMountPoint
case constants.BootPartitionLabel:
diff --git a/internal/pkg/rootfs/rootfs.go b/internal/pkg/rootfs/rootfs.go
index 0d276d8df14..6d3f99014de 100644
--- a/internal/pkg/rootfs/rootfs.go
+++ b/internal/pkg/rootfs/rootfs.go
@@ -15,7 +15,6 @@ import (
"github.com/pkg/errors"
"github.com/talos-systems/talos/internal/pkg/constants"
"github.com/talos-systems/talos/internal/pkg/grpc/gen"
- "github.com/talos-systems/talos/internal/pkg/rootfs/cni"
"github.com/talos-systems/talos/internal/pkg/rootfs/etc"
"github.com/talos-systems/talos/internal/pkg/rootfs/proc"
"github.com/talos-systems/talos/pkg/crypto/x509"
@@ -66,32 +65,10 @@ func Prepare(s string, inContainer bool, data *userdata.UserData) (err error) {
}
}
- // Create required directories that are not part of FHS.
- for _, path := range []string{"/etc/kubernetes/manifests", "/etc/cni", "/var/lib/kubelet", "/var/log/pods", "/usr/libexec/kubernetes"} {
- if err = os.MkdirAll(filepath.Join(s, path), 0700); err != nil {
- return err
- }
- }
- // Create symlinks to /etc/ssl/certs as required by the control plane.
- for _, path := range []string{"/etc/pki", "/usr/share/ca-certificates", "/usr/local/share/ca-certificates", "/etc/ca-certificates"} {
- target := filepath.Join(s, path)
- if _, err = os.Stat(target); os.IsNotExist(err) {
- if err = os.MkdirAll(filepath.Dir(target), 0700); err != nil {
- return err
- }
- if err = os.Symlink("/etc/ssl/certs", target); err != nil {
- return err
- }
- }
- }
// Create /etc/os-release.
if err = etc.OSRelease(s); err != nil {
return
}
- // Setup directories required by the CNI plugin.
- if err = cni.Setup(s, data); err != nil {
- return
- }
// Generate the identity certificate.
if err = generatePKI(data); err != nil {
return
diff --git a/internal/pkg/upgrade/upgrade.go b/internal/pkg/upgrade/upgrade.go
index a1dcd225e0f..eef33ebf1c1 100644
--- a/internal/pkg/upgrade/upgrade.go
+++ b/internal/pkg/upgrade/upgrade.go
@@ -15,19 +15,15 @@ import (
"github.com/pkg/errors"
"github.com/talos-systems/talos/internal/pkg/blockdevice/bootloader/syslinux"
- "github.com/talos-systems/talos/internal/pkg/blockdevice/probe"
"github.com/talos-systems/talos/internal/pkg/constants"
"github.com/talos-systems/talos/internal/pkg/install"
"github.com/talos-systems/talos/internal/pkg/kernel"
"github.com/talos-systems/talos/internal/pkg/kubernetes"
- "github.com/talos-systems/talos/internal/pkg/mount"
"github.com/talos-systems/talos/pkg/userdata"
"go.etcd.io/etcd/clientv3"
"go.etcd.io/etcd/pkg/transport"
- "golang.org/x/sys/unix"
-
yaml "gopkg.in/yaml.v2"
)
@@ -54,9 +50,6 @@ func NewUpgrade(url string) (err error) {
return err
}
- if err = upgradeRoot(url); err != nil {
- return err
- }
if err = upgradeBoot(url); err != nil {
return err
}
@@ -89,65 +82,23 @@ func NewUpgrade(url string) (err error) {
return err
}
-func upgradeRoot(url string) (err error) {
- // Identify next root disk
- var dev *probe.ProbedBlockDevice
- if dev, err = probe.GetDevWithFileSystemLabel(constants.NextRootPartitionLabel()); err != nil {
- return
- }
-
- // Should we handle anything around the disk/partition itself? maybe Format()
- rootTarget := install.Target{
- Label: constants.NextRootPartitionLabel(),
- MountPoint: "/var/nextroot",
- Device: dev.Path,
- FileSystemType: "xfs",
- Force: true,
- PartitionName: dev.Path,
- Assets: []*install.Asset{},
- }
-
- rootTarget.Assets = append(rootTarget.Assets, &install.Asset{
- Source: url + "/" + constants.RootfsAsset,
- Destination: constants.RootfsAsset,
- })
-
- if err = rootTarget.Format(); err != nil {
- return
- }
-
- // mount up 'next' root disk rw
- mountpoint := mount.NewMountPoint(dev.Path, rootTarget.MountPoint, dev.SuperBlock.Type(), unix.MS_NOATIME, "")
-
- if err = mount.WithRetry(mountpoint); err != nil {
- return errors.Errorf("error mounting partitions: %v", err)
- }
-
- // Ensure we unmount the new rootfs in case of failure
- // nolint: errcheck
- defer mount.UnWithRetry(mountpoint)
-
- // install assets
- return rootTarget.Install()
-}
-
func upgradeBoot(url string) error {
bootTarget := install.Target{
Label: constants.BootPartitionLabel,
- MountPoint: "/boot",
+ MountPoint: constants.BootMountPoint,
Assets: []*install.Asset{},
}
// Kernel
bootTarget.Assets = append(bootTarget.Assets, &install.Asset{
Source: url + "/" + constants.KernelAsset,
- Destination: filepath.Join(constants.NextRootPartitionLabel(), constants.KernelAsset),
+ Destination: filepath.Join("/", "default", constants.KernelAsset),
})
// Initramfs
bootTarget.Assets = append(bootTarget.Assets, &install.Asset{
Source: url + "/" + constants.InitramfsAsset,
- Destination: filepath.Join(constants.NextRootPartitionLabel(), constants.InitramfsAsset),
+ Destination: filepath.Join("/", "default", constants.InitramfsAsset),
})
var err error
@@ -158,18 +109,9 @@ func upgradeBoot(url string) error {
// TODO: Figure out a method to update kernel args
nextCmdline := kernel.NewCmdline(kernel.Cmdline().String())
- // talos.root=
- talosRoot := kernel.NewParameter(constants.KernelCurrentRoot)
- talosRoot.Append(constants.NextRootPartitionLabel())
- if root := nextCmdline.Get(constants.KernelCurrentRoot); root == nil {
- nextCmdline.Append(constants.KernelCurrentRoot, *(talosRoot.First()))
- } else {
- nextCmdline.Set(constants.KernelCurrentRoot, talosRoot)
- }
-
- // initrd=
+ // Set the initrd kernel paramaeter.
initParam := kernel.NewParameter("initrd")
- initParam.Append(filepath.Join("/", constants.NextRootPartitionLabel(), constants.InitramfsAsset))
+ initParam.Append(filepath.Join("/", "default", constants.InitramfsAsset))
if initrd := nextCmdline.Get("initrd"); initrd == nil {
nextCmdline.Append("initrd", *(initParam.First()))
} else {
@@ -177,27 +119,19 @@ func upgradeBoot(url string) error {
}
// Create bootloader config
- bootcfg := &syslinux.Cfg{
- Default: constants.NextRootPartitionLabel(),
+ syslinuxcfg := &syslinux.Cfg{
+ Default: "default",
Labels: []*syslinux.Label{
{
- Root: constants.NextRootPartitionLabel(),
- Kernel: filepath.Join("/", constants.NextRootPartitionLabel(), constants.KernelAsset),
- Initrd: filepath.Join("/", constants.NextRootPartitionLabel(), constants.InitramfsAsset),
+ Root: "default",
+ Kernel: filepath.Join("/", "default", constants.KernelAsset),
+ Initrd: filepath.Join("/", "default", constants.InitramfsAsset),
Append: nextCmdline.String(),
},
- // TODO see if we can omit this section and/or pass in only the root(?)
- // so we can make use of existing boot config
- {
- Root: constants.CurrentRootPartitionLabel(),
- Kernel: filepath.Join("/", constants.CurrentRootPartitionLabel(), constants.KernelAsset),
- Initrd: filepath.Join("/", constants.CurrentRootPartitionLabel(), constants.InitramfsAsset),
- Append: kernel.Cmdline().String(),
- },
},
}
- return syslinux.Install(constants.BootMountPoint, bootcfg)
+ return syslinux.Install(constants.BootMountPoint, syslinuxcfg)
}
// Reset calls kubeadm reset to clean up a kubernetes installation
diff --git a/pkg/userdata/install.go b/pkg/userdata/install.go
index 2cca9fe559b..ee1bc6f676d 100644
--- a/pkg/userdata/install.go
+++ b/pkg/userdata/install.go
@@ -7,7 +7,6 @@ package userdata
// Install represents the installation options for preparing a node.
type Install struct {
Boot *BootDevice `yaml:"boot,omitempty"`
- Root *RootDevice `yaml:"root"`
Data *InstallDevice `yaml:"data,omitempty"`
ExtraDevices []*ExtraDevice `yaml:"extraDevices,omitempty"`
ExtraKernelArgs []string `yaml:"extraKernelArgs,omitempty"`
|
terraform-provider-aws
|
https://github.com/hashicorp/terraform-provider-aws
|
0bed8e5970e330ad92f8692bdab7c13cb38480f1
|
dependabot[bot]
|
2024-08-21 23:59:43
|
chore(deps): bump mvdan.cc/gofumpt from 0.6.0 to 0.7.0 in /.ci/tools (#38938)
|
Bumps [mvdan.cc/gofumpt](https://github.com/mvdan/gofumpt) from 0.6.0 to 0.7.0.
- [Release notes](https://github.com/mvdan/gofumpt/releases)
- [Changelog](https://github.com/mvdan/gofumpt/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mvdan/gofumpt/compare/v0.6.0...v0.7.0)
---
|
chore(deps): bump mvdan.cc/gofumpt from 0.6.0 to 0.7.0 in /.ci/tools (#38938)
Bumps [mvdan.cc/gofumpt](https://github.com/mvdan/gofumpt) from 0.6.0 to 0.7.0.
- [Release notes](https://github.com/mvdan/gofumpt/releases)
- [Changelog](https://github.com/mvdan/gofumpt/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mvdan/gofumpt/compare/v0.6.0...v0.7.0)
---
updated-dependencies:
- dependency-name: mvdan.cc/gofumpt
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
|
diff --git a/.ci/tools/go.mod b/.ci/tools/go.mod
index f48768a16b8..851b52727a0 100644
--- a/.ci/tools/go.mod
+++ b/.ci/tools/go.mod
@@ -13,7 +13,7 @@ require (
github.com/rhysd/actionlint v1.7.1
github.com/terraform-linters/tflint v0.52.0
github.com/uber-go/gopatch v0.4.0
- mvdan.cc/gofumpt v0.6.0
+ mvdan.cc/gofumpt v0.7.0
)
require (
diff --git a/.ci/tools/go.sum b/.ci/tools/go.sum
index 597518d1efa..6c7b07014d8 100644
--- a/.ci/tools/go.sum
+++ b/.ci/tools/go.sum
@@ -467,6 +467,8 @@ github.com/go-openapi/errors v0.20.2 h1:dxy7PGTqEh94zj2E3h1cUmQQWiM1+aeCROfAr02E
github.com/go-openapi/errors v0.20.2/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M=
github.com/go-openapi/strfmt v0.21.3 h1:xwhj5X6CjXEZZHMWy1zKJxvW9AfHC9pkyUjLvHtKG7o=
github.com/go-openapi/strfmt v0.21.3/go.mod h1:k+RzNO0Da+k3FrrynSNN8F7n/peCmQQqbbXjtDfvmGg=
+github.com/go-quicktest/qt v1.101.0 h1:O1K29Txy5P2OK0dGo59b7b0LR6wKfIhttaAhHUyn7eI=
+github.com/go-quicktest/qt v1.101.0/go.mod h1:14Bz/f7NwaXPtdYEgzsx46kqSxVwTbzVZsDC26tQJow=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI=
github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8=
@@ -1918,8 +1920,8 @@ honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9
honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
honnef.co/go/tools v0.4.7 h1:9MDAWxMoSnB6QoSqiVr7P5mtkT9pOc1kSxchzPCnqJs=
honnef.co/go/tools v0.4.7/go.mod h1:+rnGS1THNh8zMwnd2oVOTL9QF6vmfyG6ZXBULae2uc0=
-mvdan.cc/gofumpt v0.6.0 h1:G3QvahNDmpD+Aek/bNOLrFR2XC6ZAdo62dZu65gmwGo=
-mvdan.cc/gofumpt v0.6.0/go.mod h1:4L0wf+kgIPZtcCWXynNS2e6bhmj73umwnuXSZarixzA=
+mvdan.cc/gofumpt v0.7.0 h1:bg91ttqXmi9y2xawvkuMXyvAA/1ZGJqYAEGjXuP0JXU=
+mvdan.cc/gofumpt v0.7.0/go.mod h1:txVFJy/Sc/mvaycET54pV8SW8gWxTlUuGHVEcncmNUo=
mvdan.cc/unparam v0.0.0-20240528143540-8a5130ca722f h1:lMpcwN6GxNbWtbpI1+xzFLSW8XzX0u72NttUGVFjO3U=
mvdan.cc/unparam v0.0.0-20240528143540-8a5130ca722f/go.mod h1:RSLa7mKKCNeTTMHBw5Hsy2rfJmd6O2ivt9Dw9ZqCQpQ=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
|
iceberg
|
https://github.com/apache/iceberg
|
f9f7312ecb851a58502aa49f431c5b8888f809b5
|
dependabot[bot]
|
2022-10-01 15:23:04
|
Build: Bump jinja2 from 3.0.3 to 3.1.2 in /python (#5849)
|
Bumps [jinja2](https://github.com/pallets/jinja) from 3.0.3 to 3.1.2.
- [Release notes](https://github.com/pallets/jinja/releases)
- [Changelog](https://github.com/pallets/jinja/blob/main/CHANGES.rst)
- [Commits](https://github.com/pallets/jinja/compare/3.0.3...3.1.2)
---
|
Build: Bump jinja2 from 3.0.3 to 3.1.2 in /python (#5849)
Bumps [jinja2](https://github.com/pallets/jinja) from 3.0.3 to 3.1.2.
- [Release notes](https://github.com/pallets/jinja/releases)
- [Changelog](https://github.com/pallets/jinja/blob/main/CHANGES.rst)
- [Commits](https://github.com/pallets/jinja/compare/3.0.3...3.1.2)
---
updated-dependencies:
- dependency-name: jinja2
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
|
diff --git a/python/mkdocs/requirements.txt b/python/mkdocs/requirements.txt
index 642a688ebc5a..b21284bb84b0 100644
--- a/python/mkdocs/requirements.txt
+++ b/python/mkdocs/requirements.txt
@@ -16,4 +16,4 @@
# under the License.
mkdocs==1.3.1
-jinja2==3.0.3
+jinja2==3.1.2
|
cockpit
|
https://github.com/cockpit-project/cockpit
|
71524710db02519c565999d4a7725305a0e8cb4a
|
Martin Pitt
|
2025-03-20 21:42:10
|
test: Make TestUpdates.testTracer more realistic
|
Put an actual binary (copy of `sleep` command) into the upgraded test
package. This makes `dnf needs-restarting` actually detect a necessary
change. With a shell script, there is no running binary which actually
changed on package upgrade. `tracer` does not seem to care, but (of
course) this also works with tracer.
Fix the initial newline in the .service unit, which looks odd.
|
test: Make TestUpdates.testTracer more realistic
Put an actual binary (copy of `sleep` command) into the upgraded test
package. This makes `dnf needs-restarting` actually detect a necessary
change. With a shell script, there is no running binary which actually
changed on package upgrade. `tracer` does not seem to care, but (of
course) this also works with tracer.
Fix the initial newline in the .service unit, which looks odd.
|
diff --git a/test/verify/check-packagekit b/test/verify/check-packagekit
index 0bc66a717748..2c521cd3a8e6 100755
--- a/test/verify/check-packagekit
+++ b/test/verify/check-packagekit
@@ -421,20 +421,20 @@ echo -e "Loaded patch modules:\nkpatch_3_10_0_1062_1_1 [enabled]\n\nInstalled pa
def createServicePackageUpgrade(self, package: str) -> str:
m = self.machine
- scriptContent = "#!/bin/sh\nsleep infinity"
- unitContent = f"""
-[Service]
-ExecStart=/usr/local/bin/{package}
+ unitContent = f"""[Service]
+ExecStart=/usr/local/bin/{package} infinity
"""
self.createPackage(package, "1", "1", install=True, changes="initial package with service and run script",
- content={f"/usr/local/bin/{package}": scriptContent,
+ content={f"/usr/local/bin/{package}": {"path": "/usr/bin/sleep"},
f"/etc/systemd/system/{package}.service": unitContent},
postinst=(f"chmod a+x /usr/local/bin/{package};"
- f"systemctl daemon-reload; systemctl start {package}.service"))
+ f"systemctl daemon-reload; systemctl start {package}.service"),
+ arch=self.secondary_arch)
self.createPackage(package, "1", "2",
- content={f"/usr/local/bin/{package}": scriptContent,
+ content={f"/usr/local/bin/{package}": {"path": "/usr/bin/sleep"},
f"/etc/systemd/system/{package}.service": unitContent},
- postinst=f"chmod a+x /usr/local/bin/{package}")
+ postinst=f"chmod a+x /usr/local/bin/{package}",
+ arch=self.secondary_arch)
startTime = m.execute(f"systemctl show {package}.service --property=ExecMainStartTimestamp")
|
RSSHub
|
https://github.com/DIYgod/RSSHub
|
ffb4767dacd8528a70a98553c32771fda31cd490
|
Nano
|
2024-09-12 19:14:59
|
fix(route/bilibili): add logger to handle error codes (#16721)
|
Add logger to handle error codes returned by the Bilibili API. If the response code is -6 or 4100000, it throws a ConfigNotFoundError. Otherwise, it throws an error with the corresponding error code and message.
|
fix(route/bilibili): add logger to handle error codes (#16721)
Add logger to handle error codes returned by the Bilibili API. If the response code is -6 or 4100000, it throws a ConfigNotFoundError. Otherwise, it throws an error with the corresponding error code and message.
Fixes #16716
|
diff --git a/lib/routes/bilibili/followings-video.ts b/lib/routes/bilibili/followings-video.ts
index 6a112ed90a8b45..0707a240238723 100644
--- a/lib/routes/bilibili/followings-video.ts
+++ b/lib/routes/bilibili/followings-video.ts
@@ -4,6 +4,7 @@ import cache from './cache';
import { config } from '@/config';
import utils from './utils';
import ConfigNotFoundError from '@/errors/types/config-not-found';
+import logger from '@/utils/logger';
export const route: Route = {
path: '/followings/video/:uid/:disableEmbed?',
@@ -53,10 +54,15 @@ async function handler(ctx) {
Cookie: cookie,
},
});
- if (response.data.code === -6) {
- throw new ConfigNotFoundError('对应 uid 的 Bilibili 用户的 Cookie 已过期');
+ const data = response.data;
+ if (data.code) {
+ logger.error(JSON.stringify(data));
+ if (data.code === -6 || data.code === 4_100_000) {
+ throw new ConfigNotFoundError('对应 uid 的 Bilibili 用户的 Cookie 已过期');
+ }
+ throw new Error(`Got error code ${data.code} while fetching: ${data.message}`);
}
- const cards = response.data.data.cards;
+ const cards = data.data.cards;
const out = cards.map((card) => {
const card_data = JSON.parse(card.card);
|
sentry
|
https://github.com/getsentry/sentry
|
52ddd432cfca3081f45821d0502a7f6e9af01539
|
Stephen Cefali
|
2022-02-08 22:41:06
|
feat(ui): creates sessionStorage wrapper (#31612)
|
This PR makes a wrapper around sessionStorage that won't error out when we can't modify session storage the same way we handle localStorage. It also makes sure that if window is ever undefined, it won't blow up (not sure if that's possible with Sentry but it's definitely possible with server-side rendering).
|
feat(ui): creates sessionStorage wrapper (#31612)
This PR makes a wrapper around sessionStorage that won't error out when we can't modify session storage the same way we handle localStorage. It also makes sure that if window is ever undefined, it won't blow up (not sure if that's possible with Sentry but it's definitely possible with server-side rendering).
|
diff --git a/static/app/utils/createStorage.tsx b/static/app/utils/createStorage.tsx
new file mode 100644
index 00000000000000..78d984a76b64f6
--- /dev/null
+++ b/static/app/utils/createStorage.tsx
@@ -0,0 +1,31 @@
+// our storage wrapper is a subset of the full API
+type Storage = Pick<globalThis.Storage, 'getItem' | 'setItem' | 'removeItem'>;
+
+export default function createStorage(getStorage: () => globalThis.Storage): Storage {
+ try {
+ const storage = getStorage();
+ const mod = 'sentry';
+ storage.setItem(mod, mod);
+ storage.removeItem(mod);
+
+ return {
+ setItem: storage.setItem.bind(storage),
+ getItem: storage.getItem.bind(storage),
+ removeItem: storage.removeItem.bind(storage),
+ } as Storage;
+ } catch (e) {
+ return {
+ setItem() {
+ return;
+ },
+ // Returns null if key doesn't exist:
+ // https://developer.mozilla.org/en-US/docs/Web/API/Storage/getItem
+ getItem() {
+ return null;
+ },
+ removeItem() {
+ return null;
+ },
+ };
+ }
+}
diff --git a/static/app/utils/localStorage.tsx b/static/app/utils/localStorage.tsx
index 4d746ffc164965..ceae6769c37eae 100644
--- a/static/app/utils/localStorage.tsx
+++ b/static/app/utils/localStorage.tsx
@@ -1,39 +1,5 @@
-interface LocalStorage {
- getItem(key: string): string | null;
- removeItem(key: string): void;
- setItem(key: string, value: string): void;
-}
+import createLocalStorage from './createStorage';
-function createLocalStorage(): LocalStorage {
- try {
- const localStorage = window.localStorage;
+const Storage = createLocalStorage(() => window.localStorage);
- const mod = 'sentry';
- localStorage.setItem(mod, mod);
- localStorage.removeItem(mod);
-
- return {
- setItem: localStorage.setItem.bind(localStorage),
- getItem: localStorage.getItem.bind(localStorage),
- removeItem: localStorage.removeItem.bind(localStorage),
- } as LocalStorage;
- } catch (e) {
- return {
- setItem() {
- return;
- },
- // Returns null if key doesn't exist:
- // https://developer.mozilla.org/en-US/docs/Web/API/Storage/getItem
- getItem() {
- return null;
- },
- removeItem() {
- return null;
- },
- } as LocalStorage;
- }
-}
-
-const functions = createLocalStorage();
-
-export default functions;
+export default Storage;
diff --git a/static/app/utils/sessionStorage.tsx b/static/app/utils/sessionStorage.tsx
new file mode 100644
index 00000000000000..65fedeacc056a1
--- /dev/null
+++ b/static/app/utils/sessionStorage.tsx
@@ -0,0 +1,5 @@
+import createLocalStorage from './createStorage';
+
+const Storage = createLocalStorage(() => window.sessionStorage);
+
+export default Storage;
|
immortalwrt
|
https://github.com/immortalwrt/immortalwrt
|
52751b12320599b557d8c7779b612102b963595d
|
Zeyu Dong
|
2023-10-29 01:04:20
|
build: cache kernel module package compiling
|
Kernel module packages compiling is not cached (e.g. mac80211)
even with CONFIG_CCACHE on.
CC should be set to KERNEL_CC in KERNEL_MAKE_FLAGS at kernel.mk
to allow kernel module packages using ccache.
|
build: cache kernel module package compiling
Kernel module packages compiling is not cached (e.g. mac80211)
even with CONFIG_CCACHE on.
CC should be set to KERNEL_CC in KERNEL_MAKE_FLAGS at kernel.mk
to allow kernel module packages using ccache.
Signed-off-by: Zeyu Dong <[email protected]>
|
diff --git a/include/kernel-defaults.mk b/include/kernel-defaults.mk
index a0527c0d286..d9842fd82ae 100644
--- a/include/kernel-defaults.mk
+++ b/include/kernel-defaults.mk
@@ -9,10 +9,6 @@ endif
INITRAMFS_EXTRA_FILES ?= $(GENERIC_PLATFORM_DIR)/image/initramfs-base-files.txt
-ifneq (,$(KERNEL_CC))
- KERNEL_MAKEOPTS += CC="$(KERNEL_CC)"
-endif
-
export HOST_EXTRACFLAGS=-I$(STAGING_DIR_HOST)/include
# defined in quilt.mk
diff --git a/include/kernel.mk b/include/kernel.mk
index 3012eb89935..8236416132d 100644
--- a/include/kernel.mk
+++ b/include/kernel.mk
@@ -119,6 +119,10 @@ KERNEL_MAKE_FLAGS = \
cmd_syscalls= \
$(if $(__package_mk),KBUILD_EXTRA_SYMBOLS="$(wildcard $(PKG_SYMVERS_DIR)/*.symvers)")
+ifneq (,$(KERNEL_CC))
+ KERNEL_MAKE_FLAGS += CC="$(KERNEL_CC)"
+endif
+
KERNEL_NOSTDINC_FLAGS = \
-nostdinc $(if $(DUMP),, -isystem $(shell $(TARGET_CC) -print-file-name=include))
|
downshift
|
https://github.com/downshift-js/downshift
|
0ff43a30db1f5e0e6b238fdb417ca70529e79d68
|
Frank Li
|
2018-08-20 23:39:08
|
fix(TS): improved typings for getMenuProps (#534)
|
* Improved typings for getMenuProps
Fixes the typing part of #490
* Update index.d.ts
* Fixed build error
* Update index.d.ts
|
fix(TS): improved typings for getMenuProps (#534)
* Improved typings for getMenuProps
Fixes the typing part of #490
* Update index.d.ts
* Fixed build error
* Update index.d.ts
|
diff --git a/typings/index.d.ts b/typings/index.d.ts
index 5e8330709..15ac9838e 100644
--- a/typings/index.d.ts
+++ b/typings/index.d.ts
@@ -109,24 +109,29 @@ export interface GetInputPropsOptions
export interface GetLabelPropsOptions
extends React.HTMLProps<HTMLLabelElement> {}
-export interface getToggleButtonPropsOptions
+export interface GetToggleButtonPropsOptions
extends React.HTMLProps<HTMLButtonElement> {}
-interface OptionalExtraGetItemPropsOptions {
- [key: string]: any
+export interface GetMenuPropsOptions {
+ refKey?: string;
+ ['aria-label']?: string;
+};
+
+export interface GetMenuPropsOtherOptions {
+ suppressRefError?: boolean;
}
export interface GetItemPropsOptions<Item>
- extends OptionalExtraGetItemPropsOptions {
+ extends Record<string, any> {
index?: number
item: Item
}
export interface PropGetters<Item> {
getRootProps: (options: GetRootPropsOptions) => any
- getToggleButtonProps: (options?: getToggleButtonPropsOptions) => any
+ getToggleButtonProps: (options?: GetToggleButtonPropsOptions) => any
getLabelProps: (options?: GetLabelPropsOptions) => any
- getMenuProps: (options?: {}) => any
+ getMenuProps: (options?: GetMenuPropsOptions, otherOptions?: GetMenuPropsOtherOptions) => any
getInputProps: (options?: GetInputPropsOptions) => any
getItemProps: (options: GetItemPropsOptions<Item>) => any
}
|
sentry
|
https://github.com/getsentry/sentry
|
7a6d28de1a2eb15a2ef2fe61abc35bc0bc3f5b1b
|
Elias Hussary
|
2023-05-05 23:02:32
|
feat(replay): details issue tab support backend errors (#48479)
|
## Summary
Adds backend error support in replay details issue tab.
|
feat(replay): details issue tab support backend errors (#48479)
## Summary
Adds backend error support in replay details issue tab.
Requires: https://github.com/getsentry/sentry/pull/48493
Relates to: https://github.com/getsentry/sentry/issues/48249
Closes: https://github.com/getsentry/sentry/issues/48478

|
diff --git a/static/app/api.tsx b/static/app/api.tsx
index 2f94c73e9d4f89..e18f48c6179f2b 100644
--- a/static/app/api.tsx
+++ b/static/app/api.tsx
@@ -217,6 +217,10 @@ export type RequestOptions = RequestCallbacks & {
* Values to attach to the body of the request.
*/
data?: any;
+ /**
+ * Headers add to the request.
+ */
+ headers?: Record<string, string>;
/**
* The HTTP method to use when making the API request
*/
@@ -430,6 +434,7 @@ export class Client {
const headers = new Headers({
Accept: 'application/json; charset=utf-8',
'Content-Type': 'application/json',
+ ...options.headers,
});
// Do not set the X-CSRFToken header when making a request outside of the
diff --git a/static/app/views/replays/detail/issueList.tsx b/static/app/views/replays/detail/issueList.tsx
index 8d96522229ec5e..575e40da89dbe4 100644
--- a/static/app/views/replays/detail/issueList.tsx
+++ b/static/app/views/replays/detail/issueList.tsx
@@ -1,4 +1,4 @@
-import {Fragment, useCallback, useEffect, useMemo, useState} from 'react';
+import {Fragment, useCallback, useEffect, useState} from 'react';
import styled from '@emotion/styled';
import * as Sentry from '@sentry/react';
@@ -17,7 +17,6 @@ import theme from 'sentry/utils/theme';
import useApi from 'sentry/utils/useApi';
import useMedia from 'sentry/utils/useMedia';
import useOrganization from 'sentry/utils/useOrganization';
-import useProjects from 'sentry/utils/useProjects';
type Props = {
projectId: string;
@@ -35,8 +34,6 @@ function IssueList({projectId, replayId}: Props) {
const organization = useOrganization();
const api = useApi();
const isScreenLarge = useMedia(`(min-width: ${theme.breakpoints.large})`);
- const {projects} = useProjects();
- const project = projects.find(p => p.id === projectId);
const [state, setState] = useState<State>({
fetchError: undefined,
@@ -54,10 +51,11 @@ function IssueList({projectId, replayId}: Props) {
`/organizations/${organization.slug}/issues/`,
{
query: {
- // TODO(replays): What about backend issues?
- project: projectId,
query: `replayId:${replayId}`,
},
+ headers: {
+ 'x-sentry-replay-request': '1',
+ },
}
);
setState({
@@ -73,20 +71,15 @@ function IssueList({projectId, replayId}: Props) {
issues: [],
});
}
- }, [api, organization.slug, replayId, projectId]);
+ }, [api, organization.slug, replayId]);
useEffect(() => {
fetchIssueData();
}, [fetchIssueData]);
- const projectIds = useMemo(
- () => (project?.id ? [Number(project.id)] : []),
- [project?.id]
- );
const counts = useReplaysCount({
groupIds: state.issues.map(issue => issue.id),
organization,
- projectIds,
});
return (
@@ -99,14 +92,17 @@ function IssueList({projectId, replayId}: Props) {
isScreenLarge ? columns : columns.filter(column => column !== t('Graph'))
}
>
- {state.issues.map(issue => (
- <TableRow
- key={issue.id}
- isScreenLarge={isScreenLarge}
- issue={issue}
- organization={organization}
- />
- )) || null}
+ {state.issues
+ // prioritize the replay issues first
+ .sort(a => (a.project.id === projectId ? -1 : 1))
+ .map(issue => (
+ <TableRow
+ key={issue.id}
+ isScreenLarge={isScreenLarge}
+ issue={issue}
+ organization={organization}
+ />
+ )) || null}
</StyledPanelTable>
</ReplayCountContext.Provider>
);
|
aws-cdk
|
https://github.com/aws/aws-cdk
|
f5988852e7f9520768551859a8e9fdabd7dba2b1
|
Eli Polonsky
|
2024-11-13 15:37:56
|
chore: disable codecov workflow on forks (#32109)
|
We shouldn't be trying to publish codecov results when the workflow runs in a fork. Nevermind that it will most likely fail because a token is required.
----
*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
chore: disable codecov workflow on forks (#32109)
We shouldn't be trying to publish codecov results when the workflow runs in a fork. Nevermind that it will most likely fail because a token is required.
----
*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml
index 73cf3abea7b73..c313f13efc77d 100644
--- a/.github/workflows/codecov.yml
+++ b/.github/workflows/codecov.yml
@@ -9,6 +9,7 @@ on:
jobs:
collect:
name: collect
+ if: github.repository == 'aws/aws-cdk'
runs-on: ubuntu-latest
steps:
- name: Checkout
|
hyper
|
https://github.com/hyperium/hyper
|
24f11a421d8422714bf023a602d7718b885a39a0
|
Theodore Cipicchio
|
2018-08-27 23:02:53
|
fix(http2): allow TE "trailers" request headers
|
The HTTP/2 spec allows TE headers in requests if the value is
"trailers". Other TE headers are still stripped.
|
fix(http2): allow TE "trailers" request headers
The HTTP/2 spec allows TE headers in requests if the value is
"trailers". Other TE headers are still stripped.
Closes #1642
|
diff --git a/src/proto/h2/client.rs b/src/proto/h2/client.rs
index 1570d2ee0a..b285574f47 100644
--- a/src/proto/h2/client.rs
+++ b/src/proto/h2/client.rs
@@ -108,7 +108,7 @@ where
}
let (head, body) = req.into_parts();
let mut req = ::http::Request::from_parts(head, ());
- super::strip_connection_headers(req.headers_mut());
+ super::strip_connection_headers(req.headers_mut(), true);
if let Some(len) = body.content_length() {
headers::set_content_length_if_missing(req.headers_mut(), len);
}
diff --git a/src/proto/h2/mod.rs b/src/proto/h2/mod.rs
index de877f0bc7..6620877210 100644
--- a/src/proto/h2/mod.rs
+++ b/src/proto/h2/mod.rs
@@ -15,15 +15,17 @@ mod server;
pub(crate) use self::client::Client;
pub(crate) use self::server::Server;
-fn strip_connection_headers(headers: &mut HeaderMap) {
+fn strip_connection_headers(headers: &mut HeaderMap, is_request: bool) {
// List of connection headers from:
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Connection
+ //
+ // TE headers are allowed in HTTP/2 requests as long as the value is "trailers", so they're
+ // tested separately.
let connection_headers = [
HeaderName::from_lowercase(b"keep-alive").unwrap(),
HeaderName::from_lowercase(b"proxy-connection").unwrap(),
PROXY_AUTHENTICATE,
PROXY_AUTHORIZATION,
- TE,
TRAILER,
TRANSFER_ENCODING,
UPGRADE,
@@ -35,6 +37,17 @@ fn strip_connection_headers(headers: &mut HeaderMap) {
}
}
+ if is_request {
+ if headers.get(TE).map(|te_header| te_header != "trailers").unwrap_or(false) {
+ warn!("TE headers not set to \"trailers\" are illegal in HTTP/2 requests");
+ headers.remove(TE);
+ }
+ } else {
+ if headers.remove(TE).is_some() {
+ warn!("TE headers illegal in HTTP/2 responses");
+ }
+ }
+
if let Some(header) = headers.remove(CONNECTION) {
warn!(
"Connection header illegal in HTTP/2: {}",
diff --git a/src/proto/h2/server.rs b/src/proto/h2/server.rs
index d78d4a254e..1ded63b33e 100644
--- a/src/proto/h2/server.rs
+++ b/src/proto/h2/server.rs
@@ -192,7 +192,7 @@ where
let (head, body) = res.into_parts();
let mut res = ::http::Response::from_parts(head, ());
- super::strip_connection_headers(res.headers_mut());
+ super::strip_connection_headers(res.headers_mut(), false);
if let Some(len) = body.content_length() {
headers::set_content_length_if_missing(res.headers_mut(), len);
}
diff --git a/tests/integration.rs b/tests/integration.rs
index e593284bba..9e7450b685 100644
--- a/tests/integration.rs
+++ b/tests/integration.rs
@@ -184,6 +184,30 @@ t! {
;
}
+t! {
+ get_allow_te_trailers_header,
+ client:
+ request:
+ uri: "/",
+ headers: {
+ // http2 strips connection headers other than TE "trailers"
+ "te" => "trailers",
+ },
+ ;
+ response:
+ status: 200,
+ ;
+ server:
+ request:
+ uri: "/",
+ headers: {
+ "te" => "trailers",
+ },
+ ;
+ response:
+ ;
+}
+
t! {
get_body_chunked,
client:
|
wry
|
https://github.com/tauri-apps/wry
|
c1b26b9612bf5c5a9e4e0185f73739a2444343cd
|
Amr Bashir
|
2024-10-22 00:12:03
|
feat: add `WebView::cookies` and `WebView::cookies_for_url` (#1394)
|
* feat: add `WebView::cookies` and `WebView::cookies_for_url`
|
feat: add `WebView::cookies` and `WebView::cookies_for_url` (#1394)
* feat: add `WebView::cookies` and `WebView::cookies_for_url`
closes #518
ref: https://github.com/tauri-apps/tauri/issues/11330
* cookies -> getCookies in android
* fix macos build
* fix gtk blocking
* document why we don't use wait_for_async_operation
* change file
* implement cookies_for_url on macOS
* fmt
* fix macos impl
* actually use interval
* make it faster
* remove matching on path
* Apply suggestions from code review
Co-authored-by: Lucas Fernandes Nogueira <[email protected]>
* Apply suggestions from code review
---------
Co-authored-by: Lucas Nogueira <[email protected]>
|
diff --git a/.changes/cookies-api.md b/.changes/cookies-api.md
new file mode 100644
index 000000000..de2225bbe
--- /dev/null
+++ b/.changes/cookies-api.md
@@ -0,0 +1,5 @@
+---
+"wry": "patch"
+---
+
+Add `WebView::cookies` and `WebView::cookies_for_url` APIs.
diff --git a/Cargo.toml b/Cargo.toml
index 33fca77c8..e413dea31 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -53,6 +53,7 @@ thiserror = "1.0"
http = "1.1"
raw-window-handle = { version = "0.6", features = ["std"] }
dpi = "0.1"
+cookie = "0.18"
[target."cfg(any(target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies]
javascriptcore-rs = { version = "=1.1.2", features = [
@@ -93,6 +94,7 @@ features = [
]
[target."cfg(any(target_os = \"ios\", target_os = \"macos\"))".dependencies]
+url = "2.5"
block2 = "0.5"
objc2 = { version = "0.5", features = ["exception"] }
objc2-web-kit = { version = "0.2.0", features = [
@@ -119,6 +121,7 @@ objc2-web-kit = { version = "0.2.0", features = [
"WKWebpagePreferences",
"WKNavigationResponse",
"WKUserScript",
+ "WKHTTPCookieStore",
] }
objc2-foundation = { version = "0.2.0", features = [
"NSURLRequest",
@@ -137,6 +140,7 @@ objc2-foundation = { version = "0.2.0", features = [
"NSProcessInfo",
"NSValue",
"NSRange",
+ "NSRunLoop",
] }
[target."cfg(target_os = \"ios\")".dependencies]
diff --git a/examples/custom_protocol.rs b/examples/custom_protocol.rs
index e19a9a759..b31fbcf41 100644
--- a/examples/custom_protocol.rs
+++ b/examples/custom_protocol.rs
@@ -19,46 +19,6 @@ fn main() -> wry::Result<()> {
let window = WindowBuilder::new().build(&event_loop).unwrap();
let builder = WebViewBuilder::new()
- .with_id("id2")
- .with_custom_protocol(
- "wry".into(),
- move |_webview_id, request| match get_wry_response(request) {
- Ok(r) => r.map(Into::into),
- Err(e) => http::Response::builder()
- .header(CONTENT_TYPE, "text/plain")
- .status(500)
- .body(e.to_string().as_bytes().to_vec())
- .unwrap()
- .map(Into::into),
- },
- )
- // tell the webview to load the custom protocol
- .with_url("wry://localhost");
-
- #[cfg(any(
- target_os = "windows",
- target_os = "macos",
- target_os = "ios",
- target_os = "android"
- ))]
- let _webview = builder.build(&window)?;
- #[cfg(not(any(
- target_os = "windows",
- target_os = "macos",
- target_os = "ios",
- target_os = "android"
- )))]
- let _webview = {
- use tao::platform::unix::WindowExtUnix;
- use wry::WebViewBuilderExtUnix;
- let vbox = window.default_vbox().unwrap();
- builder.build_gtk(vbox)?
- };
-
- let window = WindowBuilder::new().build(&event_loop).unwrap();
-
- let builder = WebViewBuilder::new()
- .with_id("id1")
.with_custom_protocol(
"wry".into(),
move |_webview_id, request| match get_wry_response(request) {
diff --git a/examples/simple.rs b/examples/simple.rs
index d5d632b24..2cf47f6d9 100644
--- a/examples/simple.rs
+++ b/examples/simple.rs
@@ -59,7 +59,7 @@ fn main() -> wry::Result<()> {
..
} = event
{
- *control_flow = ControlFlow::Exit
+ *control_flow = ControlFlow::Exit;
}
});
}
diff --git a/src/android/kotlin/RustWebView.kt b/src/android/kotlin/RustWebView.kt
index 1486791a6..cb7b0014e 100644
--- a/src/android/kotlin/RustWebView.kt
+++ b/src/android/kotlin/RustWebView.kt
@@ -97,6 +97,11 @@ class RustWebView(context: Context, val initScripts: Array<String>, val id: Stri
settings.userAgentString = ua
}
+ fun getCookies(url: String): String {
+ val cookieManager = CookieManager.getInstance()
+ return cookieManager.getCookie(url)
+ }
+
private external fun shouldOverride(url: String): Boolean
private external fun onEval(id: Int, result: String)
diff --git a/src/android/main_pipe.rs b/src/android/main_pipe.rs
index e5da92a51..c82232e36 100644
--- a/src/android/main_pipe.rs
+++ b/src/android/main_pipe.rs
@@ -10,7 +10,7 @@ use jni::{
JNIEnv,
};
use once_cell::sync::Lazy;
-use std::{os::unix::prelude::*, sync::atomic::Ordering};
+use std::{os::unix::prelude::*, str::FromStr, sync::atomic::Ordering};
use super::{find_class, EvalCallback, EVAL_CALLBACKS, EVAL_ID_GENERATOR, PACKAGE};
@@ -267,24 +267,6 @@ impl<'a> MainPipe<'a> {
Err(e) => tx.send(Err(e.into())).unwrap(),
}
}
- WebViewMessage::GetId(tx) => {
- if let Some(webview) = &self.webview {
- let url = self
- .env
- .call_method(webview.as_obj(), "getUrl", "()Ljava/lang/String;", &[])
- .and_then(|v| v.l())
- .and_then(|s| {
- let s = JString::from(s);
- self
- .env
- .get_string(&s)
- .map(|v| v.to_string_lossy().to_string())
- })
- .unwrap_or_default();
-
- tx.send(url).unwrap()
- }
- }
WebViewMessage::GetUrl(tx) => {
if let Some(webview) = &self.webview {
let url = self
@@ -329,6 +311,36 @@ impl<'a> MainPipe<'a> {
load_html(&mut self.env, webview.as_obj(), &html)?;
}
}
+ WebViewMessage::GetCookies(tx, url) => {
+ if let Some(webview) = &self.webview {
+ let url = self.env.new_string(url)?;
+ let cookies = self
+ .env
+ .call_method(
+ webview,
+ "getCookies",
+ "(Ljava/lang/String;)Ljava/lang/String;",
+ &[(&url).into()],
+ )
+ .and_then(|v| v.l())
+ .and_then(|s| {
+ let s = JString::from(s);
+ self
+ .env
+ .get_string(&s)
+ .map(|v| v.to_string_lossy().to_string())
+ })
+ .unwrap_or_default();
+
+ tx.send(
+ cookies
+ .split("; ")
+ .flat_map(|c| cookie::Cookie::parse(c.to_string()))
+ .collect(),
+ )
+ .unwrap();
+ }
+ }
}
}
Ok(())
@@ -395,8 +407,8 @@ pub(crate) enum WebViewMessage {
Eval(String, Option<EvalCallback>),
SetBackgroundColor(RGBA),
GetWebViewVersion(Sender<Result<String, Error>>),
- GetId(Sender<String>),
GetUrl(Sender<String>),
+ GetCookies(Sender<Vec<cookie::Cookie<'static>>>, String),
Jni(Box<dyn FnOnce(&mut JNIEnv, &JObject, &JObject) + Send>),
LoadUrl(String, Option<http::HeaderMap>),
LoadHtml(String),
diff --git a/src/android/mod.rs b/src/android/mod.rs
index ae96095ee..32aecd856 100644
--- a/src/android/mod.rs
+++ b/src/android/mod.rs
@@ -375,6 +375,16 @@ impl InnerWebView {
Ok(())
}
+ pub fn cookies_for_url(&self, url: &str) -> Result<Vec<cookie::Cookie<'static>>> {
+ let (tx, rx) = bounded(1);
+ MainPipe::send(WebViewMessage::GetCookies(tx, url.to_string()));
+ rx.recv().map_err(Into::into)
+ }
+
+ pub fn cookies(&self) -> Result<Vec<cookie::Cookie<'static>>> {
+ Ok(Vec::new())
+ }
+
pub fn bounds(&self) -> Result<crate::Rect> {
Ok(crate::Rect::default())
}
diff --git a/src/error.rs b/src/error.rs
index e3b026117..a7fad37e7 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -65,4 +65,7 @@ pub enum Error {
DuplicateCustomProtocol(String),
#[error("Duplicate custom protocol registered on the same web context on Linux: {0}")]
ContextDuplicateCustomProtocol(String),
+ #[error(transparent)]
+ #[cfg(any(target_os = "macos", target_os = "ios"))]
+ UrlPrase(#[from] url::ParseError),
}
diff --git a/src/lib.rs b/src/lib.rs
index bf257c662..3c6344825 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -248,6 +248,7 @@ use std::{borrow::Cow, collections::HashMap, path::PathBuf, rc::Rc};
use http::{Request, Response};
+pub use cookie;
pub use dpi;
pub use error::*;
pub use http;
@@ -1517,6 +1518,20 @@ impl WebView {
self.webview.print()
}
+ /// Get a list of cookies for specific url.
+ pub fn cookies_for_url(&self, url: &str) -> Result<Vec<cookie::Cookie<'static>>> {
+ self.webview.cookies_for_url(url)
+ }
+
+ /// Get the list of cookies.
+ ///
+ /// ## Platform-specific
+ ///
+ /// - **Android**: Unsupported, always returns an empty [`Vec`].
+ pub fn cookies(&self) -> Result<Vec<cookie::Cookie<'static>>> {
+ self.webview.cookies()
+ }
+
/// Open the web inspector which is usually called dev tool.
///
/// ## Platform-specific
diff --git a/src/webkitgtk/mod.rs b/src/webkitgtk/mod.rs
index 9cbf75b88..38b99dfc3 100644
--- a/src/webkitgtk/mod.rs
+++ b/src/webkitgtk/mod.rs
@@ -3,6 +3,7 @@
// SPDX-License-Identifier: MIT
use dpi::{LogicalPosition, LogicalSize};
+use ffi::CookieManageExt;
use gdkx11::{
ffi::{gdk_x11_window_foreign_new_for_display, GdkX11Display},
X11Display,
@@ -25,7 +26,7 @@ use std::{
#[cfg(any(debug_assertions, feature = "devtools"))]
use webkit2gtk::WebInspectorExt;
use webkit2gtk::{
- AutoplayPolicy, InputMethodContextExt, LoadEvent, NavigationPolicyDecision,
+ AutoplayPolicy, CookieManagerExt, InputMethodContextExt, LoadEvent, NavigationPolicyDecision,
NavigationPolicyDecisionExt, NetworkProxyMode, NetworkProxySettings, PolicyDecisionType,
PrintOperationExt, SettingsExt, URIRequest, URIRequestExt, UserContentInjectedFrames,
UserContentManager, UserContentManagerExt, UserScript, UserScriptInjectionTime,
@@ -804,6 +805,103 @@ impl InnerWebView {
Ok(())
}
+ fn cookie_from_soup_cookie(mut cookie: soup::Cookie) -> cookie::Cookie<'static> {
+ let name = cookie.name().map(|n| n.to_string()).unwrap_or_default();
+ let value = cookie.value().map(|n| n.to_string()).unwrap_or_default();
+
+ let mut cookie_builder = cookie::CookieBuilder::new(name, value);
+
+ if let Some(domain) = cookie.domain().map(|n| n.to_string()) {
+ cookie_builder = cookie_builder.domain(domain);
+ }
+
+ if let Some(path) = cookie.path().map(|n| n.to_string()) {
+ cookie_builder = cookie_builder.path(path);
+ }
+
+ let http_only = cookie.is_http_only();
+ cookie_builder = cookie_builder.http_only(http_only);
+
+ let secure = cookie.is_secure();
+ cookie_builder = cookie_builder.secure(secure);
+
+ let same_site = cookie.same_site_policy();
+ let same_site = match same_site {
+ soup::SameSitePolicy::Lax => cookie::SameSite::Lax,
+ soup::SameSitePolicy::Strict => cookie::SameSite::Strict,
+ soup::SameSitePolicy::None => cookie::SameSite::None,
+ _ => cookie::SameSite::None,
+ };
+ cookie_builder = cookie_builder.same_site(same_site);
+
+ let expires = cookie.expires();
+ let expires = match expires {
+ Some(datetime) => cookie::time::OffsetDateTime::from_unix_timestamp(datetime.to_unix())
+ .ok()
+ .map(cookie::Expiration::DateTime),
+ None => Some(cookie::Expiration::Session),
+ };
+ if let Some(expires) = expires {
+ cookie_builder = cookie_builder.expires(expires);
+ }
+
+ cookie_builder.build()
+ }
+
+ pub fn cookies_for_url(&self, url: &str) -> Result<Vec<cookie::Cookie<'static>>> {
+ let (tx, rx) = std::sync::mpsc::channel();
+ self
+ .webview
+ .website_data_manager()
+ .and_then(|manager| manager.cookie_manager())
+ .map(|cookies_manager| {
+ cookies_manager.cookies(url, None::<&Cancellable>, move |cookies| {
+ let cookies = cookies.map(|cookies| {
+ cookies
+ .into_iter()
+ .map(Self::cookie_from_soup_cookie)
+ .collect()
+ });
+ let _ = tx.send(cookies);
+ })
+ });
+
+ loop {
+ gtk::main_iteration();
+
+ if let Ok(response) = rx.try_recv() {
+ return response.map_err(Into::into);
+ }
+ }
+ }
+
+ pub fn cookies(&self) -> Result<Vec<cookie::Cookie<'static>>> {
+ let (tx, rx) = std::sync::mpsc::channel();
+ self
+ .webview
+ .website_data_manager()
+ .and_then(|manager| manager.cookie_manager())
+ .map(|cookies_manager| {
+ cookies_manager.all_cookies(None::<&Cancellable>, move |cookies| {
+ let cookies = cookies.map(|cookies| {
+ cookies
+ .into_iter()
+ .map(Self::cookie_from_soup_cookie)
+ .collect()
+ });
+ let _ = tx.send(cookies);
+ })
+ });
+
+ loop {
+ gtk::main_iteration();
+
+ if let Ok(response) = rx.try_recv() {
+ return response.map_err(Into::into);
+ }
+ }
+ }
+
pub fn reparent<W>(&self, container: &W) -> Result<()>
where
W: gtk::prelude::IsA<gtk::Container>,
@@ -860,3 +958,88 @@ fn scale_factor_from_x11(xlib: &Xlib, display: *mut _XDisplay, parent: c_ulong)
let scale_factor = unsafe { (*attrs.screen).width as f64 * 25.4 / (*attrs.screen).mwidth as f64 };
scale_factor / BASE_DPI
}
+
+mod ffi {
+ use gtk::{
+ gdk,
+ gio::{
+ self,
+ ffi::{GAsyncReadyCallback, GCancellable},
+ prelude::*,
+ Cancellable,
+ },
+ glib::{
+ self,
+ translate::{FromGlibPtrContainer, ToGlibPtr},
+ },
+ };
+ use webkit2gtk::CookieManager;
+ use webkit2gtk_sys::WebKitCookieManager;
+
+ pub trait CookieManageExt: IsA<CookieManager> + 'static {
+ fn all_cookies<P: FnOnce(std::result::Result<Vec<soup::Cookie>, glib::Error>) + 'static>(
+ &self,
+ cancellable: Option<&impl IsA<Cancellable>>,
+ callback: P,
+ ) {
+ let main_context = glib::MainContext::ref_thread_default();
+ let is_main_context_owner = main_context.is_owner();
+ let has_acquired_main_context = (!is_main_context_owner)
+ .then(|| main_context.acquire().ok())
+ .flatten();
+ assert!(
+ is_main_context_owner || has_acquired_main_context.is_some(),
+ "Async operations only allowed if the thread is owning the MainContext"
+ );
+
+ let user_data: Box<glib::thread_guard::ThreadGuard<P>> =
+ Box::new(glib::thread_guard::ThreadGuard::new(callback));
+ unsafe extern "C" fn cookies_trampoline<
+ P: FnOnce(std::result::Result<Vec<soup::Cookie>, glib::Error>) + 'static,
+ >(
+ _source_object: *mut glib::gobject_ffi::GObject,
+ res: *mut gdk::gio::ffi::GAsyncResult,
+ user_data: glib::ffi::gpointer,
+ ) {
+ let mut error = std::ptr::null_mut();
+ let ret =
+ webkit_cookie_manager_get_all_cookies_finish(_source_object as *mut _, res, &mut error);
+ let result = if error.is_null() {
+ Ok(FromGlibPtrContainer::from_glib_full(ret))
+ } else {
+ Err(glib::translate::from_glib_full(error))
+ };
+ let callback: Box<glib::thread_guard::ThreadGuard<P>> = Box::from_raw(user_data as *mut _);
+ let callback: P = callback.into_inner();
+ callback(result);
+ }
+ let callback = cookies_trampoline::<P>;
+
+ unsafe {
+ webkit_cookie_manager_get_all_cookies(
+ self.as_ref().to_glib_none().0,
+ cancellable.map(|p| p.as_ref()).to_glib_none().0,
+ Some(callback),
+ Box::into_raw(user_data) as *mut _,
+ );
+ }
+ }
+ }
+
+ impl CookieManageExt for CookieManager {}
+
+ extern "C" {
+ pub fn webkit_cookie_manager_get_all_cookies(
+ cookie_manager: *mut webkit2gtk_sys::WebKitCookieManager,
+ cancellable: *mut GCancellable,
+ callback: GAsyncReadyCallback,
+ user_data: glib::ffi::gpointer,
+ );
+
+ pub fn webkit_cookie_manager_get_all_cookies_finish(
+ cookie_manager: *mut WebKitCookieManager,
+ result: *mut gio::ffi::GAsyncResult,
+ error: *mut *mut glib::ffi::GError,
+ ) -> *mut glib::ffi::GList;
+ }
+}
diff --git a/src/webview2/mod.rs b/src/webview2/mod.rs
index dcdc46a77..d4e294360 100644
--- a/src/webview2/mod.rs
+++ b/src/webview2/mod.rs
@@ -293,42 +293,42 @@ impl InnerWebView {
});
let (tx, rx) = mpsc::channel();
- CreateCoreWebView2EnvironmentCompletedHandler::wait_for_async_operation(
- Box::new(move |environmentcreatedhandler| unsafe {
- let options = CoreWebView2EnvironmentOptions::default();
-
- options.set_additional_browser_arguments(additional_browser_args);
- options.set_are_browser_extensions_enabled(pl_attrs.browser_extensions_enabled);
-
- // Get user's system language
- let lcid = GetUserDefaultUILanguage();
- let mut lang = [0; MAX_LOCALE_NAME as usize];
- LCIDToLocaleName(lcid as u32, Some(&mut lang), LOCALE_ALLOW_NEUTRAL_NAMES);
- options.set_language(String::from_utf16_lossy(&lang));
-
- let scroll_bar_style = match pl_attrs.scroll_bar_style {
- ScrollBarStyle::Default => COREWEBVIEW2_SCROLLBAR_STYLE_DEFAULT,
- ScrollBarStyle::FluentOverlay => COREWEBVIEW2_SCROLLBAR_STYLE_FLUENT_OVERLAY,
- };
+ let options = CoreWebView2EnvironmentOptions::default();
+ unsafe {
+ options.set_additional_browser_arguments(additional_browser_args);
+ options.set_are_browser_extensions_enabled(pl_attrs.browser_extensions_enabled);
+
+ // Get user's system language
+ let lcid = GetUserDefaultUILanguage();
+ let mut lang = [0; MAX_LOCALE_NAME as usize];
+ LCIDToLocaleName(lcid as u32, Some(&mut lang), LOCALE_ALLOW_NEUTRAL_NAMES);
+ options.set_language(String::from_utf16_lossy(&lang));
+
+ let scroll_bar_style = match pl_attrs.scroll_bar_style {
+ ScrollBarStyle::Default => COREWEBVIEW2_SCROLLBAR_STYLE_DEFAULT,
+ ScrollBarStyle::FluentOverlay => COREWEBVIEW2_SCROLLBAR_STYLE_FLUENT_OVERLAY,
+ };
- options.set_scroll_bar_style(scroll_bar_style);
+ options.set_scroll_bar_style(scroll_bar_style);
- CreateCoreWebView2EnvironmentWithOptions(
- PCWSTR::null(),
- &data_directory.unwrap_or_default(),
- &ICoreWebView2EnvironmentOptions::from(options),
- &environmentcreatedhandler,
- )
- .map_err(Into::into)
- }),
- Box::new(move |error_code, environment| {
- error_code?;
- tx.send(environment.ok_or_else(|| windows::core::Error::from(E_POINTER)))
- .map_err(|_| windows::core::Error::from(E_UNEXPECTED))
- }),
- )?;
+ CreateCoreWebView2EnvironmentWithOptions(
+ PCWSTR::null(),
+ &data_directory.unwrap_or_default(),
+ &ICoreWebView2EnvironmentOptions::from(options),
+ // we don't use CreateCoreWebView2EnvironmentCompletedHandler::wait_for_async
+ // as it uses an mspc::channel under the hood, so we can avoid using two channels
+ // by manually creating the callback handler and use webview2_com::with_with_bump
+ &CreateCoreWebView2EnvironmentCompletedHandler::create(Box::new(
+ move |error_code, environment| {
+ error_code?;
+ tx.send(environment.ok_or_else(|| windows::core::Error::from(E_POINTER)))
+ .map_err(|_| windows::core::Error::from(E_UNEXPECTED))
+ },
+ )),
+ )?;
+ }
- rx.recv()?.map_err(Into::into)
+ webview2_com::wait_with_pump(rx)?.map_err(Into::into)
}
#[inline]
@@ -341,34 +341,28 @@ impl InnerWebView {
let env = env.clone();
let env10 = env.cast::<ICoreWebView2Environment10>();
- CreateCoreWebView2ControllerCompletedHandler::wait_for_async_operation(
- if let Ok(env10) = env10 {
- let controller_opts = unsafe { env10.CreateCoreWebView2ControllerOptions()? };
- unsafe { controller_opts.SetIsInPrivateModeEnabled(incognito)? }
- Box::new(
- move |handler: ICoreWebView2CreateCoreWebView2ControllerCompletedHandler| unsafe {
- env10
- .CreateCoreWebView2ControllerWithOptions(hwnd, &controller_opts, &handler)
- .map_err(Into::into)
- },
- )
- } else {
- Box::new(
- move |handler: ICoreWebView2CreateCoreWebView2ControllerCompletedHandler| unsafe {
- env
- .CreateCoreWebView2Controller(hwnd, &handler)
- .map_err(Into::into)
- },
- )
- },
- Box::new(move |error_code, controller| {
+ // we don't use CreateCoreWebView2ControllerCompletedHandler::wait_for_async
+ // as it uses an mspc::channel under the hood, so we can avoid using two channels
+ // by manually creating the callback handler and use webview2_com::with_with_bump
+ let handler = CreateCoreWebView2ControllerCompletedHandler::create(Box::new(
+ move |error_code, controller| {
error_code?;
tx.send(controller.ok_or_else(|| windows::core::Error::from(E_POINTER)))
.map_err(|_| windows::core::Error::from(E_UNEXPECTED))
- }),
- )?;
+ },
+ ));
+
+ unsafe {
+ if let Ok(env10) = env10 {
+ let controller_opts = env10.CreateCoreWebView2ControllerOptions()?;
+ controller_opts.SetIsInPrivateModeEnabled(incognito)?;
+ env10.CreateCoreWebView2ControllerWithOptions(hwnd, &controller_opts, &handler)?;
+ } else {
+ env.CreateCoreWebView2Controller(hwnd, &handler)?
+ }
+ }
- rx.recv()?.map_err(Into::into)
+ webview2_com::wait_with_pump(rx)?.map_err(Into::into)
}
#[inline]
@@ -1326,6 +1320,112 @@ impl InnerWebView {
Ok(())
}
+ unsafe fn cookie_from_win32(cookie: ICoreWebView2Cookie) -> Result<cookie::Cookie<'static>> {
+ let mut name = PWSTR::null();
+ cookie.Name(&mut name)?;
+ let name = take_pwstr(name);
+
+ let mut value = PWSTR::null();
+ cookie.Value(&mut value)?;
+ let value = take_pwstr(value);
+
+ let mut cookie_builder = cookie::CookieBuilder::new(name, value);
+
+ let mut domain = PWSTR::null();
+ cookie.Domain(&mut domain)?;
+ cookie_builder = cookie_builder.domain(take_pwstr(domain));
+
+ let mut path = PWSTR::null();
+ cookie.Path(&mut path)?;
+ cookie_builder = cookie_builder.path(take_pwstr(path));
+
+ let mut http_only: BOOL = false.into();
+ cookie.IsHttpOnly(&mut http_only)?;
+ cookie_builder = cookie_builder.http_only(http_only.as_bool());
+
+ let mut secure: BOOL = false.into();
+ cookie.IsSecure(&mut secure)?;
+ cookie_builder = cookie_builder.secure(secure.as_bool());
+
+ let mut same_site = COREWEBVIEW2_COOKIE_SAME_SITE_KIND_LAX;
+ cookie.SameSite(&mut same_site)?;
+ let same_site = match same_site {
+ COREWEBVIEW2_COOKIE_SAME_SITE_KIND_LAX => cookie::SameSite::Lax,
+ COREWEBVIEW2_COOKIE_SAME_SITE_KIND_STRICT => cookie::SameSite::Strict,
+ COREWEBVIEW2_COOKIE_SAME_SITE_KIND_NONE => cookie::SameSite::None,
+ _ => cookie::SameSite::None,
+ };
+ cookie_builder = cookie_builder.same_site(same_site);
+
+ let mut is_session: BOOL = false.into();
+ cookie.IsSession(&mut is_session)?;
+
+ let mut expires = 0.0;
+ cookie.Expires(&mut expires)?;
+
+ let expires = match expires {
+ -1.0 | _ if is_session.as_bool() => Some(cookie::Expiration::Session),
+ datetime => cookie::time::OffsetDateTime::from_unix_timestamp(datetime as _)
+ .ok()
+ .map(cookie::Expiration::DateTime),
+ };
+ if let Some(expires) = expires {
+ cookie_builder = cookie_builder.expires(expires);
+ }
+
+ Ok(cookie_builder.build())
+ }
+
+ pub fn cookies_for_url(&self, url: &str) -> Result<Vec<cookie::Cookie<'static>>> {
+ let uri = HSTRING::from(url);
+ self.cookies_inner(PCWSTR::from_raw(uri.as_ptr()))
+ }
+
+ pub fn cookies(&self) -> Result<Vec<cookie::Cookie<'static>>> {
+ self.cookies_inner(PCWSTR::null())
+ }
+
+ fn cookies_inner(&self, uri: PCWSTR) -> Result<Vec<cookie::Cookie<'static>>> {
+ let (tx, rx) = mpsc::channel();
+
+ let webview = self.webview.cast::<ICoreWebView2_2>()?;
+ unsafe {
+ webview.CookieManager()?.GetCookies(
+ uri,
+ // we don't use GetCookiesCompletedHandler::wait_for_async
+ // as it uses an mspc::channel under the hood, so we can avoid using two channels
+ // by manually creating the callback handler and use webview2_com::with_with_bump
+ &GetCookiesCompletedHandler::create(Box::new(move |error_code, cookies| {
+ error_code?;
+
+ let cookies = if let Some(cookies) = cookies {
+ let mut count = 0;
+ cookies.Count(&mut count)?;
+
+ let mut out = Vec::with_capacity(count as _);
+
+ for idx in 0..count {
+ let cookie = cookies.GetValueAtIndex(idx)?;
+
+ if let Ok(cookie) = Self::cookie_from_win32(cookie) {
+ out.push(cookie)
+ }
+ }
+
+ out
+ } else {
+ Vec::new()
+ };
+
+ tx.send(cookies)
+ .map_err(|_| windows::core::Error::from(E_UNEXPECTED))
+ })),
+ )?;
+ }
+
+ webview2_com::wait_with_pump(rx).map_err(Into::into)
+ }
+
pub fn reparent(&self, parent: isize) -> Result<()> {
let parent = HWND(parent as _);
diff --git a/src/wkwebview/mod.rs b/src/wkwebview/mod.rs
index 8fd3b96fc..61c8baf64 100644
--- a/src/wkwebview/mod.rs
+++ b/src/wkwebview/mod.rs
@@ -42,9 +42,10 @@ use objc2_app_kit::{NSApplication, NSAutoresizingMaskOptions, NSTitlebarSeparato
#[cfg(target_os = "macos")]
use objc2_foundation::CGSize;
use objc2_foundation::{
- ns_string, CGPoint, CGRect, MainThreadMarker, NSBundle, NSDate, NSError, NSJSONSerialization,
- NSMutableURLRequest, NSNumber, NSObjectNSKeyValueCoding, NSObjectProtocol, NSString,
- NSUTF8StringEncoding, NSURL, NSUUID,
+ ns_string, CGPoint, CGRect, MainThreadMarker, NSArray, NSBundle, NSDate, NSError, NSHTTPCookie,
+ NSHTTPCookieSameSiteLax, NSHTTPCookieSameSiteStrict, NSJSONSerialization, NSMutableURLRequest,
+ NSNumber, NSObjectNSKeyValueCoding, NSObjectProtocol, NSString, NSUTF8StringEncoding, NSURL,
+ NSUUID,
};
#[cfg(target_os = "ios")]
use objc2_ui_kit::{UIScrollView, UIViewAutoresizing};
@@ -71,10 +72,11 @@ use raw_window_handle::{HasWindowHandle, RawWindowHandle};
use std::{
collections::{HashMap, HashSet},
ffi::{c_void, CString},
+ net::Ipv4Addr,
os::raw::c_char,
panic::AssertUnwindSafe,
- ptr::null_mut,
- str,
+ ptr::{null_mut, NonNull},
+ str::{self, FromStr},
sync::{Arc, Mutex},
};
@@ -112,6 +114,7 @@ pub(crate) struct InnerWebView {
id: String,
pub webview: Retained<WryWebView>,
pub manager: Retained<WKUserContentController>,
+ data_store: Retained<WKWebsiteDataStore>,
ns_view: Retained<NSView>,
#[allow(dead_code)]
is_child: bool,
@@ -268,8 +271,7 @@ impl InnerWebView {
}
};
- let proxies: Retained<objc2_foundation::NSArray<NSObject>> =
- objc2_foundation::NSArray::arrayWithObject(&*proxy_config);
+ let proxies: Retained<NSArray<NSObject>> = NSArray::arrayWithObject(&*proxy_config);
data_store.setValue_forKey(Some(&proxies), ns_string!("proxyConfigurations"));
}
@@ -462,6 +464,7 @@ impl InnerWebView {
webview: webview.clone(),
manager: manager.clone(),
ns_view: ns_view.retain(),
+ data_store,
pending_scripts,
ipc_handler_delegate,
document_title_changed_observer,
@@ -825,6 +828,95 @@ r#"Object.defineProperty(window, 'ipc', {
Ok(())
}
+ unsafe fn cookie_from_wkwebview(cookie: &NSHTTPCookie) -> cookie::Cookie<'static> {
+ let name = cookie.name().to_string();
+ let value = cookie.value().to_string();
+
+ let mut cookie_builder = cookie::CookieBuilder::new(name, value);
+
+ let domain = cookie.domain().to_string();
+ cookie_builder = cookie_builder.domain(domain);
+
+ let path = cookie.path().to_string();
+ cookie_builder = cookie_builder.path(path);
+
+ let http_only = cookie.isHTTPOnly();
+ cookie_builder = cookie_builder.http_only(http_only);
+
+ let secure = cookie.isSecure();
+ cookie_builder = cookie_builder.secure(secure);
+
+ let same_site = cookie.sameSitePolicy();
+ let same_site = match same_site {
+ Some(policy) if policy.as_ref() == NSHTTPCookieSameSiteLax => cookie::SameSite::Lax,
+ Some(policy) if policy.as_ref() == NSHTTPCookieSameSiteStrict => cookie::SameSite::Strict,
+ _ => cookie::SameSite::None,
+ };
+ cookie_builder = cookie_builder.same_site(same_site);
+
+ let expires = cookie.expiresDate();
+ let expires = match expires {
+ Some(datetime) => {
+ cookie::time::OffsetDateTime::from_unix_timestamp(datetime.timeIntervalSince1970() as i64)
+ .ok()
+ .map(cookie::Expiration::DateTime)
+ }
+ None => Some(cookie::Expiration::Session),
+ };
+ if let Some(expires) = expires {
+ cookie_builder = cookie_builder.expires(expires);
+ }
+
+ cookie_builder.build()
+ }
+
+ pub fn cookies_for_url(&self, url: &str) -> Result<Vec<cookie::Cookie<'static>>> {
+ let url = url::Url::parse(url)?;
+
+ self.cookies().map(|cookies| {
+ cookies.into_iter().filter(|cookie: &cookie::Cookie| {
+ let secure = cookie.secure().unwrap_or_default();
+ // domain is the same
+ cookie.domain() == url.domain()
+ // and one of
+ && (
+ // cookie is secure and url is https
+ (secure && url.scheme() == "https") ||
+ // or cookie is secure and is localhost
+ (
+ secure && url.scheme() == "http" &&
+ (url.domain() == Some("localhost") || url.domain().and_then(|d| Ipv4Addr::from_str(d).ok()).map(|ip| ip.is_loopback()).unwrap_or(false))
+ ) ||
+ // or cookie is not secure
+ (!secure)
+ )
+ }).collect()
+ })
+ }
+
+ pub fn cookies(&self) -> Result<Vec<cookie::Cookie<'static>>> {
+ let (tx, rx) = std::sync::mpsc::channel();
+
+ unsafe {
+ self
+ .data_store
+ .httpCookieStore()
+ .getAllCookies(&block2::RcBlock::new(
+ move |cookies: NonNull<NSArray<NSHTTPCookie>>| {
+ let cookies = cookies.as_ref();
+ let cookies = cookies
+ .to_vec()
+ .into_iter()
+ .map(|cookie| Self::cookie_from_wkwebview(cookie))
+ .collect();
+ let _ = tx.send(cookies);
+ },
+ ));
+
+ wait_for_blocking_operation(rx)
+ }
+ }
+
#[cfg(target_os = "macos")]
pub(crate) fn reparent(&self, window: *mut NSWindow) -> crate::Result<()> {
unsafe {
@@ -905,3 +997,25 @@ unsafe fn window_position(view: &NSView, x: i32, y: i32, height: f64) -> CGPoint
let frame: CGRect = view.frame();
CGPoint::new(x as f64, frame.size.height - y as f64 - height)
}
+
+unsafe fn wait_for_blocking_operation<T>(rx: std::sync::mpsc::Receiver<T>) -> Result<T> {
+ let interval = 0.0002;
+ let limit = 1.;
+ let mut elapsed = 0.;
+ // run event loop until we get the response back, blocking for at most 3 seconds
+ loop {
+ let rl = objc2_foundation::NSRunLoop::mainRunLoop();
+ let d = NSDate::dateWithTimeIntervalSinceNow(interval);
+ rl.runUntilDate(&d);
+ if let Ok(response) = rx.try_recv() {
+ return Ok(response);
+ }
+ elapsed += interval;
+ if elapsed >= limit {
+ return Err(Error::Io(std::io::Error::new(
+ std::io::ErrorKind::TimedOut,
+ "timed out waiting for cookies response",
+ )));
+ }
+ }
+}
|
n8n
|
https://github.com/n8n-io/n8n
|
b17d5f9aa086bf408e8450244460ada57de0d7c3
|
Milorad FIlipović
|
2023-04-28 15:44:31
|
feat(editor): Add support for `loadOptionsDependsOn` to RLC (#6101)
|
* feat(editor): Add support for `loadOptionsDependsOn` to the Resource Locator component
* 🔥 Removing leftover log
* ✅ Added e2e tests for ResourceLocator component
|
feat(editor): Add support for `loadOptionsDependsOn` to RLC (#6101)
* feat(editor): Add support for `loadOptionsDependsOn` to the Resource Locator component
* 🔥 Removing leftover log
* ✅ Added e2e tests for ResourceLocator component
|
diff --git a/cypress/e2e/26-resource-locator.cy.ts b/cypress/e2e/26-resource-locator.cy.ts
new file mode 100644
index 0000000000000..e0ba34d70aa20
--- /dev/null
+++ b/cypress/e2e/26-resource-locator.cy.ts
@@ -0,0 +1,58 @@
+import { WorkflowPage, NDV, CredentialsModal } from '../pages';
+
+const workflowPage = new WorkflowPage();
+const ndv = new NDV();
+const credentialsModal = new CredentialsModal();
+
+const NO_CREDENTIALS_MESSAGE = 'Please add your credential';
+const INVALID_CREDENTIALS_MESSAGE = 'Please check your credential';
+
+describe('Resource Locator', () => {
+ before(() => {
+ cy.resetAll();
+ cy.skipSetup();
+ });
+
+ beforeEach(() => {
+ workflowPage.actions.visit();
+ });
+
+ it('should render both RLC components in google sheets', () => {
+ workflowPage.actions.addInitialNodeToCanvas('Manual');
+ workflowPage.actions.addNodeToCanvas('Google Sheets', true, true);
+ ndv.getters.resourceLocator('documentId').should('be.visible');
+ ndv.getters.resourceLocator('sheetName').should('be.visible');
+ });
+
+ it('should show appropriate error when credentials are not set', () => {
+ workflowPage.actions.addInitialNodeToCanvas('Manual');
+ workflowPage.actions.addNodeToCanvas('Google Sheets', true, true);
+ ndv.getters.resourceLocator('documentId').should('be.visible');
+ ndv.getters.resourceLocatorInput('documentId').click();
+ ndv.getters.resourceLocatorErrorMessage().should('contain', NO_CREDENTIALS_MESSAGE);
+ });
+
+ it('should show appropriate error when credentials are not valid', () => {
+ workflowPage.actions.addInitialNodeToCanvas('Manual');
+ workflowPage.actions.addNodeToCanvas('Google Sheets', true, true);
+ workflowPage.getters.nodeCredentialsSelect().click();
+ // Add oAuth credentials
+ workflowPage.getters.nodeCredentialsSelect().find('li').last().click();
+ credentialsModal.getters.credentialsEditModal().should('be.visible');
+ credentialsModal.getters.credentialAuthTypeRadioButtons().should('have.length', 2);
+ credentialsModal.getters.credentialAuthTypeRadioButtons().first().click();
+ credentialsModal.actions.fillCredentialsForm();
+ cy.get('.el-message-box').find('button').contains('Close').click();
+ ndv.getters.resourceLocatorInput('documentId').click();
+ ndv.getters.resourceLocatorErrorMessage().should('contain', INVALID_CREDENTIALS_MESSAGE);
+ });
+
+ it('should reset resource locator when dependent field is changed', () => {
+ workflowPage.actions.addInitialNodeToCanvas('Manual');
+ workflowPage.actions.addNodeToCanvas('Google Sheets', true, true);
+ ndv.actions.setRLCValue('documentId', '123');
+ ndv.actions.setRLCValue('sheetName', '123');
+ ndv.actions.setRLCValue('documentId', '321');
+ ndv.getters.resourceLocatorInput('sheetName').should('have.value', '');
+ });
+});
diff --git a/cypress/pages/ndv.ts b/cypress/pages/ndv.ts
index cf787a4a3f095..f23f9a0548a61 100644
--- a/cypress/pages/ndv.ts
+++ b/cypress/pages/ndv.ts
@@ -51,6 +51,11 @@ export class NDV extends BasePage {
inputHoveringItem: () => this.getters.inputPanel().findChildByTestId('hovering-item'),
outputBranches: () => this.getters.outputPanel().findChildByTestId('branches'),
inputBranches: () => this.getters.inputPanel().findChildByTestId('branches'),
+ resourceLocator: (paramName: string) => cy.getByTestId(`resource-locator-${paramName}`),
+ resourceLocatorInput: (paramName: string) => this.getters.resourceLocator(paramName).find('[data-test-id="rlc-input-container"]'),
+ resourceLocatorDropdown: (paramName: string) => this.getters.resourceLocator(paramName).find('[data-test-id="resource-locator-dropdown"]'),
+ resourceLocatorErrorMessage: () => cy.getByTestId('rlc-error-container'),
+ resourceLocatorModeSelector: (paramName: string) => this.getters.resourceLocator(paramName).find('[data-test-id="rlc-mode-selector"]'),
};
actions = {
@@ -148,5 +153,10 @@ export class NDV extends BasePage {
switchIntputBranch: (name: string) => {
this.getters.inputBranches().get('span').contains(name).click();
},
+ setRLCValue: (paramName: string, value: string) => {
+ this.getters.resourceLocatorModeSelector(paramName).click();
+ this.getters.resourceLocatorModeSelector(paramName).find('li').last().click();
+ this.getters.resourceLocatorInput(paramName).type(value);
+ }
};
}
diff --git a/packages/editor-ui/src/components/ParameterInput.vue b/packages/editor-ui/src/components/ParameterInput.vue
index 6f71269433c2f..24d127c55171b 100644
--- a/packages/editor-ui/src/components/ParameterInput.vue
+++ b/packages/editor-ui/src/components/ParameterInput.vue
@@ -18,6 +18,7 @@
ref="resourceLocator"
:parameter="parameter"
:value="value"
+ :dependentParametersValues="dependentParametersValues"
:displayTitle="displayTitle"
:expressionDisplayValue="expressionDisplayValue"
:expressionComputedValue="expressionEvaluated"
diff --git a/packages/editor-ui/src/components/ResourceLocator/ResourceLocator.vue b/packages/editor-ui/src/components/ResourceLocator/ResourceLocator.vue
index b11d7a2eca806..998fe9c3e3480 100644
--- a/packages/editor-ui/src/components/ResourceLocator/ResourceLocator.vue
+++ b/packages/editor-ui/src/components/ResourceLocator/ResourceLocator.vue
@@ -1,5 +1,9 @@
<template>
- <div class="resource-locator" ref="container">
+ <div
+ class="resource-locator"
+ ref="container"
+ :data-test-id="`resource-locator-${parameter.name}`"
+ >
<resource-locator-dropdown
:value="value ? value.value : ''"
:show="showResourceDropdown"
@@ -18,7 +22,7 @@
ref="dropdown"
>
<template #error>
- <div :class="$style.error">
+ <div :class="$style.error" data-test-id="rlc-error-container">
<n8n-text color="text-dark" align="center" tag="div">
{{ $locale.baseText('resourceLocator.mode.list.error.title') }}
</n8n-text>
@@ -47,6 +51,7 @@
:disabled="isReadOnly"
@change="onModeSelected"
:placeholder="$locale.baseText('resourceLocator.modeSelector.placeholder')"
+ data-test-id="rlc-mode-selector"
>
<n8n-option
v-for="mode in parameter.modes"
@@ -64,7 +69,7 @@
</n8n-select>
</div>
- <div :class="$style.inputContainer">
+ <div :class="$style.inputContainer" data-test-id="rlc-input-container">
<draggable-target
type="mapping"
:disabled="hasOnlyListMode"
@@ -101,6 +106,7 @@
:placeholder="inputPlaceholder"
type="text"
ref="input"
+ data-test-id="rlc-input"
@input="onInputChange"
@focus="onInputFocus"
@blur="onInputBlur"
@@ -212,6 +218,10 @@ export default mixins(debounceHelper, workflowHelpers, nodeHelpers).extend({
type: Array as PropType<string[]>,
default: () => [],
},
+ dependentParametersValues: {
+ type: [String, null] as PropType<string | null>,
+ default: null,
+ },
displayTitle: {
type: String,
default: '',
@@ -448,6 +458,17 @@ export default mixins(debounceHelper, workflowHelpers, nodeHelpers).extend({
this.$emit('input', { ...this.value, __regex: mode.extractValue.regex });
}
},
+ dependentParametersValues() {
+ // Reset value if dependent parameters change
+ if (this.value && isResourceLocatorValue(this.value) && this.value.value !== '') {
+ this.$emit('input', {
+ ...this.value,
+ cachedResultName: '',
+ cachedResultUrl: '',
+ value: '',
+ });
+ }
+ },
},
mounted() {
this.$on('refreshList', this.refreshList);
diff --git a/packages/editor-ui/src/components/ResourceLocator/ResourceLocatorDropdown.vue b/packages/editor-ui/src/components/ResourceLocator/ResourceLocatorDropdown.vue
index f2702d6a0d767..dfee08556181a 100644
--- a/packages/editor-ui/src/components/ResourceLocator/ResourceLocatorDropdown.vue
+++ b/packages/editor-ui/src/components/ResourceLocator/ResourceLocatorDropdown.vue
@@ -5,6 +5,7 @@
:popper-class="$style.popover"
:value="show"
trigger="manual"
+ data-test-id="resource-locator-dropdown"
v-click-outside="onClickOutside"
>
<div :class="$style.messageContainer" v-if="errorView">
diff --git a/packages/nodes-base/nodes/Google/Sheet/v2/actions/sheet/Sheet.resource.ts b/packages/nodes-base/nodes/Google/Sheet/v2/actions/sheet/Sheet.resource.ts
index b6ea2b41d5594..8dc3de896eee1 100644
--- a/packages/nodes-base/nodes/Google/Sheet/v2/actions/sheet/Sheet.resource.ts
+++ b/packages/nodes-base/nodes/Google/Sheet/v2/actions/sheet/Sheet.resource.ts
@@ -139,6 +139,9 @@ export const descriptions: INodeProperties[] = [
default: { mode: 'list', value: '' },
// default: '', //empty string set to progresivly reveal fields
required: true,
+ typeOptions: {
+ loadOptionsDependsOn: ['documentId.value'],
+ },
modes: [
{
displayName: 'From List',
|
posthog
|
https://github.com/PostHog/posthog
|
81b67c08bee0659bfbd05d34437410b56250f862
|
Karl-Aksel Puulmann
|
2022-08-22 16:08:56
|
chore(async-migrations): Add logging to 0006 async migration (#11407)
|
We're seeing this migration fail in unexpected ways (marked as complete
after query failed) so adding logging.
|
chore(async-migrations): Add logging to 0006 async migration (#11407)
We're seeing this migration fail in unexpected ways (marked as complete
after query failed) so adding logging.
|
diff --git a/posthog/async_migrations/runner.py b/posthog/async_migrations/runner.py
index 4344b38800ca8..f8637f114068d 100644
--- a/posthog/async_migrations/runner.py
+++ b/posthog/async_migrations/runner.py
@@ -152,6 +152,11 @@ def run_async_migration_next_op(migration_name: str, migration_instance: Optiona
migration_definition = get_async_migration_definition(migration_name)
if migration_instance.current_operation_index > len(migration_definition.operations) - 1:
+ logger.info(
+ "Marking async migration as complete",
+ migration=migration_name,
+ current_operation_index=migration_instance.current_operation_index,
+ )
complete_migration(migration_instance)
return (False, True)
@@ -159,6 +164,11 @@ def run_async_migration_next_op(migration_name: str, migration_instance: Optiona
current_query_id = str(UUIDT())
try:
+ logger.info(
+ "Running async migration operation",
+ migration=migration_name,
+ current_operation_index=migration_instance.current_operation_index,
+ )
op = migration_definition.operations[migration_instance.current_operation_index]
execute_op(op, current_query_id)
@@ -170,6 +180,12 @@ def run_async_migration_next_op(migration_name: str, migration_instance: Optiona
except Exception as e:
error = f"Exception was thrown while running operation {migration_instance.current_operation_index} : {str(e)}"
+ logger.error(
+ "Error running async migration operation",
+ migration=migration_name,
+ current_operation_index=migration_instance.current_operation_index,
+ error=e,
+ )
process_error(migration_instance, error, alert=True)
if error:
|
azerothcore-wotlk
|
https://github.com/azerothcore/azerothcore-wotlk
|
05780f2c50dc304360d252ee95fd22a8358f06d5
|
Kitzunu
|
2021-05-11 21:16:28
|
feat(apps): Config Merger (#5779)
|
* feat(apps): Config Merger
* update for ac
* Update README.md
|
feat(apps): Config Merger (#5779)
* feat(apps): Config Merger
* update for ac
* Update README.md
|
diff --git a/apps/config-merger/README.md b/apps/config-merger/README.md
new file mode 100644
index 00000000000000..4a5301e8fb6478
--- /dev/null
+++ b/apps/config-merger/README.md
@@ -0,0 +1,22 @@
+# ==== PHP merger (index.php + merge.php) ====
+
+This is a PHP script for merging a new .dist file with your existing .conf file (worldserver.conf.dist and authserver.conf.dist)
+
+It uses sessions so it is multi user safe, it adds any options that are removed to the bottom of the file commented out, just in case it removes something it shouldn't.
+If you add your custom patch configs below "# Custom" they will be copied exactly as they are.
+
+Your new config will be found under $basedir/session_id/newconfig.conf.merge
+
+If you do not run a PHP server on your machiene you can read this guide on ["How to execute PHP code using command line?"](https://www.geeksforgeeks.org/how-to-execute-php-code-using-command-line/) on geeksforgeeks.org.
+
+```
+php -S localhost:port -t E:\Azerothcore-wotlk\apps\config-merger\
+```
+
+Change port to an available port to use. i.e 8000
+
+Then go to your browser and type:
+
+```
+localhost:8000/index.php
+```
diff --git a/apps/config-merger/index.php b/apps/config-merger/index.php
new file mode 100644
index 00000000000000..8754d29954c768
--- /dev/null
+++ b/apps/config-merger/index.php
@@ -0,0 +1,44 @@
+<?php
+/*
+ * Project Name: Config File Merge For Mangos/Trinity/AzerothCore Server
+ * Date: 01.01.2010 inital version (0.0.1a)
+ * Author: Paradox
+ * Copyright: Paradox
+ * Email: [email protected] (paypal email)
+ * License: GNU General Public License v2(GPL)
+ */
+?>
+<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
+<FORM enctype="multipart/form-data" ACTION="merge.php" METHOD="POST">
+Dist File (.conf.dist)
+<br />
+<INPUT name="File1" TYPE="file">
+<br />
+<br />
+Current Conf File (.conf)
+<br />
+<INPUT name="File2" TYPE="file">
+<br />
+<br />
+<INPUT TYPE=RADIO NAME="eol" VALUE="0" CHECKED >Windows -
+<INPUT TYPE=RADIO NAME="eol" VALUE="1" >UNIX/Linux
+<br />
+<br />
+<INPUT TYPE="submit" VALUE="Submit">
+<br />
+<br />
+If you have any custom settings, such as from patches,
+<br />
+make sure they are at the bottom of the file following
+<br />
+this block (add it if it's not there)
+<br />
+###############################################################################
+<br />
+# Custom
+<br />
+###############################################################################
+<br />
+<br />
+
+</FORM>
diff --git a/apps/config-merger/merge.php b/apps/config-merger/merge.php
new file mode 100644
index 00000000000000..17417e1a2b45fc
--- /dev/null
+++ b/apps/config-merger/merge.php
@@ -0,0 +1,179 @@
+<?php
+/*
+ * Project Name: Config File Merge For Mangos/Trinity Server
+ * Date: 01.01.2010 inital version (0.0.1a)
+ * Author: Paradox
+ * Copyright: Paradox
+ * Email: [email protected] (paypal email)
+ * License: GNU General Public License v2(GPL)
+ */
+
+error_reporting(0);
+
+if (!empty($_FILES['File1']) && !empty($_FILES['File2']))
+{
+ session_id();
+ session_start();
+ $basedir = "merge";
+ $eol = "\r\n";
+ if ($_POST['eol'])
+ $eol = "\n";
+ else
+ $eol = "\r\n";
+ if (!file_exists($basedir))
+ mkdir($basedir);
+ if (!file_exists($basedir."/".session_id()))
+ mkdir($basedir."/".session_id());
+ $upload1 = $basedir."/".session_id()."/".basename($_FILES['File1']['name']);
+ $upload2 = $basedir."/".session_id()."/".basename($_FILES['File2']['name']);
+
+ if (strpos($upload1, "worldserver") !== false)
+ $newconfig = $basedir."/".session_id()."/worldserver.conf.merge";
+ else if (strpos($upload1, "authserver") !== false)
+ $newconfig = $basedir."/".session_id()."/authserver.conf.merge";
+ else
+ $newconfig = $basedir."/".session_id()."/UnkownConfigFile.conf.merge";
+
+ $out_file = fopen($newconfig, "w");
+ $success = false;
+ if (move_uploaded_file($_FILES['File1']['tmp_name'], $upload1))
+ {
+ $success = true;
+ }
+ else
+ {
+ $success = false;
+ }
+ if (move_uploaded_file($_FILES['File2']['tmp_name'], $upload2))
+ {
+ $success = true;
+ }
+ else
+ {
+ $success = false;
+ }
+
+ if ($success)
+ {
+ $custom_found = false;
+ $in_file1 = fopen($upload1,"r");
+ $in_file2 = fopen($upload2,"r");
+ $array1 = array();
+ $array2 = array();
+ $line = trim(fgets($in_file1));
+ while (!feof($in_file1))
+ {
+ if ((substr($line,0,1) != '#' && substr($line,0,1) != ''))
+ {
+ list($key, $val) = explode("=",$line);
+ $key = trim($key);
+ $val = trim($val);
+ $array1[$key] = $val;
+ }
+ $line = trim(fgets($in_file1));
+ }
+ $line = trim(fgets($in_file2));
+ while (!feof($in_file2) && !$custom_found)
+ {
+ if (substr($line,0,1) != '#' && substr($line,0,1) != '')
+ {
+ list($key, $val) = explode("=",$line);
+ $key = trim($key);
+ $val = trim($val);
+ $array2[$key] = $val;
+ }
+ if (strtolower($line) == "# custom")
+ $custom_found = true;
+ else
+ $line = trim(fgets($in_file2));
+ }
+ fclose($in_file1);
+ foreach($array2 as $k => $v)
+ {
+ if (array_key_exists($k, $array1))
+ {
+ $array1[$k] = $v;
+ unset($array2[$k]);
+ }
+ }
+ $in_file1 = fopen($upload1,"r");
+ $line = trim(fgets($in_file1));
+ while (!feof($in_file1))
+ {
+ if (substr($line,0,1) != '#' && substr($line,0,1) != '')
+ {
+ $array = array();
+ while (substr($line,0,1) != '#' && substr($line,0,1) != '')
+ {
+ list($key, $val) = explode("=",$line);
+ $key = trim($key);
+ $val = trim($val);
+ $array[$key] = $val;
+ $line = trim(fgets($in_file1));
+ }
+ foreach($array as $k => $v)
+ {
+ if (array_key_exists($k, $array1))
+ fwrite($out_file, $k."=".$array1[$k].$eol);
+ else
+ continue;
+ }
+ unset($array);
+ if (!feof($in_file1))
+ fwrite($out_file, $line.$eol);
+ }
+ else
+ fwrite($out_file, $line.$eol);
+ $line = trim(fgets($in_file1));
+ }
+ if ($custom_found)
+ {
+ fwrite($out_file, $eol);
+ fwrite($out_file, "###############################################################################".$eol);
+ fwrite($out_file, "# Custom".$eol);
+ $line = trim(fgets($in_file2));
+ while (!feof($in_file2))
+ {
+ fwrite($out_file, $line.$eol);
+ $line = trim(fgets($in_file2));
+ }
+ }
+ $first = true;
+ foreach($array2 as $k => $v)
+ {
+ if ($first)
+ {
+ fwrite($out_file, $eol);
+ fwrite($out_file, "###############################################################################".$eol);
+ fwrite($out_file, "# The Following values were removed from the config.".$eol);
+ $first = false;
+ }
+ fwrite($out_file, "# ".$k."=".$v.$eol);
+ }
+
+ if (strpos($upload1, "worldserver") !== false)
+ {
+ file_put_contents($newconfig, str_replace("]=","]",file_get_contents($newconfig)));
+ }
+ else if (strpos($upload1, "authserver") !== false)
+ {
+ file_put_contents($newconfig, str_replace("]=","]",file_get_contents($newconfig)));
+ }
+
+ unset($array1);
+ unset($array2);
+ fclose($in_file1);
+ fclose($in_file2);
+ fclose($out_file);
+ unlink($upload1);
+ unlink($upload2);
+
+ echo "Process done";
+ echo "<br /><a href=".$newconfig.">Click here to retrieve your merged conf</a>";
+ }
+}
+else
+{
+ echo "An error has occurred";
+}
+?>
|
angular
|
https://github.com/angular/angular
|
ffad040a9675038f3b0c6c546799369a2d873b18
|
Joey Perrott
|
2021-01-27 00:22:27
|
build: update to yarn v1.22.10 (#40562)
|
Update to the latest version of yarn.
PR Close #40562
|
build: update to yarn v1.22.10 (#40562)
Update to the latest version of yarn.
PR Close #40562
|
diff --git a/.yarn/releases/yarn-1.22.5.js b/.yarn/releases/yarn-1.22.10.cjs
similarity index 99%
rename from .yarn/releases/yarn-1.22.5.js
rename to .yarn/releases/yarn-1.22.10.cjs
index d31be0b947fbb..68b1990b1d92f 100755
--- a/.yarn/releases/yarn-1.22.5.js
+++ b/.yarn/releases/yarn-1.22.10.cjs
@@ -46679,7 +46679,7 @@ function mkdirfix (name, opts, cb) {
/* 194 */
/***/ (function(module, exports) {
-module.exports = {"name":"yarn","installationMethod":"unknown","version":"1.22.5","license":"BSD-2-Clause","preferGlobal":true,"description":"📦🐈 Fast, reliable, and secure dependency management.","dependencies":{"@zkochan/cmd-shim":"^3.1.0","babel-runtime":"^6.26.0","bytes":"^3.0.0","camelcase":"^4.0.0","chalk":"^2.1.0","cli-table3":"^0.4.0","commander":"^2.9.0","death":"^1.0.0","debug":"^3.0.0","deep-equal":"^1.0.1","detect-indent":"^5.0.0","dnscache":"^1.0.1","glob":"^7.1.1","gunzip-maybe":"^1.4.0","hash-for-dep":"^1.2.3","imports-loader":"^0.8.0","ini":"^1.3.4","inquirer":"^6.2.0","invariant":"^2.2.0","is-builtin-module":"^2.0.0","is-ci":"^1.0.10","is-webpack-bundle":"^1.0.0","js-yaml":"^3.13.1","leven":"^2.0.0","loud-rejection":"^1.2.0","micromatch":"^2.3.11","mkdirp":"^0.5.1","node-emoji":"^1.6.1","normalize-url":"^2.0.0","npm-logical-tree":"^1.2.1","object-path":"^0.11.2","proper-lockfile":"^2.0.0","puka":"^1.0.0","read":"^1.0.7","request":"^2.87.0","request-capture-har":"^1.2.2","rimraf":"^2.5.0","semver":"^5.1.0","ssri":"^5.3.0","strip-ansi":"^4.0.0","strip-bom":"^3.0.0","tar-fs":"^1.16.0","tar-stream":"^1.6.1","uuid":"^3.0.1","v8-compile-cache":"^2.0.0","validate-npm-package-license":"^3.0.4","yn":"^2.0.0"},"devDependencies":{"babel-core":"^6.26.0","babel-eslint":"^7.2.3","babel-loader":"^6.2.5","babel-plugin-array-includes":"^2.0.3","babel-plugin-inline-import":"^3.0.0","babel-plugin-transform-builtin-extend":"^1.1.2","babel-plugin-transform-inline-imports-commonjs":"^1.0.0","babel-plugin-transform-runtime":"^6.4.3","babel-preset-env":"^1.6.0","babel-preset-flow":"^6.23.0","babel-preset-stage-0":"^6.0.0","babylon":"^6.5.0","commitizen":"^2.9.6","cz-conventional-changelog":"^2.0.0","eslint":"^4.3.0","eslint-config-fb-strict":"^22.0.0","eslint-plugin-babel":"^5.0.0","eslint-plugin-flowtype":"^2.35.0","eslint-plugin-jasmine":"^2.6.2","eslint-plugin-jest":"^21.0.0","eslint-plugin-jsx-a11y":"^6.0.2","eslint-plugin-prefer-object-spread":"^1.2.1","eslint-plugin-prettier":"^2.1.2","eslint-plugin-react":"^7.1.0","eslint-plugin-relay":"^0.0.28","eslint-plugin-yarn-internal":"file:scripts/eslint-rules","execa":"^0.11.0","fancy-log":"^1.3.2","flow-bin":"^0.66.0","git-release-notes":"^3.0.0","gulp":"^4.0.0","gulp-babel":"^7.0.0","gulp-if":"^2.0.1","gulp-newer":"^1.0.0","gulp-plumber":"^1.0.1","gulp-sourcemaps":"^2.2.0","jest":"^22.4.4","jsinspect":"^0.12.6","minimatch":"^3.0.4","mock-stdin":"^0.3.0","prettier":"^1.5.2","string-replace-loader":"^2.1.1","temp":"^0.8.3","webpack":"^2.1.0-beta.25","yargs":"^6.3.0"},"resolutions":{"sshpk":"^1.14.2"},"engines":{"node":">=4.0.0"},"repository":"yarnpkg/yarn","bin":{"yarn":"./bin/yarn.js","yarnpkg":"./bin/yarn.js"},"scripts":{"build":"gulp build","build-bundle":"node ./scripts/build-webpack.js","build-chocolatey":"powershell ./scripts/build-chocolatey.ps1","build-deb":"./scripts/build-deb.sh","build-dist":"bash ./scripts/build-dist.sh","build-win-installer":"scripts\\build-windows-installer.bat","changelog":"git-release-notes $(git describe --tags --abbrev=0 $(git describe --tags --abbrev=0)^)..$(git describe --tags --abbrev=0) scripts/changelog.md","dupe-check":"yarn jsinspect ./src","lint":"eslint . && flow check","pkg-tests":"yarn --cwd packages/pkg-tests jest yarn.test.js","prettier":"eslint src __tests__ --fix","release-branch":"./scripts/release-branch.sh","test":"yarn lint && yarn test-only","test-only":"node --max_old_space_size=4096 node_modules/jest/bin/jest.js --verbose","test-only-debug":"node --inspect-brk --max_old_space_size=4096 node_modules/jest/bin/jest.js --runInBand --verbose","test-coverage":"node --max_old_space_size=4096 node_modules/jest/bin/jest.js --coverage --verbose","watch":"gulp watch","commit":"git-cz"},"jest":{"collectCoverageFrom":["src/**/*.js"],"testEnvironment":"node","modulePathIgnorePatterns":["__tests__/fixtures/","packages/pkg-tests/pkg-tests-fixtures","dist/"],"testPathIgnorePatterns":["__tests__/(fixtures|__mocks__)/","updates/","_(temp|mock|install|init|helpers).js$","packages/pkg-tests"]},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}}}
+module.exports = {"name":"yarn","installationMethod":"unknown","version":"1.22.10","license":"BSD-2-Clause","preferGlobal":true,"description":"📦🐈 Fast, reliable, and secure dependency management.","dependencies":{"@zkochan/cmd-shim":"^3.1.0","babel-runtime":"^6.26.0","bytes":"^3.0.0","camelcase":"^4.0.0","chalk":"^2.1.0","cli-table3":"^0.4.0","commander":"^2.9.0","death":"^1.0.0","debug":"^3.0.0","deep-equal":"^1.0.1","detect-indent":"^5.0.0","dnscache":"^1.0.1","glob":"^7.1.1","gunzip-maybe":"^1.4.0","hash-for-dep":"^1.2.3","imports-loader":"^0.8.0","ini":"^1.3.4","inquirer":"^6.2.0","invariant":"^2.2.0","is-builtin-module":"^2.0.0","is-ci":"^1.0.10","is-webpack-bundle":"^1.0.0","js-yaml":"^3.13.1","leven":"^2.0.0","loud-rejection":"^1.2.0","micromatch":"^2.3.11","mkdirp":"^0.5.1","node-emoji":"^1.6.1","normalize-url":"^2.0.0","npm-logical-tree":"^1.2.1","object-path":"^0.11.2","proper-lockfile":"^2.0.0","puka":"^1.0.0","read":"^1.0.7","request":"^2.87.0","request-capture-har":"^1.2.2","rimraf":"^2.5.0","semver":"^5.1.0","ssri":"^5.3.0","strip-ansi":"^4.0.0","strip-bom":"^3.0.0","tar-fs":"^1.16.0","tar-stream":"^1.6.1","uuid":"^3.0.1","v8-compile-cache":"^2.0.0","validate-npm-package-license":"^3.0.4","yn":"^2.0.0"},"devDependencies":{"babel-core":"^6.26.0","babel-eslint":"^7.2.3","babel-loader":"^6.2.5","babel-plugin-array-includes":"^2.0.3","babel-plugin-inline-import":"^3.0.0","babel-plugin-transform-builtin-extend":"^1.1.2","babel-plugin-transform-inline-imports-commonjs":"^1.0.0","babel-plugin-transform-runtime":"^6.4.3","babel-preset-env":"^1.6.0","babel-preset-flow":"^6.23.0","babel-preset-stage-0":"^6.0.0","babylon":"^6.5.0","commitizen":"^2.9.6","cz-conventional-changelog":"^2.0.0","eslint":"^4.3.0","eslint-config-fb-strict":"^22.0.0","eslint-plugin-babel":"^5.0.0","eslint-plugin-flowtype":"^2.35.0","eslint-plugin-jasmine":"^2.6.2","eslint-plugin-jest":"^21.0.0","eslint-plugin-jsx-a11y":"^6.0.2","eslint-plugin-prefer-object-spread":"^1.2.1","eslint-plugin-prettier":"^2.1.2","eslint-plugin-react":"^7.1.0","eslint-plugin-relay":"^0.0.28","eslint-plugin-yarn-internal":"file:scripts/eslint-rules","execa":"^0.11.0","fancy-log":"^1.3.2","flow-bin":"^0.66.0","git-release-notes":"^3.0.0","gulp":"^4.0.0","gulp-babel":"^7.0.0","gulp-if":"^2.0.1","gulp-newer":"^1.0.0","gulp-plumber":"^1.0.1","gulp-sourcemaps":"^2.2.0","jest":"^22.4.4","jsinspect":"^0.12.6","minimatch":"^3.0.4","mock-stdin":"^0.3.0","prettier":"^1.5.2","string-replace-loader":"^2.1.1","temp":"^0.8.3","webpack":"^2.1.0-beta.25","yargs":"^6.3.0"},"resolutions":{"sshpk":"^1.14.2"},"engines":{"node":">=4.0.0"},"repository":"yarnpkg/yarn","bin":{"yarn":"./bin/yarn.js","yarnpkg":"./bin/yarn.js"},"scripts":{"build":"gulp build","build-bundle":"node ./scripts/build-webpack.js","build-chocolatey":"powershell ./scripts/build-chocolatey.ps1","build-deb":"./scripts/build-deb.sh","build-dist":"bash ./scripts/build-dist.sh","build-win-installer":"scripts\\build-windows-installer.bat","changelog":"git-release-notes $(git describe --tags --abbrev=0 $(git describe --tags --abbrev=0)^)..$(git describe --tags --abbrev=0) scripts/changelog.md","dupe-check":"yarn jsinspect ./src","lint":"eslint . && flow check","pkg-tests":"yarn --cwd packages/pkg-tests jest yarn.test.js","prettier":"eslint src __tests__ --fix","release-branch":"./scripts/release-branch.sh","test":"yarn lint && yarn test-only","test-only":"node --max_old_space_size=4096 node_modules/jest/bin/jest.js --verbose","test-only-debug":"node --inspect-brk --max_old_space_size=4096 node_modules/jest/bin/jest.js --runInBand --verbose","test-coverage":"node --max_old_space_size=4096 node_modules/jest/bin/jest.js --coverage --verbose","watch":"gulp watch","commit":"git-cz"},"jest":{"collectCoverageFrom":["src/**/*.js"],"testEnvironment":"node","modulePathIgnorePatterns":["__tests__/fixtures/","packages/pkg-tests/pkg-tests-fixtures","dist/"],"testPathIgnorePatterns":["__tests__/(fixtures|__mocks__)/","updates/","_(temp|mock|install|init|helpers).js$","packages/pkg-tests"]},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}}}
/***/ }),
/* 195 */
@@ -97014,7 +97014,7 @@ let run = exports.run = (() => {
if (!(yield (_fs || _load_fs()).exists(lockfilePath))) {
yield (_fs || _load_fs()).writeFile(lockfilePath, '');
}
- yield (_child || _load_child()).spawn((_constants || _load_constants()).NODE_BIN_PATH, [process.argv[1], 'policies', 'set-version', installVersion], {
+ yield (_child || _load_child()).spawn((_constants || _load_constants()).NODE_BIN_PATH, [process.argv[1], 'policies', 'set-version', installVersion, '--silent'], {
stdio: 'inherit',
cwd: config.cwd
});
diff --git a/.yarnrc b/.yarnrc
index 54b28414542d9..57997b1cd7489 100644
--- a/.yarnrc
+++ b/.yarnrc
@@ -2,4 +2,4 @@
# yarn lockfile v1
-yarn-path ".yarn/releases/yarn-1.22.5.js"
+yarn-path ".yarn/releases/yarn-1.22.10.cjs"
|
next.js
|
https://github.com/vercel/next.js
|
7c20918bc787d24403fab170e7840f946886dcef
|
Leah
|
2022-06-23 22:25:05
|
feat: enable configuration of `styled-components` transform and enable `css` prop support (#37861)
|
This allows configuring / overriding the default options of the `styled-components` swc transform and allows using the `css` prop support, which was already implemented, but not available.
|
feat: enable configuration of `styled-components` transform and enable `css` prop support (#37861)
This allows configuring / overriding the default options of the `styled-components` swc transform and allows using the `css` prop support, which was already implemented, but not available.
Edit: made the CSS prop transform run before the display name, so it gets picked up by that and receives the (deterministic) name.
Relates to #30802
|
diff --git a/docs/advanced-features/compiler.md b/docs/advanced-features/compiler.md
index 4def26d34351b..43022a63fd506 100644
--- a/docs/advanced-features/compiler.md
+++ b/docs/advanced-features/compiler.md
@@ -40,12 +40,31 @@ We're working to port `babel-plugin-styled-components` to the Next.js Compiler.
First, update to the latest version of Next.js: `npm install next@latest`. Then, update your `next.config.js` file:
```js
-// next.config.js
-
module.exports = {
compiler: {
- // ssr and displayName are configured by default
- styledComponents: true,
+ // see https://styled-components.com/docs/tooling#babel-plugin for more info on the options.
+ styledComponents: boolean | {
+ // Enabled by default in development, disabled in production to reduce file size,
+ // setting this will override the default for all environments.
+ displayName?: boolean,
+ // Enabled by default.
+ ssr?: boolean,
+ // Enabled by default.
+ fileName?: boolean,
+ // Empty by default.
+ topLevelImportPaths?: string[],
+ // Defaults to ["index"].
+ meaninglessFileNames?: string[],
+ // Disabled by default.
+ cssProp?: boolean,
+ // Empty by default.
+ namespace?: string,
+ // Not supported yet.
+ minify?: boolean,
+ // Not supported yet.
+ transpileTemplateLiterals?: boolean,
+ // Not supported yet.
+ pure?: boolean,
},
}
```
diff --git a/package.json b/package.json
index 76467b5ffa1c6..ff2e619592a7e 100644
--- a/package.json
+++ b/package.json
@@ -209,5 +209,5 @@
"node": ">=12.22.0",
"pnpm": ">= 7.2.1"
},
- "packageManager": "[email protected]"
+ "packageManager": "[email protected]"
}
diff --git a/packages/next-swc/crates/core/src/lib.rs b/packages/next-swc/crates/core/src/lib.rs
index ecebc808ff4d9..60fcb7ce18af3 100644
--- a/packages/next-swc/crates/core/src/lib.rs
+++ b/packages/next-swc/crates/core/src/lib.rs
@@ -134,23 +134,12 @@ pub fn custom_before_pass<'a, C: Comments + 'a>(
styled_jsx::styled_jsx(cm.clone(), file.name.clone()),
hook_optimizer::hook_optimizer(),
match &opts.styled_components {
- Some(config) => {
- let config = Rc::new(config.clone());
- let state: Rc<RefCell<styled_components::State>> = Default::default();
-
- Either::Left(chain!(
- styled_components::analyzer(config.clone(), state.clone()),
- styled_components::display_name_and_id(
- file.name.clone(),
- file.src_hash,
- config,
- state
- )
- ))
- }
- None => {
- Either::Right(noop())
- }
+ Some(config) => Either::Left(styled_components::styled_components(
+ file.name.clone(),
+ file.src_hash,
+ config.clone(),
+ )),
+ None => Either::Right(noop()),
},
Optional::new(
next_ssg::next_ssg(eliminated_packages),
diff --git a/packages/next-swc/crates/styled_components/src/lib.rs b/packages/next-swc/crates/styled_components/src/lib.rs
index b463ab9f6e33e..14c0890351bc4 100644
--- a/packages/next-swc/crates/styled_components/src/lib.rs
+++ b/packages/next-swc/crates/styled_components/src/lib.rs
@@ -9,7 +9,7 @@ pub use crate::{
use serde::Deserialize;
use std::{cell::RefCell, rc::Rc};
use swc_atoms::JsWord;
-use swc_common::{chain, FileName};
+use swc_common::{chain, pass::Optional, FileName};
use swc_ecmascript::visit::{Fold, VisitMut};
mod css;
@@ -28,6 +28,9 @@ pub struct Config {
#[serde(default = "true_by_default")]
pub file_name: bool,
+ #[serde(default = "default_index_file_name")]
+ pub meaningless_file_names: Vec<String>,
+
#[serde(default)]
pub namespace: String,
@@ -40,6 +43,9 @@ pub struct Config {
#[serde(default)]
pub minify: bool,
+ #[serde(default)]
+ pub pure: bool,
+
#[serde(default)]
pub css_prop: bool,
}
@@ -48,6 +54,10 @@ fn true_by_default() -> bool {
true
}
+fn default_index_file_name() -> Vec<String> {
+ vec!["index".to_string()]
+}
+
impl Config {
pub(crate) fn use_namespace(&self) -> String {
if self.namespace.is_empty() {
@@ -70,7 +80,10 @@ pub fn styled_components(
chain!(
analyzer(config.clone(), state.clone()),
- display_name_and_id(file_name, src_file_hash, config, state),
- transpile_css_prop()
+ Optional {
+ enabled: config.css_prop,
+ visitor: transpile_css_prop(state.clone())
+ },
+ display_name_and_id(file_name, src_file_hash, config.clone(), state)
)
}
diff --git a/packages/next-swc/crates/styled_components/src/utils/analyzer.rs b/packages/next-swc/crates/styled_components/src/utils/analyzer.rs
index 5d59d92123fb0..b6c4bca8d9e20 100644
--- a/packages/next-swc/crates/styled_components/src/utils/analyzer.rs
+++ b/packages/next-swc/crates/styled_components/src/utils/analyzer.rs
@@ -61,27 +61,28 @@ impl Visit for Analyzer<'_> {
fn visit_var_declarator(&mut self, v: &VarDeclarator) {
v.visit_children_with(self);
- if let Pat::Ident(name) = &v.name {
- if let Some(Expr::Call(CallExpr {
+ if let (
+ Pat::Ident(name),
+ Some(Expr::Call(CallExpr {
callee: Callee::Expr(callee),
args,
..
- })) = v.init.as_deref()
- {
- if let Expr::Ident(callee) = &**callee {
- if &*callee.sym == "require" && args.len() == 1 && args[0].spread.is_none() {
- if let Expr::Lit(Lit::Str(v)) = &*args[0].expr {
- let is_styled = if self.config.top_level_import_paths.is_empty() {
- &*v.value == "styled-components"
- || v.value.starts_with("styled-components/")
- } else {
- self.config.top_level_import_paths.contains(&v.value)
- };
-
- if is_styled {
- self.state.styled_required = Some(name.id.to_id());
- self.state.unresolved_ctxt = Some(callee.span.ctxt);
- }
+ })),
+ ) = (&v.name, v.init.as_deref())
+ {
+ if let Expr::Ident(callee) = &**callee {
+ if &*callee.sym == "require" && args.len() == 1 && args[0].spread.is_none() {
+ if let Expr::Lit(Lit::Str(v)) = &*args[0].expr {
+ let is_styled = if self.config.top_level_import_paths.is_empty() {
+ &*v.value == "styled-components"
+ || v.value.starts_with("styled-components/")
+ } else {
+ self.config.top_level_import_paths.contains(&v.value)
+ };
+
+ if is_styled {
+ self.state.styled_required = Some(name.id.to_id());
+ self.state.unresolved_ctxt = Some(callee.span.ctxt);
}
}
}
diff --git a/packages/next-swc/crates/styled_components/src/utils/mod.rs b/packages/next-swc/crates/styled_components/src/utils/mod.rs
index de303c989d18b..754b4cc33449a 100644
--- a/packages/next-swc/crates/styled_components/src/utils/mod.rs
+++ b/packages/next-swc/crates/styled_components/src/utils/mod.rs
@@ -1,6 +1,4 @@
pub use self::analyzer::{analyze, analyzer};
-use once_cell::sync::Lazy;
-use regex::{Captures, Regex};
use std::{borrow::Cow, cell::RefCell};
use swc_atoms::js_word;
use swc_common::{collections::AHashMap, SyntaxContext};
@@ -210,7 +208,11 @@ impl State {
false
}
- fn import_local_name(&self, name: &str, cache_identifier: Option<&Ident>) -> Option<Id> {
+ pub(crate) fn import_local_name(
+ &self,
+ name: &str,
+ cache_identifier: Option<&Ident>,
+ ) -> Option<Id> {
if name == "default" {
if let Some(cached) = self.imported_local_name.clone() {
return Some(cached);
@@ -251,6 +253,10 @@ impl State {
name
}
+ pub(crate) fn set_import_name(&mut self, id: Id) {
+ self.imported_local_name = Some(id);
+ }
+
fn is_helper(&self, e: &Expr) -> bool {
self.is_create_global_style_helper(e)
|| self.is_css_helper(e)
@@ -304,10 +310,9 @@ impl State {
}
pub fn prefix_leading_digit(s: &str) -> Cow<str> {
- static REGEX: Lazy<Regex> = Lazy::new(|| Regex::new(r"^(\d)").unwrap());
-
- REGEX.replace(s, |s: &Captures| {
- //
- format!("sc-{}", s.get(0).unwrap().as_str())
- })
+ if s.chars().next().map(|c| c.is_digit(10)).unwrap_or(false) {
+ Cow::Owned(format!("sc-{}", s))
+ } else {
+ Cow::Borrowed(s)
+ }
}
diff --git a/packages/next-swc/crates/styled_components/src/visitors/display_name_and_id.rs b/packages/next-swc/crates/styled_components/src/visitors/display_name_and_id.rs
index c4eed07e1762a..0b761ec51f1ba 100644
--- a/packages/next-swc/crates/styled_components/src/visitors/display_name_and_id.rs
+++ b/packages/next-swc/crates/styled_components/src/visitors/display_name_and_id.rs
@@ -49,16 +49,21 @@ struct DisplayNameAndId {
impl DisplayNameAndId {
fn get_block_name(&self, p: &Path) -> String {
- let file_stem = p.file_stem();
- if let Some(file_stem) = file_stem {
- if file_stem == "index" {
- } else {
- return file_stem.to_string_lossy().to_string();
+ match p.file_stem().map(|s| s.to_string_lossy()) {
+ Some(file_stem)
+ if !self
+ .config
+ .meaningless_file_names
+ .iter()
+ .any(|meaningless| file_stem.as_ref() == meaningless) =>
+ {
+ file_stem.into()
}
- } else {
+ _ => self.get_block_name(
+ p.parent()
+ .expect("path only contains meaningless filenames (e.g. /index/index)?"),
+ ),
}
-
- self.get_block_name(p.parent().expect("/index/index/index?"))
}
fn get_display_name(&mut self, _: &Expr) -> JsWord {
@@ -338,20 +343,13 @@ impl VisitMut for DisplayNameAndId {
None
};
- let display_name = if self.config.display_name {
- Some(self.get_display_name(expr))
- } else {
- None
- };
-
+ let display_name = self
+ .config
+ .display_name
+ .then(|| self.get_display_name(expr));
trace!("display_name: {:?}", display_name);
- let component_id = if self.config.ssr {
- Some(self.get_component_id().into())
- } else {
- None
- };
-
+ let component_id = self.config.ssr.then(|| self.get_component_id().into());
trace!("component_id: {:?}", display_name);
self.add_config(
diff --git a/packages/next-swc/crates/styled_components/src/visitors/transpile_css_prop/transpile.rs b/packages/next-swc/crates/styled_components/src/visitors/transpile_css_prop/transpile.rs
index 1a9f96b302d90..07278c30d7fec 100644
--- a/packages/next-swc/crates/styled_components/src/visitors/transpile_css_prop/transpile.rs
+++ b/packages/next-swc/crates/styled_components/src/visitors/transpile_css_prop/transpile.rs
@@ -1,7 +1,10 @@
//! Port of https://github.com/styled-components/babel-plugin-styled-components/blob/a20c3033508677695953e7a434de4746168eeb4e/src/visitors/transpileCssProp.js
+use std::cell::RefCell;
+use std::rc::Rc;
use std::{borrow::Cow, collections::HashMap};
+use crate::State;
use inflector::Inflector;
use once_cell::sync::Lazy;
use regex::Regex;
@@ -24,12 +27,17 @@ use super::top_level_binding_collector::collect_top_level_decls;
static TAG_NAME_REGEX: Lazy<Regex> =
Lazy::new(|| Regex::new("^[a-z][a-z\\d]*(\\-[a-z][a-z\\d]*)?$").unwrap());
-pub fn transpile_css_prop() -> impl Fold + VisitMut {
- as_folder(TranspileCssProp::default())
+pub fn transpile_css_prop(state: Rc<RefCell<State>>) -> impl Fold + VisitMut {
+ as_folder(TranspileCssProp {
+ state,
+ ..Default::default()
+ })
}
#[derive(Default)]
struct TranspileCssProp {
+ state: Rc<RefCell<State>>,
+
import_name: Option<Ident>,
injected_nodes: Vec<Stmt>,
interleaved_injections: AHashMap<Id, Vec<Stmt>>,
@@ -69,10 +77,18 @@ impl VisitMut for TranspileCssProp {
continue;
}
- let import_name = self
- .import_name
- .get_or_insert_with(|| private_ident!("_styled"))
- .clone();
+ let import_name = if let Some(ident) = self
+ .state
+ .borrow()
+ .import_local_name("default", None)
+ .map(Ident::from)
+ {
+ ident
+ } else {
+ self.import_name
+ .get_or_insert_with(|| private_ident!("_styled"))
+ .clone()
+ };
let name = get_name_ident(&elem.opening.name);
let id_sym = name.sym.to_class_case();
@@ -349,6 +365,7 @@ impl VisitMut for TranspileCssProp {
self.top_level_decls = None;
if let Some(import_name) = self.import_name.take() {
+ self.state.borrow_mut().set_import_name(import_name.to_id());
let specifier = ImportSpecifier::Default(ImportDefaultSpecifier {
span: DUMMY_SP,
local: import_name,
diff --git a/packages/next-swc/crates/styled_components/tests/fixtures/transpile-css-prop-all-options-on/output.js b/packages/next-swc/crates/styled_components/tests/fixtures/transpile-css-prop-all-options-on/output.js
index e0504edff2e34..ce524e2f23882 100644
--- a/packages/next-swc/crates/styled_components/tests/fixtures/transpile-css-prop-all-options-on/output.js
+++ b/packages/next-swc/crates/styled_components/tests/fixtures/transpile-css-prop-all-options-on/output.js
@@ -1,4 +1,3 @@
-import _styled from "styled-components";
import styled from 'styled-components';
import SomeComponent from '../SomeComponentPath';
const { SomeOtherComponent } = require('../SomeOtherComponentPath');
@@ -90,25 +89,40 @@ const Thing3 = styled.div.withConfig({
})`
color: blue;
`;
-var _StyledThing6 = _styled(Thing3)((p)=>({
+var _StyledThing6 = styled(Thing3).withConfig({
+ displayName: "code___StyledThing6",
+ componentId: "sc-867225be-3"
+})((p)=>({
[p.$_css19]: {
color: 'red'
}
}));
-var _StyledThing5 = _styled(Thing3)((p)=>({
+var _StyledThing5 = styled(Thing3).withConfig({
+ displayName: "code___StyledThing5",
+ componentId: "sc-867225be-4"
+})((p)=>({
[p.$_css18]: {
color: 'red'
}
}));
-var _StyledThing4 = _styled(Thing3)((p)=>({
+var _StyledThing4 = styled(Thing3).withConfig({
+ displayName: "code___StyledThing4",
+ componentId: "sc-867225be-5"
+})((p)=>({
[p.$_css17]: {
color: 'red'
}
}));
-var _StyledThing3 = _styled(Thing3)((p)=>({
+var _StyledThing3 = styled(Thing3).withConfig({
+ displayName: "code___StyledThing3",
+ componentId: "sc-867225be-6"
+})((p)=>({
color: p.$_css16
}));
-var _StyledThing = _styled(Thing3)`color: red;`;
+var _StyledThing = styled(Thing3).withConfig({
+ displayName: "code___StyledThing",
+ componentId: "sc-867225be-7"
+})`color: red;`;
const EarlyUsageComponent2 = (p)=><_StyledThing2 />;
function Thing4(props1) {
return <div {...props1}/>;
@@ -165,42 +179,102 @@ const ObjectPropWithSpread = ()=>{
bottom: '-100px'
} : {}}/>;
};
-var _StyledSomeComponent = _styled(SomeComponent)`color: red;`;
-var _StyledSomeOtherComponent = _styled(SomeOtherComponent)`color: red;`;
-var _StyledThing2 = _styled(Thing4)`color: red;`;
-var _StyledP = _styled("p")`flex: 1;`;
-var _StyledP2 = _styled("p")`
+var _StyledSomeComponent = styled(SomeComponent).withConfig({
+ displayName: "code___StyledSomeComponent",
+ componentId: "sc-867225be-8"
+})`color: red;`;
+var _StyledSomeOtherComponent = styled(SomeOtherComponent).withConfig({
+ displayName: "code___StyledSomeOtherComponent",
+ componentId: "sc-867225be-9"
+})`color: red;`;
+var _StyledThing2 = styled(Thing4).withConfig({
+ displayName: "code___StyledThing2",
+ componentId: "sc-867225be-10"
+})`color: red;`;
+var _StyledP = styled("p").withConfig({
+ displayName: "code___StyledP",
+ componentId: "sc-867225be-11"
+})`flex: 1;`;
+var _StyledP2 = styled("p").withConfig({
+ displayName: "code___StyledP2",
+ componentId: "sc-867225be-12"
+})`
flex: 1;
`;
-var _StyledP3 = _styled("p")({
+var _StyledP3 = styled("p").withConfig({
+ displayName: "code___StyledP3",
+ componentId: "sc-867225be-13"
+})({
color: 'blue'
});
-var _StyledP4 = _styled("p")`flex: 1;`;
-var _StyledP5 = _styled("p")`
+var _StyledP4 = styled("p").withConfig({
+ displayName: "code___StyledP4",
+ componentId: "sc-867225be-14"
+})`flex: 1;`;
+var _StyledP5 = styled("p").withConfig({
+ displayName: "code___StyledP5",
+ componentId: "sc-867225be-15"
+})`
color: blue;
`;
-var _StyledParagraph = _styled(Paragraph)`flex: 1`;
-var _StyledP6 = _styled("p")`${(p)=>p.$_css}`;
-var _StyledP7 = _styled("p")`
+var _StyledParagraph = styled(Paragraph).withConfig({
+ displayName: "code___StyledParagraph",
+ componentId: "sc-867225be-16"
+})`flex: 1`;
+var _StyledP6 = styled("p").withConfig({
+ displayName: "code___StyledP6",
+ componentId: "sc-867225be-17"
+})`${(p)=>p.$_css}`;
+var _StyledP7 = styled("p").withConfig({
+ displayName: "code___StyledP7",
+ componentId: "sc-867225be-18"
+})`
background: ${(p)=>p.$_css2};
`;
-var _StyledP8 = _styled("p")`
+var _StyledP8 = styled("p").withConfig({
+ displayName: "code___StyledP8",
+ componentId: "sc-867225be-19"
+})`
color: ${(props1)=>props1.theme.a};
`;
-var _StyledP9 = _styled("p")`
+var _StyledP9 = styled("p").withConfig({
+ displayName: "code___StyledP9",
+ componentId: "sc-867225be-20"
+})`
border-radius: ${radius}px;
`;
-var _StyledP10 = _styled("p")`
+var _StyledP10 = styled("p").withConfig({
+ displayName: "code___StyledP10",
+ componentId: "sc-867225be-21"
+})`
color: ${(p)=>p.$_css3};
`;
-var _StyledP11 = _styled("p")`
+var _StyledP11 = styled("p").withConfig({
+ displayName: "code___StyledP11",
+ componentId: "sc-867225be-22"
+})`
color: ${(props1)=>props1.theme.color};
`;
-var _StyledButtonGhost = _styled(Button.Ghost)`flex: 1`;
-var _StyledButtonGhostNew = _styled(Button.Ghost.New)`flex: 1`;
-var _StyledButtonGhost2 = _styled(button.ghost)`flex: 1`;
-var _StyledButtonGhost3 = _styled("button-ghost")`flex: 1`;
-var _StyledP12 = _styled("p")((p)=>({
+var _StyledButtonGhost = styled(Button.Ghost).withConfig({
+ displayName: "code___StyledButtonGhost",
+ componentId: "sc-867225be-23"
+})`flex: 1`;
+var _StyledButtonGhostNew = styled(Button.Ghost.New).withConfig({
+ displayName: "code___StyledButtonGhostNew",
+ componentId: "sc-867225be-24"
+})`flex: 1`;
+var _StyledButtonGhost2 = styled(button.ghost).withConfig({
+ displayName: "code___StyledButtonGhost2",
+ componentId: "sc-867225be-25"
+})`flex: 1`;
+var _StyledButtonGhost3 = styled("button-ghost").withConfig({
+ displayName: "code___StyledButtonGhost3",
+ componentId: "sc-867225be-26"
+})`flex: 1`;
+var _StyledP12 = styled("p").withConfig({
+ displayName: "code___StyledP12",
+ componentId: "sc-867225be-27"
+})((p)=>({
background: p.$_css4,
color: p.$_css5,
textAlign: 'left',
@@ -211,7 +285,10 @@ var _StyledP12 = _styled("p")((p)=>({
content: p.$_css7
}
}));
-var _StyledP13 = _styled("p")((p)=>({
+var _StyledP13 = styled("p").withConfig({
+ displayName: "code___StyledP13",
+ componentId: "sc-867225be-28"
+})((p)=>({
...{
'::before': {
content: p.$_css8
@@ -237,10 +314,16 @@ var _StyledP13 = _styled("p")((p)=>({
content: p.$_css14
}
}));
-var _StyledP14 = _styled("p")((p)=>({
+var _StyledP14 = styled("p").withConfig({
+ displayName: "code___StyledP14",
+ componentId: "sc-867225be-29"
+})((p)=>({
color: p.$_css15
}));
-var _StyledDiv = _styled("div")((p)=>({
+var _StyledDiv = styled("div").withConfig({
+ displayName: "code___StyledDiv",
+ componentId: "sc-867225be-30"
+})((p)=>({
...p.$_css20,
...p.$_css21
}));
diff --git a/packages/next/build/swc/options.js b/packages/next/build/swc/options.js
index f6895bcaddec5..e6e9ec9bccb75 100644
--- a/packages/next/build/swc/options.js
+++ b/packages/next/build/swc/options.js
@@ -17,7 +17,7 @@ export function getParserOptions({ filename, jsConfig, ...rest }) {
dynamicImport: true,
decorators: enableDecorators,
// Exclude regular TypeScript files from React transformation to prevent e.g. generic parameters and angle-bracket type assertion from being interpreted as JSX tags.
- [isTypeScript ? 'tsx' : 'jsx']: isTSFile ? false : true,
+ [isTypeScript ? 'tsx' : 'jsx']: !isTSFile,
importAssertions: true,
}
}
@@ -104,11 +104,7 @@ function getBaseSWCOptions({
},
},
sourceMaps: jest ? 'inline' : undefined,
- styledComponents: nextConfig?.compiler?.styledComponents
- ? {
- displayName: Boolean(development),
- }
- : null,
+ styledComponents: getStyledComponentsOptions(nextConfig, development),
removeConsole: nextConfig?.compiler?.removeConsole,
// disable "reactRemoveProperties" when "jest" is true
// otherwise the setting from next.config.js will be used
@@ -121,6 +117,18 @@ function getBaseSWCOptions({
}
}
+function getStyledComponentsOptions(nextConfig, development) {
+ let styledComponentsOptions = nextConfig?.compiler?.styledComponents
+ if (!styledComponentsOptions) {
+ return null
+ }
+
+ return {
+ ...styledComponentsOptions,
+ displayName: styledComponentsOptions.displayName ?? Boolean(development),
+ }
+}
+
function getEmotionOptions(nextConfig, development) {
if (!nextConfig?.compiler?.emotion) {
return null
diff --git a/packages/next/server/config-shared.ts b/packages/next/server/config-shared.ts
index d637a34ef7d44..c0c95b1374a73 100644
--- a/packages/next/server/config-shared.ts
+++ b/packages/next/server/config-shared.ts
@@ -421,7 +421,24 @@ export interface NextConfig extends Record<string, any> {
| {
exclude?: string[]
}
- styledComponents?: boolean
+ styledComponents?:
+ | boolean
+ | {
+ /**
+ * Enabled by default in development, disabled in production to reduce file size,
+ * setting this will override the default for all environments.
+ */
+ displayName?: boolean
+ topLevelImportPaths?: string[]
+ ssr?: boolean
+ fileName?: boolean
+ meaninglessFileNames?: string[]
+ minify?: boolean
+ transpileTemplateLiterals?: boolean
+ namespace?: string
+ pure?: boolean
+ cssProp?: boolean
+ }
emotion?:
| boolean
| {
diff --git a/packages/react-refresh-utils/tsconfig.json b/packages/react-refresh-utils/tsconfig.json
index 4798cd7ae317a..bd580ec9271ec 100644
--- a/packages/react-refresh-utils/tsconfig.json
+++ b/packages/react-refresh-utils/tsconfig.json
@@ -13,5 +13,5 @@
}
},
"include": ["**/*.ts"],
- "exclude": ["node_modules"]
+ "exclude": ["node_modules", "dist"]
}
diff --git a/test/development/basic/styled-components.test.ts b/test/development/basic/styled-components.test.ts
index 458dd95086949..69adfd195b851 100644
--- a/test/development/basic/styled-components.test.ts
+++ b/test/development/basic/styled-components.test.ts
@@ -66,6 +66,19 @@ describe('styled-components SWC transform', () => {
`window.getComputedStyle(document.querySelector('#btn')).color`
)
).toBe('rgb(255, 255, 255)')
+ expect(
+ await browser.eval(
+ `window.getComputedStyle(document.querySelector('#wrap-div')).color`
+ )
+ ).toBe('rgb(0, 0, 0)')
+ })
+
+ it('should enable the display name transform by default', async () => {
+ // make sure the index chunk gets generated
+ await webdriver(next.appPort, '/')
+
+ const chunk = await next.readFile('.next/static/chunks/pages/index.js')
+ expect(chunk).toContain('displayName: \\"pages__Button\\"')
})
it('should contain styles in initial HTML', async () => {
diff --git a/test/development/basic/styled-components/next.config.js b/test/development/basic/styled-components/next.config.js
index 91f693fda5258..1b9e5702bf862 100644
--- a/test/development/basic/styled-components/next.config.js
+++ b/test/development/basic/styled-components/next.config.js
@@ -1,5 +1,7 @@
module.exports = {
compiler: {
- styledComponents: true,
+ styledComponents: {
+ cssProp: true,
+ },
},
}
diff --git a/test/development/basic/styled-components/pages/index.js b/test/development/basic/styled-components/pages/index.js
index 8c833028979d7..a40708a545465 100644
--- a/test/development/basic/styled-components/pages/index.js
+++ b/test/development/basic/styled-components/pages/index.js
@@ -23,7 +23,12 @@ const Button = styled.a`
export default function Home() {
console.log('__render__')
return (
- <div>
+ <div
+ id="wrap-div"
+ css={`
+ background: black;
+ `}
+ >
<Button
href="https://github.com/styled-components/styled-components"
target="_blank"
|
cube
|
https://github.com/cube-js/cube
|
e0d4e553c5103e47bcaebb13b340e17db4676f0d
|
dependabot-preview[bot]
|
2020-03-27 05:53:51
|
build(deps): bump @babel/runtime-corejs2 from 7.0.0 to 7.9.2 (#540)
|
Bumps [@babel/runtime-corejs2](https://github.com/babel/babel) from 7.0.0 to 7.9.2.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/master/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/compare/v7.0.0...v7.9.2)
|
build(deps): bump @babel/runtime-corejs2 from 7.0.0 to 7.9.2 (#540)
Bumps [@babel/runtime-corejs2](https://github.com/babel/babel) from 7.0.0 to 7.9.2.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/master/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/compare/v7.0.0...v7.9.2)
Signed-off-by: dependabot-preview[bot] <[email protected]>
Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
|
diff --git a/yarn.lock b/yarn.lock
index 6099a206f64b6..0806b279c4460 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -775,11 +775,12 @@
"@babel/plugin-transform-react-jsx-source" "^7.8.3"
"@babel/runtime-corejs2@^7.0.0":
- version "7.0.0"
- resolved "https://registry.yarnpkg.com/@babel/runtime-corejs2/-/runtime-corejs2-7.0.0.tgz#786711ee099c2c2af7875638866c1259eff30a8c"
+ version "7.9.2"
+ resolved "https://registry.yarnpkg.com/@babel/runtime-corejs2/-/runtime-corejs2-7.9.2.tgz#f11d074ff99b9b4319b5ecf0501f12202bf2bf4d"
+ integrity sha512-ayjSOxuK2GaSDJFCtLgHnYjuMyIpViNujWrZo8GUpN60/n7juzJKK5yOo6RFVb0zdU9ACJFK+MsZrUnj3OmXMw==
dependencies:
- core-js "^2.5.7"
- regenerator-runtime "^0.12.0"
+ core-js "^2.6.5"
+ regenerator-runtime "^0.13.4"
"@babel/runtime@^7.0.0", "@babel/runtime@^7.1.2":
version "7.9.2"
@@ -2361,9 +2362,10 @@ core-js-compat@^3.6.2:
browserslist "^4.8.3"
semver "7.0.0"
-core-js@^2.4.0, core-js@^2.5.3, core-js@^2.5.7:
- version "2.5.7"
- resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.7.tgz#f972608ff0cead68b841a16a932d0b183791814e"
+core-js@^2.4.0, core-js@^2.5.3, core-js@^2.6.5:
+ version "2.6.11"
+ resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.11.tgz#38831469f9922bded8ee21c9dc46985e0399308c"
+ integrity sha512-5wjnpaT/3dV+XB4borEsnAYQchn00XSgTAWKDkEqv+K8KevjbzmofK6hfJ9TZIlpj2N0xQpazy7PiRQiWHqzWg==
[email protected], core-util-is@~1.0.0:
version "1.0.2"
@@ -5599,10 +5601,6 @@ regenerator-runtime@^0.11.0:
version "0.11.1"
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9"
-regenerator-runtime@^0.12.0:
- version "0.12.1"
- resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.12.1.tgz#fa1a71544764c036f8c49b13a08b2594c9f8a0de"
-
regenerator-runtime@^0.13.4:
version "0.13.5"
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.5.tgz#d878a1d094b4306d10b9096484b33ebd55e26697"
|
ort
|
https://github.com/oss-review-toolkit/ort
|
b051095415a4f4b7610e509a9ca12f456a22c520
|
Frank Viernau
|
2024-05-16 20:02:45
|
fix(model): Fix-up filtering excluded issues
|
This fixes the logic introduced by 6a84fa2.
|
fix(model): Fix-up filtering excluded issues
This fixes the logic introduced by 6a84fa2.
Signed-off-by: Frank Viernau <[email protected]>
|
diff --git a/model/src/main/kotlin/OrtResult.kt b/model/src/main/kotlin/OrtResult.kt
index 54184500f8b25..85ccd06d2e3f4 100644
--- a/model/src/main/kotlin/OrtResult.kt
+++ b/model/src/main/kotlin/OrtResult.kt
@@ -329,7 +329,7 @@ data class OrtResult(
val filteredIssues = issues.filterTo(mutableSetOf()) {
(!omitResolved || !isResolved(it))
&& it.severity >= minSeverity
- && it !in issuesWithExcludedAffectedPathById[id].orEmpty()
+ && (!omitExcluded || it !in issuesWithExcludedAffectedPathById[id].orEmpty())
}
filteredIssues.takeUnless { it.isEmpty() }?.let { id to it }
diff --git a/plugins/reporters/static-html/src/funTest/assets/static-html-reporter-test-expected-output.html b/plugins/reporters/static-html/src/funTest/assets/static-html-reporter-test-expected-output.html
index 8d6f31a4f70df..455c7c663aa3e 100644
--- a/plugins/reporters/static-html/src/funTest/assets/static-html-reporter-test-expected-output.html
+++ b/plugins/reporters/static-html/src/funTest/assets/static-html-reporter-test-expected-output.html
@@ -1048,6 +1048,12 @@ <h3>Packages</h3>
Resolved by: CANT_FIX_ISSUE - Resolved for illustration.</p>
</td>
</tr>
+ <tr class="excluded">
+ <td>
+ <p>2024-04-22T10:36:10.661544294Z [ERROR]: FakeScanner - ERROR: Timeout after 300 seconds
+ while scanning file 'analyzer/src/funTest/assets/projects/synthetic/gradle/lib/excluded-file.dat'.</p>
+ </td>
+ </tr>
</table>
</td>
</tr>
|
sqlx
|
https://github.com/launchbadge/sqlx
|
b3091b03226432e055dceba7fd6b3a6172f17437
|
liushuyu
|
2021-12-30 02:40:18
|
feat(postgres): add an option to specify extra options (#1539)
|
* feat(postgres): add an option to specify extra options ...
... this allow you to specify stuff like search path and statement
timeouts etc.
* feat(postgres): set options through setting run-time parameters
* feat(postgres): use flat command-list instead of hashmap
* feat(postgres): make the options taking parameters with `Display` trait
|
feat(postgres): add an option to specify extra options (#1539)
* feat(postgres): add an option to specify extra options ...
... this allow you to specify stuff like search path and statement
timeouts etc.
* feat(postgres): set options through setting run-time parameters
* feat(postgres): use flat command-list instead of hashmap
* feat(postgres): make the options taking parameters with `Display` trait
|
diff --git a/sqlx-core/src/postgres/connection/establish.rs b/sqlx-core/src/postgres/connection/establish.rs
index 59e3727c24..bd23780026 100644
--- a/sqlx-core/src/postgres/connection/establish.rs
+++ b/sqlx-core/src/postgres/connection/establish.rs
@@ -40,6 +40,10 @@ impl PgConnection {
params.push(("application_name", application_name));
}
+ if let Some(ref options) = options.options {
+ params.push(("options", options));
+ }
+
stream
.send(Startup {
username: Some(&options.username),
diff --git a/sqlx-core/src/postgres/options/mod.rs b/sqlx-core/src/postgres/options/mod.rs
index 72a4b5cd0c..499b64d284 100644
--- a/sqlx-core/src/postgres/options/mod.rs
+++ b/sqlx-core/src/postgres/options/mod.rs
@@ -1,4 +1,5 @@
use std::env::var;
+use std::fmt::Display;
use std::path::{Path, PathBuf};
mod connect;
@@ -33,6 +34,7 @@ pub use ssl_mode::PgSslMode;
/// | `password` | `None` | Password to be used if the server demands password authentication. |
/// | `port` | `5432` | Port number to connect to at the server host, or socket file name extension for Unix-domain connections. |
/// | `dbname` | `None` | The database name. |
+/// | `options` | `None` | The runtime parameters to send to the server at connection start. |
///
/// The URI scheme designator can be either `postgresql://` or `postgres://`.
/// Each of the URI parts is optional.
@@ -85,6 +87,7 @@ pub struct PgConnectOptions {
pub(crate) statement_cache_capacity: usize,
pub(crate) application_name: Option<String>,
pub(crate) log_settings: LogSettings,
+ pub(crate) options: Option<String>,
}
impl Default for PgConnectOptions {
@@ -145,6 +148,7 @@ impl PgConnectOptions {
statement_cache_capacity: 100,
application_name: var("PGAPPNAME").ok(),
log_settings: Default::default(),
+ options: var("PGOPTIONS").ok(),
}
}
@@ -332,6 +336,34 @@ impl PgConnectOptions {
self
}
+ /// Set additional startup options for the connection as a list of key-value pairs.
+ ///
+ /// # Example
+ ///
+ /// ```rust
+ /// # use sqlx_core::postgres::PgConnectOptions;
+ /// let options = PgConnectOptions::new()
+ /// .options([("geqo", "off"), ("statement_timeout", "5min")]);
+ /// ```
+ pub fn options<K, V, I>(mut self, options: I) -> Self
+ where
+ K: Display,
+ V: Display,
+ I: IntoIterator<Item = (K, V)>,
+ {
+ let mut options_str = String::new();
+ for (k, v) in options {
+ options_str += &format!("-c {}={}", k, v);
+ }
+ if let Some(ref mut v) = self.options {
+ v.push(' ');
+ v.push_str(&options_str);
+ } else {
+ self.options = Some(options_str);
+ }
+ self
+ }
+
/// We try using a socket if hostname starts with `/` or if socket parameter
/// is specified.
pub(crate) fn fetch_socket(&self) -> Option<String> {
diff --git a/sqlx-core/src/postgres/options/parse.rs b/sqlx-core/src/postgres/options/parse.rs
index 04d2f222ab..dc099b831f 100644
--- a/sqlx-core/src/postgres/options/parse.rs
+++ b/sqlx-core/src/postgres/options/parse.rs
@@ -85,6 +85,21 @@ impl FromStr for PgConnectOptions {
"application_name" => options = options.application_name(&*value),
+ "options" => {
+ if let Some(options) = options.options.as_mut() {
+ options.push(' ');
+ options.push_str(&*value);
+ } else {
+ options.options = Some(value.to_string());
+ }
+ }
+
+ k if k.starts_with("options[") => {
+ if let Some(key) = k.strip_prefix("options[").unwrap().strip_suffix(']') {
+ options = options.options([(key, &*value)]);
+ }
+ }
+
_ => log::warn!("ignoring unrecognized connect parameter: {}={}", key, value),
}
}
@@ -197,3 +212,23 @@ fn it_parses_socket_correctly_with_username_percent_encoded() {
assert_eq!(Some("/var/lib/postgres/".into()), opts.socket);
assert_eq!(Some("database"), opts.database.as_deref());
}
+#[test]
+fn it_parses_libpq_options_correctly() {
+ let uri = "postgres:///?options=-c%20synchronous_commit%3Doff%20--search_path%3Dpostgres";
+ let opts = PgConnectOptions::from_str(uri).unwrap();
+
+ assert_eq!(
+ Some("-c synchronous_commit=off --search_path=postgres".into()),
+ opts.options
+ );
+}
+#[test]
+fn it_parses_sqlx_options_correctly() {
+ let uri = "postgres:///?options[synchronous_commit]=off&options[search_path]=postgres";
+ let opts = PgConnectOptions::from_str(uri).unwrap();
+
+ assert_eq!(
+ Some("-c synchronous_commit=off -c search_path=postgres".into()),
+ opts.options
+ );
+}
|
redwood
|
https://github.com/redwoodjs/redwood
|
d949d8dea028461069dbebf6f80775aef7dd63db
|
renovate[bot]
|
2024-05-16 22:02:20
|
chore(deps): update chore (major) (#10593)
|
[](https://renovatebot.com)
This PR contains the following updates:
| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [nx](https://nx.dev)
([source](https://togithub.com/nrwl/nx/tree/HEAD/packages/nx)) |
[`18.2.4` ->
`19.0.4`](https://renovatebot.com/diffs/npm/nx/18.2.4/19.0.4) |
[](https://docs.renovatebot.com/merge-confidence/)
|
[](https://docs.renovatebot.com/merge-confidence/)
|
[](https://docs.renovatebot.com/merge-confidence/)
|
[](https://docs.renovatebot.com/merge-confidence/)
|
| [zx](https://togithub.com/google/zx) | [`7.2.3` ->
`8.1.0`](https://renovatebot.com/diffs/npm/zx/7.2.3/8.1.0) |
[](https://docs.renovatebot.com/merge-confidence/)
|
[](https://docs.renovatebot.com/merge-confidence/)
|
[](https://docs.renovatebot.com/merge-confidence/)
|
[](https://docs.renovatebot.com/merge-confidence/)
|
---
### Release Notes
<details>
<summary>nrwl/nx (nx)</summary>
### [`v19.0.4`](https://togithub.com/nrwl/nx/releases/tag/19.0.4)
[Compare Source](https://togithub.com/nrwl/nx/compare/19.0.3...19.0.4)
#### 19.0.4 (2024-05-15)
##### 🚀 Features
- **core:** support finding matching projects with only negative
patterns ([#​22743](https://togithub.com/nrwl/nx/pull/22743))
- **react-native:** add optional syncDeps param to storybook executor
([#​22032](https://togithub.com/nrwl/nx/pull/22032))
##### 🩹 Fixes
- **core:** properly indent command output with mixed line endings
([#​23321](https://togithub.com/nrwl/nx/pull/23321))
- **core:** read socket dir on demand & load .env files on client
startup ([#​23348](https://togithub.com/nrwl/nx/pull/23348))
- **core:** not load env files when NX_LOAD_DOT_ENV_FILES is false
([#​23231](https://togithub.com/nrwl/nx/pull/23231))
- **core:** addPlugin should not conflict on project.json targ…
([#​23391](https://togithub.com/nrwl/nx/pull/23391))
- **core:** fix affected detection for inputs after named inputs
([#​23354](https://togithub.com/nrwl/nx/pull/23354))
- **core:** fix eslint --help command
([#​23274](https://togithub.com/nrwl/nx/pull/23274))
- **core:** copy native files to tmp file location instead of .nx/cache
([#​23375](https://togithub.com/nrwl/nx/pull/23375))
- **core:** retry interrupted errors when writing to stdout
([#​23359](https://togithub.com/nrwl/nx/pull/23359))
- **graph:** properly remove <base> tag when generating static graph
file ([#​23399](https://togithub.com/nrwl/nx/pull/23399))
- **js:** copy assets handler should correctly handle assets on windows
([#​23351](https://togithub.com/nrwl/nx/pull/23351))
- **misc:** guard against failure to decode file in migration
([#​23069](https://togithub.com/nrwl/nx/pull/23069))
- **nextjs:** Moving a library using
[@​nx/workspace](https://togithub.com/nx/workspace):move should
update … ([#​23311](https://togithub.com/nrwl/nx/pull/23311))
- **testing:** ignore jest-sequencer- paths in jest resolver
([#​23396](https://togithub.com/nrwl/nx/pull/23396))
- **testing:** check for project eslint config file in cypress and pla…
([#​23401](https://togithub.com/nrwl/nx/pull/23401))
- **vite:** migration should handle config object correctly
[#​20921](https://togithub.com/nrwl/nx/issues/20921)
([#​23364](https://togithub.com/nrwl/nx/pull/23364),
[#​20921](https://togithub.com/nrwl/nx/issues/20921))
- **webpack:** apply-base-config should initialize options it will set
[#​23296](https://togithub.com/nrwl/nx/issues/23296)
([#​23368](https://togithub.com/nrwl/nx/pull/23368),
[#​23296](https://togithub.com/nrwl/nx/issues/23296))
##### ❤️ Thank You
- arekkubaczkowski
[@​arekkubaczkowski](https://togithub.com/arekkubaczkowski)
- Colum Ferry [@​Coly010](https://togithub.com/Coly010)
- Craigory Coppola [@​AgentEnder](https://togithub.com/AgentEnder)
- Denis Bendrikov
- Emily Xiong [@​xiongemi](https://togithub.com/xiongemi)
- Jason Jean [@​FrozenPandaz](https://togithub.com/FrozenPandaz)
- Leosvel Pérez Espinosa
[@​leosvelperez](https://togithub.com/leosvelperez)
- MaxKless [@​MaxKless](https://togithub.com/MaxKless)
- Nicholas Cunningham
[@​ndcunningham](https://togithub.com/ndcunningham)
### [`v19.0.3`](https://togithub.com/nrwl/nx/releases/tag/19.0.3)
[Compare Source](https://togithub.com/nrwl/nx/compare/19.0.2...19.0.3)
##### 19.0.3 (2024-05-13)
##### 🚀 Features
- **nx-dev:** show banner on documentation pages
([#​23266](https://togithub.com/nrwl/nx/pull/23266))
- **nx-dev:** check for missing images
([#​23248](https://togithub.com/nrwl/nx/pull/23248))
- **nx-dev:** put banner above menu
([#​23335](https://togithub.com/nrwl/nx/pull/23335))
- **react:** Add SvgOptions for NxReactWebpackPlugin and WithNx
([#​23283](https://togithub.com/nrwl/nx/pull/23283))
##### 🩹 Fixes
- **core:** include more binary extensions
([#​22788](https://togithub.com/nrwl/nx/pull/22788),
[#​22861](https://togithub.com/nrwl/nx/pull/22861))
- **core:** workspace remove generator should handle no root jest config
([#​23328](https://togithub.com/nrwl/nx/pull/23328))
- **core:** addPlugin should not conflict on project.json targets
([#​23264](https://togithub.com/nrwl/nx/pull/23264))
- **core:** throw a specific error for print-affected and affected graph
([#​23336](https://togithub.com/nrwl/nx/pull/23336))
- **js:** Adds mjs files to prettierrcNameOptions
([#​21796](https://togithub.com/nrwl/nx/pull/21796))
- **linter:** ensure all spreads are removed from rules before parsing
([#​23292](https://togithub.com/nrwl/nx/pull/23292))
- **linter:** log transpilation errors of workspace rules
([#​21503](https://togithub.com/nrwl/nx/pull/21503))
- **linter:** rename languageSettings to languageOptions for flat config
migration ([#​22924](https://togithub.com/nrwl/nx/pull/22924))
- **linter:** fix migrating projects with the eslint plugin
([#​23147](https://togithub.com/nrwl/nx/pull/23147))
- **misc:** move e2e-ci to a separate parallel 1 command
([#​23305](https://togithub.com/nrwl/nx/pull/23305))
- **module-federation:** Throw an error if remote is invalid
([#​23100](https://togithub.com/nrwl/nx/pull/23100))
- **nx-cloud:** ensure generated ci workflows use dlx for nx-cloud
([#​23333](https://togithub.com/nrwl/nx/pull/23333))
- **nx-dev:** move table of contents down
([#​23350](https://togithub.com/nrwl/nx/pull/23350))
- **storybook:** should handle inferred cypress when generating cypress
project [#​21770](https://togithub.com/nrwl/nx/issues/21770)
([#​23327](https://togithub.com/nrwl/nx/pull/23327),
[#​21770](https://togithub.com/nrwl/nx/issues/21770))
- **testing:** resolve absolute paths for ts path mappings in jest
resolver ([#​23346](https://togithub.com/nrwl/nx/pull/23346))
- **vite:** support passing --watch to inferred vitest commands
([#​23298](https://togithub.com/nrwl/nx/pull/23298))
- **vite:** generate vitest cache dir scoped to each project root and
normalize vite cache dir
([#​23330](https://togithub.com/nrwl/nx/pull/23330))
##### ❤️ Thank You
- Colum Ferry [@​Coly010](https://togithub.com/Coly010)
- Denis Bendrikov
- Dmitry Zakharov [@​pumano](https://togithub.com/pumano)
- Isaac Mann [@​isaacplmann](https://togithub.com/isaacplmann)
- James Henry [@​JamesHenry](https://togithub.com/JamesHenry)
- Jason Jean [@​FrozenPandaz](https://togithub.com/FrozenPandaz)
- Leosvel Pérez Espinosa
[@​leosvelperez](https://togithub.com/leosvelperez)
- Mehrad Rafigh
[@​mehrad-rafigh](https://togithub.com/mehrad-rafigh)
- Nicholas Cunningham
[@​ndcunningham](https://togithub.com/ndcunningham)
- Patrick P [@​ppfenning92](https://togithub.com/ppfenning92)
### [`v19.0.2`](https://togithub.com/nrwl/nx/releases/tag/19.0.2)
[Compare Source](https://togithub.com/nrwl/nx/compare/19.0.1...19.0.2)
##### 19.0.2 (2024-05-09)
##### 🩹 Fixes
- **bundling:** rollup does not log build errors
([#​23141](https://togithub.com/nrwl/nx/pull/23141))
- **bundling:** resolve index files from ts paths when running esbuild
without bundling
([#​23098](https://togithub.com/nrwl/nx/pull/23098))
- **core:** set yarn berry nodeLinker correctly in migrate command
([#​23249](https://togithub.com/nrwl/nx/pull/23249))
- **core:** show project --web shouldn't error
([#​23251](https://togithub.com/nrwl/nx/pull/23251))
- **core:** update getLastValueFromAsyncIterableIterator to support
AsyncIterables returned from executors
([#​23229](https://togithub.com/nrwl/nx/pull/23229))
- **gradle:** run gradle init if no settings.gradle
([#​23226](https://togithub.com/nrwl/nx/pull/23226))
- **linter:** ensure config.rules is spread into rules in flat config
migration ([#​23263](https://togithub.com/nrwl/nx/pull/23263))
- **misc:** create workspaces and default app with the name as provided
([#​23196](https://togithub.com/nrwl/nx/pull/23196))
- ⚠️ **misc:** adjust deprecation messages to v20
([#​23223](https://togithub.com/nrwl/nx/pull/23223))
- **nx-dev:** fix home page mobile menu
([#​23250](https://togithub.com/nrwl/nx/pull/23250))
- **release:** ensure changelog renderers are resolvable when processing
config ([#​23214](https://togithub.com/nrwl/nx/pull/23214))
- **vite:** don't generate tasks for remix projects
([#​22551](https://togithub.com/nrwl/nx/pull/22551))
- **vite:** get tsconfig from new path including target
([#​22775](https://togithub.com/nrwl/nx/pull/22775))
- **webpack:** fix default compiler option
([#​22762](https://togithub.com/nrwl/nx/pull/22762))
- **webpack:** don't overwrite output config
([#​22116](https://togithub.com/nrwl/nx/pull/22116))
- **webpack:** publicPath and rebaseRootRelative
([#​20992](https://togithub.com/nrwl/nx/pull/20992))
##### ⚠️ Breaking Changes
- **misc:** `nx print-affected` was deprecated in 16.4.0 and has been
removed
- **misc:** `nx affected:graph` was deprecated in 16.4.0 and has been
removed
- **misc:** `criticalPath` and `affectedProjects` properties created for
`nx graph --file graph.json` was deprecated in 16.2.0 and has been
removed
##### ❤️ Thank You
- andriizavoiko
[@​andriizavoiko](https://togithub.com/andriizavoiko)
- Craigory Coppola [@​AgentEnder](https://togithub.com/AgentEnder)
- Edward Wang [@​wzc0415](https://togithub.com/wzc0415)
- Emily Xiong [@​xiongemi](https://togithub.com/xiongemi)
- Isaac Mann [@​isaacplmann](https://togithub.com/isaacplmann)
- Jack Hsu [@​jaysoo](https://togithub.com/jaysoo)
- James Henry [@​JamesHenry](https://togithub.com/JamesHenry)
- Jason Jean [@​FrozenPandaz](https://togithub.com/FrozenPandaz)
- Krystian Sowiński
[@​plumcoding](https://togithub.com/plumcoding)
- Leosvel Pérez Espinosa
[@​leosvelperez](https://togithub.com/leosvelperez)
- Mateo Tibaquirá
- Matthias Stemmler [@​ms-tng](https://togithub.com/ms-tng)
- Mike Peters
- Sean Sanker
### [`v19.0.1`](https://togithub.com/nrwl/nx/releases/tag/19.0.1)
[Compare Source](https://togithub.com/nrwl/nx/compare/19.0.0...19.0.1)
#### 19.0.1 (2024-05-07)
##### 🚀 Features
- **core:** add an option to seperate the output of show with provide…
([#​23172](https://togithub.com/nrwl/nx/pull/23172))
- **misc:** improve nx cloud setup prompts and messaging
([#​23218](https://togithub.com/nrwl/nx/pull/23218))
##### 🩹 Fixes
- **gradle:** use local gradlew instead of sdkman
([#​23205](https://togithub.com/nrwl/nx/pull/23205))
- **module-federation:** nested projects should be ordered first when
reading from tsconfig paths
[#​20284](https://togithub.com/nrwl/nx/issues/20284)
([#​23212](https://togithub.com/nrwl/nx/pull/23212),
[#​20284](https://togithub.com/nrwl/nx/issues/20284))
##### ❤️ Thank You
- Colum Ferry [@​Coly010](https://togithub.com/Coly010)
- Daniel Santiago
- Emily Xiong [@​xiongemi](https://togithub.com/xiongemi)
- Leosvel Pérez Espinosa
[@​leosvelperez](https://togithub.com/leosvelperez)
###
[`v19.0.0`](https://togithub.com/nrwl/nx/compare/18.3.4...41d21ab9ac7fa3682ba535979278bb3c4a349654)
[Compare Source](https://togithub.com/nrwl/nx/compare/18.3.5...19.0.0)
### [`v18.3.5`](https://togithub.com/nrwl/nx/releases/tag/18.3.5)
[Compare Source](https://togithub.com/nrwl/nx/compare/18.3.4...18.3.5)
##### 18.3.5 (2024-05-15)
##### 🩹 Fixes
- **core:** fix affected detection for inputs after named inputs
([#​23354](https://togithub.com/nrwl/nx/pull/23354))
##### ❤️ Thank You
- Jason Jean [@​FrozenPandaz](https://togithub.com/FrozenPandaz)
### [`v18.3.4`](https://togithub.com/nrwl/nx/releases/tag/18.3.4)
[Compare Source](https://togithub.com/nrwl/nx/compare/18.3.3...18.3.4)
##### 18.3.4 (2024-04-25)
##### 🚀 Features
- **core:** add root level forwardAllArgs
([#​22753](https://togithub.com/nrwl/nx/pull/22753))
##### 🩹 Fixes
- **core:** different commands should not be considered compatible
targets ([#​22863](https://togithub.com/nrwl/nx/pull/22863))
- **core:** fix pnpm install order on ci workflows
([#​22580](https://togithub.com/nrwl/nx/pull/22580))
- **core:** workspace context glob respects exclude
([#​22939](https://togithub.com/nrwl/nx/pull/22939))
- **core:** handle events that do not have paths
([#​22947](https://togithub.com/nrwl/nx/pull/22947))
- **core:** fix exclude for empty array
([#​22951](https://togithub.com/nrwl/nx/pull/22951))
- **core:** move a few api points to return root maps directly
([#​22949](https://togithub.com/nrwl/nx/pull/22949))
- **core:** regression register ts transpiler for local plugin
([#​22964](https://togithub.com/nrwl/nx/pull/22964))
- **core:** handle created directories when watching on linux
([#​22980](https://togithub.com/nrwl/nx/pull/22980))
- **core:** ensure create nodes functions are properly parallelized
([#​23005](https://togithub.com/nrwl/nx/pull/23005))
- **gradle:** change gradle command to be relative path
([#​22963](https://togithub.com/nrwl/nx/pull/22963))
- **gradle:** should skip println in project report
([#​22862](https://togithub.com/nrwl/nx/pull/22862))
- **gradle:** get gradlew path with projectRoot joins workspaceRoot
([#​22988](https://togithub.com/nrwl/nx/pull/22988))
- **graph:** don't listen to system theme changes in console
([#​22938](https://togithub.com/nrwl/nx/pull/22938))
- **linter:** do not infer lint tasks for projects without files to lint
([#​22944](https://togithub.com/nrwl/nx/pull/22944))
- **misc:** fix publish script
([#​22981](https://togithub.com/nrwl/nx/pull/22981))
- **misc:** perf logging shouldn't be enabled twice
([#​23012](https://togithub.com/nrwl/nx/pull/23012))
- **node:** e2e target fails out of the box
([#​22987](https://togithub.com/nrwl/nx/pull/22987))
- **repo:** downgrade to macos-13 in publish workflow
([#​22961](https://togithub.com/nrwl/nx/pull/22961))
- **storybook:** handle inherited config correctly when identifying the
framework used for inferred tasks
([#​22953](https://togithub.com/nrwl/nx/pull/22953))
##### ❤️ Thank You
- Colum Ferry [@​Coly010](https://togithub.com/Coly010)
- Craigory Coppola [@​AgentEnder](https://togithub.com/AgentEnder)
- Emily Xiong [@​xiongemi](https://togithub.com/xiongemi)
- Jack Hsu [@​jaysoo](https://togithub.com/jaysoo)
- Jason Jean [@​FrozenPandaz](https://togithub.com/FrozenPandaz)
- Jonathan Cammisuli
- Leosvel Pérez Espinosa
[@​leosvelperez](https://togithub.com/leosvelperez)
- MaxKless [@​MaxKless](https://togithub.com/MaxKless)
- Miroslav Jonaš [@​meeroslav](https://togithub.com/meeroslav)
- Nicholas Cunningham
[@​ndcunningham](https://togithub.com/ndcunningham)
- Richard Roozenboom
[@​Roozenboom](https://togithub.com/Roozenboom)
### [`v18.3.3`](https://togithub.com/nrwl/nx/releases/tag/18.3.3)
[Compare Source](https://togithub.com/nrwl/nx/compare/18.3.2...18.3.3)
#### 18.3.3 (2024-04-20)
##### 🩹 Fixes
- **angular:** fix loading postcss configuration in ng-packagr executors
([#​22900](https://togithub.com/nrwl/nx/pull/22900))
- **core:** group command exit listeners to avoid warning
([#​22892](https://togithub.com/nrwl/nx/pull/22892))
- **core:** handle plugin errors from isolation correctly
([#​22890](https://togithub.com/nrwl/nx/pull/22890))
- **core:** disable pty on windows until stable
([#​22910](https://togithub.com/nrwl/nx/pull/22910))
- **core:** fix cursor being hidden and process shutdown for ctrl c
([#​22895](https://togithub.com/nrwl/nx/pull/22895))
- **misc:** add --verbose support to nx graph
([#​22889](https://togithub.com/nrwl/nx/pull/22889))
- **misc:** mark migration for escaping env vars as skipped in nx repair
([#​22916](https://togithub.com/nrwl/nx/pull/22916))
- **misc:** don't clear node_modules require cache
([#​22907](https://togithub.com/nrwl/nx/pull/22907))
- **testing:** bust require cache in jest plugin so configs reload
([#​22893](https://togithub.com/nrwl/nx/pull/22893))
- **vue:** do not add verbatimImportSyntax to tsconfig
([#​22905](https://togithub.com/nrwl/nx/pull/22905))
##### ❤️ Thank You
- Colum Ferry [@​Coly010](https://togithub.com/Coly010)
- Craigory Coppola [@​AgentEnder](https://togithub.com/AgentEnder)
- Jason Jean [@​FrozenPandaz](https://togithub.com/FrozenPandaz)
- Leosvel Pérez Espinosa
[@​leosvelperez](https://togithub.com/leosvelperez)
### [`v18.3.2`](https://togithub.com/nrwl/nx/releases/tag/18.3.2)
[Compare Source](https://togithub.com/nrwl/nx/compare/18.3.1...18.3.2)
##### 18.3.2 (2024-04-18)
##### 🚀 Features
- **core:** load native files from tmp location instead of node_modules
([#​22648](https://togithub.com/nrwl/nx/pull/22648))
##### 🩹 Fixes
- **bundling:** handle circular dependencies in
[@​nx/esbuild](https://togithub.com/nx/esbuild)
getExtraDependencies
([#​22644](https://togithub.com/nrwl/nx/pull/22644))
- **core:** load config util supports absolute paths on windows
([#​22837](https://togithub.com/nrwl/nx/pull/22837))
- **core:** keep plugin workers until main process shutdown
([#​22860](https://togithub.com/nrwl/nx/pull/22860))
- **core:** handle schema validation errors running commands directly
([#​22864](https://togithub.com/nrwl/nx/pull/22864))
- **core:** forward args provided to the nx add command to the invoked
init generator
([#​22855](https://togithub.com/nrwl/nx/pull/22855))
- **core:** fix hashing of external dependencies
([#​22865](https://togithub.com/nrwl/nx/pull/22865))
- **nx-cloud:** ensure root .env files are loaded during dte
([#​22859](https://togithub.com/nrwl/nx/pull/22859))
- **testing:** fix jest ci target names
([#​22858](https://togithub.com/nrwl/nx/pull/22858))
##### ❤️ Thank You
- Colum Ferry [@​Coly010](https://togithub.com/Coly010)
- Craigory Coppola [@​AgentEnder](https://togithub.com/AgentEnder)
- Jason Jean [@​FrozenPandaz](https://togithub.com/FrozenPandaz)
- Kyle Cannon [@​kylecannon](https://togithub.com/kylecannon)
- Leosvel Pérez Espinosa
[@​leosvelperez](https://togithub.com/leosvelperez)
- MaxKless [@​MaxKless](https://togithub.com/MaxKless)
### [`v18.3.1`](https://togithub.com/nrwl/nx/releases/tag/18.3.1)
[Compare Source](https://togithub.com/nrwl/nx/compare/18.3.0...18.3.1)
##### 18.3.1 (2024-04-17)
##### 🩹 Fixes
- **core:** repair sourcemap creation in createNodes
([#​22851](https://togithub.com/nrwl/nx/pull/22851))
##### ❤️ Thank You
- MaxKless [@​MaxKless](https://togithub.com/MaxKless)
### [`v18.3.0`](https://togithub.com/nrwl/nx/releases/tag/18.3.0)
[Compare Source](https://togithub.com/nrwl/nx/compare/18.2.4...18.3.0)
##### 18.3.0 (2024-04-16)
##### 🚀 Features
- **core:** add metadata to targets
([#​22655](https://togithub.com/nrwl/nx/pull/22655))
- **core:** list crystal plugins with nx report
([#​22649](https://togithub.com/nrwl/nx/pull/22649))
- **core:** re-enable running plugins in isolation
([#​22527](https://togithub.com/nrwl/nx/pull/22527))
- **core:** load root .env files on daemon
([#​22786](https://togithub.com/nrwl/nx/pull/22786))
- **js:** add swc cli options --strip-leading-paths
([#​22193](https://togithub.com/nrwl/nx/pull/22193))
- **js:** add swc cli options --strip-leading-paths "
([#​22193](https://togithub.com/nrwl/nx/pull/22193),
[#​22832](https://togithub.com/nrwl/nx/pull/22832))
- **misc:** non conflicting init/add flow
([#​22791](https://togithub.com/nrwl/nx/pull/22791))
- **nuxt:** update
[@​nuxt/eslint-config](https://togithub.com/nuxt/eslint-config) to
a stable version
([#​22804](https://togithub.com/nrwl/nx/pull/22804))
- **nx-dev:** link Nx Launch Conf videos
([#​22690](https://togithub.com/nrwl/nx/pull/22690))
- **nx-dev:** remember selected tabs
([#​22699](https://togithub.com/nrwl/nx/pull/22699))
- **nx-dev:** add contact pages
([#​22815](https://togithub.com/nrwl/nx/pull/22815))
- **nx-dev:** banner for webinar
([#​22824](https://togithub.com/nrwl/nx/pull/22824))
- **testing:** add ability to split jest tests
([#​22662](https://togithub.com/nrwl/nx/pull/22662))
- **testing:** add metadata to playwright targets
([#​22768](https://togithub.com/nrwl/nx/pull/22768))
- **vite:** migrate to latest vite-plugin-dts
([#​22614](https://togithub.com/nrwl/nx/pull/22614))
##### 🩹 Fixes
- **angular:** prevent false positive validation due to option default
value in dev-server executor
([#​22606](https://togithub.com/nrwl/nx/pull/22606))
- **angular:** respect skipPackageJson correctly in library generator
([#​22608](https://togithub.com/nrwl/nx/pull/22608))
- **angular:** fix @​nx/angular/src/utils entry point
([#​22609](https://togithub.com/nrwl/nx/pull/22609))
- **angular:** fix dynamic module federation generation
([#​22724](https://togithub.com/nrwl/nx/pull/22724))
- **angular:** respect skipPackageJson correctly across generators
([#​22777](https://togithub.com/nrwl/nx/pull/22777))
- **angular:** execute wrapped schematics post tasks and log messages
([#​22780](https://togithub.com/nrwl/nx/pull/22780))
- **bundling:** support exported array of options for rollup
([#​22703](https://togithub.com/nrwl/nx/pull/22703))
- **bundling:** print errors from rollup build
([#​22707](https://togithub.com/nrwl/nx/pull/22707))
- **bundling:** show codeframes for Rollup build errors
([#​22845](https://togithub.com/nrwl/nx/pull/22845))
- **core:** do not assume workspace inputs cause all projects to be af…
([#​22573](https://togithub.com/nrwl/nx/pull/22573))
- **core:** write terminal output to cache folder
([#​22673](https://togithub.com/nrwl/nx/pull/22673))
- **core:** errors from create dependencies should show properly
([#​22695](https://togithub.com/nrwl/nx/pull/22695))
- **core:** not passing props of run-commands to underlying command
([#​22595](https://togithub.com/nrwl/nx/pull/22595))
- **core:** update pty version to add windows specific flags
([#​22711](https://togithub.com/nrwl/nx/pull/22711))
- **core:** detect imports from template literals in dynamic imports
([#​22749](https://togithub.com/nrwl/nx/pull/22749))
- **core:** attach cli args from target options explicitly with '='
([#​22756](https://togithub.com/nrwl/nx/pull/22756))
- **core:** fix plugin exclude option
([#​22738](https://togithub.com/nrwl/nx/pull/22738))
- **core:** improve `isCI` to better detect other providers
([#​22694](https://togithub.com/nrwl/nx/pull/22694))
- **core:** errors thrown when creating projects should prevent running
targets ([#​22807](https://togithub.com/nrwl/nx/pull/22807))
- **core:** use name instead of .prototype.name when comparing errors
([#​22840](https://togithub.com/nrwl/nx/pull/22840))
- **core:** fix init logging and package.json updates
([#​22843](https://togithub.com/nrwl/nx/pull/22843))
- **devkit:** update peer dependency on nx to include Nx 19
([#​22811](https://togithub.com/nrwl/nx/pull/22811))
- **js:** update jest snapshot after vite-plugin-dts bump
([#​22621](https://togithub.com/nrwl/nx/pull/22621))
- **js:** append target when generating tmp tsconfig to prevent
conflicts [#​21396](https://togithub.com/nrwl/nx/issues/21396)
([#​22671](https://togithub.com/nrwl/nx/pull/22671),
[#​21396](https://togithub.com/nrwl/nx/issues/21396))
- **js:** propagate error from child process to
[@​nx/js](https://togithub.com/nx/js):node executor
([#​22705](https://togithub.com/nrwl/nx/pull/22705))
- **js:** do not default to commonjs type field in package.json
([#​22819](https://togithub.com/nrwl/nx/pull/22819))
- **misc:** fix optional branch tracking on ci pipeline
([#​22652](https://togithub.com/nrwl/nx/pull/22652))
- **module-federation:** serve dynamic remotes statically in their own
processes ([#​22688](https://togithub.com/nrwl/nx/pull/22688))
- **nextjs:** Adding tailwind should work when creating an app OOTB
([#​22709](https://togithub.com/nrwl/nx/pull/22709))
- **nuxt:** use loadConfigFile from devkit rather than
[@​nuxt/kit](https://togithub.com/nuxt/kit)
([#​22571](https://togithub.com/nrwl/nx/pull/22571))
- **nx-dev:** Update urls that are 404
([#​22653](https://togithub.com/nrwl/nx/pull/22653))
- **react-native:** storybook relative paths
([#​22031](https://togithub.com/nrwl/nx/pull/22031))
- **react-native:** should ask for app name when preset is react native
([#​22761](https://togithub.com/nrwl/nx/pull/22761))
- **react-native:** fix unable to resolve on windows
([#​22759](https://togithub.com/nrwl/nx/pull/22759))
- **release:** respect root .npmrc registry settings for publishing
([12afa20210](https://togithub.com/nrwl/nx/commit/12afa20210))
- **release:** do not try to interpolate packageRoot for root project
([#​22771](https://togithub.com/nrwl/nx/pull/22771))
- **testing:** fix playwright executor uiPort option schema
([#​22610](https://togithub.com/nrwl/nx/pull/22610))
- **testing:** app generators should create correct e2e config at
generation time
([#​22565](https://togithub.com/nrwl/nx/pull/22565))
- **vite:** ensure cache is created correctly for separate vite and
vitest config files
[#​22244](https://togithub.com/nrwl/nx/issues/22244)
([#​22618](https://togithub.com/nrwl/nx/pull/22618),
[#​22244](https://togithub.com/nrwl/nx/issues/22244))
- **vite:** pass cli arguments as options to vitest
([#​22355](https://togithub.com/nrwl/nx/pull/22355))
- **webpack:** bring back previous SVG and SVGR behavior for React
projects ([#​22628](https://togithub.com/nrwl/nx/pull/22628))
- **webpack:** support standard webpack config with
[@​nx/webpack](https://togithub.com/nx/webpack):dev-server
([#​22660](https://togithub.com/nrwl/nx/pull/22660))
- **webpack:** remove url-loader from dependencies since it is replaced
by asset modules
([#​22698](https://togithub.com/nrwl/nx/pull/22698))
- **webpack:** typo for outputPath
([#​22734](https://togithub.com/nrwl/nx/pull/22734))
- **webpack:** Should work when absolute paths are supplied as output
([#​22736](https://togithub.com/nrwl/nx/pull/22736))
##### ❤️ Thank You
- Altan Stalker
- arekkubaczkowski
[@​arekkubaczkowski](https://togithub.com/arekkubaczkowski)
- Austin Fahsl [@​fahslaj](https://togithub.com/fahslaj)
- Benjamin Cabanes [@​bcabanes](https://togithub.com/bcabanes)
- Colum Ferry [@​Coly010](https://togithub.com/Coly010)
- Craigory Coppola [@​AgentEnder](https://togithub.com/AgentEnder)
- Emily Xiong [@​xiongemi](https://togithub.com/xiongemi)
- Every [@​hongxuWei](https://togithub.com/hongxuWei)
- Isaac Mann [@​isaacplmann](https://togithub.com/isaacplmann)
- Jack Hsu [@​jaysoo](https://togithub.com/jaysoo)
- Jason Jean [@​FrozenPandaz](https://togithub.com/FrozenPandaz)
- Juri Strumpflohner [@​juristr](https://togithub.com/juristr)
- Leosvel Pérez Espinosa
[@​leosvelperez](https://togithub.com/leosvelperez)
- Lucca Miranda [@​luckened](https://togithub.com/luckened)
- MaxKless [@​MaxKless](https://togithub.com/MaxKless)
- Miroslav Jonaš [@​meeroslav](https://togithub.com/meeroslav)
- Nicholas Cunningham
[@​ndcunningham](https://togithub.com/ndcunningham)
- Thomas Dekiere
- Younes Jaaidi
</details>
<details>
<summary>google/zx (zx)</summary>
### [`v8.1.0`](https://togithub.com/google/zx/releases/tag/8.1.0)
[Compare Source](https://togithub.com/google/zx/compare/8.0.2...8.1.0)
This new release is a big deal. It brings significant improvements in
reliability and compatibility.
- Switched to
[hybrid-scheme](https://2ality.com/2019/10/hybrid-npm-packages.html)
|
chore(deps): update chore (major) (#10593)
[](https://renovatebot.com)
This PR contains the following updates:
| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [nx](https://nx.dev)
([source](https://togithub.com/nrwl/nx/tree/HEAD/packages/nx)) |
[`18.2.4` ->
`19.0.4`](https://renovatebot.com/diffs/npm/nx/18.2.4/19.0.4) |
[](https://docs.renovatebot.com/merge-confidence/)
|
[](https://docs.renovatebot.com/merge-confidence/)
|
[](https://docs.renovatebot.com/merge-confidence/)
|
[](https://docs.renovatebot.com/merge-confidence/)
|
| [zx](https://togithub.com/google/zx) | [`7.2.3` ->
`8.1.0`](https://renovatebot.com/diffs/npm/zx/7.2.3/8.1.0) |
[](https://docs.renovatebot.com/merge-confidence/)
|
[](https://docs.renovatebot.com/merge-confidence/)
|
[](https://docs.renovatebot.com/merge-confidence/)
|
[](https://docs.renovatebot.com/merge-confidence/)
|
---
### Release Notes
<details>
<summary>nrwl/nx (nx)</summary>
### [`v19.0.4`](https://togithub.com/nrwl/nx/releases/tag/19.0.4)
[Compare Source](https://togithub.com/nrwl/nx/compare/19.0.3...19.0.4)
#### 19.0.4 (2024-05-15)
##### 🚀 Features
- **core:** support finding matching projects with only negative
patterns ([#​22743](https://togithub.com/nrwl/nx/pull/22743))
- **react-native:** add optional syncDeps param to storybook executor
([#​22032](https://togithub.com/nrwl/nx/pull/22032))
##### 🩹 Fixes
- **core:** properly indent command output with mixed line endings
([#​23321](https://togithub.com/nrwl/nx/pull/23321))
- **core:** read socket dir on demand & load .env files on client
startup ([#​23348](https://togithub.com/nrwl/nx/pull/23348))
- **core:** not load env files when NX_LOAD_DOT_ENV_FILES is false
([#​23231](https://togithub.com/nrwl/nx/pull/23231))
- **core:** addPlugin should not conflict on project.json targ…
([#​23391](https://togithub.com/nrwl/nx/pull/23391))
- **core:** fix affected detection for inputs after named inputs
([#​23354](https://togithub.com/nrwl/nx/pull/23354))
- **core:** fix eslint --help command
([#​23274](https://togithub.com/nrwl/nx/pull/23274))
- **core:** copy native files to tmp file location instead of .nx/cache
([#​23375](https://togithub.com/nrwl/nx/pull/23375))
- **core:** retry interrupted errors when writing to stdout
([#​23359](https://togithub.com/nrwl/nx/pull/23359))
- **graph:** properly remove <base> tag when generating static graph
file ([#​23399](https://togithub.com/nrwl/nx/pull/23399))
- **js:** copy assets handler should correctly handle assets on windows
([#​23351](https://togithub.com/nrwl/nx/pull/23351))
- **misc:** guard against failure to decode file in migration
([#​23069](https://togithub.com/nrwl/nx/pull/23069))
- **nextjs:** Moving a library using
[@​nx/workspace](https://togithub.com/nx/workspace):move should
update … ([#​23311](https://togithub.com/nrwl/nx/pull/23311))
- **testing:** ignore jest-sequencer- paths in jest resolver
([#​23396](https://togithub.com/nrwl/nx/pull/23396))
- **testing:** check for project eslint config file in cypress and pla…
([#​23401](https://togithub.com/nrwl/nx/pull/23401))
- **vite:** migration should handle config object correctly
[#​20921](https://togithub.com/nrwl/nx/issues/20921)
([#​23364](https://togithub.com/nrwl/nx/pull/23364),
[#​20921](https://togithub.com/nrwl/nx/issues/20921))
- **webpack:** apply-base-config should initialize options it will set
[#​23296](https://togithub.com/nrwl/nx/issues/23296)
([#​23368](https://togithub.com/nrwl/nx/pull/23368),
[#​23296](https://togithub.com/nrwl/nx/issues/23296))
##### ❤️ Thank You
- arekkubaczkowski
[@​arekkubaczkowski](https://togithub.com/arekkubaczkowski)
- Colum Ferry [@​Coly010](https://togithub.com/Coly010)
- Craigory Coppola [@​AgentEnder](https://togithub.com/AgentEnder)
- Denis Bendrikov
- Emily Xiong [@​xiongemi](https://togithub.com/xiongemi)
- Jason Jean [@​FrozenPandaz](https://togithub.com/FrozenPandaz)
- Leosvel Pérez Espinosa
[@​leosvelperez](https://togithub.com/leosvelperez)
- MaxKless [@​MaxKless](https://togithub.com/MaxKless)
- Nicholas Cunningham
[@​ndcunningham](https://togithub.com/ndcunningham)
### [`v19.0.3`](https://togithub.com/nrwl/nx/releases/tag/19.0.3)
[Compare Source](https://togithub.com/nrwl/nx/compare/19.0.2...19.0.3)
##### 19.0.3 (2024-05-13)
##### 🚀 Features
- **nx-dev:** show banner on documentation pages
([#​23266](https://togithub.com/nrwl/nx/pull/23266))
- **nx-dev:** check for missing images
([#​23248](https://togithub.com/nrwl/nx/pull/23248))
- **nx-dev:** put banner above menu
([#​23335](https://togithub.com/nrwl/nx/pull/23335))
- **react:** Add SvgOptions for NxReactWebpackPlugin and WithNx
([#​23283](https://togithub.com/nrwl/nx/pull/23283))
##### 🩹 Fixes
- **core:** include more binary extensions
([#​22788](https://togithub.com/nrwl/nx/pull/22788),
[#​22861](https://togithub.com/nrwl/nx/pull/22861))
- **core:** workspace remove generator should handle no root jest config
([#​23328](https://togithub.com/nrwl/nx/pull/23328))
- **core:** addPlugin should not conflict on project.json targets
([#​23264](https://togithub.com/nrwl/nx/pull/23264))
- **core:** throw a specific error for print-affected and affected graph
([#​23336](https://togithub.com/nrwl/nx/pull/23336))
- **js:** Adds mjs files to prettierrcNameOptions
([#​21796](https://togithub.com/nrwl/nx/pull/21796))
- **linter:** ensure all spreads are removed from rules before parsing
([#​23292](https://togithub.com/nrwl/nx/pull/23292))
- **linter:** log transpilation errors of workspace rules
([#​21503](https://togithub.com/nrwl/nx/pull/21503))
- **linter:** rename languageSettings to languageOptions for flat config
migration ([#​22924](https://togithub.com/nrwl/nx/pull/22924))
- **linter:** fix migrating projects with the eslint plugin
([#​23147](https://togithub.com/nrwl/nx/pull/23147))
- **misc:** move e2e-ci to a separate parallel 1 command
([#​23305](https://togithub.com/nrwl/nx/pull/23305))
- **module-federation:** Throw an error if remote is invalid
([#​23100](https://togithub.com/nrwl/nx/pull/23100))
- **nx-cloud:** ensure generated ci workflows use dlx for nx-cloud
([#​23333](https://togithub.com/nrwl/nx/pull/23333))
- **nx-dev:** move table of contents down
([#​23350](https://togithub.com/nrwl/nx/pull/23350))
- **storybook:** should handle inferred cypress when generating cypress
project [#​21770](https://togithub.com/nrwl/nx/issues/21770)
([#​23327](https://togithub.com/nrwl/nx/pull/23327),
[#​21770](https://togithub.com/nrwl/nx/issues/21770))
- **testing:** resolve absolute paths for ts path mappings in jest
resolver ([#​23346](https://togithub.com/nrwl/nx/pull/23346))
- **vite:** support passing --watch to inferred vitest commands
([#​23298](https://togithub.com/nrwl/nx/pull/23298))
- **vite:** generate vitest cache dir scoped to each project root and
normalize vite cache dir
([#​23330](https://togithub.com/nrwl/nx/pull/23330))
##### ❤️ Thank You
- Colum Ferry [@​Coly010](https://togithub.com/Coly010)
- Denis Bendrikov
- Dmitry Zakharov [@​pumano](https://togithub.com/pumano)
- Isaac Mann [@​isaacplmann](https://togithub.com/isaacplmann)
- James Henry [@​JamesHenry](https://togithub.com/JamesHenry)
- Jason Jean [@​FrozenPandaz](https://togithub.com/FrozenPandaz)
- Leosvel Pérez Espinosa
[@​leosvelperez](https://togithub.com/leosvelperez)
- Mehrad Rafigh
[@​mehrad-rafigh](https://togithub.com/mehrad-rafigh)
- Nicholas Cunningham
[@​ndcunningham](https://togithub.com/ndcunningham)
- Patrick P [@​ppfenning92](https://togithub.com/ppfenning92)
### [`v19.0.2`](https://togithub.com/nrwl/nx/releases/tag/19.0.2)
[Compare Source](https://togithub.com/nrwl/nx/compare/19.0.1...19.0.2)
##### 19.0.2 (2024-05-09)
##### 🩹 Fixes
- **bundling:** rollup does not log build errors
([#​23141](https://togithub.com/nrwl/nx/pull/23141))
- **bundling:** resolve index files from ts paths when running esbuild
without bundling
([#​23098](https://togithub.com/nrwl/nx/pull/23098))
- **core:** set yarn berry nodeLinker correctly in migrate command
([#​23249](https://togithub.com/nrwl/nx/pull/23249))
- **core:** show project --web shouldn't error
([#​23251](https://togithub.com/nrwl/nx/pull/23251))
- **core:** update getLastValueFromAsyncIterableIterator to support
AsyncIterables returned from executors
([#​23229](https://togithub.com/nrwl/nx/pull/23229))
- **gradle:** run gradle init if no settings.gradle
([#​23226](https://togithub.com/nrwl/nx/pull/23226))
- **linter:** ensure config.rules is spread into rules in flat config
migration ([#​23263](https://togithub.com/nrwl/nx/pull/23263))
- **misc:** create workspaces and default app with the name as provided
([#​23196](https://togithub.com/nrwl/nx/pull/23196))
- ⚠️ **misc:** adjust deprecation messages to v20
([#​23223](https://togithub.com/nrwl/nx/pull/23223))
- **nx-dev:** fix home page mobile menu
([#​23250](https://togithub.com/nrwl/nx/pull/23250))
- **release:** ensure changelog renderers are resolvable when processing
config ([#​23214](https://togithub.com/nrwl/nx/pull/23214))
- **vite:** don't generate tasks for remix projects
([#​22551](https://togithub.com/nrwl/nx/pull/22551))
- **vite:** get tsconfig from new path including target
([#​22775](https://togithub.com/nrwl/nx/pull/22775))
- **webpack:** fix default compiler option
([#​22762](https://togithub.com/nrwl/nx/pull/22762))
- **webpack:** don't overwrite output config
([#​22116](https://togithub.com/nrwl/nx/pull/22116))
- **webpack:** publicPath and rebaseRootRelative
([#​20992](https://togithub.com/nrwl/nx/pull/20992))
##### ⚠️ Breaking Changes
- **misc:** `nx print-affected` was deprecated in 16.4.0 and has been
removed
- **misc:** `nx affected:graph` was deprecated in 16.4.0 and has been
removed
- **misc:** `criticalPath` and `affectedProjects` properties created for
`nx graph --file graph.json` was deprecated in 16.2.0 and has been
removed
##### ❤️ Thank You
- andriizavoiko
[@​andriizavoiko](https://togithub.com/andriizavoiko)
- Craigory Coppola [@​AgentEnder](https://togithub.com/AgentEnder)
- Edward Wang [@​wzc0415](https://togithub.com/wzc0415)
- Emily Xiong [@​xiongemi](https://togithub.com/xiongemi)
- Isaac Mann [@​isaacplmann](https://togithub.com/isaacplmann)
- Jack Hsu [@​jaysoo](https://togithub.com/jaysoo)
- James Henry [@​JamesHenry](https://togithub.com/JamesHenry)
- Jason Jean [@​FrozenPandaz](https://togithub.com/FrozenPandaz)
- Krystian Sowiński
[@​plumcoding](https://togithub.com/plumcoding)
- Leosvel Pérez Espinosa
[@​leosvelperez](https://togithub.com/leosvelperez)
- Mateo Tibaquirá
- Matthias Stemmler [@​ms-tng](https://togithub.com/ms-tng)
- Mike Peters
- Sean Sanker
### [`v19.0.1`](https://togithub.com/nrwl/nx/releases/tag/19.0.1)
[Compare Source](https://togithub.com/nrwl/nx/compare/19.0.0...19.0.1)
#### 19.0.1 (2024-05-07)
##### 🚀 Features
- **core:** add an option to seperate the output of show with provide…
([#​23172](https://togithub.com/nrwl/nx/pull/23172))
- **misc:** improve nx cloud setup prompts and messaging
([#​23218](https://togithub.com/nrwl/nx/pull/23218))
##### 🩹 Fixes
- **gradle:** use local gradlew instead of sdkman
([#​23205](https://togithub.com/nrwl/nx/pull/23205))
- **module-federation:** nested projects should be ordered first when
reading from tsconfig paths
[#​20284](https://togithub.com/nrwl/nx/issues/20284)
([#​23212](https://togithub.com/nrwl/nx/pull/23212),
[#​20284](https://togithub.com/nrwl/nx/issues/20284))
##### ❤️ Thank You
- Colum Ferry [@​Coly010](https://togithub.com/Coly010)
- Daniel Santiago
- Emily Xiong [@​xiongemi](https://togithub.com/xiongemi)
- Leosvel Pérez Espinosa
[@​leosvelperez](https://togithub.com/leosvelperez)
###
[`v19.0.0`](https://togithub.com/nrwl/nx/compare/18.3.4...41d21ab9ac7fa3682ba535979278bb3c4a349654)
[Compare Source](https://togithub.com/nrwl/nx/compare/18.3.5...19.0.0)
### [`v18.3.5`](https://togithub.com/nrwl/nx/releases/tag/18.3.5)
[Compare Source](https://togithub.com/nrwl/nx/compare/18.3.4...18.3.5)
##### 18.3.5 (2024-05-15)
##### 🩹 Fixes
- **core:** fix affected detection for inputs after named inputs
([#​23354](https://togithub.com/nrwl/nx/pull/23354))
##### ❤️ Thank You
- Jason Jean [@​FrozenPandaz](https://togithub.com/FrozenPandaz)
### [`v18.3.4`](https://togithub.com/nrwl/nx/releases/tag/18.3.4)
[Compare Source](https://togithub.com/nrwl/nx/compare/18.3.3...18.3.4)
##### 18.3.4 (2024-04-25)
##### 🚀 Features
- **core:** add root level forwardAllArgs
([#​22753](https://togithub.com/nrwl/nx/pull/22753))
##### 🩹 Fixes
- **core:** different commands should not be considered compatible
targets ([#​22863](https://togithub.com/nrwl/nx/pull/22863))
- **core:** fix pnpm install order on ci workflows
([#​22580](https://togithub.com/nrwl/nx/pull/22580))
- **core:** workspace context glob respects exclude
([#​22939](https://togithub.com/nrwl/nx/pull/22939))
- **core:** handle events that do not have paths
([#​22947](https://togithub.com/nrwl/nx/pull/22947))
- **core:** fix exclude for empty array
([#​22951](https://togithub.com/nrwl/nx/pull/22951))
- **core:** move a few api points to return root maps directly
([#​22949](https://togithub.com/nrwl/nx/pull/22949))
- **core:** regression register ts transpiler for local plugin
([#​22964](https://togithub.com/nrwl/nx/pull/22964))
- **core:** handle created directories when watching on linux
([#​22980](https://togithub.com/nrwl/nx/pull/22980))
- **core:** ensure create nodes functions are properly parallelized
([#​23005](https://togithub.com/nrwl/nx/pull/23005))
- **gradle:** change gradle command to be relative path
([#​22963](https://togithub.com/nrwl/nx/pull/22963))
- **gradle:** should skip println in project report
([#​22862](https://togithub.com/nrwl/nx/pull/22862))
- **gradle:** get gradlew path with projectRoot joins workspaceRoot
([#​22988](https://togithub.com/nrwl/nx/pull/22988))
- **graph:** don't listen to system theme changes in console
([#​22938](https://togithub.com/nrwl/nx/pull/22938))
- **linter:** do not infer lint tasks for projects without files to lint
([#​22944](https://togithub.com/nrwl/nx/pull/22944))
- **misc:** fix publish script
([#​22981](https://togithub.com/nrwl/nx/pull/22981))
- **misc:** perf logging shouldn't be enabled twice
([#​23012](https://togithub.com/nrwl/nx/pull/23012))
- **node:** e2e target fails out of the box
([#​22987](https://togithub.com/nrwl/nx/pull/22987))
- **repo:** downgrade to macos-13 in publish workflow
([#​22961](https://togithub.com/nrwl/nx/pull/22961))
- **storybook:** handle inherited config correctly when identifying the
framework used for inferred tasks
([#​22953](https://togithub.com/nrwl/nx/pull/22953))
##### ❤️ Thank You
- Colum Ferry [@​Coly010](https://togithub.com/Coly010)
- Craigory Coppola [@​AgentEnder](https://togithub.com/AgentEnder)
- Emily Xiong [@​xiongemi](https://togithub.com/xiongemi)
- Jack Hsu [@​jaysoo](https://togithub.com/jaysoo)
- Jason Jean [@​FrozenPandaz](https://togithub.com/FrozenPandaz)
- Jonathan Cammisuli
- Leosvel Pérez Espinosa
[@​leosvelperez](https://togithub.com/leosvelperez)
- MaxKless [@​MaxKless](https://togithub.com/MaxKless)
- Miroslav Jonaš [@​meeroslav](https://togithub.com/meeroslav)
- Nicholas Cunningham
[@​ndcunningham](https://togithub.com/ndcunningham)
- Richard Roozenboom
[@​Roozenboom](https://togithub.com/Roozenboom)
### [`v18.3.3`](https://togithub.com/nrwl/nx/releases/tag/18.3.3)
[Compare Source](https://togithub.com/nrwl/nx/compare/18.3.2...18.3.3)
#### 18.3.3 (2024-04-20)
##### 🩹 Fixes
- **angular:** fix loading postcss configuration in ng-packagr executors
([#​22900](https://togithub.com/nrwl/nx/pull/22900))
- **core:** group command exit listeners to avoid warning
([#​22892](https://togithub.com/nrwl/nx/pull/22892))
- **core:** handle plugin errors from isolation correctly
([#​22890](https://togithub.com/nrwl/nx/pull/22890))
- **core:** disable pty on windows until stable
([#​22910](https://togithub.com/nrwl/nx/pull/22910))
- **core:** fix cursor being hidden and process shutdown for ctrl c
([#​22895](https://togithub.com/nrwl/nx/pull/22895))
- **misc:** add --verbose support to nx graph
([#​22889](https://togithub.com/nrwl/nx/pull/22889))
- **misc:** mark migration for escaping env vars as skipped in nx repair
([#​22916](https://togithub.com/nrwl/nx/pull/22916))
- **misc:** don't clear node_modules require cache
([#​22907](https://togithub.com/nrwl/nx/pull/22907))
- **testing:** bust require cache in jest plugin so configs reload
([#​22893](https://togithub.com/nrwl/nx/pull/22893))
- **vue:** do not add verbatimImportSyntax to tsconfig
([#​22905](https://togithub.com/nrwl/nx/pull/22905))
##### ❤️ Thank You
- Colum Ferry [@​Coly010](https://togithub.com/Coly010)
- Craigory Coppola [@​AgentEnder](https://togithub.com/AgentEnder)
- Jason Jean [@​FrozenPandaz](https://togithub.com/FrozenPandaz)
- Leosvel Pérez Espinosa
[@​leosvelperez](https://togithub.com/leosvelperez)
### [`v18.3.2`](https://togithub.com/nrwl/nx/releases/tag/18.3.2)
[Compare Source](https://togithub.com/nrwl/nx/compare/18.3.1...18.3.2)
##### 18.3.2 (2024-04-18)
##### 🚀 Features
- **core:** load native files from tmp location instead of node_modules
([#​22648](https://togithub.com/nrwl/nx/pull/22648))
##### 🩹 Fixes
- **bundling:** handle circular dependencies in
[@​nx/esbuild](https://togithub.com/nx/esbuild)
getExtraDependencies
([#​22644](https://togithub.com/nrwl/nx/pull/22644))
- **core:** load config util supports absolute paths on windows
([#​22837](https://togithub.com/nrwl/nx/pull/22837))
- **core:** keep plugin workers until main process shutdown
([#​22860](https://togithub.com/nrwl/nx/pull/22860))
- **core:** handle schema validation errors running commands directly
([#​22864](https://togithub.com/nrwl/nx/pull/22864))
- **core:** forward args provided to the nx add command to the invoked
init generator
([#​22855](https://togithub.com/nrwl/nx/pull/22855))
- **core:** fix hashing of external dependencies
([#​22865](https://togithub.com/nrwl/nx/pull/22865))
- **nx-cloud:** ensure root .env files are loaded during dte
([#​22859](https://togithub.com/nrwl/nx/pull/22859))
- **testing:** fix jest ci target names
([#​22858](https://togithub.com/nrwl/nx/pull/22858))
##### ❤️ Thank You
- Colum Ferry [@​Coly010](https://togithub.com/Coly010)
- Craigory Coppola [@​AgentEnder](https://togithub.com/AgentEnder)
- Jason Jean [@​FrozenPandaz](https://togithub.com/FrozenPandaz)
- Kyle Cannon [@​kylecannon](https://togithub.com/kylecannon)
- Leosvel Pérez Espinosa
[@​leosvelperez](https://togithub.com/leosvelperez)
- MaxKless [@​MaxKless](https://togithub.com/MaxKless)
### [`v18.3.1`](https://togithub.com/nrwl/nx/releases/tag/18.3.1)
[Compare Source](https://togithub.com/nrwl/nx/compare/18.3.0...18.3.1)
##### 18.3.1 (2024-04-17)
##### 🩹 Fixes
- **core:** repair sourcemap creation in createNodes
([#​22851](https://togithub.com/nrwl/nx/pull/22851))
##### ❤️ Thank You
- MaxKless [@​MaxKless](https://togithub.com/MaxKless)
### [`v18.3.0`](https://togithub.com/nrwl/nx/releases/tag/18.3.0)
[Compare Source](https://togithub.com/nrwl/nx/compare/18.2.4...18.3.0)
##### 18.3.0 (2024-04-16)
##### 🚀 Features
- **core:** add metadata to targets
([#​22655](https://togithub.com/nrwl/nx/pull/22655))
- **core:** list crystal plugins with nx report
([#​22649](https://togithub.com/nrwl/nx/pull/22649))
- **core:** re-enable running plugins in isolation
([#​22527](https://togithub.com/nrwl/nx/pull/22527))
- **core:** load root .env files on daemon
([#​22786](https://togithub.com/nrwl/nx/pull/22786))
- **js:** add swc cli options --strip-leading-paths
([#​22193](https://togithub.com/nrwl/nx/pull/22193))
- **js:** add swc cli options --strip-leading-paths "
([#​22193](https://togithub.com/nrwl/nx/pull/22193),
[#​22832](https://togithub.com/nrwl/nx/pull/22832))
- **misc:** non conflicting init/add flow
([#​22791](https://togithub.com/nrwl/nx/pull/22791))
- **nuxt:** update
[@​nuxt/eslint-config](https://togithub.com/nuxt/eslint-config) to
a stable version
([#​22804](https://togithub.com/nrwl/nx/pull/22804))
- **nx-dev:** link Nx Launch Conf videos
([#​22690](https://togithub.com/nrwl/nx/pull/22690))
- **nx-dev:** remember selected tabs
([#​22699](https://togithub.com/nrwl/nx/pull/22699))
- **nx-dev:** add contact pages
([#​22815](https://togithub.com/nrwl/nx/pull/22815))
- **nx-dev:** banner for webinar
([#​22824](https://togithub.com/nrwl/nx/pull/22824))
- **testing:** add ability to split jest tests
([#​22662](https://togithub.com/nrwl/nx/pull/22662))
- **testing:** add metadata to playwright targets
([#​22768](https://togithub.com/nrwl/nx/pull/22768))
- **vite:** migrate to latest vite-plugin-dts
([#​22614](https://togithub.com/nrwl/nx/pull/22614))
##### 🩹 Fixes
- **angular:** prevent false positive validation due to option default
value in dev-server executor
([#​22606](https://togithub.com/nrwl/nx/pull/22606))
- **angular:** respect skipPackageJson correctly in library generator
([#​22608](https://togithub.com/nrwl/nx/pull/22608))
- **angular:** fix @​nx/angular/src/utils entry point
([#​22609](https://togithub.com/nrwl/nx/pull/22609))
- **angular:** fix dynamic module federation generation
([#​22724](https://togithub.com/nrwl/nx/pull/22724))
- **angular:** respect skipPackageJson correctly across generators
([#​22777](https://togithub.com/nrwl/nx/pull/22777))
- **angular:** execute wrapped schematics post tasks and log messages
([#​22780](https://togithub.com/nrwl/nx/pull/22780))
- **bundling:** support exported array of options for rollup
([#​22703](https://togithub.com/nrwl/nx/pull/22703))
- **bundling:** print errors from rollup build
([#​22707](https://togithub.com/nrwl/nx/pull/22707))
- **bundling:** show codeframes for Rollup build errors
([#​22845](https://togithub.com/nrwl/nx/pull/22845))
- **core:** do not assume workspace inputs cause all projects to be af…
([#​22573](https://togithub.com/nrwl/nx/pull/22573))
- **core:** write terminal output to cache folder
([#​22673](https://togithub.com/nrwl/nx/pull/22673))
- **core:** errors from create dependencies should show properly
([#​22695](https://togithub.com/nrwl/nx/pull/22695))
- **core:** not passing props of run-commands to underlying command
([#​22595](https://togithub.com/nrwl/nx/pull/22595))
- **core:** update pty version to add windows specific flags
([#​22711](https://togithub.com/nrwl/nx/pull/22711))
- **core:** detect imports from template literals in dynamic imports
([#​22749](https://togithub.com/nrwl/nx/pull/22749))
- **core:** attach cli args from target options explicitly with '='
([#​22756](https://togithub.com/nrwl/nx/pull/22756))
- **core:** fix plugin exclude option
([#​22738](https://togithub.com/nrwl/nx/pull/22738))
- **core:** improve `isCI` to better detect other providers
([#​22694](https://togithub.com/nrwl/nx/pull/22694))
- **core:** errors thrown when creating projects should prevent running
targets ([#​22807](https://togithub.com/nrwl/nx/pull/22807))
- **core:** use name instead of .prototype.name when comparing errors
([#​22840](https://togithub.com/nrwl/nx/pull/22840))
- **core:** fix init logging and package.json updates
([#​22843](https://togithub.com/nrwl/nx/pull/22843))
- **devkit:** update peer dependency on nx to include Nx 19
([#​22811](https://togithub.com/nrwl/nx/pull/22811))
- **js:** update jest snapshot after vite-plugin-dts bump
([#​22621](https://togithub.com/nrwl/nx/pull/22621))
- **js:** append target when generating tmp tsconfig to prevent
conflicts [#​21396](https://togithub.com/nrwl/nx/issues/21396)
([#​22671](https://togithub.com/nrwl/nx/pull/22671),
[#​21396](https://togithub.com/nrwl/nx/issues/21396))
- **js:** propagate error from child process to
[@​nx/js](https://togithub.com/nx/js):node executor
([#​22705](https://togithub.com/nrwl/nx/pull/22705))
- **js:** do not default to commonjs type field in package.json
([#​22819](https://togithub.com/nrwl/nx/pull/22819))
- **misc:** fix optional branch tracking on ci pipeline
([#​22652](https://togithub.com/nrwl/nx/pull/22652))
- **module-federation:** serve dynamic remotes statically in their own
processes ([#​22688](https://togithub.com/nrwl/nx/pull/22688))
- **nextjs:** Adding tailwind should work when creating an app OOTB
([#​22709](https://togithub.com/nrwl/nx/pull/22709))
- **nuxt:** use loadConfigFile from devkit rather than
[@​nuxt/kit](https://togithub.com/nuxt/kit)
([#​22571](https://togithub.com/nrwl/nx/pull/22571))
- **nx-dev:** Update urls that are 404
([#​22653](https://togithub.com/nrwl/nx/pull/22653))
- **react-native:** storybook relative paths
([#​22031](https://togithub.com/nrwl/nx/pull/22031))
- **react-native:** should ask for app name when preset is react native
([#​22761](https://togithub.com/nrwl/nx/pull/22761))
- **react-native:** fix unable to resolve on windows
([#​22759](https://togithub.com/nrwl/nx/pull/22759))
- **release:** respect root .npmrc registry settings for publishing
([12afa20210](https://togithub.com/nrwl/nx/commit/12afa20210))
- **release:** do not try to interpolate packageRoot for root project
([#​22771](https://togithub.com/nrwl/nx/pull/22771))
- **testing:** fix playwright executor uiPort option schema
([#​22610](https://togithub.com/nrwl/nx/pull/22610))
- **testing:** app generators should create correct e2e config at
generation time
([#​22565](https://togithub.com/nrwl/nx/pull/22565))
- **vite:** ensure cache is created correctly for separate vite and
vitest config files
[#​22244](https://togithub.com/nrwl/nx/issues/22244)
([#​22618](https://togithub.com/nrwl/nx/pull/22618),
[#​22244](https://togithub.com/nrwl/nx/issues/22244))
- **vite:** pass cli arguments as options to vitest
([#​22355](https://togithub.com/nrwl/nx/pull/22355))
- **webpack:** bring back previous SVG and SVGR behavior for React
projects ([#​22628](https://togithub.com/nrwl/nx/pull/22628))
- **webpack:** support standard webpack config with
[@​nx/webpack](https://togithub.com/nx/webpack):dev-server
([#​22660](https://togithub.com/nrwl/nx/pull/22660))
- **webpack:** remove url-loader from dependencies since it is replaced
by asset modules
([#​22698](https://togithub.com/nrwl/nx/pull/22698))
- **webpack:** typo for outputPath
([#​22734](https://togithub.com/nrwl/nx/pull/22734))
- **webpack:** Should work when absolute paths are supplied as output
([#​22736](https://togithub.com/nrwl/nx/pull/22736))
##### ❤️ Thank You
- Altan Stalker
- arekkubaczkowski
[@​arekkubaczkowski](https://togithub.com/arekkubaczkowski)
- Austin Fahsl [@​fahslaj](https://togithub.com/fahslaj)
- Benjamin Cabanes [@​bcabanes](https://togithub.com/bcabanes)
- Colum Ferry [@​Coly010](https://togithub.com/Coly010)
- Craigory Coppola [@​AgentEnder](https://togithub.com/AgentEnder)
- Emily Xiong [@​xiongemi](https://togithub.com/xiongemi)
- Every [@​hongxuWei](https://togithub.com/hongxuWei)
- Isaac Mann [@​isaacplmann](https://togithub.com/isaacplmann)
- Jack Hsu [@​jaysoo](https://togithub.com/jaysoo)
- Jason Jean [@​FrozenPandaz](https://togithub.com/FrozenPandaz)
- Juri Strumpflohner [@​juristr](https://togithub.com/juristr)
- Leosvel Pérez Espinosa
[@​leosvelperez](https://togithub.com/leosvelperez)
- Lucca Miranda [@​luckened](https://togithub.com/luckened)
- MaxKless [@​MaxKless](https://togithub.com/MaxKless)
- Miroslav Jonaš [@​meeroslav](https://togithub.com/meeroslav)
- Nicholas Cunningham
[@​ndcunningham](https://togithub.com/ndcunningham)
- Thomas Dekiere
- Younes Jaaidi
</details>
<details>
<summary>google/zx (zx)</summary>
### [`v8.1.0`](https://togithub.com/google/zx/releases/tag/8.1.0)
[Compare Source](https://togithub.com/google/zx/compare/8.0.2...8.1.0)
This new release is a big deal. It brings significant improvements in
reliability and compatibility.
- Switched to
[hybrid-scheme](https://2ality.com/2019/10/hybrid-npm-packages.html)
package: both ESM and CJS entry points are provided.
- Extended Node.js supported versions range: from [12.17.0 to the latest
22.x.x](https://togithub.com/google/zx/blob/main/.github/workflows/test.yml#L101).
-
[Added](https://togithub.com/google/zx/blob/main/.github/workflows/test.yml#L84)
compatibility with Deno 1.x.
- zx libdefs are now compatible with [TS
4.0+](https://togithub.com/google/zx/pull/801).
#### New features
Added `usePwsh()` helper to switch to PowerShell v7+
[#​790](https://togithub.com/google/zx/pull/790)
```js
import {usePwsh, useBash} from 'zx'
usePwsh()
$.shell // 'pwsh'
useBash()
$.shell // 'bash'
```
`timeout` is now configurable `$` opts
[#​796](https://togithub.com/google/zx/pull/796)
```js
import {$} from 'zx'
await $({ timeout: 100 })`sleep 999`
$.timeout = 1000 // Sets default timeout for all commands
$.timeoutSignal = 'SIGKILL' // Sets signal to send on timeout
await $`sleep 999`
```
Added `--cwd` option for CLI
[#​804](https://togithub.com/google/zx/pull/804)
```bash
zx --cwd=/some/path script.js
```
Introduced `tmpdir` and `tmpfile` helpers
[#​803](https://togithub.com/google/zx/pull/803)
```js
import {tmpdir, tmpfile} from 'zx'
t1 = tmpdir() // /os/based/tmp/zx-1ra1iofojgg/
t2 = tmpdir('foo') // /os/based/tmp/zx-1ra1iofojgg/foo/
f1 = tmpfile() // /os/based/tmp/zx-1ra1iofojgg
f2 = tmpfile('f.txt') // /os/based/tmp/zx-1ra1iofojgg/foo.txt
f3 = tmpfile('f.txt', 'string or buffer')
```
- Support CRLF for markdown script
[#​788](https://togithub.com/google/zx/pull/788)
- Added help digest for
[man](https://docs.npmjs.com/cli/v10/configuring-npm/package-json#man)
[#​806](https://togithub.com/google/zx/pull/806)
- Added compatibility with Deno 1.x. → zx seems to be working with Deno
1.x.
### [`v8.0.2`](https://togithub.com/google/zx/releases/tag/8.0.2)
[Compare Source](https://togithub.com/google/zx/compare/8.0.1...8.0.2)
**In this release:**
- Added configurable `detached` option
([#​782](https://togithub.com/google/zx/issues/782))
- Fixed pkg typings entries for tsd tests
([#​780](https://togithub.com/google/zx/issues/780))
### [`v8.0.1`](https://togithub.com/google/zx/releases/tag/8.0.1)
[Compare Source](https://togithub.com/google/zx/compare/8.0.0...8.0.1)
**In this release**:
- Added feature: add `stdio` option
([#​772](https://togithub.com/google/zx/issues/772))
- Added feature: support `signal` opt
([#​769](https://togithub.com/google/zx/issues/769))
- Fixed: additional `process.kill` fallback for bun
([#​770](https://togithub.com/google/zx/issues/770))
### [`v8.0.0`](https://togithub.com/google/zx/releases/tag/8.0.0)
[Compare Source](https://togithub.com/google/zx/compare/7.2.3...8.0.0)
We are thrilled to announce the release of `zx` v8.0.0! 🎉
With this release, we have introduced a lot of new features,
improvements, and bug fixes.
We have also made some breaking changes, so please read the following
release notes carefully.
##### 🚀 New Shiny Features
Squashed deps: we use [esbuild](https://togithub.com/evanw/esbuild) with
custom plugins to forge js bundles and
[dts-bundle-generator](https://togithub.com/timocov/dts-bundle-generator)
for typings <sup>
[2acb0f](https://togithub.com/google/zx/commit/2acb0f2c786bcfe4f0ed1ac0dfc4c818d96d6c30),
[#​722](https://togithub.com/google/zx/pull/722) </sup>
More safety, more stability and significantly reduced installation time.
Zx now is **~20x** smaller.
```bash
npx [email protected]
npm install [email protected]
```
Options presets are here. To implement this, we have also completely
refactored the `zx` core, and now it's available as a separate package –
[zurk](https://togithub.com/webpod/zurk)\ <sup>
[aeec7a](https://togithub.com/google/zx/commit/aeec7ae84b814d7134f88b3455e144b39429d8b6),
[#​733](https://togithub.com/google/zx/pull/733),
[#​600](https://togithub.com/google/zx/pull/600)</sup>
```ts
const $$ = $({quiet: true})
await $$`echo foo`
$({nothrow: true})`exit 1`
```
We have introduced `$.sync()` API\ <sup>
[1f8c8b](https://togithub.com/google/zx/commit/1f8c8b85d301607faedf0ba820a742a53c6e41b2),
[#​738](https://togithub.com/google/zx/pull/738),
[#​681](https://togithub.com/google/zx/pull/681),
[1d8aa9](https://togithub.com/google/zx/commit/1d8aa9356968d8e7f523f3cddac10e8b457c0ecc),
[#​739](https://togithub.com/google/zx/pull/739) </sup>
```ts
import {$} from 'zx'
const { output } = $.sync`echo foo` // foo
```
You can also override the internal API to implement pools, test mocking,
etc.
```ts
$.spawnSync = () => {} // defaults to `child_process.spawnSync`
```
The `input` option is now available to pass data to the command.\ <sup>
[b38972](https://togithub.com/google/zx/commit/b38972e8001782f88a04feabeb89271523654e3f),
[#​736](https://togithub.com/google/zx/pull/736) </sup>
```ts
const p1 = $({ input: 'foo' })`cat`
const p2 = $({ input: Readable.from('bar') })`cat`
const p3 = $({ input: Buffer.from('baz') })`cat`
const p4 = $({ input: p3 })`cat`
const p5 = $({ input: await p3 })`cat`
```
`AbortController` has been introduced to abort the command execution.
It's available via the `ac` option.\ <sup>
[fa4a7b](https://togithub.com/google/zx/commit/fa4a7b404b34986b51ad9a941c1a17ac473d0d7d),
[#​734](https://togithub.com/google/zx/pull/734),
[#​527](https://togithub.com/google/zx/pull/527) </sup>
```ts
const ac = new AbortController()
const p = $({ ac })`sleep 9999`
setTimeout(() => ac.abort(), 100)
```
If not specified, the default instance will be used. Abortion trigger is
also available via `PromiseResponse`:
```ts
const p = $`sleep 9999`
setTimeout(() => p.abort(), 100)
```
`kill` method is exposed now. To terminate any (not only zx starter)
process:
```ts
import { kill } from 'zx'
await kill(123)
await kill(123, 'SIGKILL')
```
Btw, we have replaced `ps-tree` with
[@​webpod/ps](https://togithub.com/webpod/ps) &
[@​webpod/ingrid](https://togithub.com/webpod/ingrid), and exposed
`ps` util:
```ts
import {ps} from 'zx'
const children = await ps.tree(123)
/**
[
{pid: 124, ppid: 123},
{pid: 125, ppid: 123}
]
*/
const children2 = await ps.tree({pid: 123, recursive: true})
/**
[
{pid: 124, ppid: 123},
{pid: 125, ppid: 123},
{pid: 126, ppid: 124},
{pid: 127, ppid: 124},
{pid: 128, ppid: 124},
{pid: 129, ppid: 125},
{pid: 130, ppid: 125},
]
*/
```
Introduced `$.postfix` option. It's like a `$.prefix`, but for the end
of the command. <sup>
[fb9554](https://togithub.com/google/zx/commit/fb9554f322d5b1fa013ee27fe21ab92558a7ed4b),
[#​756](https://togithub.com/google/zx/pull/756),
[#​536](https://togithub.com/google/zx/pull/#​536) </sup>
```ts
import {$} from 'zx'
$.postfix = '; exit $LastExitCode' // for PowerShell compatibility
```
`minimist` API exposed\ <sup>
[#​661](https://togithub.com/google/zx/pull/661) </sup>
```ts
import { minimist } from 'zx'
const argv = minimist(process.argv.slice(2), {})
```
Fixed npm package name pattern on `--install` mode <sup>
[956dcc](https://togithub.com/google/zx/commit/956dcc3bbdd349ac4c41f8db51add4efa2f58456),
[#​659](https://togithub.com/google/zx/pull/659),
[#​660](https://togithub.com/google/zx/pull/660),
[#​663](https://togithub.com/google/zx/pull/663) </sup>
```ts
import '@​qux/pkg' // valid
import '@​qux/pkg/entry' // was invalid before and valid now
```
##### ⚠️ Breaking changes
> We've tried our best to avoid them, but it was necessary.
1. `$.verbose` is set to `false` by default, but errors are still
printed to `stderr`. Set `$.quiet = true` to suppress all output.\ <sup>
[cafb90](https://togithub.com/google/zx/commit/cafb90dafe30a12dda9ff6b9b9e0ff9550e1272b),
[#​745](https://togithub.com/google/zx/pull/745),
[#​569](https://togithub.com/google/zx/pull/569) </sup>
```ts
$.verbose = true // everything works like in v7
$.quiet = true // to completely turn off logging
```
2. `ssh` API was dropped. Install
[webpod](https://togithub.com/webpod/webpod) package instead.\ <sup>
[8925a1](https://togithub.com/google/zx/commit/8925a127e4bcf7e9a2e0cf5e443076f4473eedd0),
[#​750](https://togithub.com/google/zx/pull/750) </sup>
```ts
// import {ssh} from 'zx' ↓
import {ssh} from 'webpod'
const remote = ssh('user@host')
await remote`echo foo`
```
3. zx is not looking for `powershell` anymore, on Windows by default. If
you still need it, use the `usePowerShell` helper:\ <sup>
[24dcf3](https://togithub.com/google/zx/commit/24dcf3a2953777b70cc54effe2989621a9133886),
[#​757](https://togithub.com/google/zx/pull/757) </sup>
```ts
import { usePowerShell, useBash } from 'zx'
usePowerShell() // to enable powershell
useBash() // switch to bash, the default
```
4. Process cwd synchronization between `$` invocations is disabled by
default. This functionality is provided via an async hook and can now be
controlled directly.\ <sup>
[d79a63](https://togithub.com/google/zx/commit/d79a63888352eda47a30c018c9734fb9a3347746),
[#​765](https://togithub.com/google/zx/pull/765) </sup>
```ts
import { syncProcessCwd } from 'zx'
syncProcessCwd() // restores legacy v7 behavior
```
##### 🧰 Other Improvements
- added dev (snapshot publish) releases
[0c97b9](https://togithub.com/google/zx/commit/0c97b9f1752b8cf9fdd8178e5798b70f6440d8e4)
[#​723](https://togithub.com/google/zx/issues/723)
- tsconfig: dropped `lib DOM`
[fe0356](https://togithub.com/google/zx/commit/fe0356fd14ee8d448c74d9bba2412e70b7644ad2)
[#​735](https://togithub.com/google/zx/issues/735),
[#​619](https://togithub.com/google/zx/issues/619),
[#​722](https://togithub.com/google/zx/issues/722))
- implemented `ProcessPromise.valueOf()` to simplify value comparisons
[0640b8](https://togithub.com/google/zx/commit/0640b80c978ba7c5c1fcb57b42f774de79181721),
[#​737](https://togithub.com/google/zx/issues/737),
[#​690](https://togithub.com/google/zx/issues/690)
- enhanced `--install` API: use
[depkeek](https://togithub.com/antongolub/misc/tree/master/packages/dep/depseek)
for deps extraction
[1a03a6](https://togithub.com/google/zx/commit/1a03a62cd17565eb181527aa2dec5b9c1d308d81)
- removed `--experimental` toggle, all APIs are available by default
[8a7a8f](https://togithub.com/google/zx/commit/8a7a8feb829c71ad623195f2c8391c3203c7a58e),
[#​751](https://togithub.com/google/zx/issues/751)
- added minute support in duration
[b02fd5](https://togithub.com/google/zx/commit/b02fd5279e79af44b83eb0e20d53bb9ee57c988d),
[#​703](https://togithub.com/google/zx/issues/703),
[#​704](https://togithub.com/google/zx/issues/704)
- enhanced stack extraction to support bun
[2026d4](https://togithub.com/google/zx/commit/2026d4a4451f963064b0b340cd8ff91cf2a5d8fd),
[#​752](https://togithub.com/google/zx/issues/752)
- fixed `spinner` issue on weird TTY
[1124e3](https://togithub.com/google/zx/commit/1124e31c9cb9f2b087aa26e019f49caebcc2aa0e),
[#​755](https://togithub.com/google/zx/issues/755),
[#​607](https://togithub.com/google/zx/issues/607)
- migrated tests to native `node:test`
[cd1835](https://togithub.com/google/zx/commit/cd18352320de3873a1d1473c037632212557757a)
</details>
---
### Configuration
📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).
🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.
♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.
👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config help](https://togithub.com/renovatebot/renovate/discussions) if
that's undesired.
---
- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box
---
This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/redwoodjs/redwood).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zNjMuNSIsInVwZGF0ZWRJblZlciI6IjM3LjM2My41IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
---------
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Josh GM Walker <[email protected]>
|
diff --git a/package.json b/package.json
index 13863c423e94..e3e781686b1b 100644
--- a/package.json
+++ b/package.json
@@ -101,7 +101,7 @@
"ncp": "2.0.0",
"nodemon": "3.1.0",
"npm-packlist": "8.0.2",
- "nx": "18.2.4",
+ "nx": "19.0.4",
"octokit": "3.1.2",
"ora": "7.0.1",
"prompts": "2.4.2",
@@ -111,7 +111,7 @@
"typescript": "5.4.5",
"vitest": "1.4.0",
"yargs": "17.7.2",
- "zx": "7.2.3"
+ "zx": "8.1.0"
},
"packageManager": "[email protected]",
"npmClient": "yarn"
diff --git a/tasks/changesets/changesetsHelpers.mts b/tasks/changesets/changesetsHelpers.mts
index b664a5efdc79..c0ac7aef8f0c 100644
--- a/tasks/changesets/changesetsHelpers.mts
+++ b/tasks/changesets/changesetsHelpers.mts
@@ -3,8 +3,6 @@ import { fileURLToPath } from 'node:url'
import { humanId } from 'human-id'
import { $, argv, path, fs, ProcessPromise } from 'zx'
-$.verbose = false
-
const ROOT_DIR_PATH = fileURLToPath(new URL('../../', import.meta.url))
const DIRNAME = path.dirname(fileURLToPath(new URL(import.meta.url)))
const CHANGESETS_DIR = path.join(ROOT_DIR_PATH, '.changesets')
diff --git a/yarn.lock b/yarn.lock
index 03386008bf36..4385d6b117cd 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -5824,18 +5824,6 @@ __metadata:
languageName: node
linkType: hard
-"@nrwl/tao@npm:18.2.4":
- version: 18.2.4
- resolution: "@nrwl/tao@npm:18.2.4"
- dependencies:
- nx: "npm:18.2.4"
- tslib: "npm:^2.3.0"
- bin:
- tao: index.js
- checksum: 10c0/649f7e51f6c9a8247682359bf6a09a634b5646373be5769b555e26e778787c317a4b32dfbfa56cf34f4a9600c9d600cc41995a7d3cc7bc6d059ce8451ab00d5c
- languageName: node
- linkType: hard
-
"@nrwl/tao@npm:19.0.4":
version: 19.0.4
resolution: "@nrwl/tao@npm:19.0.4"
@@ -5867,13 +5855,6 @@ __metadata:
languageName: node
linkType: hard
-"@nx/nx-darwin-arm64@npm:18.2.4":
- version: 18.2.4
- resolution: "@nx/nx-darwin-arm64@npm:18.2.4"
- conditions: os=darwin & cpu=arm64
- languageName: node
- linkType: hard
-
"@nx/nx-darwin-arm64@npm:19.0.4":
version: 19.0.4
resolution: "@nx/nx-darwin-arm64@npm:19.0.4"
@@ -5881,13 +5862,6 @@ __metadata:
languageName: node
linkType: hard
-"@nx/nx-darwin-x64@npm:18.2.4":
- version: 18.2.4
- resolution: "@nx/nx-darwin-x64@npm:18.2.4"
- conditions: os=darwin & cpu=x64
- languageName: node
- linkType: hard
-
"@nx/nx-darwin-x64@npm:19.0.4":
version: 19.0.4
resolution: "@nx/nx-darwin-x64@npm:19.0.4"
@@ -5895,13 +5869,6 @@ __metadata:
languageName: node
linkType: hard
-"@nx/nx-freebsd-x64@npm:18.2.4":
- version: 18.2.4
- resolution: "@nx/nx-freebsd-x64@npm:18.2.4"
- conditions: os=freebsd & cpu=x64
- languageName: node
- linkType: hard
-
"@nx/nx-freebsd-x64@npm:19.0.4":
version: 19.0.4
resolution: "@nx/nx-freebsd-x64@npm:19.0.4"
@@ -5909,13 +5876,6 @@ __metadata:
languageName: node
linkType: hard
-"@nx/nx-linux-arm-gnueabihf@npm:18.2.4":
- version: 18.2.4
- resolution: "@nx/nx-linux-arm-gnueabihf@npm:18.2.4"
- conditions: os=linux & cpu=arm
- languageName: node
- linkType: hard
-
"@nx/nx-linux-arm-gnueabihf@npm:19.0.4":
version: 19.0.4
resolution: "@nx/nx-linux-arm-gnueabihf@npm:19.0.4"
@@ -5923,13 +5883,6 @@ __metadata:
languageName: node
linkType: hard
-"@nx/nx-linux-arm64-gnu@npm:18.2.4":
- version: 18.2.4
- resolution: "@nx/nx-linux-arm64-gnu@npm:18.2.4"
- conditions: os=linux & cpu=arm64 & libc=glibc
- languageName: node
- linkType: hard
-
"@nx/nx-linux-arm64-gnu@npm:19.0.4":
version: 19.0.4
resolution: "@nx/nx-linux-arm64-gnu@npm:19.0.4"
@@ -5937,13 +5890,6 @@ __metadata:
languageName: node
linkType: hard
-"@nx/nx-linux-arm64-musl@npm:18.2.4":
- version: 18.2.4
- resolution: "@nx/nx-linux-arm64-musl@npm:18.2.4"
- conditions: os=linux & cpu=arm64 & libc=musl
- languageName: node
- linkType: hard
-
"@nx/nx-linux-arm64-musl@npm:19.0.4":
version: 19.0.4
resolution: "@nx/nx-linux-arm64-musl@npm:19.0.4"
@@ -5951,13 +5897,6 @@ __metadata:
languageName: node
linkType: hard
-"@nx/nx-linux-x64-gnu@npm:18.2.4":
- version: 18.2.4
- resolution: "@nx/nx-linux-x64-gnu@npm:18.2.4"
- conditions: os=linux & cpu=x64 & libc=glibc
- languageName: node
- linkType: hard
-
"@nx/nx-linux-x64-gnu@npm:19.0.4":
version: 19.0.4
resolution: "@nx/nx-linux-x64-gnu@npm:19.0.4"
@@ -5965,13 +5904,6 @@ __metadata:
languageName: node
linkType: hard
-"@nx/nx-linux-x64-musl@npm:18.2.4":
- version: 18.2.4
- resolution: "@nx/nx-linux-x64-musl@npm:18.2.4"
- conditions: os=linux & cpu=x64 & libc=musl
- languageName: node
- linkType: hard
-
"@nx/nx-linux-x64-musl@npm:19.0.4":
version: 19.0.4
resolution: "@nx/nx-linux-x64-musl@npm:19.0.4"
@@ -5979,13 +5911,6 @@ __metadata:
languageName: node
linkType: hard
-"@nx/nx-win32-arm64-msvc@npm:18.2.4":
- version: 18.2.4
- resolution: "@nx/nx-win32-arm64-msvc@npm:18.2.4"
- conditions: os=win32 & cpu=arm64
- languageName: node
- linkType: hard
-
"@nx/nx-win32-arm64-msvc@npm:19.0.4":
version: 19.0.4
resolution: "@nx/nx-win32-arm64-msvc@npm:19.0.4"
@@ -5993,13 +5918,6 @@ __metadata:
languageName: node
linkType: hard
-"@nx/nx-win32-x64-msvc@npm:18.2.4":
- version: 18.2.4
- resolution: "@nx/nx-win32-x64-msvc@npm:18.2.4"
- conditions: os=win32 & cpu=x64
- languageName: node
- linkType: hard
-
"@nx/nx-win32-x64-msvc@npm:19.0.4":
version: 19.0.4
resolution: "@nx/nx-win32-x64-msvc@npm:19.0.4"
@@ -11271,7 +11189,7 @@ __metadata:
languageName: node
linkType: hard
-"@types/fs-extra@npm:11.0.4, @types/fs-extra@npm:^11.0.1":
+"@types/fs-extra@npm:11.0.4, @types/fs-extra@npm:^11.0.4":
version: 11.0.4
resolution: "@types/fs-extra@npm:11.0.4"
dependencies:
@@ -11617,12 +11535,12 @@ __metadata:
languageName: node
linkType: hard
-"@types/node@npm:*, @types/node@npm:20.11.25, @types/node@npm:>=12.12.47, @types/node@npm:>=13.7.0":
- version: 20.11.25
- resolution: "@types/node@npm:20.11.25"
+"@types/node@npm:*, @types/node@npm:>=12.12.47, @types/node@npm:>=13.7.0, @types/node@npm:>=20.12.11":
+ version: 20.12.12
+ resolution: "@types/node@npm:20.12.12"
dependencies:
undici-types: "npm:~5.26.4"
- checksum: 10c0/3a65a0469309d503e572a3198d81c9248876236b1bcc0c9943e995cfa536df7ce9a9302638258984877420d1613167a8a82dbfb3a92197319fb79ebebf9abc83
+ checksum: 10c0/f374b763c744e8f16e4f38cf6e2c0eef31781ec9228c9e43a6f267880fea420fab0a238b59f10a7cb3444e49547c5e3785787e371fc242307310995b21988812
languageName: node
linkType: hard
@@ -11633,7 +11551,16 @@ __metadata:
languageName: node
linkType: hard
-"@types/node@npm:^18.0.0, @types/node@npm:^18.11.9, @types/node@npm:^18.16.3":
+"@types/node@npm:20.11.25":
+ version: 20.11.25
+ resolution: "@types/node@npm:20.11.25"
+ dependencies:
+ undici-types: "npm:~5.26.4"
+ checksum: 10c0/3a65a0469309d503e572a3198d81c9248876236b1bcc0c9943e995cfa536df7ce9a9302638258984877420d1613167a8a82dbfb3a92197319fb79ebebf9abc83
+ languageName: node
+ linkType: hard
+
+"@types/node@npm:^18.0.0, @types/node@npm:^18.11.9":
version: 18.19.3
resolution: "@types/node@npm:18.19.3"
dependencies:
@@ -11710,13 +11637,6 @@ __metadata:
languageName: node
linkType: hard
-"@types/ps-tree@npm:^1.1.2":
- version: 1.1.2
- resolution: "@types/ps-tree@npm:1.1.2"
- checksum: 10c0/d43d5ac375886c37b11f54254578925ff07093b07326898d34eec744bf5721b61b7f3f743b2337e7157a368bb39166e679f26d464620371a0d232509f7f9ac99
- languageName: node
- linkType: hard
-
"@types/qs@npm:*, @types/qs@npm:6.9.14, @types/qs@npm:^6.9.5":
version: 6.9.14
resolution: "@types/qs@npm:6.9.14"
@@ -11940,13 +11860,6 @@ __metadata:
languageName: node
linkType: hard
-"@types/which@npm:^3.0.0":
- version: 3.0.0
- resolution: "@types/which@npm:3.0.0"
- checksum: 10c0/6c867d8a70dd1ef8999acf0b721b4b7c10e4a08b783b532a5c1223e36c8dd1b4b9e3644891db7013ac817a7afc89bef6fc680c4faddd473d8384387428d5bf9c
- languageName: node
- linkType: hard
-
"@types/ws@npm:^8.0.0, @types/ws@npm:^8.5.10, @types/ws@npm:^8.5.5":
version: 8.5.10
resolution: "@types/ws@npm:8.5.10"
@@ -15957,13 +15870,6 @@ __metadata:
languageName: node
linkType: hard
-"data-uri-to-buffer@npm:^4.0.0":
- version: 4.0.1
- resolution: "data-uri-to-buffer@npm:4.0.1"
- checksum: 10c0/20a6b93107597530d71d4cb285acee17f66bcdfc03fd81040921a81252f19db27588d87fc8fc69e1950c55cfb0bf8ae40d0e5e21d907230813eb5d5a7f9eb45b
- languageName: node
- linkType: hard
-
"data-urls@npm:^3.0.2":
version: 3.0.2
resolution: "data-urls@npm:3.0.2"
@@ -16754,7 +16660,7 @@ __metadata:
languageName: node
linkType: hard
-"duplexer@npm:^0.1.1, duplexer@npm:^0.1.2, duplexer@npm:~0.1.1":
+"duplexer@npm:^0.1.1, duplexer@npm:^0.1.2":
version: 0.1.2
resolution: "duplexer@npm:0.1.2"
checksum: 10c0/c57bcd4bdf7e623abab2df43a7b5b23d18152154529d166c1e0da6bee341d84c432d157d7e97b32fecb1bf3a8b8857dd85ed81a915789f550637ed25b8e64fc2
@@ -17958,21 +17864,6 @@ __metadata:
languageName: node
linkType: hard
-"event-stream@npm:=3.3.4":
- version: 3.3.4
- resolution: "event-stream@npm:3.3.4"
- dependencies:
- duplexer: "npm:~0.1.1"
- from: "npm:~0"
- map-stream: "npm:~0.1.0"
- pause-stream: "npm:0.0.11"
- split: "npm:0.3"
- stream-combiner: "npm:~0.0.4"
- through: "npm:~2.3.1"
- checksum: 10c0/c3ec4e1efc27ab3e73a98923f0a2fa9a19051b87068fea2f3d53d2e4e8c5cfdadf8c8a115b17f3d90b16a46432d396bad91b6e8d0cceb3e449be717a03b75209
- languageName: node
- linkType: hard
-
"event-target-shim@npm:^5.0.0":
version: 5.0.1
resolution: "event-target-shim@npm:5.0.1"
@@ -18460,16 +18351,6 @@ __metadata:
languageName: node
linkType: hard
-"fetch-blob@npm:^3.1.2, fetch-blob@npm:^3.1.4":
- version: 3.2.0
- resolution: "fetch-blob@npm:3.2.0"
- dependencies:
- node-domexception: "npm:^1.0.0"
- web-streams-polyfill: "npm:^3.0.3"
- checksum: 10c0/60054bf47bfa10fb0ba6cb7742acec2f37c1f56344f79a70bb8b1c48d77675927c720ff3191fa546410a0442c998d27ab05e9144c32d530d8a52fbe68f843b69
- languageName: node
- linkType: hard
-
"fetch-retry@npm:^5.0.2":
version: 5.0.6
resolution: "fetch-retry@npm:5.0.6"
@@ -18851,15 +18732,6 @@ __metadata:
languageName: node
linkType: hard
-"formdata-polyfill@npm:^4.0.10":
- version: 4.0.10
- resolution: "formdata-polyfill@npm:4.0.10"
- dependencies:
- fetch-blob: "npm:^3.1.2"
- checksum: 10c0/5392ec484f9ce0d5e0d52fb5a78e7486637d516179b0eb84d81389d7eccf9ca2f663079da56f761355c0a65792810e3b345dc24db9a8bbbcf24ef3c8c88570c6
- languageName: node
- linkType: hard
-
"forwarded@npm:0.2.0":
version: 0.2.0
resolution: "forwarded@npm:0.2.0"
@@ -18874,13 +18746,6 @@ __metadata:
languageName: node
linkType: hard
-"from@npm:~0":
- version: 0.1.7
- resolution: "from@npm:0.1.7"
- checksum: 10c0/3aab5aea8fe8e1f12a5dee7f390d46a93431ce691b6222dcd5701c5d34378e51ca59b44967da1105a0f90fcdf5d7629d963d51e7ccd79827d19693bdcfb688d4
- languageName: node
- linkType: hard
-
"fs-constants@npm:^1.0.0":
version: 1.0.0
resolution: "fs-constants@npm:1.0.0"
@@ -19043,15 +18908,6 @@ __metadata:
languageName: node
linkType: hard
-"fx@npm:*":
- version: 28.0.0
- resolution: "fx@npm:28.0.0"
- bin:
- fx: index.js
- checksum: 10c0/becd85992730d07d57dc0fa4deae847ae741952035d22a82903f5b2cc39b9c74592df6db5e3125ad50065d49cd83aedd4217b56c5e7ef7073d7391f37ca55fdf
- languageName: node
- linkType: hard
-
"gauge@npm:^4.0.3":
version: 4.0.4
resolution: "gauge@npm:4.0.4"
@@ -19513,7 +19369,7 @@ __metadata:
languageName: node
linkType: hard
-"globby@npm:^13.1.1, globby@npm:^13.1.4":
+"globby@npm:^13.1.1":
version: 13.2.2
resolution: "globby@npm:13.2.2"
dependencies:
@@ -23500,13 +23356,6 @@ __metadata:
languageName: node
linkType: hard
-"map-stream@npm:~0.1.0":
- version: 0.1.0
- resolution: "map-stream@npm:0.1.0"
- checksum: 10c0/7dd6debe511c1b55d9da75e1efa65a28b1252a2d8357938d2e49b412713c478efbaefb0cdf0ee0533540c3bf733e8f9f71e1a15aa0fe74bf71b64e75bf1576bd
- languageName: node
- linkType: hard
-
"map-values@npm:^1.0.1":
version: 1.0.1
resolution: "map-values@npm:1.0.1"
@@ -24707,13 +24556,6 @@ __metadata:
languageName: node
linkType: hard
-"node-domexception@npm:^1.0.0":
- version: 1.0.0
- resolution: "node-domexception@npm:1.0.0"
- checksum: 10c0/5e5d63cda29856402df9472335af4bb13875e1927ad3be861dc5ebde38917aecbf9ae337923777af52a48c426b70148815e890a5d72760f1b4d758cc671b1a2b
- languageName: node
- linkType: hard
-
"node-environment-flags@npm:^1.0.5":
version: 1.0.6
resolution: "node-environment-flags@npm:1.0.6"
@@ -24752,17 +24594,6 @@ __metadata:
languageName: node
linkType: hard
-"node-fetch@npm:3.3.1":
- version: 3.3.1
- resolution: "node-fetch@npm:3.3.1"
- dependencies:
- data-uri-to-buffer: "npm:^4.0.0"
- fetch-blob: "npm:^3.1.4"
- formdata-polyfill: "npm:^4.0.10"
- checksum: 10c0/78671bffed741a2f3ccb15588a42fd7e9db2bdc9f99f9f584e0c749307f9603d961692f0877d853b28a4d1375ab2253b19978dd3bfc0c3189b42adc340bef927
- languageName: node
- linkType: hard
-
"node-fetch@npm:^2.0.0, node-fetch@npm:^2.6.0, node-fetch@npm:^2.6.1, node-fetch@npm:^2.6.12, node-fetch@npm:^2.6.7, node-fetch@npm:^2.6.9":
version: 2.7.0
resolution: "node-fetch@npm:2.7.0"
@@ -25206,90 +25037,6 @@ __metadata:
languageName: node
linkType: hard
-"nx@npm:18.2.4":
- version: 18.2.4
- resolution: "nx@npm:18.2.4"
- dependencies:
- "@nrwl/tao": "npm:18.2.4"
- "@nx/nx-darwin-arm64": "npm:18.2.4"
- "@nx/nx-darwin-x64": "npm:18.2.4"
- "@nx/nx-freebsd-x64": "npm:18.2.4"
- "@nx/nx-linux-arm-gnueabihf": "npm:18.2.4"
- "@nx/nx-linux-arm64-gnu": "npm:18.2.4"
- "@nx/nx-linux-arm64-musl": "npm:18.2.4"
- "@nx/nx-linux-x64-gnu": "npm:18.2.4"
- "@nx/nx-linux-x64-musl": "npm:18.2.4"
- "@nx/nx-win32-arm64-msvc": "npm:18.2.4"
- "@nx/nx-win32-x64-msvc": "npm:18.2.4"
- "@yarnpkg/lockfile": "npm:^1.1.0"
- "@yarnpkg/parsers": "npm:3.0.0-rc.46"
- "@zkochan/js-yaml": "npm:0.0.6"
- axios: "npm:^1.6.0"
- chalk: "npm:^4.1.0"
- cli-cursor: "npm:3.1.0"
- cli-spinners: "npm:2.6.1"
- cliui: "npm:^8.0.1"
- dotenv: "npm:~16.3.1"
- dotenv-expand: "npm:~10.0.0"
- enquirer: "npm:~2.3.6"
- figures: "npm:3.2.0"
- flat: "npm:^5.0.2"
- fs-extra: "npm:^11.1.0"
- ignore: "npm:^5.0.4"
- jest-diff: "npm:^29.4.1"
- js-yaml: "npm:4.1.0"
- jsonc-parser: "npm:3.2.0"
- lines-and-columns: "npm:~2.0.3"
- minimatch: "npm:9.0.3"
- node-machine-id: "npm:1.1.12"
- npm-run-path: "npm:^4.0.1"
- open: "npm:^8.4.0"
- ora: "npm:5.3.0"
- semver: "npm:^7.5.3"
- string-width: "npm:^4.2.3"
- strong-log-transformer: "npm:^2.1.0"
- tar-stream: "npm:~2.2.0"
- tmp: "npm:~0.2.1"
- tsconfig-paths: "npm:^4.1.2"
- tslib: "npm:^2.3.0"
- yargs: "npm:^17.6.2"
- yargs-parser: "npm:21.1.1"
- peerDependencies:
- "@swc-node/register": ^1.8.0
- "@swc/core": ^1.3.85
- dependenciesMeta:
- "@nx/nx-darwin-arm64":
- optional: true
- "@nx/nx-darwin-x64":
- optional: true
- "@nx/nx-freebsd-x64":
- optional: true
- "@nx/nx-linux-arm-gnueabihf":
- optional: true
- "@nx/nx-linux-arm64-gnu":
- optional: true
- "@nx/nx-linux-arm64-musl":
- optional: true
- "@nx/nx-linux-x64-gnu":
- optional: true
- "@nx/nx-linux-x64-musl":
- optional: true
- "@nx/nx-win32-arm64-msvc":
- optional: true
- "@nx/nx-win32-x64-msvc":
- optional: true
- peerDependenciesMeta:
- "@swc-node/register":
- optional: true
- "@swc/core":
- optional: true
- bin:
- nx: bin/nx.js
- nx-cloud: bin/nx-cloud.js
- checksum: 10c0/723b7589b57207b418146e6070b7a3d0a1fb6b655d2b07877917423ab0f1b3a493fa696e7328ea420e2e635b7108dfd8f62af30cc01ac1aa6e73ec97534ee18a
- languageName: node
- linkType: hard
-
"nx@npm:19.0.4, nx@npm:>=17.1.2 < 20":
version: 19.0.4
resolution: "nx@npm:19.0.4"
@@ -26249,15 +25996,6 @@ __metadata:
languageName: node
linkType: hard
-"pause-stream@npm:0.0.11":
- version: 0.0.11
- resolution: "pause-stream@npm:0.0.11"
- dependencies:
- through: "npm:~2.3"
- checksum: 10c0/86f12c64cdaaa8e45ebaca4e39a478e1442db8b4beabc280b545bfaf79c0e2f33c51efb554aace5c069cc441c7b924ba484837b345eaa4ba6fc940d62f826802
- languageName: node
- linkType: hard
-
"peberminta@npm:^0.8.0":
version: 0.8.0
resolution: "peberminta@npm:0.8.0"
@@ -27255,17 +26993,6 @@ __metadata:
languageName: node
linkType: hard
-"ps-tree@npm:^1.2.0":
- version: 1.2.0
- resolution: "ps-tree@npm:1.2.0"
- dependencies:
- event-stream: "npm:=3.3.4"
- bin:
- ps-tree: ./bin/ps-tree.js
- checksum: 10c0/9d1c159e0890db5aa05f84d125193c2190a6c4ecd457596fd25e7611f8f747292a846459dcc0244e27d45529d4cea6d1010c3a2a087fad02624d12fdb7d97c22
- languageName: node
- linkType: hard
-
"pseudomap@npm:^1.0.1":
version: 1.0.2
resolution: "pseudomap@npm:1.0.2"
@@ -28686,7 +28413,7 @@ __metadata:
ncp: "npm:2.0.0"
nodemon: "npm:3.1.0"
npm-packlist: "npm:8.0.2"
- nx: "npm:18.2.4"
+ nx: "npm:19.0.4"
octokit: "npm:3.1.2"
ora: "npm:7.0.1"
prompts: "npm:2.4.2"
@@ -28696,7 +28423,7 @@ __metadata:
typescript: "npm:5.4.5"
vitest: "npm:1.4.0"
yargs: "npm:17.7.2"
- zx: "npm:7.2.3"
+ zx: "npm:8.1.0"
languageName: unknown
linkType: soft
@@ -29534,15 +29261,6 @@ __metadata:
languageName: node
linkType: hard
-"split@npm:0.3":
- version: 0.3.3
- resolution: "split@npm:0.3.3"
- dependencies:
- through: "npm:2"
- checksum: 10c0/88c09b1b4de84953bf5d6c153123a1fbb20addfea9381f70d27b4eb6b2bfbadf25d313f8f5d3fd727d5679b97bfe54da04766b91010f131635bf49e51d5db3fc
- languageName: node
- linkType: hard
-
"split@npm:^1.0.1":
version: 1.0.1
resolution: "split@npm:1.0.1"
@@ -29717,15 +29435,6 @@ __metadata:
languageName: node
linkType: hard
-"stream-combiner@npm:~0.0.4":
- version: 0.0.4
- resolution: "stream-combiner@npm:0.0.4"
- dependencies:
- duplexer: "npm:~0.1.1"
- checksum: 10c0/8075a94c0eb0f20450a8236cb99d4ce3ea6e6a4b36d8baa7440b1a08cde6ffd227debadffaecd80993bd334282875d0e927ab5b88484625e01970dd251004ff5
- languageName: node
- linkType: hard
-
"stream-events@npm:^1.0.5":
version: 1.0.5
resolution: "stream-events@npm:1.0.5"
@@ -30460,7 +30169,7 @@ __metadata:
languageName: node
linkType: hard
-"through@npm:2, through@npm:>=2.2.7 <3, through@npm:^2.3.4, through@npm:^2.3.6, through@npm:^2.3.8, through@npm:~2.3, through@npm:~2.3.1":
+"through@npm:2, through@npm:>=2.2.7 <3, through@npm:^2.3.4, through@npm:^2.3.6, through@npm:^2.3.8":
version: 2.3.8
resolution: "through@npm:2.3.8"
checksum: 10c0/4b09f3774099de0d4df26d95c5821a62faee32c7e96fb1f4ebd54a2d7c11c57fe88b0a0d49cf375de5fee5ae6bf4eb56dbbf29d07366864e2ee805349970d3cc
@@ -31944,7 +31653,7 @@ __metadata:
languageName: node
linkType: hard
-"web-streams-polyfill@npm:^3.0.3, web-streams-polyfill@npm:^3.2.1":
+"web-streams-polyfill@npm:^3.2.1":
version: 3.2.1
resolution: "web-streams-polyfill@npm:3.2.1"
checksum: 10c0/70ed6b5708e14afa2ab699221ea197d7c68ec0c8274bbe0181aecc5ba636ca27cbd383d2049f0eb9d529e738f5c088825502b317f3df24d18a278e4cc9a10e8b
@@ -32219,15 +31928,6 @@ __metadata:
languageName: node
linkType: hard
-"webpod@npm:^0":
- version: 0.0.2
- resolution: "webpod@npm:0.0.2"
- bin:
- webpod: dist/index.js
- checksum: 10c0/92b5920be7a8a080839221ce70e5d18f5cac86455af9ee20a54e77ee5c577746981c6d70afc2510df15061d3e3ea8c47f9fc36c2be01f47fd7630db1c9e5cba0
- languageName: node
- linkType: hard
-
"websocket-driver@npm:>=0.5.1, websocket-driver@npm:^0.7.4":
version: 0.7.4
resolution: "websocket-driver@npm:0.7.4"
@@ -32391,17 +32091,6 @@ __metadata:
languageName: node
linkType: hard
-"which@npm:^3.0.0":
- version: 3.0.1
- resolution: "which@npm:3.0.1"
- dependencies:
- isexe: "npm:^2.0.0"
- bin:
- node-which: bin/which.js
- checksum: 10c0/15263b06161a7c377328fd2066cb1f093f5e8a8f429618b63212b5b8847489be7bcab0ab3eb07f3ecc0eda99a5a7ea52105cf5fa8266bedd083cc5a9f6da24f1
- languageName: node
- linkType: hard
-
"which@npm:^4.0.0":
version: 4.0.0
resolution: "which@npm:4.0.0"
@@ -32740,13 +32429,6 @@ __metadata:
languageName: node
linkType: hard
-"yaml@npm:^2.2.2":
- version: 2.3.1
- resolution: "yaml@npm:2.3.1"
- checksum: 10c0/ed4c21a907fb1cd60a25177612fa46d95064a144623d269199817908475fe85bef20fb17406e3bdc175351b6488056a6f84beb7836e8c262646546a0220188e3
- languageName: node
- linkType: hard
-
"yargs-parser@npm:21.1.1, yargs-parser@npm:^21.1.1":
version: 21.1.1
resolution: "yargs-parser@npm:21.1.1"
@@ -32887,27 +32569,19 @@ __metadata:
languageName: node
linkType: hard
-"zx@npm:7.2.3":
- version: 7.2.3
- resolution: "zx@npm:7.2.3"
+"zx@npm:8.1.0":
+ version: 8.1.0
+ resolution: "zx@npm:8.1.0"
dependencies:
- "@types/fs-extra": "npm:^11.0.1"
- "@types/minimist": "npm:^1.2.2"
- "@types/node": "npm:^18.16.3"
- "@types/ps-tree": "npm:^1.1.2"
- "@types/which": "npm:^3.0.0"
- chalk: "npm:^5.2.0"
- fs-extra: "npm:^11.1.1"
- fx: "npm:*"
- globby: "npm:^13.1.4"
- minimist: "npm:^1.2.8"
- node-fetch: "npm:3.3.1"
- ps-tree: "npm:^1.2.0"
- webpod: "npm:^0"
- which: "npm:^3.0.0"
- yaml: "npm:^2.2.2"
+ "@types/fs-extra": "npm:^11.0.4"
+ "@types/node": "npm:>=20.12.11"
+ dependenciesMeta:
+ "@types/fs-extra":
+ optional: true
+ "@types/node":
+ optional: true
bin:
zx: build/cli.js
- checksum: 10c0/9a90886e4e923263aa363c1b5193d5ef0db23b7debe69d4f267b594c33748b234234ceb4fa984c38487255c3801e748237bb857859f066ba90503935a61bdba7
+ checksum: 10c0/a833ccfb94889c900f127bb89cd537fc3a32eb5c0bda71ddba6e24d5f268926234c48855af8da4550646fa5cff876fe18ca835f24f2d4d8548b3ec21c253d372
languageName: node
linkType: hard
|
leetcode
|
https://github.com/doocs/leetcode
|
ab9c0005e030987a084fcc56062c856b4edac8eb
|
yanglbme
|
2022-01-27 16:40:41
|
feat: add solutions to lc problem: No.0426
|
No.0426.Convert Binary Search Tree to Sorted Doubly Linked List
|
feat: add solutions to lc problem: No.0426
No.0426.Convert Binary Search Tree to Sorted Doubly Linked List
|
diff --git a/solution/0400-0499/0426.Convert Binary Search Tree to Sorted Doubly Linked List/README.md b/solution/0400-0499/0426.Convert Binary Search Tree to Sorted Doubly Linked List/README.md
index c6820df942a67..3119a6f371aa3 100644
--- a/solution/0400-0499/0426.Convert Binary Search Tree to Sorted Doubly Linked List/README.md
+++ b/solution/0400-0499/0426.Convert Binary Search Tree to Sorted Doubly Linked List/README.md
@@ -63,9 +63,9 @@
<!-- 这里可写通用的实现逻辑 -->
-- 排序链表:二叉搜索树中序遍历得到有序序列
-- 循环链表:头节点指向链表尾节点,尾节点指向链表头节点
-- 双向链表:`pre.right = cur`、`cur.left = pre`、`pre = cur`
+- 排序链表:二叉搜索树中序遍历得到有序序列
+- 循环链表:头节点指向链表尾节点,尾节点指向链表头节点
+- 双向链表:`prev.right = cur`、`cur.left = prev`、`prev = cur`
<!-- tabs:start -->
@@ -82,26 +82,30 @@ class Node:
self.left = left
self.right = right
"""
+
+
class Solution:
- def treeToDoublyList(self, root: 'Node') -> 'Node':
- def dfs(cur):
- if cur is None:
+ def treeToDoublyList(self, root: 'Optional[Node]') -> 'Optional[Node]':
+ def dfs(root):
+ if root is None:
return
- dfs(cur.left)
- if self.pre is None:
- self.head = cur
+ nonlocal prev, head
+ dfs(root.left)
+ if prev:
+ prev.right = root
+ root.left = prev
else:
- self.pre.right = cur
- cur.left = self.pre
- self.pre = cur
- dfs(cur.right)
+ head = root
+ prev = root
+ dfs(root.right)
+
if root is None:
return None
- self.head = self.pre = None
+ head = prev = None
dfs(root)
- self.head.left = self.pre
- self.pre.right = self.head
- return self.head
+ prev.right = head
+ head.left = prev
+ return head
```
### **Java**
@@ -131,26 +135,132 @@ class Node {
*/
class Solution {
+ private Node prev;
private Node head;
- private Node pre;
public Node treeToDoublyList(Node root) {
- if (root == null) return null;
+ if (root == null) {
+ return null;
+ }
+ prev = null;
+ head = null;
+ dfs(root);
+ prev.right = head;
+ head.left = prev;
+ return head;
+ }
+
+ private void dfs(Node root) {
+ if (root == null) {
+ return;
+ }
+ dfs(root.left);
+ if (prev != null) {
+ prev.right = root;
+ root.left = prev;
+ } else {
+ head = root;
+ }
+ prev = root;
+ dfs(root.right);
+ }
+}
+```
+
+### **C++**
+
+```cpp
+/*
+// Definition for a Node.
+class Node {
+public:
+ int val;
+ Node* left;
+ Node* right;
+
+ Node() {}
+
+ Node(int _val) {
+ val = _val;
+ left = NULL;
+ right = NULL;
+ }
+
+ Node(int _val, Node* _left, Node* _right) {
+ val = _val;
+ left = _left;
+ right = _right;
+ }
+};
+*/
+
+class Solution {
+public:
+ Node* prev;
+ Node* head;
+
+ Node* treeToDoublyList(Node* root) {
+ if (!root) return nullptr;
+ prev = nullptr;
+ head = nullptr;
dfs(root);
- head.left = pre;
- pre.right = head;
+ prev->right = head;
+ head->left = prev;
return head;
}
- private void dfs(Node cur) {
- if (cur == null) return;
- dfs(cur.left);
- if (pre == null) head = cur;
- else pre.right = cur;
- cur.left = pre;
- pre = cur;
- dfs(cur.right);
+ void dfs(Node* root) {
+ if (!root) return;
+ dfs(root->left);
+ if (prev)
+ {
+ prev->right = root;
+ root->left = prev;
+ }
+ else head = root;
+ prev = root;
+ dfs(root->right);
}
+};
+```
+
+### **Go**
+
+```go
+/**
+ * Definition for a Node.
+ * type Node struct {
+ * Val int
+ * Left *Node
+ * Right *Node
+ * }
+ */
+
+func treeToDoublyList(root *Node) *Node {
+ if root == nil {
+ return root
+ }
+ var prev, head *Node
+
+ var dfs func(root *Node)
+ dfs = func(root *Node) {
+ if root == nil {
+ return
+ }
+ dfs(root.Left)
+ if prev != nil {
+ prev.Right = root
+ root.Left = prev
+ } else {
+ head = root
+ }
+ prev = root
+ dfs(root.Right)
+ }
+ dfs(root)
+ prev.Right = head
+ head.Left = prev
+ return head
}
```
@@ -159,31 +269,37 @@ class Solution {
```js
/**
* // Definition for a Node.
- * function Node(val,left,right) {
- * this.val = val;
- * this.left = left;
- * this.right = right;
- * };
+ * function Node(val, left, right) {
+ * this.val = val;
+ * this.left = left;
+ * this.right = right;
+ * };
*/
+
/**
* @param {Node} root
* @return {Node}
*/
var treeToDoublyList = function (root) {
- function dfs(cur) {
- if (!cur) return;
- dfs(cur.left);
- if (!pre) head = cur;
- else pre.right = cur;
- cur.left = pre;
- pre = cur;
- dfs(cur.right);
+ if (!root) return root;
+ let prev = null;
+ let head = null;
+
+ function dfs(root) {
+ if (!root) return;
+ dfs(root.left);
+ if (prev) {
+ prev.right = root;
+ root.left = prev;
+ } else {
+ head = root;
+ }
+ prev = root;
+ dfs(root.right);
}
- if (!root) return null;
- let head, pre;
dfs(root);
- head.left = pre;
- pre.right = head;
+ prev.right = head;
+ head.left = prev;
return head;
};
```
diff --git a/solution/0400-0499/0426.Convert Binary Search Tree to Sorted Doubly Linked List/README_EN.md b/solution/0400-0499/0426.Convert Binary Search Tree to Sorted Doubly Linked List/README_EN.md
index 0e742abbc51ab..d0bd796e41bfa 100644
--- a/solution/0400-0499/0426.Convert Binary Search Tree to Sorted Doubly Linked List/README_EN.md
+++ b/solution/0400-0499/0426.Convert Binary Search Tree to Sorted Doubly Linked List/README_EN.md
@@ -71,26 +71,30 @@ class Node:
self.left = left
self.right = right
"""
+
+
class Solution:
- def treeToDoublyList(self, root: 'Node') -> 'Node':
- def dfs(cur):
- if cur is None:
+ def treeToDoublyList(self, root: 'Optional[Node]') -> 'Optional[Node]':
+ def dfs(root):
+ if root is None:
return
- dfs(cur.left)
- if self.pre is None:
- self.head = cur
+ nonlocal prev, head
+ dfs(root.left)
+ if prev:
+ prev.right = root
+ root.left = prev
else:
- self.pre.right = cur
- cur.left = self.pre
- self.pre = cur
- dfs(cur.right)
+ head = root
+ prev = root
+ dfs(root.right)
+
if root is None:
return None
- self.head = self.pre = None
+ head = prev = None
dfs(root)
- self.head.left = self.pre
- self.pre.right = self.head
- return self.head
+ prev.right = head
+ head.left = prev
+ return head
```
### **Java**
@@ -118,26 +122,132 @@ class Node {
*/
class Solution {
+ private Node prev;
private Node head;
- private Node pre;
public Node treeToDoublyList(Node root) {
- if (root == null) return null;
+ if (root == null) {
+ return null;
+ }
+ prev = null;
+ head = null;
+ dfs(root);
+ prev.right = head;
+ head.left = prev;
+ return head;
+ }
+
+ private void dfs(Node root) {
+ if (root == null) {
+ return;
+ }
+ dfs(root.left);
+ if (prev != null) {
+ prev.right = root;
+ root.left = prev;
+ } else {
+ head = root;
+ }
+ prev = root;
+ dfs(root.right);
+ }
+}
+```
+
+### **C++**
+
+```cpp
+/*
+// Definition for a Node.
+class Node {
+public:
+ int val;
+ Node* left;
+ Node* right;
+
+ Node() {}
+
+ Node(int _val) {
+ val = _val;
+ left = NULL;
+ right = NULL;
+ }
+
+ Node(int _val, Node* _left, Node* _right) {
+ val = _val;
+ left = _left;
+ right = _right;
+ }
+};
+*/
+
+class Solution {
+public:
+ Node* prev;
+ Node* head;
+
+ Node* treeToDoublyList(Node* root) {
+ if (!root) return nullptr;
+ prev = nullptr;
+ head = nullptr;
dfs(root);
- head.left = pre;
- pre.right = head;
+ prev->right = head;
+ head->left = prev;
return head;
}
- private void dfs(Node cur) {
- if (cur == null) return;
- dfs(cur.left);
- if (pre == null) head = cur;
- else pre.right = cur;
- cur.left = pre;
- pre = cur;
- dfs(cur.right);
+ void dfs(Node* root) {
+ if (!root) return;
+ dfs(root->left);
+ if (prev)
+ {
+ prev->right = root;
+ root->left = prev;
+ }
+ else head = root;
+ prev = root;
+ dfs(root->right);
}
+};
+```
+
+### **Go**
+
+```go
+/**
+ * Definition for a Node.
+ * type Node struct {
+ * Val int
+ * Left *Node
+ * Right *Node
+ * }
+ */
+
+func treeToDoublyList(root *Node) *Node {
+ if root == nil {
+ return root
+ }
+ var prev, head *Node
+
+ var dfs func(root *Node)
+ dfs = func(root *Node) {
+ if root == nil {
+ return
+ }
+ dfs(root.Left)
+ if prev != nil {
+ prev.Right = root
+ root.Left = prev
+ } else {
+ head = root
+ }
+ prev = root
+ dfs(root.Right)
+ }
+ dfs(root)
+ prev.Right = head
+ head.Left = prev
+ return head
}
```
@@ -146,31 +256,37 @@ class Solution {
```js
/**
* // Definition for a Node.
- * function Node(val,left,right) {
- * this.val = val;
- * this.left = left;
- * this.right = right;
- * };
+ * function Node(val, left, right) {
+ * this.val = val;
+ * this.left = left;
+ * this.right = right;
+ * };
*/
+
/**
* @param {Node} root
* @return {Node}
*/
var treeToDoublyList = function (root) {
- function dfs(cur) {
- if (!cur) return;
- dfs(cur.left);
- if (!pre) head = cur;
- else pre.right = cur;
- cur.left = pre;
- pre = cur;
- dfs(cur.right);
+ if (!root) return root;
+ let prev = null;
+ let head = null;
+
+ function dfs(root) {
+ if (!root) return;
+ dfs(root.left);
+ if (prev) {
+ prev.right = root;
+ root.left = prev;
+ } else {
+ head = root;
+ }
+ prev = root;
+ dfs(root.right);
}
- if (!root) return null;
- let head, pre;
dfs(root);
- head.left = pre;
- pre.right = head;
+ prev.right = head;
+ head.left = prev;
return head;
};
```
diff --git a/solution/0400-0499/0426.Convert Binary Search Tree to Sorted Doubly Linked List/Solution.cpp b/solution/0400-0499/0426.Convert Binary Search Tree to Sorted Doubly Linked List/Solution.cpp
new file mode 100644
index 0000000000000..efdb0de9bc2c1
--- /dev/null
+++ b/solution/0400-0499/0426.Convert Binary Search Tree to Sorted Doubly Linked List/Solution.cpp
@@ -0,0 +1,52 @@
+/*
+// Definition for a Node.
+class Node {
+public:
+ int val;
+ Node* left;
+ Node* right;
+
+ Node() {}
+
+ Node(int _val) {
+ val = _val;
+ left = NULL;
+ right = NULL;
+ }
+
+ Node(int _val, Node* _left, Node* _right) {
+ val = _val;
+ left = _left;
+ right = _right;
+ }
+};
+*/
+
+class Solution {
+public:
+ Node* prev;
+ Node* head;
+
+ Node* treeToDoublyList(Node* root) {
+ if (!root) return nullptr;
+ prev = nullptr;
+ head = nullptr;
+ dfs(root);
+ prev->right = head;
+ head->left = prev;
+ return head;
+ }
+
+ void dfs(Node* root) {
+ if (!root) return;
+ dfs(root->left);
+ if (prev)
+ {
+ prev->right = root;
+ root->left = prev;
+ }
+ else head = root;
+ prev = root;
+ dfs(root->right);
+ }
+};
\ No newline at end of file
diff --git a/solution/0400-0499/0426.Convert Binary Search Tree to Sorted Doubly Linked List/Solution.go b/solution/0400-0499/0426.Convert Binary Search Tree to Sorted Doubly Linked List/Solution.go
new file mode 100644
index 0000000000000..90d14d9f52a9d
--- /dev/null
+++ b/solution/0400-0499/0426.Convert Binary Search Tree to Sorted Doubly Linked List/Solution.go
@@ -0,0 +1,35 @@
+/**
+ * Definition for a Node.
+ * type Node struct {
+ * Val int
+ * Left *Node
+ * Right *Node
+ * }
+ */
+
+func treeToDoublyList(root *Node) *Node {
+ if root == nil {
+ return root
+ }
+ var prev, head *Node
+
+ var dfs func(root *Node)
+ dfs = func(root *Node) {
+ if root == nil {
+ return
+ }
+ dfs(root.Left)
+ if prev != nil {
+ prev.Right = root
+ root.Left = prev
+ } else {
+ head = root
+ }
+ prev = root
+ dfs(root.Right)
+ }
+ dfs(root)
+ prev.Right = head
+ head.Left = prev
+ return head
+}
\ No newline at end of file
diff --git a/solution/0400-0499/0426.Convert Binary Search Tree to Sorted Doubly Linked List/Solution.java b/solution/0400-0499/0426.Convert Binary Search Tree to Sorted Doubly Linked List/Solution.java
index 53bf73e796cae..a441e08c107ff 100644
--- a/solution/0400-0499/0426.Convert Binary Search Tree to Sorted Doubly Linked List/Solution.java
+++ b/solution/0400-0499/0426.Convert Binary Search Tree to Sorted Doubly Linked List/Solution.java
@@ -20,24 +20,33 @@ public Node(int _val,Node _left,Node _right) {
*/
class Solution {
+ private Node prev;
private Node head;
- private Node pre;
-
+
public Node treeToDoublyList(Node root) {
- if (root == null) return null;
+ if (root == null) {
+ return null;
+ }
+ prev = null;
+ head = null;
dfs(root);
- head.left = pre;
- pre.right = head;
+ prev.right = head;
+ head.left = prev;
return head;
}
- private void dfs(Node cur) {
- if (cur == null) return;
- dfs(cur.left);
- if (pre == null) head = cur;
- else pre.right = cur;
- cur.left = pre;
- pre = cur;
- dfs(cur.right);
+ private void dfs(Node root) {
+ if (root == null) {
+ return;
+ }
+ dfs(root.left);
+ if (prev != null) {
+ prev.right = root;
+ root.left = prev;
+ } else {
+ head = root;
+ }
+ prev = root;
+ dfs(root.right);
}
}
\ No newline at end of file
diff --git a/solution/0400-0499/0426.Convert Binary Search Tree to Sorted Doubly Linked List/Solution.js b/solution/0400-0499/0426.Convert Binary Search Tree to Sorted Doubly Linked List/Solution.js
index 9ae80161b6c20..e55dff83eb858 100644
--- a/solution/0400-0499/0426.Convert Binary Search Tree to Sorted Doubly Linked List/Solution.js
+++ b/solution/0400-0499/0426.Convert Binary Search Tree to Sorted Doubly Linked List/Solution.js
@@ -1,34 +1,3 @@
-/**
- * // Definition for a Node.
- * function Node(val,left,right) {
- * this.val = val;
- * this.left = left;
- * this.right = right;
- * };
- */
-/**
- * @param {Node} root
- * @return {Node}
- */
-var treeToDoublyList = function (root) {
- function dfs(cur) {
- if (!cur) return;
- dfs(cur.left);
- if (!pre) head = cur;
- else pre.right = cur;
- cur.left = pre;
- pre = cur;
- dfs(cur.right);
- }
- if (!root) return null;
- let head, pre;
- dfs(root);
- head.left = pre;
- pre.right = head;
- return head;
-};
-
-//solution 2
/**
* // Definition for a Node.
* function Node(val, left, right) {
@@ -43,26 +12,24 @@ var treeToDoublyList = function (root) {
* @return {Node}
*/
var treeToDoublyList = function (root) {
- if (!root) return;
- let stk = [];
- let cur = root;
- let pre, head;
- while (cur || stk.length) {
- while (cur) {
- stk.push(cur);
- cur = cur.left;
- }
- let top = stk.pop();
- if (pre) {
- pre.right = top;
- top.left = pre;
+ if (!root) return root;
+ let prev = null;
+ let head = null;
+
+ function dfs(root) {
+ if (!root) return;
+ dfs(root.left);
+ if (prev) {
+ prev.right = root;
+ root.left = prev;
} else {
- head = top;
+ head = root;
}
- pre = top;
- cur = top.right;
+ prev = root;
+ dfs(root.right);
}
- pre.right = head;
- head.left = pre;
+ dfs(root);
+ prev.right = head;
+ head.left = prev;
return head;
};
diff --git a/solution/0400-0499/0426.Convert Binary Search Tree to Sorted Doubly Linked List/Solution.py b/solution/0400-0499/0426.Convert Binary Search Tree to Sorted Doubly Linked List/Solution.py
index 3b425cca35b24..35a254c4840da 100644
--- a/solution/0400-0499/0426.Convert Binary Search Tree to Sorted Doubly Linked List/Solution.py
+++ b/solution/0400-0499/0426.Convert Binary Search Tree to Sorted Doubly Linked List/Solution.py
@@ -6,23 +6,27 @@ def __init__(self, val, left=None, right=None):
self.left = left
self.right = right
"""
+
+
class Solution:
- def treeToDoublyList(self, root: 'Node') -> 'Node':
- def dfs(cur):
- if cur is None:
+ def treeToDoublyList(self, root: 'Optional[Node]') -> 'Optional[Node]':
+ def dfs(root):
+ if root is None:
return
- dfs(cur.left)
- if self.pre is None:
- self.head = cur
+ nonlocal prev, head
+ dfs(root.left)
+ if prev:
+ prev.right = root
+ root.left = prev
else:
- self.pre.right = cur
- cur.left = self.pre
- self.pre = cur
- dfs(cur.right)
+ head = root
+ prev = root
+ dfs(root.right)
+
if root is None:
return None
- self.head = self.pre = None
+ head = prev = None
dfs(root)
- self.head.left = self.pre
- self.pre.right = self.head
- return self.head
+ prev.right = head
+ head.left = prev
+ return head
diff --git a/solution/2000-2099/2046.Sort Linked List Already Sorted Using Absolute Values/README.md b/solution/2000-2099/2046.Sort Linked List Already Sorted Using Absolute Values/README.md
index 479ec3e46d509..eeecec0cf7b34 100644
--- a/solution/2000-2099/2046.Sort Linked List Already Sorted Using Absolute Values/README.md
+++ b/solution/2000-2099/2046.Sort Linked List Already Sorted Using Absolute Values/README.md
@@ -1,4 +1,4 @@
-# [2046. Sort Linked List Already Sorted Using Absolute Values](https://leetcode-cn.com/problems/sort-linked-list-already-sorted-using-absolute-values)
+# [2046. 给按照绝对值排序的链表排序](https://leetcode-cn.com/problems/sort-linked-list-already-sorted-using-absolute-values)
[English Version](/solution/2000-2099/2046.Sort%20Linked%20List%20Already%20Sorted%20Using%20Absolute%20Values/README_EN.md)
@@ -6,50 +6,50 @@
<!-- 这里写题目描述 -->
-Given the <code>head</code> of a singly linked list that is sorted in <strong>non-decreasing</strong> order using the <strong>absolute values</strong> of its nodes, return <em>the list sorted in <strong>non-decreasing</strong> order using the <strong>actual values</strong> of its nodes</em>.
+给你一个链表的头结点 <code>head</code> ,这个链表是根据结点的<strong>绝对值</strong>进行<strong>升序</strong>排序, 返回重新根据<strong>节点的值</strong>进行<strong>升序</strong>排序的链表。
<p> </p>
-<p><strong>Example 1:</strong></p>
-<img src="https://cdn.jsdelivr.net/gh/doocs/leetcode@main/solution/2000-2099/2046.Sort%20Linked%20List%20Already%20Sorted%20Using%20Absolute%20Values/images/image-20211017201240-3.png" style="width: 621px; height: 250px;" />
-<pre>
-<strong>Input:</strong> head = [0,2,-5,5,10,-10]
-<strong>Output:</strong> [-10,-5,0,2,5,10]
-<strong>Explanation:</strong>
-The list sorted in non-descending order using the absolute values of the nodes is [0,2,-5,5,10,-10].
-The list sorted in non-descending order using the actual values is [-10,-5,0,2,5,10].
-</pre>
-<p><strong>Example 2:</strong></p>
-<img src="https://cdn.jsdelivr.net/gh/doocs/leetcode@main/solution/2000-2099/2046.Sort%20Linked%20List%20Already%20Sorted%20Using%20Absolute%20Values/images/image-20211017201318-4.png" style="width: 338px; height: 250px;" />
-<pre>
-<strong>Input:</strong> head = [0,1,2]
-<strong>Output:</strong> [0,1,2]
-<strong>Explanation:</strong>
-The linked list is already sorted in non-decreasing order.
+<p><strong>示例 1:</strong></p>
+<img src="https://cdn.jsdelivr.net/gh/doocs/leetcode@main/solution/2000-2099/2046.Sort%20Linked%20List%20Already%20Sorted%20Using%20Absolute%20Values/images/image-20211017201240-3.png" style="width: 621px; height: 250px;">
+<pre><strong>输入:</strong> head = [0,2,-5,5,10,-10]
+<strong>输出:</strong> [-10,-5,0,2,5,10]
+<strong>解释:</strong>
+根据结点的值的绝对值排序的链表是 [0,2,-5,5,10,-10].
+根据结点的值排序的链表是 [-10,-5,0,2,5,10].
</pre>
-<p><strong>Example 3:</strong></p>
+<p><strong>示例 2:</strong></p>
-<pre>
-<strong>Input:</strong> head = [1]
-<strong>Output:</strong> [1]
-<strong>Explanation:</strong>
-The linked list is already sorted in non-decreasing order.
-</pre>
+<p><img src="https://cdn.jsdelivr.net/gh/doocs/leetcode@main/solution/2000-2099/2046.Sort%20Linked%20List%20Already%20Sorted%20Using%20Absolute%20Values/images/image-20211017201318-4.png" style="width: 338px; height: 250px;"></p>
+
+<pre><strong>输入:</strong> head = [0,1,2]
+<strong>输出:</strong> [0,1,2]
+<strong>解释:</strong>
+这个链表已经是升序的了。</pre>
+
+<p><strong>示例 3:</strong></p>
+
+<pre><strong>输入:</strong> head = [1]
+<strong>输出:</strong> [1]
+<strong>解释:</strong>
+这个链表已经是升序的了。</pre>
<p> </p>
-<p><strong>Constraints:</strong></p>
+
+<p><strong>提示:</strong></p>
<ul>
- <li>The number of nodes in the list is the range <code>[1, 10<sup>5</sup>]</code>.</li>
+ <li>链表节点数的范围是 <code>[1, 10<sup>5</sup>]</code>.</li>
<li><code>-5000 <= Node.val <= 5000</code></li>
- <li><code>head</code> is sorted in non-decreasing order using the absolute value of its nodes.</li>
+ <li><code>head</code> 是根据结点绝对值升序排列好的链表.</li>
</ul>
<p> </p>
-<strong>Follow up:</strong>
+<strong>进阶:</strong>
+
<ul>
- <li>Can you think of a solution with <code>O(n)</code> time complexity?</li>
+ <li>你可以在<code>O(n)</code>的时间复杂度之内解决这个问题吗?</li>
</ul>
## 解法
|
unleash
|
https://github.com/Unleash/unleash
|
05781bbf17a3a44ae0fbf507059d1d0ace458819
|
renovate[bot]
|
2023-10-15 03:05:44
|
chore(deps): update dependency @swc/core to v1.3.92 (#5028)
|
[](https://renovatebot.com)
This PR contains the following updates:
| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [@swc/core](https://swc.rs)
([source](https://togithub.com/swc-project/swc)) | [`1.3.90` ->
`1.3.92`](https://renovatebot.com/diffs/npm/@swc%2fcore/1.3.90/1.3.92) |
[](https://docs.renovatebot.com/merge-confidence/)
|
[](https://docs.renovatebot.com/merge-confidence/)
|
[](https://docs.renovatebot.com/merge-confidence/)
|
[](https://docs.renovatebot.com/merge-confidence/)
|
---
### Release Notes
<details>
<summary>swc-project/swc (@​swc/core)</summary>
###
[`v1.3.92`](https://togithub.com/swc-project/swc/blob/HEAD/CHANGELOG.md#1392---2023-10-05)
[Compare
Source](https://togithub.com/swc-project/swc/compare/v1.3.91...v1.3.92)
##### Bug Fixes
- **(es/compat)** Fix scoping of `explicit-resource-management`
([#​8044](https://togithub.com/swc-project/swc/issues/8044))
([96a7a4d](https://togithub.com/swc-project/swc/commit/96a7a4d045d08547fed75c79a7156f79262edfc2))
- **(es/compat)** Transform default-exported class decorators correctly
([#​8050](https://togithub.com/swc-project/swc/issues/8050))
([a751f1c](https://togithub.com/swc-project/swc/commit/a751f1cfaf415917ab2a5e5098d9ca32bffa907b))
- **(es/compat)** Use `async` and `await` correctly in `block-scoping`
pass ([#​8056](https://togithub.com/swc-project/swc/issues/8056))
([8318ea8](https://togithub.com/swc-project/swc/commit/8318ea82c28d3cf55e701f6da2f3077efe8ca653))
- **(es/module)** Handle directives
([#​8048](https://togithub.com/swc-project/swc/issues/8048))
([4d8e101](https://togithub.com/swc-project/swc/commit/4d8e1013bb7775f60d463276cc3233ecd7849b31))
##### Miscellaneous Tasks
- **(ci)** Fix publish action
([8ddb0da](https://togithub.com/swc-project/swc/commit/8ddb0dafa25e21020f6378ee4c29fa286654ea30))
- **(ci)** Prepare multi-package repository
([#​8043](https://togithub.com/swc-project/swc/issues/8043))
([f2bc6a3](https://togithub.com/swc-project/swc/commit/f2bc6a3fcc7367726afe55b4fa4c6bde839fbd70))
- **(ci)** Fix publish action for minifier
([77b8591](https://togithub.com/swc-project/swc/commit/77b8591d86dee33c92277b4b2d301d8cb253c16b))
- Fix CI condition
([9c9c03b](https://togithub.com/swc-project/swc/commit/9c9c03b76b7de8df754437e3ee2d4ab5d079b96d))
- Fix CI
([0c8d8a3](https://togithub.com/swc-project/swc/commit/0c8d8a3f4ab24c41d209bf2fdd37703e0205f0c0))
- Configure `nissuer`
([#​8053](https://togithub.com/swc-project/swc/issues/8053))
([2a508bc](https://togithub.com/swc-project/swc/commit/2a508bcb9a7fb4d3323b4e08c0702b1191f95b96))
- Configure issue validator
([a555823](https://togithub.com/swc-project/swc/commit/a5558236b715e49dbbb7842edfb24baa7a3f0760))
- Mark reproduction link required
([c6e0a18](https://togithub.com/swc-project/swc/commit/c6e0a18292001cb46722b533213acdf374311edc))
- Update nissuer.yml
([#​8060](https://togithub.com/swc-project/swc/issues/8060))
([a2f1010](https://togithub.com/swc-project/swc/commit/a2f1010b4e312d972d901705da971b887b1b254a))
- Add `evanw.github.io` to the allowed repro hosts
([c26ee63](https://togithub.com/swc-project/swc/commit/c26ee63839df040644082ed6ff88bd2571c3af44))
##### Refactor
- **(cli)** Make CLI testable/managable with `swc-bump`
([#​8045](https://togithub.com/swc-project/swc/issues/8045))
([f717cf2](https://togithub.com/swc-project/swc/commit/f717cf21cc1cea5e30e87c4d08861daadb25ab14))
###
[`v1.3.91`](https://togithub.com/swc-project/swc/blob/HEAD/CHANGELOG.md#1391---2023-10-01)
[Compare
Source](https://togithub.com/swc-project/swc/compare/v1.3.90...v1.3.91)
##### Bug Fixes
- **(es/compat)** Use return statements for method and setter decorator
([#​8017](https://togithub.com/swc-project/swc/issues/8017))
([38bc710](https://togithub.com/swc-project/swc/commit/38bc71006ed6f46c0145e07acccce75f7be26553))
- **(es/compat)** Generate `OptCall` for `OptCall` for private fields
([#​8031](https://togithub.com/swc-project/swc/issues/8031))
([06b6eb9](https://togithub.com/swc-project/swc/commit/06b6eb999964c25a964b0105bd7a4f20b51300dd))
- **(es/minifier)** Check if object shorthand is skippable for seq
inliner
([#​8036](https://togithub.com/swc-project/swc/issues/8036))
([01391e3](https://togithub.com/swc-project/swc/commit/01391e3c13e42b7f42f80ab13b396cad182942ff))
- **(es/module)** Sort the exported ESM bindings
([#​8024](https://togithub.com/swc-project/swc/issues/8024))
([990ca06](https://togithub.com/swc-project/swc/commit/990ca06aca3242a789e165f4318c95d0bb64b02e))
- **(es/typescript)** Rename wrong `unresolved_mark`
([#​8018](https://togithub.com/swc-project/swc/issues/8018))
([5817268](https://togithub.com/swc-project/swc/commit/58172689ce7f8dd2f0a79d8771c52fe309880b44))
- **(es/typescript)** Preserve default value of an exported binding in a
namespace
([#​8029](https://togithub.com/swc-project/swc/issues/8029))
([cf96171](https://togithub.com/swc-project/swc/commit/cf96171a53589118a0103495169e02fed10a675f))
##### Documentation
- **(counter)** Document the purpose of the package
([#​8032](https://togithub.com/swc-project/swc/issues/8032))
([b6b5a4d](https://togithub.com/swc-project/swc/commit/b6b5a4d3a6f1c6c74d47c855081a8fee17066829))
##### Features
- **(bindings)** Create a minifier-only package
([#​7993](https://togithub.com/swc-project/swc/issues/7993))
([64d8f4b](https://togithub.com/swc-project/swc/commit/64d8f4b59f81c71bffbb906595bafa356f326924))
##### Miscellaneous Tasks
- **(ci)** Prepare `@swc/minifier`
([#​8027](https://togithub.com/swc-project/swc/issues/8027))
([8214b9e](https://togithub.com/swc-project/swc/commit/8214b9ed4e214dc6a52e7d2c80cd3b8ca87d3a12))
- **(ci)** Expose more crates to JS
([#​8033](https://togithub.com/swc-project/swc/issues/8033))
([186ecfa](https://togithub.com/swc-project/swc/commit/186ecfadb55430405d1a4e1400574a6e958f9458))
- **(ci)** Remove wrong `if`s
([dec68c3](https://togithub.com/swc-project/swc/commit/dec68c32126e38066feb813fce4635e7d40a8429))-
**general**: Fix yarn lockfile
([7f91274](https://togithub.com/swc-project/swc/commit/7f9127420867cba856faa4ede8ef62ec3146e382))-
**general**: Fix yarn lockfile
([c062536](https://togithub.com/swc-project/swc/commit/c0625361a1ad7537ca53a157fbdc8599fbbe2a44))
##### Refactor
- **(es)** Extract parser/codegen code for `swc::Compiler`
([#​8030](https://togithub.com/swc-project/swc/issues/8030))
([a13f5cb](https://togithub.com/swc-project/swc/commit/a13f5cbe03f067b376f9f3318ef822142551eb96))
- **(es/minifier)** Move JS options to `swc_ecma_minifier`
([#​8028](https://togithub.com/swc-project/swc/issues/8028))
([725f7f5](https://togithub.com/swc-project/swc/commit/725f7f5bda0881bdaac1bf1254f58e5341633d4e))
</details>
---
### Configuration
📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).
🚦 **Automerge**: Enabled.
♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.
🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.
---
- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box
---
This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/Unleash/unleash).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy44LjEiLCJ1cGRhdGVkSW5WZXIiOiIzNy44LjEiLCJ0YXJnZXRCcmFuY2giOiJtYWluIn0=-->
|
chore(deps): update dependency @swc/core to v1.3.92 (#5028)
[](https://renovatebot.com)
This PR contains the following updates:
| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [@swc/core](https://swc.rs)
([source](https://togithub.com/swc-project/swc)) | [`1.3.90` ->
`1.3.92`](https://renovatebot.com/diffs/npm/@swc%2fcore/1.3.90/1.3.92) |
[](https://docs.renovatebot.com/merge-confidence/)
|
[](https://docs.renovatebot.com/merge-confidence/)
|
[](https://docs.renovatebot.com/merge-confidence/)
|
[](https://docs.renovatebot.com/merge-confidence/)
|
---
### Release Notes
<details>
<summary>swc-project/swc (@​swc/core)</summary>
###
[`v1.3.92`](https://togithub.com/swc-project/swc/blob/HEAD/CHANGELOG.md#1392---2023-10-05)
[Compare
Source](https://togithub.com/swc-project/swc/compare/v1.3.91...v1.3.92)
##### Bug Fixes
- **(es/compat)** Fix scoping of `explicit-resource-management`
([#​8044](https://togithub.com/swc-project/swc/issues/8044))
([96a7a4d](https://togithub.com/swc-project/swc/commit/96a7a4d045d08547fed75c79a7156f79262edfc2))
- **(es/compat)** Transform default-exported class decorators correctly
([#​8050](https://togithub.com/swc-project/swc/issues/8050))
([a751f1c](https://togithub.com/swc-project/swc/commit/a751f1cfaf415917ab2a5e5098d9ca32bffa907b))
- **(es/compat)** Use `async` and `await` correctly in `block-scoping`
pass ([#​8056](https://togithub.com/swc-project/swc/issues/8056))
([8318ea8](https://togithub.com/swc-project/swc/commit/8318ea82c28d3cf55e701f6da2f3077efe8ca653))
- **(es/module)** Handle directives
([#​8048](https://togithub.com/swc-project/swc/issues/8048))
([4d8e101](https://togithub.com/swc-project/swc/commit/4d8e1013bb7775f60d463276cc3233ecd7849b31))
##### Miscellaneous Tasks
- **(ci)** Fix publish action
([8ddb0da](https://togithub.com/swc-project/swc/commit/8ddb0dafa25e21020f6378ee4c29fa286654ea30))
- **(ci)** Prepare multi-package repository
([#​8043](https://togithub.com/swc-project/swc/issues/8043))
([f2bc6a3](https://togithub.com/swc-project/swc/commit/f2bc6a3fcc7367726afe55b4fa4c6bde839fbd70))
- **(ci)** Fix publish action for minifier
([77b8591](https://togithub.com/swc-project/swc/commit/77b8591d86dee33c92277b4b2d301d8cb253c16b))
- Fix CI condition
([9c9c03b](https://togithub.com/swc-project/swc/commit/9c9c03b76b7de8df754437e3ee2d4ab5d079b96d))
- Fix CI
([0c8d8a3](https://togithub.com/swc-project/swc/commit/0c8d8a3f4ab24c41d209bf2fdd37703e0205f0c0))
- Configure `nissuer`
([#​8053](https://togithub.com/swc-project/swc/issues/8053))
([2a508bc](https://togithub.com/swc-project/swc/commit/2a508bcb9a7fb4d3323b4e08c0702b1191f95b96))
- Configure issue validator
([a555823](https://togithub.com/swc-project/swc/commit/a5558236b715e49dbbb7842edfb24baa7a3f0760))
- Mark reproduction link required
([c6e0a18](https://togithub.com/swc-project/swc/commit/c6e0a18292001cb46722b533213acdf374311edc))
- Update nissuer.yml
([#​8060](https://togithub.com/swc-project/swc/issues/8060))
([a2f1010](https://togithub.com/swc-project/swc/commit/a2f1010b4e312d972d901705da971b887b1b254a))
- Add `evanw.github.io` to the allowed repro hosts
([c26ee63](https://togithub.com/swc-project/swc/commit/c26ee63839df040644082ed6ff88bd2571c3af44))
##### Refactor
- **(cli)** Make CLI testable/managable with `swc-bump`
([#​8045](https://togithub.com/swc-project/swc/issues/8045))
([f717cf2](https://togithub.com/swc-project/swc/commit/f717cf21cc1cea5e30e87c4d08861daadb25ab14))
###
[`v1.3.91`](https://togithub.com/swc-project/swc/blob/HEAD/CHANGELOG.md#1391---2023-10-01)
[Compare
Source](https://togithub.com/swc-project/swc/compare/v1.3.90...v1.3.91)
##### Bug Fixes
- **(es/compat)** Use return statements for method and setter decorator
([#​8017](https://togithub.com/swc-project/swc/issues/8017))
([38bc710](https://togithub.com/swc-project/swc/commit/38bc71006ed6f46c0145e07acccce75f7be26553))
- **(es/compat)** Generate `OptCall` for `OptCall` for private fields
([#​8031](https://togithub.com/swc-project/swc/issues/8031))
([06b6eb9](https://togithub.com/swc-project/swc/commit/06b6eb999964c25a964b0105bd7a4f20b51300dd))
- **(es/minifier)** Check if object shorthand is skippable for seq
inliner
([#​8036](https://togithub.com/swc-project/swc/issues/8036))
([01391e3](https://togithub.com/swc-project/swc/commit/01391e3c13e42b7f42f80ab13b396cad182942ff))
- **(es/module)** Sort the exported ESM bindings
([#​8024](https://togithub.com/swc-project/swc/issues/8024))
([990ca06](https://togithub.com/swc-project/swc/commit/990ca06aca3242a789e165f4318c95d0bb64b02e))
- **(es/typescript)** Rename wrong `unresolved_mark`
([#​8018](https://togithub.com/swc-project/swc/issues/8018))
([5817268](https://togithub.com/swc-project/swc/commit/58172689ce7f8dd2f0a79d8771c52fe309880b44))
- **(es/typescript)** Preserve default value of an exported binding in a
namespace
([#​8029](https://togithub.com/swc-project/swc/issues/8029))
([cf96171](https://togithub.com/swc-project/swc/commit/cf96171a53589118a0103495169e02fed10a675f))
##### Documentation
- **(counter)** Document the purpose of the package
([#​8032](https://togithub.com/swc-project/swc/issues/8032))
([b6b5a4d](https://togithub.com/swc-project/swc/commit/b6b5a4d3a6f1c6c74d47c855081a8fee17066829))
##### Features
- **(bindings)** Create a minifier-only package
([#​7993](https://togithub.com/swc-project/swc/issues/7993))
([64d8f4b](https://togithub.com/swc-project/swc/commit/64d8f4b59f81c71bffbb906595bafa356f326924))
##### Miscellaneous Tasks
- **(ci)** Prepare `@swc/minifier`
([#​8027](https://togithub.com/swc-project/swc/issues/8027))
([8214b9e](https://togithub.com/swc-project/swc/commit/8214b9ed4e214dc6a52e7d2c80cd3b8ca87d3a12))
- **(ci)** Expose more crates to JS
([#​8033](https://togithub.com/swc-project/swc/issues/8033))
([186ecfa](https://togithub.com/swc-project/swc/commit/186ecfadb55430405d1a4e1400574a6e958f9458))
- **(ci)** Remove wrong `if`s
([dec68c3](https://togithub.com/swc-project/swc/commit/dec68c32126e38066feb813fce4635e7d40a8429))-
**general**: Fix yarn lockfile
([7f91274](https://togithub.com/swc-project/swc/commit/7f9127420867cba856faa4ede8ef62ec3146e382))-
**general**: Fix yarn lockfile
([c062536](https://togithub.com/swc-project/swc/commit/c0625361a1ad7537ca53a157fbdc8599fbbe2a44))
##### Refactor
- **(es)** Extract parser/codegen code for `swc::Compiler`
([#​8030](https://togithub.com/swc-project/swc/issues/8030))
([a13f5cb](https://togithub.com/swc-project/swc/commit/a13f5cbe03f067b376f9f3318ef822142551eb96))
- **(es/minifier)** Move JS options to `swc_ecma_minifier`
([#​8028](https://togithub.com/swc-project/swc/issues/8028))
([725f7f5](https://togithub.com/swc-project/swc/commit/725f7f5bda0881bdaac1bf1254f58e5341633d4e))
</details>
---
### Configuration
📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).
🚦 **Automerge**: Enabled.
♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.
🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.
---
- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box
---
This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/Unleash/unleash).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy44LjEiLCJ1cGRhdGVkSW5WZXIiOiIzNy44LjEiLCJ0YXJnZXRCcmFuY2giOiJtYWluIn0=-->
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
|
diff --git a/package.json b/package.json
index 8b47def61aae..6b92c8a83ede 100644
--- a/package.json
+++ b/package.json
@@ -151,7 +151,7 @@
"devDependencies": {
"@apidevtools/swagger-parser": "10.1.0",
"@babel/core": "7.23.0",
- "@swc/core": "1.3.90",
+ "@swc/core": "1.3.92",
"@biomejs/biome": "1.2.2",
"@swc/jest": "0.2.29",
"@types/bcryptjs": "2.4.4",
diff --git a/yarn.lock b/yarn.lock
index 9b21363b61b1..ee85e50a7575 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1100,74 +1100,74 @@
p-queue "^6.6.1"
p-retry "^4.0.0"
-"@swc/[email protected]":
- version "1.3.90"
- resolved "https://registry.yarnpkg.com/@swc/core-darwin-arm64/-/core-darwin-arm64-1.3.90.tgz#5eb85b4911c6e1a8a082711b7ef3d4be3f86163f"
- integrity sha512-he0w74HvcoufE6CZrB/U/VGVbc7021IQvYrn1geMACnq/OqMBqjdczNtdNfJAy87LZ4AOUjHDKEIjsZZu7o8nQ==
-
-"@swc/[email protected]":
- version "1.3.90"
- resolved "https://registry.yarnpkg.com/@swc/core-darwin-x64/-/core-darwin-x64-1.3.90.tgz#e6d5c2118c6ad060f58ce9c7d246cf4c30420516"
- integrity sha512-hKNM0Ix0qMlAamPe0HUfaAhQVbZEL5uK6Iw8v9ew0FtVB4v7EifQ9n41wh+yCj0CjcHBPEBbQU0P6mNTxJu/RQ==
-
-"@swc/[email protected]":
- version "1.3.90"
- resolved "https://registry.yarnpkg.com/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.3.90.tgz#02cfecb0e5f3457e64e81eca70337c6dadba864d"
- integrity sha512-HumvtrqTWE8rlFuKt7If0ZL7145H/jVc4AeziVjcd+/ajpqub7IyfrLCYd5PmKMtfeSVDMsxjG0BJ0HLRxrTJA==
-
-"@swc/[email protected]":
- version "1.3.90"
- resolved "https://registry.yarnpkg.com/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.3.90.tgz#1ed87e65facc446880f5753fb89951da418f6ff5"
- integrity sha512-tA7DqCS7YCwngwXZQeqQhhMm8BbydpaABw8Z/EDQ7KPK1iZ1rNjZw+aWvSpmNmEGmH1RmQ9QDS9mGRDp0faAeg==
-
-"@swc/[email protected]":
- version "1.3.90"
- resolved "https://registry.yarnpkg.com/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.3.90.tgz#531edd90f46aa7282e919178633f483f7ba073d6"
- integrity sha512-p2Vtid5BZA36fJkNUwk5HP+HJlKgTru+Ghna7pRe45ghKkkRIUk3fhkgudEvfKfhT+3AvP+GTVQ+T9k0gc9S8w==
-
-"@swc/[email protected]":
- version "1.3.90"
- resolved "https://registry.yarnpkg.com/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.3.90.tgz#7b3937570964e290a0f382353d88fe8421ceb470"
- integrity sha512-J6pDtWaulYGXuANERuvv4CqmUbZOQrRZBCRQGZQJ6a86RWpesZqckBelnYx48wYmkgvMkF95Y3xbI3WTfoSHzw==
-
-"@swc/[email protected]":
- version "1.3.90"
- resolved "https://registry.yarnpkg.com/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.3.90.tgz#ae042d8dc84e086954a26308e4bccf6f38c1dafe"
- integrity sha512-3Gh6EA3+0K+l3MqnRON7h5bZ32xLmfcVM6QiHHJ9dBttq7YOEeEoMOCdIPMaQxJmK1VfLgZCsPYRd66MhvUSkw==
-
-"@swc/[email protected]":
- version "1.3.90"
- resolved "https://registry.yarnpkg.com/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.3.90.tgz#4952413bae4c5dbd7c150f7a626556fc6a2a3525"
- integrity sha512-BNaw/iJloDyaNOFV23Sr53ULlnbmzSoerTJ10v0TjSZOEIpsS0Rw6xOK1iI0voDJnRXeZeWRSxEC9DhefNtN/g==
-
-"@swc/[email protected]":
- version "1.3.90"
- resolved "https://registry.yarnpkg.com/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.3.90.tgz#ea5d417d3085dc521e6be6ecaef8c6ca59c4e5ec"
- integrity sha512-SiyTethWAheE/JbxXCukAAciU//PLcmVZ2ME92MRuLMLmOhrwksjbaa7ukj9WEF3LWrherhSqTXnpj3VC1l/qw==
-
-"@swc/[email protected]":
- version "1.3.90"
- resolved "https://registry.yarnpkg.com/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.3.90.tgz#af770b063fe7f32488a87cf0a9777e11932f7a3a"
- integrity sha512-OpWAW5ljKcPJ3SQ0pUuKqYfwXv7ssIhVgrH9XP9ONtdgXKWZRL9hqJQkcL55FARw/gDjKanoCM47wsTNQL+ZZA==
-
-"@swc/[email protected]":
- version "1.3.90"
- resolved "https://registry.yarnpkg.com/@swc/core/-/core-1.3.90.tgz#ef43524b76ef04798e6afb01d90347f4f51de136"
- integrity sha512-wptBxP4PldOnhmyDVj8qUcn++GRqyw1qc9wOTGtPNHz8cpuTfdfIgYGlhI4La0UYqecuaaIfLfokyuNePOMHPg==
+"@swc/[email protected]":
+ version "1.3.92"
+ resolved "https://registry.yarnpkg.com/@swc/core-darwin-arm64/-/core-darwin-arm64-1.3.92.tgz#0498d3584cf877e39107c94705c38fa4a8c04789"
+ integrity sha512-v7PqZUBtIF6Q5Cp48gqUiG8zQQnEICpnfNdoiY3xjQAglCGIQCjJIDjreZBoeZQZspB27lQN4eZ43CX18+2SnA==
+
+"@swc/[email protected]":
+ version "1.3.92"
+ resolved "https://registry.yarnpkg.com/@swc/core-darwin-x64/-/core-darwin-x64-1.3.92.tgz#1728e7ebbfe37b56c07d99e29dde78bfa90cf8d1"
+ integrity sha512-Q3XIgQfXyxxxms3bPN+xGgvwk0TtG9l89IomApu+yTKzaIIlf051mS+lGngjnh9L0aUiCp6ICyjDLtutWP54fw==
+
+"@swc/[email protected]":
+ version "1.3.92"
+ resolved "https://registry.yarnpkg.com/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.3.92.tgz#6f7c20833b739f8911c936c9783976ded2c449dc"
+ integrity sha512-tnOCoCpNVXC+0FCfG84PBZJyLlz0Vfj9MQhyhCvlJz9hQmvpf8nTdKH7RHrOn8VfxtUBLdVi80dXgIFgbvl7qA==
+
+"@swc/[email protected]":
+ version "1.3.92"
+ resolved "https://registry.yarnpkg.com/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.3.92.tgz#bb01dd9b922b0c076c38924013bd10036ce39c7c"
+ integrity sha512-lFfGhX32w8h1j74Iyz0Wv7JByXIwX11OE9UxG+oT7lG0RyXkF4zKyxP8EoxfLrDXse4Oop434p95e3UNC3IfCw==
+
+"@swc/[email protected]":
+ version "1.3.92"
+ resolved "https://registry.yarnpkg.com/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.3.92.tgz#0070165eed2805475c98eb732bab8bdca955932e"
+ integrity sha512-rOZtRcLj57MSAbiecMsqjzBcZDuaCZ8F6l6JDwGkQ7u1NYR57cqF0QDyU7RKS1Jq27Z/Vg21z5cwqoH5fLN+Sg==
+
+"@swc/[email protected]":
+ version "1.3.92"
+ resolved "https://registry.yarnpkg.com/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.3.92.tgz#d9785f93b9121eeef0f54e8d845dd216698e0115"
+ integrity sha512-qptoMGnBL6v89x/Qpn+l1TH1Y0ed+v0qhNfAEVzZvCvzEMTFXphhlhYbDdpxbzRmCjH6GOGq7Y+xrWt9T1/ARg==
+
+"@swc/[email protected]":
+ version "1.3.92"
+ resolved "https://registry.yarnpkg.com/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.3.92.tgz#8fe5cf244695bf4f0bc7dc7df450a9bd1bfccc2b"
+ integrity sha512-g2KrJ43bZkCZHH4zsIV5ErojuV1OIpUHaEyW1gf7JWKaFBpWYVyubzFPvPkjcxHGLbMsEzO7w/NVfxtGMlFH/Q==
+
+"@swc/[email protected]":
+ version "1.3.92"
+ resolved "https://registry.yarnpkg.com/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.3.92.tgz#d6150785455c813a8e62f4e4b0a22773baf398eb"
+ integrity sha512-3MCRGPAYDoQ8Yyd3WsCMc8eFSyKXY5kQLyg/R5zEqA0uthomo0m0F5/fxAJMZGaSdYkU1DgF73ctOWOf+Z/EzQ==
+
+"@swc/[email protected]":
+ version "1.3.92"
+ resolved "https://registry.yarnpkg.com/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.3.92.tgz#8142166bceafbaa209d440b36fdc8cd4b4f82768"
+ integrity sha512-zqTBKQhgfWm73SVGS8FKhFYDovyRl1f5dTX1IwSKynO0qHkRCqJwauFJv/yevkpJWsI2pFh03xsRs9HncTQKSA==
+
+"@swc/[email protected]":
+ version "1.3.92"
+ resolved "https://registry.yarnpkg.com/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.3.92.tgz#4ba542875fc690b579232721ccec7873e139646a"
+ integrity sha512-41bE66ddr9o/Fi1FBh0sHdaKdENPTuDpv1IFHxSg0dJyM/jX8LbkjnpdInYXHBxhcLVAPraVRrNsC4SaoPw2Pg==
+
+"@swc/[email protected]":
+ version "1.3.92"
+ resolved "https://registry.yarnpkg.com/@swc/core/-/core-1.3.92.tgz#f51808cdb6cbb90b0877b9a51806eea9a70eafca"
+ integrity sha512-vx0vUrf4YTEw59njOJ46Ha5i0cZTMYdRHQ7KXU29efN1MxcmJH2RajWLPlvQarOP1ab9iv9cApD7SMchDyx2vA==
dependencies:
"@swc/counter" "^0.1.1"
"@swc/types" "^0.1.5"
optionalDependencies:
- "@swc/core-darwin-arm64" "1.3.90"
- "@swc/core-darwin-x64" "1.3.90"
- "@swc/core-linux-arm-gnueabihf" "1.3.90"
- "@swc/core-linux-arm64-gnu" "1.3.90"
- "@swc/core-linux-arm64-musl" "1.3.90"
- "@swc/core-linux-x64-gnu" "1.3.90"
- "@swc/core-linux-x64-musl" "1.3.90"
- "@swc/core-win32-arm64-msvc" "1.3.90"
- "@swc/core-win32-ia32-msvc" "1.3.90"
- "@swc/core-win32-x64-msvc" "1.3.90"
+ "@swc/core-darwin-arm64" "1.3.92"
+ "@swc/core-darwin-x64" "1.3.92"
+ "@swc/core-linux-arm-gnueabihf" "1.3.92"
+ "@swc/core-linux-arm64-gnu" "1.3.92"
+ "@swc/core-linux-arm64-musl" "1.3.92"
+ "@swc/core-linux-x64-gnu" "1.3.92"
+ "@swc/core-linux-x64-musl" "1.3.92"
+ "@swc/core-win32-arm64-msvc" "1.3.92"
+ "@swc/core-win32-ia32-msvc" "1.3.92"
+ "@swc/core-win32-x64-msvc" "1.3.92"
"@swc/counter@^0.1.1":
version "0.1.1"
|
nomad
|
https://github.com/hashicorp/nomad
|
717fddb521e30f60977b5effd054fe6780d384c5
|
dependabot[bot]
|
2022-11-30 01:25:17
|
build(deps): bump google.golang.org/grpc from 1.50.1 to 1.51.0 (#15402)
|
* build(deps): bump google.golang.org/grpc from 1.50.1 to 1.51.0
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.50.1 to 1.51.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.50.1...v1.51.0)
---
|
build(deps): bump google.golang.org/grpc from 1.50.1 to 1.51.0 (#15402)
* build(deps): bump google.golang.org/grpc from 1.50.1 to 1.51.0
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.50.1 to 1.51.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.50.1...v1.51.0)
---
updated-dependencies:
- dependency-name: google.golang.org/grpc
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <[email protected]>
* changelog: add entry for #15402
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Luiz Aoqui <[email protected]>
|
diff --git a/.changelog/15402.txt b/.changelog/15402.txt
new file mode 100644
index 00000000000..1354428a04e
--- /dev/null
+++ b/.changelog/15402.txt
@@ -0,0 +1,3 @@
+```release-note:improvement
+deps: Update google.golang.org/grpc to v1.51.0
+```
diff --git a/go.mod b/go.mod
index 790c977275b..2cc629a9b3b 100644
--- a/go.mod
+++ b/go.mod
@@ -123,7 +123,7 @@ require (
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4
golang.org/x/sys v0.2.0
golang.org/x/time v0.0.0-20220224211638-0e9765cccd65
- google.golang.org/grpc v1.50.1
+ google.golang.org/grpc v1.51.0
google.golang.org/protobuf v1.28.1
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7
gopkg.in/tomb.v2 v2.0.0-20140626144623-14b3d72120e8
diff --git a/go.sum b/go.sum
index de1590c30f1..78835b23f41 100644
--- a/go.sum
+++ b/go.sum
@@ -1853,8 +1853,8 @@ google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnD
google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34=
google.golang.org/grpc v1.41.0/go.mod h1:U3l9uK9J0sini8mHphKoXyaqDA/8VyGnDee1zzIUK6k=
google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ=
-google.golang.org/grpc v1.50.1 h1:DS/BukOZWp8s6p4Dt/tOaJaTQyPyOoCcrjroHuCeLzY=
-google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI=
+google.golang.org/grpc v1.51.0 h1:E1eGv1FTqoLIdnBCZufiSHgKjlqG6fKFf6pPWtMTh8U=
+google.golang.org/grpc v1.51.0/go.mod h1:wgNDFcnuBGmxLKI/qn4T+m5BtEBYXJPvibbUPsAIPww=
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
|
node
|
https://github.com/nodejs/node
|
70bc62eaf8a5b856fa025d59064773c21ecd449b
|
Michael Dawson
|
2019-09-09 02:05:55
|
build: update minimum AIX OS level
|
Update minimum AIX OS level to 7.2 TL2. Looks like this
will be the version we can get into the CI so should be the
base level for 13.X and above and will be in support for the life
of 13.X.
|
build: update minimum AIX OS level
Update minimum AIX OS level to 7.2 TL2. Looks like this
will be the version we can get into the CI so should be the
base level for 13.X and above and will be in support for the life
of 13.X.
PR-URL: https://github.com/nodejs/node/pull/29476
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: David Carlier <[email protected]>
Reviewed-By: Jiawen Geng <[email protected]>
Reviewed-By: Minwoo Jung <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
|
diff --git a/BUILDING.md b/BUILDING.md
index aeb54583e90da2..7fed3f9bdd084d 100644
--- a/BUILDING.md
+++ b/BUILDING.md
@@ -116,7 +116,7 @@ platforms. This is true regardless of entries in the table below.
| Windows | arm64 | >= Windows 10 | Experimental | |
| macOS | x64 | >= 10.11 | Tier 1 | |
| SmartOS | x64 | >= 18 | Tier 2 | |
-| AIX | ppc64be >=power7 | >= 7.1 TL05 | Tier 2 | |
+| AIX | ppc64be >=power7 | >= 7.2 TL02 | Tier 2 | |
| FreeBSD | x64 | >= 11 | Experimental | Downgraded as of Node.js 12 |
<em id="fn1">1</em>: GCC 6 is not provided on the base platform, users will
|
node
|
https://github.com/nodejs/node
|
8dcb82db38e4dd7e8748622fb2494a0571d85f28
|
Johan Bergström
|
2016-04-01 22:06:01
|
build: introduce ci targets for lint/benchmark
|
Introduce two new targets we will populate with actions
once merged into all branches we need to support through CI.
|
build: introduce ci targets for lint/benchmark
Introduce two new targets we will populate with actions
once merged into all branches we need to support through CI.
PR-URL: https://github.com/nodejs/node/pull/5921
Reviewed-By: Brian White <[email protected]>
Reviewed-By: Myles Borins <[email protected]>
Reviewed-By: João Reis <[email protected]>
Reviewed-By: James M Snell <[email protected]>
|
diff --git a/Makefile b/Makefile
index f3cf43d0830dd7..401464c87a6960 100644
--- a/Makefile
+++ b/Makefile
@@ -592,6 +592,8 @@ bench-all: bench bench-misc bench-array bench-buffer bench-url bench-events benc
bench: bench-net bench-http bench-fs bench-tls
+bench-ci: bench
+
bench-http-simple:
benchmark/http_simple_bench.sh
@@ -638,10 +640,12 @@ lint:
"$ git clone https://github.com/nodejs/node.git"
endif
+lint-ci: lint
+
.PHONY: lint cpplint jslint bench clean docopen docclean doc dist distclean \
check uninstall install install-includes install-bin all staticlib \
dynamiclib test test-all test-addons build-addons website-upload pkg \
blog blogclean tar binary release-only bench-http-simple bench-idle \
bench-all bench bench-misc bench-array bench-buffer bench-net \
bench-http bench-fs bench-tls cctest run-ci test-v8 test-v8-intl \
- test-v8-benchmarks test-v8-all v8
+ test-v8-benchmarks test-v8-all v8 lint-ci bench-ci
|
sentry
|
https://github.com/getsentry/sentry
|
4b41180dfb7b42e5dff004b496bbf2fcaf051d68
|
Markus Unterwaditzer
|
2020-01-17 17:56:12
|
fix(relay): Add missing public keys to Redis cache (#16487)
|
Due to some odd behavior in relay.config.get_project_config we have to prefetch all keys everytime we call this function. I hope we can get rid of this stupid behavior once Python store is gone.
Also remove an invalid usage of get_many_from_cache, which basically only works on primary keys. Luckily this did not cause any misbehavior because get_many_from_cache detected the case and fell back to a DB query.
|
fix(relay): Add missing public keys to Redis cache (#16487)
Due to some odd behavior in relay.config.get_project_config we have to prefetch all keys everytime we call this function. I hope we can get rid of this stupid behavior once Python store is gone.
Also remove an invalid usage of get_many_from_cache, which basically only works on primary keys. Luckily this did not cause any misbehavior because get_many_from_cache detected the case and fell back to a DB query.
|
diff --git a/src/sentry/api/endpoints/relay_projectconfigs.py b/src/sentry/api/endpoints/relay_projectconfigs.py
index f8159dd08d2f23..103fef2ef811e3 100644
--- a/src/sentry/api/endpoints/relay_projectconfigs.py
+++ b/src/sentry/api/endpoints/relay_projectconfigs.py
@@ -67,7 +67,7 @@ def _post(self, request):
with Hub.current.start_span(op="relay_fetch_keys"):
project_keys = {}
- for key in ProjectKey.objects.get_many_from_cache(project_ids, key="project_id"):
+ for key in ProjectKey.objects.filter(project_id__in=project_ids):
project_keys.setdefault(key.project_id, []).append(key)
metrics.timing("relay_project_configs.projects_requested", len(project_ids))
diff --git a/src/sentry/db/models/manager.py b/src/sentry/db/models/manager.py
index 7446c30fe258e8..c2d87167157d41 100644
--- a/src/sentry/db/models/manager.py
+++ b/src/sentry/db/models/manager.py
@@ -324,6 +324,15 @@ def get_many_from_cache(self, values, key="pk"):
Wrapper around `QuerySet.filter(pk__in=values)` which supports caching of
the intermediate value. Callee is responsible for making sure the
cache key is cleared on save.
+
+ NOTE: We can only query by primary key or some other unique identifier.
+ It is not possible to e.g. run `Project.objects.get_many_from_cache([1,
+ 2, 3], key="organization_id")` and get back all projects belonging to
+ those orgs. The length of the return value is bounded by the length of
+ `values`.
+
+ For most models, if one attempts to use a non-PK value this will just
+ degrade to a DB query, like with `get_from_cache`.
"""
pk_name = self.model._meta.pk.name
diff --git a/src/sentry/tasks/relay.py b/src/sentry/tasks/relay.py
index 47a62b97402f4e..55970668641851 100644
--- a/src/sentry/tasks/relay.py
+++ b/src/sentry/tasks/relay.py
@@ -5,6 +5,7 @@
from django.conf import settings
from django.core.cache import cache
+from sentry.models.projectkey import ProjectKey
from sentry.tasks.base import instrumented_task
from sentry.utils import metrics
@@ -47,12 +48,18 @@ def update_config_cache(generate, organization_id=None, project_id=None, update_
projects = Project.objects.filter(organization_id=organization_id)
if generate:
- projectconfig_cache.set_many(
- {
- project.id: get_project_config(project, full_config=True).to_dict()
- for project in projects
- }
- )
+ project_keys = {}
+ for key in ProjectKey.objects.filter(project_id__in=[project.id for project in projects]):
+ project_keys.setdefault(key.project_id, []).append(key)
+
+ project_configs = {}
+ for project in projects:
+ project_config = get_project_config(
+ project, project_keys=project_keys.get(project.id, []), full_config=True
+ )
+ project_configs[project.id] = project_config.to_dict()
+
+ projectconfig_cache.set_many(project_configs)
else:
projectconfig_cache.delete_many([project.id for project in projects])
diff --git a/tests/sentry/tasks/test_relay.py b/tests/sentry/tasks/test_relay.py
index 7aab134cc88a31..18e3d3a2860aaa 100644
--- a/tests/sentry/tasks/test_relay.py
+++ b/tests/sentry/tasks/test_relay.py
@@ -68,6 +68,7 @@ def test_generate(
monkeypatch,
default_project,
default_organization,
+ default_projectkey,
task_runner,
entire_organization,
redis_cache,
@@ -86,6 +87,14 @@ def test_generate(
assert cfg["organizationId"] == default_organization.id
assert cfg["projectId"] == default_project.id
+ assert cfg["publicKeys"] == [
+ {
+ "publicKey": default_projectkey.public_key,
+ "isEnabled": True,
+ "numericId": default_projectkey.id,
+ "quotas": [],
+ }
+ ]
@pytest.mark.django_db
|
FXGL
|
https://github.com/AlmasB/FXGL
|
74cfdb50a9c6dad3fb4f74ba3ccdb36719fc7854
|
Ben Highgate
|
2023-03-29 00:23:04
|
test: added matrix 3x3 test (#1258)
|
* began implementation of UI font size scaling
|
test: added matrix 3x3 test (#1258)
* began implementation of UI font size scaling
|
diff --git a/fxgl-entity/src/test/kotlin/com/almasb/fxgl/physics/box2d/common/Mat33Test.kt b/fxgl-entity/src/test/kotlin/com/almasb/fxgl/physics/box2d/common/Mat33Test.kt
new file mode 100644
index 000000000..91055af7a
--- /dev/null
+++ b/fxgl-entity/src/test/kotlin/com/almasb/fxgl/physics/box2d/common/Mat33Test.kt
@@ -0,0 +1,76 @@
+/*
+ * FXGL - JavaFX Game Library. The MIT License (MIT).
+ * Copyright (c) AlmasB ([email protected]).
+ * See LICENSE for details.
+ */
+
+package com.almasb.fxgl.physics.box2d.common
+
+import com.almasb.fxgl.core.math.Vec3
+import org.hamcrest.CoreMatchers.*
+import org.hamcrest.MatcherAssert.*
+import org.junit.jupiter.api.Assertions.assertEquals
+import org.junit.jupiter.api.Test
+
+/**
+ * @author Ben Highgate ([email protected])
+ */
+class Mat33Test {
+
+ @Test
+ fun `Matrix mul vector`() {
+ val mat = Mat33()
+
+ mat.ex.set(3f, 4f, 2f)
+ mat.ey.set(6f, 2f, 5f)
+ mat.ez.set(4f, 3f, 3f)
+
+ val v = Vec3(2f, 1f, 4f)
+
+ // [ 3 6 4 ] x [ 2 ] = [ 28 ]
+ // [ 4 2 3 ] [ 1 ] [ 22 ]
+ // [ 2 5 3 ] [ 4 ] [ 21 ]
+
+ val out = Vec3()
+
+ Mat33.mulToOutUnsafe(mat, v, out)
+
+ assertThat(out, `is`(Vec3(28f, 22f, 21f)))
+ }
+
+ @Test
+ fun `Solve Ax = b`() {
+ val A = Mat33()
+ A.ex.set(3.0f, 4.0f, 2.0f)
+ A.ey.set(6.0f, 2.0f, 5.0f)
+ A.ez.set(4.0f, 3.0f, 3.0f)
+
+ val b = Vec3(28.0f, 22.0f, 21.0f)
+ val out = Vec3()
+
+ // [ 3 6 4 ] x [ 2 ] = [ 28 ]
+ // [ 4 2 3 ] [ 1 ] [ 22 ]
+ // [ 2 5 3 ] [ 4 ] [ 21 ]
+
+ A.solve33ToOut(b, out)
+
+ assertEquals(2.0f, out.x, 0.0001f)
+ assertEquals(1.0f, out.y, 0.0001f)
+ assertEquals(4.0f, out.z, 0.0001f)
+ }
+
+ @Test
+ fun `Symmetrical Invert`() {
+ val A = Mat33()
+ A.ex.set(3.0f, 4.0f, 2.0f)
+ A.ey.set(6.0f, 2.0f, 5.0f)
+ A.ez.set(4.0f, 3.0f, 3.0f)
+
+ val b = Mat33()
+ A.getSymInverse33(b)
+
+ assertThat(b.ex, `is`(Vec3(-3.0f, -6.0f, 10.0f)))
+ assertThat(b.ey, `is`(Vec3(-6.0f, -7.0f, 15.0f)))
+ assertThat(b.ez, `is`(Vec3(10.0f, 15.0f, -30.0f)))
+ }
+}
\ No newline at end of file
diff --git a/fxgl-scene/src/main/kotlin/com/almasb/fxgl/ui/FXGLDialogFactoryServiceProvider.kt b/fxgl-scene/src/main/kotlin/com/almasb/fxgl/ui/FXGLDialogFactoryServiceProvider.kt
index 55e114aeb..9b592e22f 100644
--- a/fxgl-scene/src/main/kotlin/com/almasb/fxgl/ui/FXGLDialogFactoryServiceProvider.kt
+++ b/fxgl-scene/src/main/kotlin/com/almasb/fxgl/ui/FXGLDialogFactoryServiceProvider.kt
@@ -6,6 +6,7 @@
package com.almasb.fxgl.ui
+import com.almasb.fxgl.core.Inject
import com.almasb.fxgl.core.util.EmptyRunnable
import com.almasb.fxgl.localization.LocalizationService
import javafx.beans.binding.StringBinding
@@ -34,6 +35,9 @@ import java.util.function.Predicate
*/
class FXGLDialogFactoryServiceProvider : DialogFactoryService() {
+ @Inject("fontSizeScaleUI")
+ private var fontSizeScaleUI = 1.0
+
private lateinit var uiFactory: UIFactoryService
private lateinit var local: LocalizationService
@@ -286,7 +290,7 @@ class FXGLDialogFactoryServiceProvider : DialogFactoryService() {
}
private fun createMessage(message: String): Text {
- return uiFactory.newText(message)
+ return uiFactory.newText(message, fontSizeScaleUI * 18.0)
}
private fun localizedStringProperty(key: String): StringBinding {
diff --git a/fxgl/src/main/kotlin/com/almasb/fxgl/app/Settings.kt b/fxgl/src/main/kotlin/com/almasb/fxgl/app/Settings.kt
index 86e51be3a..1d1b32de4 100644
--- a/fxgl/src/main/kotlin/com/almasb/fxgl/app/Settings.kt
+++ b/fxgl/src/main/kotlin/com/almasb/fxgl/app/Settings.kt
@@ -241,6 +241,11 @@ class GameSettings(
var soundMenuPress: String = "menu/press.wav",
var soundMenuSelect: String = "menu/select.wav",
+ /**
+ * Set the scale value for UI text size, default = 1.0.
+ */
+ var fontSizeScaleUI: Double = 1.0,
+
var pixelsPerMeter: Double = 50.0,
var collisionDetectionStrategy: CollisionDetectionStrategy = CollisionDetectionStrategy.BRUTE_FORCE,
@@ -391,6 +396,7 @@ class GameSettings(
soundMenuBack,
soundMenuPress,
soundMenuSelect,
+ fontSizeScaleUI,
pixelsPerMeter,
collisionDetectionStrategy,
secondsIn24h,
@@ -562,6 +568,8 @@ class ReadOnlyGameSettings internal constructor(
val soundMenuPress: String,
val soundMenuSelect: String,
+ val fontSizeScaleUI: Double,
+
val pixelsPerMeter: Double,
val collisionDetectionStrategy: CollisionDetectionStrategy,
|
svelte
|
https://github.com/sveltejs/svelte
|
a074734ba79a1d91f259cb02314b9e067b7dd8e3
|
Dominic Gannaway
|
2024-05-23 19:31:42
|
fix: ensure we clear down each block opening anchors from document (#11740)
|
* fix: ensure we clear down each block opening anchors from document
* fix: ensure we clear down each block opening anchors from document
|
fix: ensure we clear down each block opening anchors from document (#11740)
* fix: ensure we clear down each block opening anchors from document
* fix: ensure we clear down each block opening anchors from document
|
diff --git a/.changeset/silent-rabbits-join.md b/.changeset/silent-rabbits-join.md
new file mode 100644
index 000000000000..82f157d9dfbb
--- /dev/null
+++ b/.changeset/silent-rabbits-join.md
@@ -0,0 +1,5 @@
+---
+"svelte": patch
+---
+
+fix: ensure we clear down each block opening anchors from document
diff --git a/packages/svelte/src/internal/client/dom/blocks/each.js b/packages/svelte/src/internal/client/dom/blocks/each.js
index b0c87d6e5813..9867ed008ab8 100644
--- a/packages/svelte/src/internal/client/dom/blocks/each.js
+++ b/packages/svelte/src/internal/client/dom/blocks/each.js
@@ -280,7 +280,7 @@ function reconcile(array, state, anchor, render_fn, flags, get_key) {
item = items.get(key);
if (item === undefined) {
- var child_open = push_template_node(empty());
+ var child_open = empty();
var child_anchor = current ? current.o : anchor;
child_anchor.before(child_open);
@@ -407,6 +407,7 @@ function reconcile(array, state, anchor, render_fn, flags, get_key) {
for (var i = 0; i < to_destroy.length; i += 1) {
var item = to_destroy[i];
items.delete(item.k);
+ remove(item.o);
link(item.prev, item.next);
}
});
|
trime
|
https://github.com/osfans/trime
|
c08f1049111a0be9608e5de15a1c0c8ee222d185
|
iovxw
|
2022-01-15 08:18:29
|
fix(jni): fix librime third-party plugins
|
Making librime a static library breaks third-party plugins, this patch fixed it
|
fix(jni): fix librime third-party plugins
Making librime a static library breaks third-party plugins, this patch fixed it
Closes: #656, #665
|
diff --git a/app/src/main/jni/cmake/RimePlugins.cmake b/app/src/main/jni/cmake/RimePlugins.cmake
index 4deeb82a6f..8917183442 100644
--- a/app/src/main/jni/cmake/RimePlugins.cmake
+++ b/app/src/main/jni/cmake/RimePlugins.cmake
@@ -1,3 +1,4 @@
+# if you want to add some new plugins, add them to librime_jni/rime_jni.cc too
set(RIME_PLUGINS
librime-lua
librime-charcode
diff --git a/app/src/main/jni/librime_jni/rime_jni.cc b/app/src/main/jni/librime_jni/rime_jni.cc
index f89b6f005a..f6b0de75bf 100644
--- a/app/src/main/jni/librime_jni/rime_jni.cc
+++ b/app/src/main/jni/librime_jni/rime_jni.cc
@@ -411,8 +411,19 @@ int registerNativeMethods(JNIEnv *env, const char * className, const JNINativeMe
return JNI_TRUE;
}
+extern void rime_require_module_lua();
+extern void rime_require_module_charcode();
+extern void rime_require_module_grammar(); // librime-octagram
+// librime is compiled as a static library, we have to link modules explicitly
+static void declare_librime_module_dependencies() {
+ rime_require_module_lua();
+ rime_require_module_charcode();
+ rime_require_module_grammar();
+}
+
jint JNI_OnLoad(JavaVM* vm, void* reserved)
{
+ declare_librime_module_dependencies();
JNIEnv* env;
if (vm->GetEnv(reinterpret_cast<void**>(&env), JNI_VERSION_1_6) != JNI_OK) {
return -1;
|
shields
|
https://github.com/badges/shields
|
e2fcd1787b21f5bb17bc6005bd005fb9ec85e973
|
dependabot[bot]
|
2022-12-04 19:07:53
|
chore(deps-dev): bump sinon from 14.0.2 to 15.0.0 (#8680)
|
Bumps [sinon](https://github.com/sinonjs/sinon) from 14.0.2 to 15.0.0.
- [Release notes](https://github.com/sinonjs/sinon/releases)
- [Changelog](https://github.com/sinonjs/sinon/blob/main/docs/changelog.md)
- [Commits](https://github.com/sinonjs/sinon/compare/v14.0.2...v15.0.0)
---
|
chore(deps-dev): bump sinon from 14.0.2 to 15.0.0 (#8680)
Bumps [sinon](https://github.com/sinonjs/sinon) from 14.0.2 to 15.0.0.
- [Release notes](https://github.com/sinonjs/sinon/releases)
- [Changelog](https://github.com/sinonjs/sinon/blob/main/docs/changelog.md)
- [Commits](https://github.com/sinonjs/sinon/compare/v14.0.2...v15.0.0)
---
updated-dependencies:
- dependency-name: sinon
dependency-type: direct:development
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
|
diff --git a/package-lock.json b/package-lock.json
index 3589b41ae2d8a..7ba9c6e64a476 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -146,7 +146,7 @@
"rimraf": "^3.0.2",
"sazerac": "^2.0.0",
"simple-git-hooks": "^2.8.1",
- "sinon": "^14.0.2",
+ "sinon": "^15.0.0",
"sinon-chai": "^3.7.0",
"snap-shot-it": "^7.9.6",
"start-server-and-test": "1.14.0",
@@ -25986,9 +25986,9 @@
}
},
"node_modules/sinon": {
- "version": "14.0.2",
- "resolved": "https://registry.npmjs.org/sinon/-/sinon-14.0.2.tgz",
- "integrity": "sha512-PDpV0ZI3ZCS3pEqx0vpNp6kzPhHrLx72wA0G+ZLaaJjLIYeE0n8INlgaohKuGy7hP0as5tbUd23QWu5U233t+w==",
+ "version": "15.0.0",
+ "resolved": "https://registry.npmjs.org/sinon/-/sinon-15.0.0.tgz",
+ "integrity": "sha512-pV97G1GbslaSJoSdy2F2z8uh5F+uPGp3ddOzA4JsBOUBLEQRz2OAqlKGRFTSh2KiqUCmHkzyAeu7R4x1Hx0wwg==",
"dev": true,
"dependencies": {
"@sinonjs/commons": "^2.0.0",
@@ -49703,9 +49703,9 @@
}
},
"sinon": {
- "version": "14.0.2",
- "resolved": "https://registry.npmjs.org/sinon/-/sinon-14.0.2.tgz",
- "integrity": "sha512-PDpV0ZI3ZCS3pEqx0vpNp6kzPhHrLx72wA0G+ZLaaJjLIYeE0n8INlgaohKuGy7hP0as5tbUd23QWu5U233t+w==",
+ "version": "15.0.0",
+ "resolved": "https://registry.npmjs.org/sinon/-/sinon-15.0.0.tgz",
+ "integrity": "sha512-pV97G1GbslaSJoSdy2F2z8uh5F+uPGp3ddOzA4JsBOUBLEQRz2OAqlKGRFTSh2KiqUCmHkzyAeu7R4x1Hx0wwg==",
"dev": true,
"requires": {
"@sinonjs/commons": "^2.0.0",
diff --git a/package.json b/package.json
index 09c534909e5bf..5e6e703468584 100644
--- a/package.json
+++ b/package.json
@@ -232,7 +232,7 @@
"rimraf": "^3.0.2",
"sazerac": "^2.0.0",
"simple-git-hooks": "^2.8.1",
- "sinon": "^14.0.2",
+ "sinon": "^15.0.0",
"sinon-chai": "^3.7.0",
"snap-shot-it": "^7.9.6",
"start-server-and-test": "1.14.0",
|
angular
|
https://github.com/angular/angular
|
cbeef95c29f127c963f0ea1b789e055cad54cc8d
|
Ben Hong
|
2023-09-13 00:54:03
|
docs: migrate form-validation to standalone (#51709)
|
PR Close #51709
|
docs: migrate form-validation to standalone (#51709)
PR Close #51709
|
diff --git a/aio/content/examples/form-validation/src/app/app.component.ts b/aio/content/examples/form-validation/src/app/app.component.ts
index 14e9cd805e6206..ccd040459b1445 100644
--- a/aio/content/examples/form-validation/src/app/app.component.ts
+++ b/aio/content/examples/form-validation/src/app/app.component.ts
@@ -1,11 +1,17 @@
// #docregion
import { Component } from '@angular/core';
+import { HeroFormReactiveComponent } from './reactive/hero-form-reactive.component';
+import { HeroFormTemplateComponent } from './template/hero-form-template.component';
@Component({
selector: 'app-root',
- template: `<h1>Form validation example</h1>
- <app-hero-form-template></app-hero-form-template>
- <hr>
- <app-hero-form-reactive></app-hero-form-reactive>`
+ template: `
+ <h1>Form validation example</h1>
+ <app-hero-form-template></app-hero-form-template>
+ <hr />
+ <app-hero-form-reactive></app-hero-form-reactive>
+ `,
+ standalone: true,
+ imports: [HeroFormTemplateComponent, HeroFormReactiveComponent],
})
-export class AppComponent { }
+export class AppComponent {}
diff --git a/aio/content/examples/form-validation/src/app/app.config.ts b/aio/content/examples/form-validation/src/app/app.config.ts
new file mode 100644
index 00000000000000..cecfa00cbfe83e
--- /dev/null
+++ b/aio/content/examples/form-validation/src/app/app.config.ts
@@ -0,0 +1,7 @@
+import {ApplicationConfig} from '@angular/core';
+
+import {provideProtractorTestingSupport} from '@angular/platform-browser';
+
+export const appConfig: ApplicationConfig = {
+ providers: [provideProtractorTestingSupport()],
+};
diff --git a/aio/content/examples/form-validation/src/app/app.module.ts b/aio/content/examples/form-validation/src/app/app.module.ts
deleted file mode 100644
index 340f181d4e346a..00000000000000
--- a/aio/content/examples/form-validation/src/app/app.module.ts
+++ /dev/null
@@ -1,29 +0,0 @@
-// #docregion
-import { NgModule } from '@angular/core';
-import { FormsModule, ReactiveFormsModule } from '@angular/forms';
-import { BrowserModule } from '@angular/platform-browser';
-
-import { AppComponent } from './app.component';
-import { HeroFormTemplateComponent } from './template/hero-form-template.component';
-import { HeroFormReactiveComponent } from './reactive/hero-form-reactive.component';
-import { ForbiddenValidatorDirective } from './shared/forbidden-name.directive';
-import { IdentityRevealedValidatorDirective } from './shared/identity-revealed.directive';
-import { UniqueAlterEgoValidatorDirective } from './shared/alter-ego.directive';
-
-@NgModule({
- imports: [
- BrowserModule,
- FormsModule,
- ReactiveFormsModule
- ],
- declarations: [
- AppComponent,
- HeroFormTemplateComponent,
- HeroFormReactiveComponent,
- ForbiddenValidatorDirective,
- IdentityRevealedValidatorDirective,
- UniqueAlterEgoValidatorDirective
- ],
- bootstrap: [ AppComponent ]
-})
-export class AppModule { }
diff --git a/aio/content/examples/form-validation/src/app/reactive/hero-form-reactive.component.1.ts b/aio/content/examples/form-validation/src/app/reactive/hero-form-reactive.component.1.ts
index 76198e6cf9b983..d2c0abb75cfcbb 100644
--- a/aio/content/examples/form-validation/src/app/reactive/hero-form-reactive.component.1.ts
+++ b/aio/content/examples/form-validation/src/app/reactive/hero-form-reactive.component.1.ts
@@ -1,19 +1,27 @@
// #docplaster
// #docregion
import { Component, OnInit } from '@angular/core';
-import { FormControl, FormGroup, Validators } from '@angular/forms';
+import { NgIf, NgFor } from '@angular/common';
+import {
+ FormsModule,
+ FormControl,
+ FormGroup,
+ ReactiveFormsModule,
+ Validators,
+} from '@angular/forms';
import { forbiddenNameValidator } from '../shared/forbidden-name.directive';
@Component({
+ standalone: true,
selector: 'app-hero-form-reactive',
templateUrl: './hero-form-reactive.component.html',
styleUrls: ['./hero-form-reactive.component.css'],
+ imports: [FormsModule, ReactiveFormsModule, NgIf, NgFor],
})
export class HeroFormReactiveComponent implements OnInit {
-
powers = ['Really Smart', 'Super Flexible', 'Weather Changer'];
- hero = {name: 'Dr.', alterEgo: 'Dr. What', power: this.powers[0]};
+ hero = { name: 'Dr.', alterEgo: 'Dr. What', power: this.powers[0] };
heroForm: FormGroup;
@@ -24,18 +32,21 @@ export class HeroFormReactiveComponent implements OnInit {
name: new FormControl(this.hero.name, [
Validators.required,
Validators.minLength(4),
- forbiddenNameValidator(/bob/i) // <-- Here's how you pass in the custom validator.
+ forbiddenNameValidator(/bob/i), // <-- Here's how you pass in the custom validator.
]),
alterEgo: new FormControl(this.hero.alterEgo),
- power: new FormControl(this.hero.power, Validators.required)
+ power: new FormControl(this.hero.power, Validators.required),
});
// #enddocregion custom-validator
-
}
- get name() { return this.heroForm.get('name'); }
+ get name() {
+ return this.heroForm.get('name');
+ }
- get power() { return this.heroForm.get('power'); }
+ get power() {
+ return this.heroForm.get('power');
+ }
// #enddocregion form-group
}
// #enddocregion
diff --git a/aio/content/examples/form-validation/src/app/reactive/hero-form-reactive.component.2.ts b/aio/content/examples/form-validation/src/app/reactive/hero-form-reactive.component.2.ts
index b57521b2ee485f..30f77c604bfc6f 100644
--- a/aio/content/examples/form-validation/src/app/reactive/hero-form-reactive.component.2.ts
+++ b/aio/content/examples/form-validation/src/app/reactive/hero-form-reactive.component.2.ts
@@ -1,17 +1,25 @@
// #docplaster
// #docregion
import { Component, OnInit } from '@angular/core';
-import { FormControl, FormGroup, Validators } from '@angular/forms';
+import { NgIf, NgFor } from '@angular/common';
+import {
+ FormControl,
+ FormGroup,
+ FormsModule,
+ ReactiveFormsModule,
+ Validators,
+} from '@angular/forms';
import { forbiddenNameValidator } from '../shared/forbidden-name.directive';
import { UniqueAlterEgoValidator } from '../shared/alter-ego.directive';
@Component({
+ standalone: true,
selector: 'app-hero-form-reactive',
templateUrl: './hero-form-reactive.component.html',
styleUrls: ['./hero-form-reactive.component.css'],
+ imports: [FormsModule, ReactiveFormsModule, NgIf, NgFor],
})
export class HeroFormReactiveComponent implements OnInit {
-
powers = ['Really Smart', 'Super Flexible', 'Weather Changer'];
hero = { name: 'Dr.', alterEgo: 'Dr. What', power: this.powers[0] };
@@ -21,28 +29,36 @@ export class HeroFormReactiveComponent implements OnInit {
ngOnInit(): void {
// #docregion async-validator-usage
const alterEgoControl = new FormControl('', {
- asyncValidators: [this.alterEgoValidator.validate.bind(this.alterEgoValidator)],
- updateOn: 'blur'
+ asyncValidators: [
+ this.alterEgoValidator.validate.bind(this.alterEgoValidator),
+ ],
+ updateOn: 'blur',
});
// #enddocregion async-validator-usage
- alterEgoControl.setValue(this.hero.alterEgo);
+ alterEgoControl.setValue(this.hero.alterEgo);
this.heroForm = new FormGroup({
name: new FormControl(this.hero.name, [
Validators.required,
Validators.minLength(4),
- forbiddenNameValidator(/bob/i)
+ forbiddenNameValidator(/bob/i),
]),
alterEgo: alterEgoControl,
- power: new FormControl(this.hero.power, Validators.required)
+ power: new FormControl(this.hero.power, Validators.required),
});
}
- get name() { return this.heroForm.get('name'); }
+ get name() {
+ return this.heroForm.get('name');
+ }
- get power() { return this.heroForm.get('power'); }
+ get power() {
+ return this.heroForm.get('power');
+ }
- get alterEgo() { return this.heroForm.get('alterEgo'); }
+ get alterEgo() {
+ return this.heroForm.get('alterEgo');
+ }
// #docregion async-validator-inject
constructor(private alterEgoValidator: UniqueAlterEgoValidator) {}
diff --git a/aio/content/examples/form-validation/src/app/reactive/hero-form-reactive.component.html b/aio/content/examples/form-validation/src/app/reactive/hero-form-reactive.component.html
index 711212b75ebae0..69b44480f98f6d 100644
--- a/aio/content/examples/form-validation/src/app/reactive/hero-form-reactive.component.html
+++ b/aio/content/examples/form-validation/src/app/reactive/hero-form-reactive.component.html
@@ -1,26 +1,32 @@
- <!-- #docregion -->
+<!-- #docregion -->
<div class="container">
-
<h2>Reactive Form</h2>
<form [formGroup]="heroForm" #formDir="ngForm">
-
<div [hidden]="formDir.submitted">
-
- <div class="cross-validation" [class.cross-validation-error]="heroForm.errors?.['identityRevealed'] && (heroForm.touched || heroForm.dirty)">
+ <div
+ class="cross-validation"
+ [class.cross-validation-error]="
+ heroForm.errors?.['identityRevealed'] &&
+ (heroForm.touched || heroForm.dirty)
+ "
+ >
<div class="form-group">
-
<label for="name">Name</label>
<!-- #docregion name-with-error-msg -->
- <input type="text" id="name" class="form-control"
- formControlName="name" required>
-
- <div *ngIf="name.invalid && (name.dirty || name.touched)"
- class="alert alert-danger">
+ <input
+ type="text"
+ id="name"
+ class="form-control"
+ formControlName="name"
+ required
+ />
- <div *ngIf="name.errors?.['required']">
- Name is required.
- </div>
+ <div
+ *ngIf="name.invalid && (name.dirty || name.touched)"
+ class="alert alert-danger"
+ >
+ <div *ngIf="name.errors?.['required']">Name is required.</div>
<div *ngIf="name.errors?.['minlength']">
Name must be at least 4 characters long.
</div>
@@ -33,11 +39,18 @@ <h2>Reactive Form</h2>
<div class="form-group">
<label for="alterEgo">Alter Ego</label>
- <input type="text" id="alterEgo" class="form-control"
- formControlName="alterEgo">
+ <input
+ type="text"
+ id="alterEgo"
+ class="form-control"
+ formControlName="alterEgo"
+ />
<div *ngIf="alterEgo.pending">Validating...</div>
- <div *ngIf="alterEgo.invalid" class="alert alert-danger alter-ego-errors">
+ <div
+ *ngIf="alterEgo.invalid"
+ class="alert alert-danger alter-ego-errors"
+ >
<div *ngIf="alterEgo.errors?.['uniqueAlterEgo']">
Alter ego is already taken.
</div>
@@ -45,17 +58,27 @@ <h2>Reactive Form</h2>
</div>
<!-- #docregion cross-validation-error-message -->
- <div *ngIf="heroForm.errors?.['identityRevealed'] && (heroForm.touched || heroForm.dirty)" class="cross-validation-error-message alert alert-danger">
- Name cannot match alter ego.
+ <div
+ *ngIf="
+ heroForm.errors?.['identityRevealed'] &&
+ (heroForm.touched || heroForm.dirty)
+ "
+ class="cross-validation-error-message alert alert-danger"
+ >
+ Name cannot match alter ego.
</div>
<!-- #enddocregion cross-validation-error-message -->
</div>
<div class="form-group">
<label for="power">Hero Power</label>
- <select id="power" class="form-control"
- formControlName="power" required>
- <option *ngFor="let p of powers" [value]="p">{{p}}</option>
+ <select
+ id="power"
+ class="form-control"
+ formControlName="power"
+ required
+ >
+ <option *ngFor="let p of powers" [value]="p">{{ p }}</option>
</select>
<div *ngIf="power.invalid && power.touched" class="alert alert-danger">
@@ -64,11 +87,20 @@ <h2>Reactive Form</h2>
</div>
<p>Complete the form to enable the Submit button.</p>
- <button type="submit"
- class="btn btn-default"
- [disabled]="heroForm.invalid">Submit</button>
- <button type="button" class="btn btn-default"
- (click)="formDir.resetForm({})">Reset</button>
+ <button
+ type="submit"
+ class="btn btn-default"
+ [disabled]="heroForm.invalid"
+ >
+ Submit
+ </button>
+ <button
+ type="button"
+ class="btn btn-default"
+ (click)="formDir.resetForm({})"
+ >
+ Reset
+ </button>
</div>
</form>
diff --git a/aio/content/examples/form-validation/src/app/reactive/hero-form-reactive.component.ts b/aio/content/examples/form-validation/src/app/reactive/hero-form-reactive.component.ts
index fcd4a39a95f412..55ad4f96af67fd 100644
--- a/aio/content/examples/form-validation/src/app/reactive/hero-form-reactive.component.ts
+++ b/aio/content/examples/form-validation/src/app/reactive/hero-form-reactive.component.ts
@@ -1,17 +1,25 @@
// #docregion
import { Component, OnInit } from '@angular/core';
-import { FormControl, FormGroup, Validators } from '@angular/forms';
+import {
+ FormControl,
+ FormGroup,
+ Validators,
+ FormsModule,
+ ReactiveFormsModule,
+} from '@angular/forms';
import { forbiddenNameValidator } from '../shared/forbidden-name.directive';
import { identityRevealedValidator } from '../shared/identity-revealed.directive';
import { UniqueAlterEgoValidator } from '../shared/alter-ego.directive';
+import { NgIf, NgFor } from '@angular/common';
@Component({
+ standalone: true,
selector: 'app-hero-form-reactive',
templateUrl: './hero-form-reactive.component.html',
styleUrls: ['./hero-form-reactive.component.css'],
+ imports: [FormsModule, ReactiveFormsModule, NgIf, NgFor],
})
export class HeroFormReactiveComponent implements OnInit {
-
powers = ['Really Smart', 'Super Flexible', 'Weather Changer'];
hero = { name: 'Dr.', alterEgo: 'Dr. What', power: this.powers[0] };
@@ -19,25 +27,36 @@ export class HeroFormReactiveComponent implements OnInit {
heroForm!: FormGroup;
ngOnInit(): void {
- this.heroForm = new FormGroup({
- name: new FormControl(this.hero.name, [
- Validators.required,
- Validators.minLength(4),
- forbiddenNameValidator(/bob/i)
- ]),
- alterEgo: new FormControl(this.hero.alterEgo, {
- asyncValidators: [this.alterEgoValidator.validate.bind(this.alterEgoValidator)],
- updateOn: 'blur'
- }),
- power: new FormControl(this.hero.power, Validators.required)
- }, { validators: identityRevealedValidator }); // <-- add custom validator at the FormGroup level
+ this.heroForm = new FormGroup(
+ {
+ name: new FormControl(this.hero.name, [
+ Validators.required,
+ Validators.minLength(4),
+ forbiddenNameValidator(/bob/i),
+ ]),
+ alterEgo: new FormControl(this.hero.alterEgo, {
+ asyncValidators: [
+ this.alterEgoValidator.validate.bind(this.alterEgoValidator),
+ ],
+ updateOn: 'blur',
+ }),
+ power: new FormControl(this.hero.power, Validators.required),
+ },
+ { validators: identityRevealedValidator },
+ ); // <-- add custom validator at the FormGroup level
}
- get name() { return this.heroForm.get('name')!; }
+ get name() {
+ return this.heroForm.get('name')!;
+ }
- get power() { return this.heroForm.get('power')!; }
+ get power() {
+ return this.heroForm.get('power')!;
+ }
- get alterEgo() { return this.heroForm.get('alterEgo')!; }
+ get alterEgo() {
+ return this.heroForm.get('alterEgo')!;
+ }
- constructor(private alterEgoValidator: UniqueAlterEgoValidator) { }
+ constructor(private alterEgoValidator: UniqueAlterEgoValidator) {}
}
diff --git a/aio/content/examples/form-validation/src/app/shared/alter-ego.directive.ts b/aio/content/examples/form-validation/src/app/shared/alter-ego.directive.ts
index 44cffb280bcb5f..b5351ddc802a3e 100644
--- a/aio/content/examples/form-validation/src/app/shared/alter-ego.directive.ts
+++ b/aio/content/examples/form-validation/src/app/shared/alter-ego.directive.ts
@@ -3,7 +3,7 @@ import {
AsyncValidator,
AbstractControl,
NG_ASYNC_VALIDATORS,
- ValidationErrors
+ ValidationErrors,
} from '@angular/forms';
import { catchError, map } from 'rxjs/operators';
import { HeroesService } from './heroes.service';
@@ -14,12 +14,10 @@ import { Observable, of } from 'rxjs';
export class UniqueAlterEgoValidator implements AsyncValidator {
constructor(private heroesService: HeroesService) {}
- validate(
- control: AbstractControl
- ): Observable<ValidationErrors | null> {
+ validate(control: AbstractControl): Observable<ValidationErrors | null> {
return this.heroesService.isAlterEgoTaken(control.value).pipe(
- map(isTaken => (isTaken ? { uniqueAlterEgo: true } : null)),
- catchError(() => of(null))
+ map((isTaken) => (isTaken ? { uniqueAlterEgo: true } : null)),
+ catchError(() => of(null)),
);
}
}
@@ -32,16 +30,15 @@ export class UniqueAlterEgoValidator implements AsyncValidator {
{
provide: NG_ASYNC_VALIDATORS,
useExisting: forwardRef(() => UniqueAlterEgoValidatorDirective),
- multi: true
- }
- ]
+ multi: true,
+ },
+ ],
+ standalone: true,
})
export class UniqueAlterEgoValidatorDirective implements AsyncValidator {
constructor(private validator: UniqueAlterEgoValidator) {}
- validate(
- control: AbstractControl
- ): Observable<ValidationErrors | null> {
+ validate(control: AbstractControl): Observable<ValidationErrors | null> {
return this.validator.validate(control);
}
}
diff --git a/aio/content/examples/form-validation/src/app/shared/forbidden-name.directive.ts b/aio/content/examples/form-validation/src/app/shared/forbidden-name.directive.ts
index f6bb002cec28d6..c53f0a725aba39 100644
--- a/aio/content/examples/form-validation/src/app/shared/forbidden-name.directive.ts
+++ b/aio/content/examples/form-validation/src/app/shared/forbidden-name.directive.ts
@@ -1,13 +1,19 @@
// #docregion
import { Directive, Input } from '@angular/core';
-import { AbstractControl, NG_VALIDATORS, ValidationErrors, Validator, ValidatorFn } from '@angular/forms';
+import {
+ AbstractControl,
+ NG_VALIDATORS,
+ ValidationErrors,
+ Validator,
+ ValidatorFn,
+} from '@angular/forms';
// #docregion custom-validator
/** A hero's name can't match the given regular expression */
export function forbiddenNameValidator(nameRe: RegExp): ValidatorFn {
return (control: AbstractControl): ValidationErrors | null => {
const forbidden = nameRe.test(control.value);
- return forbidden ? {forbiddenName: {value: control.value}} : null;
+ return forbidden ? { forbiddenName: { value: control.value } } : null;
};
}
// #enddocregion custom-validator
@@ -16,16 +22,23 @@ export function forbiddenNameValidator(nameRe: RegExp): ValidatorFn {
@Directive({
selector: '[appForbiddenName]',
// #docregion directive-providers
- providers: [{provide: NG_VALIDATORS, useExisting: ForbiddenValidatorDirective, multi: true}]
+ providers: [
+ {
+ provide: NG_VALIDATORS,
+ useExisting: ForbiddenValidatorDirective,
+ multi: true,
+ },
+ ],
// #enddocregion directive-providers
+ standalone: true,
})
export class ForbiddenValidatorDirective implements Validator {
@Input('appForbiddenName') forbiddenName = '';
validate(control: AbstractControl): ValidationErrors | null {
- return this.forbiddenName ? forbiddenNameValidator(new RegExp(this.forbiddenName, 'i'))(control)
- : null;
+ return this.forbiddenName
+ ? forbiddenNameValidator(new RegExp(this.forbiddenName, 'i'))(control)
+ : null;
}
}
// #enddocregion directive
-
diff --git a/aio/content/examples/form-validation/src/app/shared/identity-revealed.directive.ts b/aio/content/examples/form-validation/src/app/shared/identity-revealed.directive.ts
old mode 100644
new mode 100755
index 2fe3212062875d..7d2d4af036f270
--- a/aio/content/examples/form-validation/src/app/shared/identity-revealed.directive.ts
+++ b/aio/content/examples/form-validation/src/app/shared/identity-revealed.directive.ts
@@ -1,21 +1,39 @@
// #docregion
import { Directive } from '@angular/core';
-import { AbstractControl, FormGroup, NG_VALIDATORS, ValidationErrors, Validator, ValidatorFn } from '@angular/forms';
+import {
+ AbstractControl,
+ FormGroup,
+ NG_VALIDATORS,
+ ValidationErrors,
+ Validator,
+ ValidatorFn,
+} from '@angular/forms';
// #docregion cross-validation-validator
/** A hero's name can't match the hero's alter ego */
-export const identityRevealedValidator: ValidatorFn = (control: AbstractControl): ValidationErrors | null => {
+export const identityRevealedValidator: ValidatorFn = (
+ control: AbstractControl,
+): ValidationErrors | null => {
const name = control.get('name');
const alterEgo = control.get('alterEgo');
- return name && alterEgo && name.value === alterEgo.value ? { identityRevealed: true } : null;
+ return name && alterEgo && name.value === alterEgo.value
+ ? { identityRevealed: true }
+ : null;
};
// #enddocregion cross-validation-validator
// #docregion cross-validation-directive
@Directive({
selector: '[appIdentityRevealed]',
- providers: [{ provide: NG_VALIDATORS, useExisting: IdentityRevealedValidatorDirective, multi: true }]
+ providers: [
+ {
+ provide: NG_VALIDATORS,
+ useExisting: IdentityRevealedValidatorDirective,
+ multi: true,
+ },
+ ],
+ standalone: true,
})
export class IdentityRevealedValidatorDirective implements Validator {
validate(control: AbstractControl): ValidationErrors | null {
diff --git a/aio/content/examples/form-validation/src/app/template/hero-form-template.component.html b/aio/content/examples/form-validation/src/app/template/hero-form-template.component.html
index 5d90b36d6e2d1f..d1082a54559645 100644
--- a/aio/content/examples/form-validation/src/app/template/hero-form-template.component.html
+++ b/aio/content/examples/form-validation/src/app/template/hero-form-template.component.html
@@ -1,48 +1,61 @@
- <!-- #docregion -->
+<!-- #docregion -->
<div>
-
<h2>Template-Driven Form</h2>
<!-- #docregion cross-validation-register-validator -->
<form #heroForm="ngForm" appIdentityRevealed>
- <!-- #enddocregion cross-validation-register-validator -->
+ <!-- #enddocregion cross-validation-register-validator -->
<div [hidden]="heroForm.submitted">
- <div class="cross-validation" [class.cross-validation-error]="heroForm.errors?.['identityRevealed'] && (heroForm.touched || heroForm.dirty)">
+ <div
+ class="cross-validation"
+ [class.cross-validation-error]="
+ heroForm.errors?.['identityRevealed'] &&
+ (heroForm.touched || heroForm.dirty)
+ "
+ >
<div class="form-group">
<label for="name">Name</label>
<!-- #docregion name-with-error-msg -->
<!-- #docregion name-input -->
- <input type="text" id="name" name="name" class="form-control"
- required minlength="4" appForbiddenName="bob"
- [(ngModel)]="hero.name" #name="ngModel">
+ <input
+ type="text"
+ id="name"
+ name="name"
+ class="form-control"
+ required
+ minlength="4"
+ appForbiddenName="bob"
+ [(ngModel)]="hero.name"
+ #name="ngModel"
+ />
<!-- #enddocregion name-input -->
- <div *ngIf="name.invalid && (name.dirty || name.touched)"
- class="alert">
-
- <div *ngIf="name.errors?.['required']">
- Name is required.
- </div>
+ <div
+ *ngIf="name.invalid && (name.dirty || name.touched)"
+ class="alert"
+ >
+ <div *ngIf="name.errors?.['required']">Name is required.</div>
<div *ngIf="name.errors?.['minlength']">
Name must be at least 4 characters long.
</div>
<div *ngIf="name.errors?.['forbiddenName']">
Name cannot be Bob.
</div>
-
</div>
<!-- #enddocregion name-with-error-msg -->
</div>
<div class="form-group">
<label for="alterEgo">Alter Ego</label>
- <!-- #docregion alterEgo-input -->
- <input type="text"
- id="alterEgo"
- name="alterEgo"
- #alterEgo="ngModel"
- [(ngModel)]="hero.alterEgo"
- [ngModelOptions]="{ updateOn: 'blur' }"
- appUniqueAlterEgo>
+ <!-- #docregion alterEgo-input -->
+ <input
+ type="text"
+ id="alterEgo"
+ name="alterEgo"
+ #alterEgo="ngModel"
+ [(ngModel)]="hero.alterEgo"
+ [ngModelOptions]="{ updateOn: 'blur' }"
+ appUniqueAlterEgo
+ />
<!-- #enddocregion alterEgo-input -->
<div *ngIf="alterEgo.pending">Validating...</div>
<div *ngIf="alterEgo.invalid" class="alert alter-ego-errors">
@@ -53,19 +66,28 @@ <h2>Template-Driven Form</h2>
</div>
<!-- #docregion cross-validation-error-message -->
- <div *ngIf="heroForm.errors?.['identityRevealed'] && (heroForm.touched || heroForm.dirty)" class="cross-validation-error-message alert">
- Name cannot match alter ego.
+ <div
+ *ngIf="
+ heroForm.errors?.['identityRevealed'] &&
+ (heroForm.touched || heroForm.dirty)
+ "
+ class="cross-validation-error-message alert"
+ >
+ Name cannot match alter ego.
</div>
<!-- #enddocregion cross-validation-error-message -->
</div>
<div class="form-group">
<label for="power">Hero Power</label>
- <select id="power"
- name="power"
- required [(ngModel)]="hero.power"
- #power="ngModel">
- <option *ngFor="let p of powers" [value]="p">{{p}}</option>
+ <select
+ id="power"
+ name="power"
+ required
+ [(ngModel)]="hero.power"
+ #power="ngModel"
+ >
+ <option *ngFor="let p of powers" [value]="p">{{ p }}</option>
</select>
<div *ngIf="power.errors && power.touched" class="alert">
@@ -74,15 +96,15 @@ <h2>Template-Driven Form</h2>
</div>
<p>Complete the form to enable the Submit button.</p>
- <button type="submit"
- [disabled]="heroForm.invalid">Submit</button>
- <button type="button"
- (click)="heroForm.resetForm({})">Reset</button>
+ <button type="submit" [disabled]="heroForm.invalid">Submit</button>
+ <button type="button" (click)="heroForm.resetForm({})">Reset</button>
</div>
<div class="submitted-message" *ngIf="heroForm.submitted">
<p>You've submitted your hero, {{ heroForm.value.name }}!</p>
- <button type="button" (click)="heroForm.resetForm({})">Add new hero</button>
+ <button type="button" (click)="heroForm.resetForm({})">
+ Add new hero
+ </button>
</div>
</form>
</div>
diff --git a/aio/content/examples/form-validation/src/app/template/hero-form-template.component.ts b/aio/content/examples/form-validation/src/app/template/hero-form-template.component.ts
index dc3d0cf7482797..566b153b591a89 100644
--- a/aio/content/examples/form-validation/src/app/template/hero-form-template.component.ts
+++ b/aio/content/examples/form-validation/src/app/template/hero-form-template.component.ts
@@ -1,14 +1,26 @@
import { Component } from '@angular/core';
+import { UniqueAlterEgoValidatorDirective } from '../shared/alter-ego.directive';
+import { NgIf, NgFor } from '@angular/common';
+import { ForbiddenValidatorDirective } from '../shared/forbidden-name.directive';
+import { IdentityRevealedValidatorDirective } from '../shared/identity-revealed.directive';
+import { FormsModule } from '@angular/forms';
@Component({
+ standalone: true,
selector: 'app-hero-form-template',
templateUrl: './hero-form-template.component.html',
styleUrls: ['./hero-form-template.component.css'],
+ imports: [
+ ForbiddenValidatorDirective,
+ FormsModule,
+ IdentityRevealedValidatorDirective,
+ NgFor,
+ NgIf,
+ UniqueAlterEgoValidatorDirective,
+ ],
})
export class HeroFormTemplateComponent {
-
powers = ['Really Smart', 'Super Flexible', 'Weather Changer'];
- hero = {name: 'Dr.', alterEgo: 'Dr. What', power: this.powers[0]};
-
+ hero = { name: 'Dr.', alterEgo: 'Dr. What', power: this.powers[0] };
}
diff --git a/aio/content/examples/form-validation/src/index.html b/aio/content/examples/form-validation/src/index.html
index d4e9dbee577326..18aab355cf3f35 100644
--- a/aio/content/examples/form-validation/src/index.html
+++ b/aio/content/examples/form-validation/src/index.html
@@ -1,15 +1,14 @@
-<!DOCTYPE html>
+<!doctype html>
<html lang="en">
<head>
<title>Hero Form with Validation</title>
- <base href="/">
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <link rel="stylesheet" href="assets/forms.css">
+ <base href="/" />
+ <meta charset="UTF-8" />
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
+ <link rel="stylesheet" href="assets/forms.css" />
</head>
<body>
<app-root></app-root>
</body>
</html>
-
diff --git a/aio/content/examples/form-validation/src/main.ts b/aio/content/examples/form-validation/src/main.ts
index 49432aa08777cc..af9d7244fad729 100644
--- a/aio/content/examples/form-validation/src/main.ts
+++ b/aio/content/examples/form-validation/src/main.ts
@@ -1,7 +1,6 @@
// #docregion
-import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
+import { AppComponent } from './app/app.component';
+import { bootstrapApplication } from '@angular/platform-browser';
+import { appConfig } from './app/app.config';
-import { AppModule } from './app/app.module';
-
-platformBrowserDynamic().bootstrapModule(AppModule)
- .catch(err => console.error(err));
+bootstrapApplication(AppComponent, appConfig);
diff --git a/aio/content/guide/form-validation.md b/aio/content/guide/form-validation.md
index 5009b3f1019015..75d69fe88e0703 100644
--- a/aio/content/guide/form-validation.md
+++ b/aio/content/guide/form-validation.md
@@ -399,4 +399,4 @@ See the [API docs](api/forms/NgForm#native-dom-validation-ui) for details.
<!-- end links -->
-@reviewed 2022-02-28
+@reviewed 2023-09-12
|
dagger
|
https://github.com/dagger/dagger
|
ca2902fc23a1f9c51ab6a807b217eb46c46e3e59
|
dependabot[bot]
|
2022-02-03 00:43:44
|
build(deps): bump sass from 1.49.4 to 1.49.7 in /website
|
Bumps [sass](https://github.com/sass/dart-sass) from 1.49.4 to 1.49.7.
- [Release notes](https://github.com/sass/dart-sass/releases)
- [Changelog](https://github.com/sass/dart-sass/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sass/dart-sass/compare/1.49.4...1.49.7)
---
|
build(deps): bump sass from 1.49.4 to 1.49.7 in /website
Bumps [sass](https://github.com/sass/dart-sass) from 1.49.4 to 1.49.7.
- [Release notes](https://github.com/sass/dart-sass/releases)
- [Changelog](https://github.com/sass/dart-sass/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sass/dart-sass/compare/1.49.4...1.49.7)
---
updated-dependencies:
- dependency-name: sass
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <[email protected]>
|
diff --git a/website/package.json b/website/package.json
index c4d11b5211d..85f57059248 100644
--- a/website/package.json
+++ b/website/package.json
@@ -33,7 +33,7 @@
"react-dom": "^17.0.1",
"react-social-login-buttons": "^3.6.0",
"remark-code-import": "^0.4.0",
- "sass": "^1.49.4",
+ "sass": "^1.49.7",
"url-loader": "^4.1.1"
},
"browserslist": {
diff --git a/website/yarn.lock b/website/yarn.lock
index a0339e1f314..9919fd3dba0 100644
--- a/website/yarn.lock
+++ b/website/yarn.lock
@@ -7719,10 +7719,10 @@ sass-loader@^10.1.1:
schema-utils "^3.0.0"
semver "^7.3.2"
-sass@^1.49.4:
- version "1.49.4"
- resolved "https://registry.yarnpkg.com/sass/-/sass-1.49.4.tgz#d2655e03e52b2212ab65d392bdef6d0931d8637c"
- integrity sha512-xUU5ZlppOjgfEyIIcHpnmY+f+3/ieaadp25S/OqZ5+jBPeTAMJJblkhM6UD9jb4j/lzglz7VOL5kglYt+CvNdQ==
+sass@^1.49.7:
+ version "1.49.7"
+ resolved "https://registry.yarnpkg.com/sass/-/sass-1.49.7.tgz#22a86a50552b9b11f71404dfad1b9ff44c6b0c49"
+ integrity sha512-13dml55EMIR2rS4d/RDHHP0sXMY3+30e1TKsyXaSz3iLWVoDWEoboY8WzJd5JMnxrRHffKO3wq2mpJ0jxRJiEQ==
dependencies:
chokidar ">=3.0.0 <4.0.0"
immutable "^4.0.0"
|
nushell
|
https://github.com/nushell/nushell
|
d122bc3d895d40adc0516f03b3d291cc45dbb76c
|
zc he
|
2025-03-07 20:25:57
|
fix: security_audit, bump ring from 0.17.8 to 0.17.13 (#15263)
|
Fixes this:
<div class="Box p-3 markdown-body f5 mb-4">
<h2 dir="auto">Vulnerabilities</h2>
<h3 dir="auto"><a
href="https://rustsec.org/advisories/RUSTSEC-2025-0009.html"
rel="nofollow">RUSTSEC-2025-0009</a></h3>
<blockquote>
<p dir="auto">Some AES functions may panic when overflow checking is
enabled.</p>
</blockquote>
<markdown-accessiblity-table data-catalyst=""><table role="table">
<thead>
<tr>
<th>Details</th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td>Package</td>
<td><code class="notranslate">ring</code></td>
</tr>
<tr>
<td>Version</td>
<td><code class="notranslate">0.17.8</code></td>
</tr>
<tr>
<td>URL</td>
<td><a
href="https://github.com/briansmith/ring/blob/main/RELEASES.md#version-01712-2025-03-05">https://github.com/briansmith/ring/blob/main/RELEASES.md#version-01712-2025-03-05</a></td>
</tr>
<tr>
<td>Date</td>
<td>2025-03-06</td>
</tr>
<tr>
<td>Patched versions</td>
<td><code class="notranslate">>=0.17.12</code></td>
</tr>
</tbody>
</table></markdown-accessiblity-table>
<p dir="auto"><code
class="notranslate">ring::aead::quic::HeaderProtectionKey::new_mask()</code>
may panic when overflow<br>
checking is enabled. In the QUIC protocol, an attacker can induce this
panic by<br>
sending a specially-crafted packet. Even unintentionally it is likely to
occur<br>
in 1 out of every 2**32 packets sent and/or received.</p>
<p dir="auto">On 64-bit targets operations using <code
class="notranslate">ring::aead::{AES_128_GCM, AES_256_GCM}</code>
may<br>
panic when overflow checking is enabled, when encrypting/decrypting
approximately<br>
68,719,476,700 bytes (about 64 gigabytes) of data in a single chunk.
Protocols<br>
like TLS and SSH are not affected by this because those protocols break
large<br>
amounts of data into small chunks. Similarly, most applications will
not<br>
attempt to encrypt/decrypt 64GB of data in one chunk.</p>
<p dir="auto">Overflow checking is not enabled in release mode by
default, but<br>
<code class="notranslate">RUSTFLAGS=&quot;-C
overflow-checks&quot;</code> or <code
class="notranslate">overflow-checks = true</code> in the Cargo.toml<br>
profile can override this. Overflow checking is usually enabled by
default in<br>
debug mode.</p>
</div>
|
fix: security_audit, bump ring from 0.17.8 to 0.17.13 (#15263)
Fixes this:
<div class="Box p-3 markdown-body f5 mb-4">
<h2 dir="auto">Vulnerabilities</h2>
<h3 dir="auto"><a
href="https://rustsec.org/advisories/RUSTSEC-2025-0009.html"
rel="nofollow">RUSTSEC-2025-0009</a></h3>
<blockquote>
<p dir="auto">Some AES functions may panic when overflow checking is
enabled.</p>
</blockquote>
<markdown-accessiblity-table data-catalyst=""><table role="table">
<thead>
<tr>
<th>Details</th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td>Package</td>
<td><code class="notranslate">ring</code></td>
</tr>
<tr>
<td>Version</td>
<td><code class="notranslate">0.17.8</code></td>
</tr>
<tr>
<td>URL</td>
<td><a
href="https://github.com/briansmith/ring/blob/main/RELEASES.md#version-01712-2025-03-05">https://github.com/briansmith/ring/blob/main/RELEASES.md#version-01712-2025-03-05</a></td>
</tr>
<tr>
<td>Date</td>
<td>2025-03-06</td>
</tr>
<tr>
<td>Patched versions</td>
<td><code class="notranslate">>=0.17.12</code></td>
</tr>
</tbody>
</table></markdown-accessiblity-table>
<p dir="auto"><code
class="notranslate">ring::aead::quic::HeaderProtectionKey::new_mask()</code>
may panic when overflow<br>
checking is enabled. In the QUIC protocol, an attacker can induce this
panic by<br>
sending a specially-crafted packet. Even unintentionally it is likely to
occur<br>
in 1 out of every 2**32 packets sent and/or received.</p>
<p dir="auto">On 64-bit targets operations using <code
class="notranslate">ring::aead::{AES_128_GCM, AES_256_GCM}</code>
may<br>
panic when overflow checking is enabled, when encrypting/decrypting
approximately<br>
68,719,476,700 bytes (about 64 gigabytes) of data in a single chunk.
Protocols<br>
like TLS and SSH are not affected by this because those protocols break
large<br>
amounts of data into small chunks. Similarly, most applications will
not<br>
attempt to encrypt/decrypt 64GB of data in one chunk.</p>
<p dir="auto">Overflow checking is not enabled in release mode by
default, but<br>
<code class="notranslate">RUSTFLAGS=&quot;-C
overflow-checks&quot;</code> or <code
class="notranslate">overflow-checks = true</code> in the Cargo.toml<br>
profile can override this. Overflow checking is usually enabled by
default in<br>
debug mode.</p>
</div>
|
diff --git a/Cargo.lock b/Cargo.lock
index 28431ecd722d1..8a536440a9f9d 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -893,9 +893,9 @@ dependencies = [
[[package]]
name = "cc"
-version = "1.2.3"
+version = "1.2.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "27f657647bcff5394bf56c7317665bbf790a137a50eaaa5c6bfbb9e27a518f2d"
+checksum = "be714c154be609ec7f5dad223a33bf1482fff90472de28f7362806e6d4832b8c"
dependencies = [
"jobserver",
"libc",
@@ -5989,15 +5989,14 @@ dependencies = [
[[package]]
name = "ring"
-version = "0.17.8"
+version = "0.17.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d"
+checksum = "70ac5d832aa16abd7d1def883a8545280c20a60f523a370aa3a9617c2b8550ee"
dependencies = [
"cc",
"cfg-if",
"getrandom",
"libc",
- "spin",
"untrusted",
"windows-sys 0.52.0",
]
@@ -6739,12 +6738,6 @@ dependencies = [
"windows-sys 0.52.0",
]
-[[package]]
-name = "spin"
-version = "0.9.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67"
-
[[package]]
name = "sqlparser"
version = "0.53.0"
|
sentry
|
https://github.com/getsentry/sentry
|
d04a554445c72ab9c9fee1e2dd66f38ada54a047
|
Tony Xiao
|
2024-03-02 04:06:26
|
feat(metrics): Render summary for custom metrics (#66141)
|
When rendering samples for custom metrics, show a summary of the metric
to make it clear why these samples are shown. It should also respect the
op chosen. For example, when the op is `count`, we should show a metric
count within the span. One caveat is that when a quantile is chosen, we
opt to show the avg because we dont not have the quantile available.
|
feat(metrics): Render summary for custom metrics (#66141)
When rendering samples for custom metrics, show a summary of the metric
to make it clear why these samples are shown. It should also respect the
op chosen. For example, when the op is `count`, we should show a metric
count within the span. One caveat is that when a quantile is chosen, we
opt to show the avg because we dont not have the quantile available.
|
diff --git a/static/app/components/ddm/metricSamplesTable.tsx b/static/app/components/ddm/metricSamplesTable.tsx
index b7c87fa5354ec7..0bb9362cda3318 100644
--- a/static/app/components/ddm/metricSamplesTable.tsx
+++ b/static/app/components/ddm/metricSamplesTable.tsx
@@ -12,12 +12,17 @@ import ProjectBadge from 'sentry/components/idBadge/projectBadge';
import Link from 'sentry/components/links/link';
import PerformanceDuration from 'sentry/components/performanceDuration';
import {t} from 'sentry/locale';
-import type {DateString, MRI, PageFilters} from 'sentry/types';
+import type {DateString, MRI, PageFilters, ParsedMRI} from 'sentry/types';
import {defined} from 'sentry/utils';
import {Container, FieldDateTime, NumberContainer} from 'sentry/utils/discover/styles';
import {getShortEventId} from 'sentry/utils/events';
+import {formatMetricUsingUnit} from 'sentry/utils/metrics/formatters';
+import {parseMRI} from 'sentry/utils/metrics/mri';
import {
+ type Field,
type MetricsSamplesResults,
+ type ResultField,
+ type Summary,
useMetricsSamples,
} from 'sentry/utils/metrics/useMetricsSamples';
import {getTransactionDetailsUrl} from 'sentry/utils/performance/urls';
@@ -30,7 +35,7 @@ import usePageFilters from 'sentry/utils/usePageFilters';
import type {SelectionRange} from 'sentry/views/ddm/chart/types';
import {getTraceDetailsUrl} from 'sentry/views/performance/traceDetails/utils';
-const fields = [
+const fields: Field[] = [
'project',
'id',
'span.op',
@@ -43,11 +48,10 @@ const fields = [
'profile_id',
];
-type Field = (typeof fields)[number];
-
interface MetricSamplesTableProps {
focusArea?: SelectionRange;
mri?: MRI;
+ op?: string;
query?: string;
sortKey?: string;
}
@@ -55,6 +59,7 @@ interface MetricSamplesTableProps {
export function MetricSamplesTable({
focusArea,
mri,
+ op,
query,
sortKey = 'sort',
}: MetricSamplesTableProps) {
@@ -62,6 +67,13 @@ export function MetricSamplesTable({
const enabled = defined(mri);
+ const parsedMRI = useMemo(() => {
+ if (!defined(mri)) {
+ return null;
+ }
+ return parseMRI(mri);
+ }, [mri]);
+
const datetime = useMemo(() => {
if (!defined(focusArea) || !defined(focusArea.start) || !defined(focusArea.end)) {
return undefined;
@@ -125,9 +137,14 @@ export function MetricSamplesTable({
return null;
}, [mri]);
+ const _renderBodyCell = useMemo(
+ () => renderBodyCell(op, parsedMRI?.unit),
+ [op, parsedMRI?.unit]
+ );
+
const _renderHeadCell = useMemo(() => {
const generateSortLink = (key: string) => () => {
- if (!SORTABLE_COLUMNS.has(key)) {
+ if (!SORTABLE_COLUMNS.has(key as ResultField)) {
return undefined;
}
@@ -156,35 +173,50 @@ export function MetricSamplesTable({
isLoading={enabled && result.isLoading}
error={enabled && result.isError && supportedMRI}
data={result.data?.data ?? []}
- columnOrder={COLUMN_ORDER}
+ columnOrder={getColumnOrder(parsedMRI)}
columnSortBy={[]}
- grid={{renderBodyCell, renderHeadCell: _renderHeadCell}}
+ grid={{renderBodyCell: _renderBodyCell, renderHeadCell: _renderHeadCell}}
location={location}
emptyMessage={emptyMessage}
/>
);
}
-const COLUMN_ORDER: GridColumnOrder<Field>[] = [
- {key: 'project', width: COL_WIDTH_UNDEFINED, name: 'Project'},
- {key: 'id', width: COL_WIDTH_UNDEFINED, name: 'Span ID'},
- {key: 'span.op', width: COL_WIDTH_UNDEFINED, name: 'Op'},
- {key: 'span.description', width: COL_WIDTH_UNDEFINED, name: 'Description'},
- {key: 'span.self_time', width: COL_WIDTH_UNDEFINED, name: 'Self Time'},
- {key: 'span.duration', width: COL_WIDTH_UNDEFINED, name: 'Duration'},
- {key: 'timestamp', width: COL_WIDTH_UNDEFINED, name: 'Timestamp'},
- {key: 'trace', width: COL_WIDTH_UNDEFINED, name: 'Trace'},
- {key: 'profile_id', width: COL_WIDTH_UNDEFINED, name: 'Profile'},
-];
+function getColumnOrder(parsedMRI?: ParsedMRI | null): GridColumnOrder<ResultField>[] {
+ const orders: (GridColumnOrder<ResultField> | undefined)[] = [
+ {key: 'project', width: COL_WIDTH_UNDEFINED, name: 'Project'},
+ {key: 'id', width: COL_WIDTH_UNDEFINED, name: 'Span ID'},
+ {key: 'span.op', width: COL_WIDTH_UNDEFINED, name: 'Op'},
+ {key: 'span.description', width: COL_WIDTH_UNDEFINED, name: 'Description'},
+ {key: 'span.self_time', width: COL_WIDTH_UNDEFINED, name: 'Self Time'},
+ {key: 'span.duration', width: COL_WIDTH_UNDEFINED, name: 'Duration'},
+ parsedMRI?.useCase === 'custom'
+ ? {key: 'summary', width: COL_WIDTH_UNDEFINED, name: parsedMRI?.name ?? 'Summary'}
+ : undefined,
+ {key: 'timestamp', width: COL_WIDTH_UNDEFINED, name: 'Timestamp'},
+ {key: 'trace', width: COL_WIDTH_UNDEFINED, name: 'Trace'},
+ {key: 'profile_id', width: COL_WIDTH_UNDEFINED, name: 'Profile'},
+ ];
+
+ return orders.filter(
+ (
+ order: GridColumnOrder<ResultField> | undefined
+ ): order is GridColumnOrder<ResultField> => !!order
+ );
+}
-const RIGHT_ALIGNED_COLUMNS = new Set<Field>(['span.duration', 'span.self_time']);
-const SORTABLE_COLUMNS = new Set<Field>(['span.duration', 'timestamp']);
+const RIGHT_ALIGNED_COLUMNS = new Set<ResultField>([
+ 'span.duration',
+ 'span.self_time',
+ 'summary',
+]);
+const SORTABLE_COLUMNS = new Set<ResultField>(['span.duration', 'timestamp']);
function renderHeadCell(
currentSort: {direction: 'asc' | 'desc'; key: string} | undefined,
generateSortLink: (key) => () => LocationDescriptorObject | undefined
) {
- return function (col: GridColumnOrder<Field>) {
+ return function (col: GridColumnOrder<ResultField>) {
return (
<SortLink
align={RIGHT_ALIGNED_COLUMNS.has(col.key) ? 'right' : 'left'}
@@ -197,59 +229,47 @@ function renderHeadCell(
};
}
-function renderBodyCell(
- col: GridColumnOrder<Field>,
- dataRow: MetricsSamplesResults<Field>['data'][number]
-) {
- if (col.key === 'id') {
- return (
- <SpanId
- project={dataRow.project as string}
- spanId={dataRow.id as string}
- transactionId={dataRow['transaction.id'] as string}
- />
- );
- }
+function renderBodyCell(op?: string, unit?: string) {
+ return function (
+ col: GridColumnOrder<ResultField>,
+ dataRow: MetricsSamplesResults<Field>['data'][number]
+ ) {
+ if (col.key === 'id') {
+ return (
+ <SpanId
+ project={dataRow.project}
+ spanId={dataRow.id}
+ transactionId={dataRow['transaction.id']}
+ />
+ );
+ }
- if (col.key === 'project') {
- return <ProjectRenderer projectSlug={dataRow.project as string} />;
- }
+ if (col.key === 'project') {
+ return <ProjectRenderer projectSlug={dataRow.project} />;
+ }
- if (col.key === 'span.self_time') {
- return <DurationRenderer duration={dataRow['span.self_time'] as number} />;
- }
+ if (col.key === 'span.self_time' || col.key === 'span.duration') {
+ return <DurationRenderer duration={dataRow[col.key]} />;
+ }
- if (col.key === 'span.duration') {
- // duration is stored as an UInt32 while self time is stored
- // as a Float64. So in cases where duration should equal self time,
- // it can be truncated.
- //
- // When this happens, we just take the self time as the duration.
- const duration = Math.max(
- dataRow['span.self_time'] as number,
- dataRow['span.duration'] as number
- );
- return <DurationRenderer duration={duration} />;
- }
+ if (col.key === 'summary') {
+ return <SummaryRenderer summary={dataRow.summary} op={op} unit={unit} />;
+ }
- if (col.key === 'timestamp') {
- return <TimestampRenderer timestamp={dataRow.timestamp as DateString} />;
- }
+ if (col.key === 'timestamp') {
+ return <TimestampRenderer timestamp={dataRow.timestamp} />;
+ }
- if (col.key === 'trace') {
- return <TraceId traceId={dataRow.trace as string} />;
- }
+ if (col.key === 'trace') {
+ return <TraceId traceId={dataRow.trace} />;
+ }
- if (col.key === 'profile_id') {
- return (
- <ProfileId
- projectSlug={dataRow.project as string}
- profileId={dataRow.profile_id as string | undefined}
- />
- );
- }
+ if (col.key === 'profile_id') {
+ return <ProfileId projectSlug={dataRow.project} profileId={dataRow.profile_id} />;
+ }
- return <Container>{dataRow[col.key]}</Container>;
+ return <Container>{dataRow[col.key]}</Container>;
+ };
}
function ProjectRenderer({projectSlug}: {projectSlug: string}) {
@@ -304,6 +324,34 @@ function DurationRenderer({duration}: {duration: number}) {
);
}
+function SummaryRenderer({
+ summary,
+ op,
+ unit,
+}: {
+ summary: Summary;
+ op?: string;
+ unit?: string;
+}) {
+ const value =
+ op === 'count'
+ ? summary.count
+ : op === 'min'
+ ? summary.min
+ : op === 'max'
+ ? summary.max
+ : op === 'sum'
+ ? summary.sum
+ : summary.sum / summary.count;
+
+ // if the op is `count`, then the unit does not apply
+ unit = op === 'count' ? '' : unit;
+
+ return (
+ <NumberContainer>{formatMetricUsingUnit(value ?? null, unit ?? '')}</NumberContainer>
+ );
+}
+
function TimestampRenderer({timestamp}: {timestamp: DateString}) {
const location = useLocation();
diff --git a/static/app/utils/metrics/useMetricsSamples.tsx b/static/app/utils/metrics/useMetricsSamples.tsx
index 0deb82c26934a1..207dc34633d5d0 100644
--- a/static/app/utils/metrics/useMetricsSamples.tsx
+++ b/static/app/utils/metrics/useMetricsSamples.tsx
@@ -1,10 +1,40 @@
import {normalizeDateTimeParams} from 'sentry/components/organizations/pageFilters/parse';
-import type {MRI, PageFilters} from 'sentry/types';
+import type {DateString, MRI, PageFilters} from 'sentry/types';
import {useApiQuery} from 'sentry/utils/queryClient';
import useOrganization from 'sentry/utils/useOrganization';
import usePageFilters from 'sentry/utils/usePageFilters';
-interface UseMetricSamplesOptions<F extends string> {
+/**
+ * This type is incomplete as there are other fields available.
+ */
+type FieldTypes = {
+ id: string;
+ profile_id: string | undefined;
+ project: string;
+ 'span.description': string;
+ 'span.duration': number;
+ 'span.op': string;
+ 'span.self_time': number;
+ timestamp: DateString;
+ trace: string;
+ 'transaction.id': string;
+};
+
+export type Summary = {
+ count: number;
+ max: number;
+ min: number;
+ sum: number;
+};
+
+type ResultFieldTypes = FieldTypes & {
+ summary: Summary;
+};
+
+export type Field = keyof FieldTypes;
+export type ResultField = keyof ResultFieldTypes;
+
+interface UseMetricSamplesOptions<F extends Field> {
fields: F[];
referrer: string;
datetime?: PageFilters['datetime'];
@@ -17,14 +47,12 @@ interface UseMetricSamplesOptions<F extends string> {
sort?: string;
}
-export interface MetricsSamplesResults<F extends string> {
- data: {
- [K in F]: string[] | string | number | null;
- }[];
+export interface MetricsSamplesResults<F extends Field> {
+ data: Pick<ResultFieldTypes, F | 'summary'>[];
meta: any; // not going to type this yet
}
-export function useMetricsSamples<F extends string>({
+export function useMetricsSamples<F extends Field>({
datetime,
enabled,
fields,
diff --git a/static/app/views/ddm/widgetDetails.tsx b/static/app/views/ddm/widgetDetails.tsx
index 555f02ed4bcf99..95b6a686486b37 100644
--- a/static/app/views/ddm/widgetDetails.tsx
+++ b/static/app/views/ddm/widgetDetails.tsx
@@ -48,11 +48,12 @@ export function WidgetDetails() {
<MetricDetails onRowHover={handleSampleRowHover} focusArea={focusArea} />;
}
- const {mri, query, focusedSeries} = selectedWidget as MetricQueryWidgetParams;
+ const {mri, op, query, focusedSeries} = selectedWidget as MetricQueryWidgetParams;
return (
<MetricDetails
mri={mri}
+ op={op}
query={query}
focusedSeries={focusedSeries}
onRowHover={handleSampleRowHover}
@@ -66,12 +67,14 @@ interface MetricDetailsProps {
focusedSeries?: FocusedMetricsSeries[];
mri?: MRI;
onRowHover?: SamplesTableProps['onRowHover'];
+ op?: string;
query?: string;
}
// TODO: add types
export function MetricDetails({
mri,
+ op,
query,
focusedSeries,
onRowHover,
@@ -131,6 +134,7 @@ export function MetricDetails({
<MetricSamplesTable
focusArea={focusArea?.selection?.range}
mri={mri}
+ op={op}
query={queryWithFocusedSeries}
/>
) : (
|
kanidm
|
https://github.com/kanidm/kanidm
|
b1f87660cc1361d12bb00bd98aed2de8bd3932ad
|
dependabot[bot]
|
2023-08-07 01:41:44
|
chore(deps): bump serde_with from 3.1.0 to 3.2.0 (#1944)
|
Bumps [serde_with](https://github.com/jonasbb/serde_with) from 3.1.0 to 3.2.0.
- [Release notes](https://github.com/jonasbb/serde_with/releases)
- [Commits](https://github.com/jonasbb/serde_with/compare/v3.1.0...v3.2.0)
---
|
chore(deps): bump serde_with from 3.1.0 to 3.2.0 (#1944)
Bumps [serde_with](https://github.com/jonasbb/serde_with) from 3.1.0 to 3.2.0.
- [Release notes](https://github.com/jonasbb/serde_with/releases)
- [Commits](https://github.com/jonasbb/serde_with/compare/v3.1.0...v3.2.0)
---
updated-dependencies:
- dependency-name: serde_with
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
|
diff --git a/Cargo.lock b/Cargo.lock
index c243207a78..6ebb684bd3 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2049,6 +2049,7 @@ checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d"
dependencies = [
"equivalent",
"hashbrown 0.14.0",
+ "serde",
]
[[package]]
@@ -4001,14 +4002,15 @@ dependencies = [
[[package]]
name = "serde_with"
-version = "3.1.0"
+version = "3.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "21e47d95bc83ed33b2ecf84f4187ad1ab9685d18ff28db000c99deac8ce180e3"
+checksum = "1402f54f9a3b9e2efe71c1cea24e648acce55887983553eeb858cf3115acfd49"
dependencies = [
"base64 0.21.2",
"chrono",
"hex",
"indexmap 1.9.3",
+ "indexmap 2.0.0",
"serde",
"serde_json",
"serde_with_macros",
@@ -4017,9 +4019,9 @@ dependencies = [
[[package]]
name = "serde_with_macros"
-version = "3.1.0"
+version = "3.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ea3cee93715c2e266b9338b7544da68a9f24e227722ba482bd1c024367c77c65"
+checksum = "9197f1ad0e3c173a0222d3c4404fb04c3afe87e962bcb327af73e8301fa203c7"
dependencies = [
"darling 0.20.3",
"proc-macro2",
diff --git a/Cargo.toml b/Cargo.toml
index 34a7799785..dabf86cfff 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -51,7 +51,7 @@ kanidm_proto = { path = "./proto", version = "1.1.0-rc.14-dev" }
kanidm_unix_int = { path = "./unix_integration" }
kanidm_utils_users = { path = "./libs/users" }
-serde_with = "3.1.0"
+serde_with = "3.2.0"
argon2 = { version = "0.5.1", features = ["alloc"] }
async-recursion = "1.0.4"
async-trait = "^0.1.72"
|
metersphere
|
https://github.com/metersphere/metersphere
|
aeac71a617e3da0f87f6f89711dd198d9a765a6d
|
wxg0103
|
2022-10-18 08:20:24
|
fix(接口定义): 修复选中模块后用更多操作创建接口没显示选中模块的缺陷
|
--bug=1018300 --user=王孝刚 【接口测试】接口定义,选中模块后用更多操作创建接口,没有显示选中的模块
|
fix(接口定义): 修复选中模块后用更多操作创建接口没显示选中模块的缺陷
--bug=1018300 --user=王孝刚 【接口测试】接口定义,选中模块后用更多操作创建接口,没有显示选中的模块
https://www.tapd.cn/55049933/s/1265461
|
diff --git a/api-test/frontend/src/business/automation/scenario/AddBasisScenario.vue b/api-test/frontend/src/business/automation/scenario/AddBasisScenario.vue
index fd83ec16cc25..dbc4145be7e2 100644
--- a/api-test/frontend/src/business/automation/scenario/AddBasisScenario.vue
+++ b/api-test/frontend/src/business/automation/scenario/AddBasisScenario.vue
@@ -153,8 +153,10 @@ export default {
open(currentModule) {
this.scenarioForm = {principal: getCurrentUser().id};
this.currentModule = currentModule;
- if (this.scenarioForm.apiScenarioModuleId === undefined) {
+ if (this.scenarioForm.apiScenarioModuleId === undefined && !currentModule.id) {
this.scenarioForm.apiScenarioModuleId = this.moduleOptions[0].id;
+ } else if (currentModule.id) {
+ this.scenarioForm.apiScenarioModuleId = currentModule.id;
}
this.getMaintainerOptions();
this.visible = true;
diff --git a/api-test/frontend/src/business/definition/components/basis/AddBasisApi.vue b/api-test/frontend/src/business/definition/components/basis/AddBasisApi.vue
index ddb59c27ce1e..f5277b440c39 100644
--- a/api-test/frontend/src/business/definition/components/basis/AddBasisApi.vue
+++ b/api-test/frontend/src/business/definition/components/basis/AddBasisApi.vue
@@ -217,10 +217,12 @@ export default {
},
open(currentModule) {
this.httpForm = {method: REQ_METHOD[0].id, userId: getCurrentUser().id};
- if (this.httpForm.moduleId === undefined) {
+ this.currentModule = currentModule;
+ if (this.httpForm.moduleId === undefined && !currentModule.id) {
this.httpForm.moduleId = this.moduleOptions[0].id;
+ } else if (currentModule.id) {
+ this.httpForm.moduleId = currentModule.id;
}
- this.currentModule = currentModule;
this.getMaintainerOptions();
this.httpVisible = true;
},
|
RSSHub
|
https://github.com/DIYgod/RSSHub
|
4f9262cd88a3cdfe08194362903dd44c4d9d242f
|
ytno1
|
2023-06-07 11:48:55
|
feat(route): Add dblp and format my code (#12620)
|
* Add dblp and format my code
* Add rule files for the dblp
* doi has been set in publication.js
* update files
* update files
* doi has been set in publication.js
|
feat(route): Add dblp and format my code (#12620)
* Add dblp and format my code
* Add rule files for the dblp
* doi has been set in publication.js
* update files
* update files
* doi has been set in publication.js
|
diff --git a/docs/en/study.md b/docs/en/study.md
index 2683466ccc7333..d9400a29bbd7bc 100644
--- a/docs/en/study.md
+++ b/docs/en/study.md
@@ -24,6 +24,12 @@ pageClass: routes
<RouteEn author="HankChow" example="/cssn/iolaw/zxzp" path="/cssn/iolaw/:section?" :paramsDesc="['Section ID, can be found in the URL. For example, the Section ID of URL `http://iolaw.cssn.cn/zxzp/` is `zxzp`. The default value is `zxzp`']"/>
+## DBLP
+
+### Keyword Search
+
+<RouteEn author="ytno1" example="/dblp/knowledge%20tracing" path="/dblp/:field" :paramsDesc="['Research field']" radar="1" />
+
## gradCafe
### gradCafe result
diff --git a/docs/study.md b/docs/study.md
index 839961413bdc00..ebfb2f61ea974c 100644
--- a/docs/study.md
+++ b/docs/study.md
@@ -85,6 +85,12 @@ path="/ctfhub/upcoming/:limit?"
</Route>
+## DBLP
+
+### 关键字搜索
+
+<Route author="ytno1" example="/dblp/knowledge%20tracing" path="/dblp/:field" :paramsDesc="['研究领域']" radar="1" />
+
## gradCafe
### gradCafe result
diff --git a/lib/v2/dblp/maintainer.js b/lib/v2/dblp/maintainer.js
new file mode 100644
index 00000000000000..31a6ab1887d904
--- /dev/null
+++ b/lib/v2/dblp/maintainer.js
@@ -0,0 +1,3 @@
+module.exports = {
+ '/:field': ['ytno1'],
+};
diff --git a/lib/v2/dblp/publication.js b/lib/v2/dblp/publication.js
new file mode 100644
index 00000000000000..19bc4be652c1f8
--- /dev/null
+++ b/lib/v2/dblp/publication.js
@@ -0,0 +1,70 @@
+// 导入所需模组
+const got = require('@/utils/got'); // 自订的 got
+// const { parseDate } = require('@/utils/parse-date');
+
+module.exports = async (ctx) => {
+ // 在此处编写您的逻辑
+ const field = ctx.params.field;
+
+ // 发送 HTTP GET 请求到 API 并解构返回的数据对象
+ const {
+ result: {
+ hits: { hit: data },
+ },
+ } = await got({
+ method: 'get',
+ url: 'https://dblp.org/search/publ/api',
+ searchParams: {
+ q: field,
+ format: 'json',
+ h: 10,
+ },
+ headers: {
+ 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
+ },
+ }).json();
+
+ // console.log(data);
+
+ // 从 API 响应中提取相关数据
+ const list = data.map((item) => {
+ const { info } = item;
+ // console.log(info);
+ const {
+ authors: { author },
+ title,
+ venue,
+ year,
+ type,
+ doi,
+ ee,
+ } = info;
+
+ let authorName;
+ if (Array.isArray(author)) {
+ authorName = author[0].text;
+ } else {
+ authorName = author.text;
+ }
+
+ return {
+ title,
+ link: ee,
+ author: `${authorName} et al.`,
+ doi,
+ description: `Year: ${year ?? 'unknown'}, Venue: ${venue}, Type: ${type}, Doi: ${doi}`,
+ };
+ });
+
+ ctx.state.data = {
+ // 在此处输出您的 RSS
+ // 源标题
+ title: `【dblp】${field}`,
+ // 源链接
+ link: `https://dblp.org/search?q=${field}`,
+ // 源描述
+ description: `DBLP ${field} RSS`,
+ // 处理后的数据,即文章列表
+ item: list,
+ };
+};
diff --git a/lib/v2/dblp/radar.js b/lib/v2/dblp/radar.js
new file mode 100644
index 00000000000000..86274d84730284
--- /dev/null
+++ b/lib/v2/dblp/radar.js
@@ -0,0 +1,13 @@
+module.exports = {
+ 'dblp.org': {
+ _name: 'DBLP',
+ '.': [
+ {
+ title: '关键字搜索',
+ docs: 'https://docs.rsshub.app/study.html#dblp',
+ source: ['/:field'],
+ target: '/dblp/:field',
+ },
+ ],
+ },
+};
diff --git a/lib/v2/dblp/router.js b/lib/v2/dblp/router.js
new file mode 100644
index 00000000000000..86645c8f9b7dd1
--- /dev/null
+++ b/lib/v2/dblp/router.js
@@ -0,0 +1,3 @@
+module.exports = (router) => {
+ router.get('/:field', require('./publication'));
+};
|
swc
|
https://github.com/swc-project/swc
|
bccdafc0c394bf3979da3c6a06d974c7d2c9bcee
|
Donny/강동윤
|
2025-03-11 08:06:49
|
perf(es/fast-lexer): Remove bound checks (#10174)
|
**Description:**
<img width="779" alt="image"
src="https://github.com/user-attachments/assets/fa830f0d-e77b-47c9-8a2f-86697d254217"
/>
|
perf(es/fast-lexer): Remove bound checks (#10174)
**Description:**
<img width="779" alt="image"
src="https://github.com/user-attachments/assets/fa830f0d-e77b-47c9-8a2f-86697d254217"
/>
|
diff --git a/crates/swc_ecma_fast_parser/src/lexer/cursor.rs b/crates/swc_ecma_fast_parser/src/lexer/cursor.rs
index 86c91369aa32..53324c9359ba 100644
--- a/crates/swc_ecma_fast_parser/src/lexer/cursor.rs
+++ b/crates/swc_ecma_fast_parser/src/lexer/cursor.rs
@@ -149,16 +149,16 @@ impl<'a> Cursor<'a> {
unsafe { self.input.get_unchecked(self.pos as usize..) }
}
- /// Get a slice of the input
+ /// Get a slice of the input without bounds checking.
+ ///
+ /// # Safety
+ ///
+ /// The caller must ensure that `start <= end <= self.len`.
#[inline(always)]
- pub fn slice(&self, start: u32, end: u32) -> &'a [u8] {
- let real_start = start.min(self.len);
- let real_end = end.min(self.len);
- // SAFETY: We've validated bounds
- unsafe {
- self.input
- .get_unchecked(real_start as usize..real_end as usize)
- }
+ pub unsafe fn slice_unchecked(&self, start: u32, end: u32) -> &'a [u8] {
+ assume!(unsafe: start <= end);
+ assume!(unsafe: end <= self.len);
+ self.input.get_unchecked(start as usize..end as usize)
}
/// Get the current position
diff --git a/crates/swc_ecma_fast_parser/src/lexer/identifier.rs b/crates/swc_ecma_fast_parser/src/lexer/identifier.rs
index ba8057247d85..d1b292f28b8a 100644
--- a/crates/swc_ecma_fast_parser/src/lexer/identifier.rs
+++ b/crates/swc_ecma_fast_parser/src/lexer/identifier.rs
@@ -71,7 +71,7 @@ impl Lexer<'_> {
let span = self.span();
let ident_start = start_pos.0;
let ident_end = self.cursor.position();
- let ident_bytes = self.cursor.slice(ident_start, ident_end);
+ let ident_bytes = unsafe { self.cursor.slice_unchecked(ident_start, ident_end) };
let ident_str = unsafe { std::str::from_utf8_unchecked(ident_bytes) };
let had_line_break_bool: bool = self.had_line_break.into();
@@ -100,7 +100,7 @@ impl Lexer<'_> {
let span = self.span();
let ident_start = start_pos.0;
let ident_end = self.cursor.position();
- let ident_bytes = self.cursor.slice(ident_start, ident_end);
+ let ident_bytes = unsafe { self.cursor.slice_unchecked(ident_start, ident_end) };
let ident_str = unsafe { std::str::from_utf8_unchecked(ident_bytes) };
let had_line_break_bool: bool = self.had_line_break.into();
diff --git a/crates/swc_ecma_fast_parser/src/lexer/jsx.rs b/crates/swc_ecma_fast_parser/src/lexer/jsx.rs
index 5dd0f5e7c02f..717a794b1a5d 100644
--- a/crates/swc_ecma_fast_parser/src/lexer/jsx.rs
+++ b/crates/swc_ecma_fast_parser/src/lexer/jsx.rs
@@ -125,7 +125,7 @@ impl Lexer<'_> {
let end = self.cursor.position();
if end > start {
- let slice = self.cursor.slice(start, end);
+ let slice = unsafe { self.cursor.slice_unchecked(start, end) };
text.push_str(unsafe { std::str::from_utf8_unchecked(slice) });
}
}
@@ -149,7 +149,7 @@ impl Lexer<'_> {
// Extract the raw text
let end_idx = self.cursor.position();
- let raw_bytes = self.cursor.slice(start_idx, end_idx);
+ let raw_bytes = unsafe { self.cursor.slice_unchecked(start_idx, end_idx) };
let raw_str = unsafe { std::str::from_utf8_unchecked(raw_bytes) };
let span = self.span();
diff --git a/crates/swc_ecma_fast_parser/src/lexer/number.rs b/crates/swc_ecma_fast_parser/src/lexer/number.rs
index 472701dfb128..ecc1efd50743 100644
--- a/crates/swc_ecma_fast_parser/src/lexer/number.rs
+++ b/crates/swc_ecma_fast_parser/src/lexer/number.rs
@@ -280,7 +280,7 @@ impl<'a> Lexer<'a> {
#[inline]
fn extract_number_str(&self, start_idx: u32) -> Cow<'a, str> {
let end_idx = self.cursor.position();
- let num_slice = self.cursor.slice(start_idx, end_idx);
+ let num_slice = unsafe { self.cursor.slice_unchecked(start_idx, end_idx) };
// Filter out the underscore separators
if num_slice.contains(&b'_') {
let mut result = String::with_capacity(num_slice.len());
@@ -304,7 +304,7 @@ impl<'a> Lexer<'a> {
let mut value: u64 = 0;
for i in start..end {
- let byte = unsafe { *self.cursor.slice(i, i + 1).get_unchecked(0) };
+ let byte = unsafe { *self.cursor.slice_unchecked(i, i + 1).get_unchecked(0) };
if byte == b'_' {
continue;
}
@@ -322,7 +322,7 @@ impl<'a> Lexer<'a> {
let mut value: u64 = 0;
for i in start..end {
- let byte = unsafe { *self.cursor.slice(i, i + 1).get_unchecked(0) };
+ let byte = unsafe { *self.cursor.slice_unchecked(i, i + 1).get_unchecked(0) };
if byte == b'_' {
continue;
}
@@ -340,7 +340,7 @@ impl<'a> Lexer<'a> {
let mut value: u64 = 0;
for i in start..end {
- let byte = unsafe { *self.cursor.slice(i, i + 1).get_unchecked(0) };
+ let byte = unsafe { *self.cursor.slice_unchecked(i, i + 1).get_unchecked(0) };
if byte == b'_' {
continue;
}
@@ -406,7 +406,7 @@ impl<'a> Lexer<'a> {
// Extract the raw string excluding the 'n' suffix
let raw_str = {
- let num_slice = self.cursor.slice(start_idx, end_idx - 1);
+ let num_slice = unsafe { self.cursor.slice_unchecked(start_idx, end_idx - 1) };
if num_slice.contains(&b'_') {
// Filter out underscores
let mut result = String::with_capacity(num_slice.len());
diff --git a/crates/swc_ecma_fast_parser/src/lexer/operators.rs b/crates/swc_ecma_fast_parser/src/lexer/operators.rs
index f0276d3a4d3f..ee5c2692d08e 100644
--- a/crates/swc_ecma_fast_parser/src/lexer/operators.rs
+++ b/crates/swc_ecma_fast_parser/src/lexer/operators.rs
@@ -624,7 +624,7 @@ impl Lexer<'_> {
}
let end = self.cursor.position();
let shebang_str =
- unsafe { std::str::from_utf8_unchecked(self.cursor.slice(start, end)) };
+ unsafe { std::str::from_utf8_unchecked(self.cursor.slice_unchecked(start, end)) };
return Ok(Token::new(
TokenType::Shebang,
diff --git a/crates/swc_ecma_fast_parser/src/lexer/regex.rs b/crates/swc_ecma_fast_parser/src/lexer/regex.rs
index dbd8c9020465..af055d8050c0 100644
--- a/crates/swc_ecma_fast_parser/src/lexer/regex.rs
+++ b/crates/swc_ecma_fast_parser/src/lexer/regex.rs
@@ -108,7 +108,7 @@ impl Lexer<'_> {
// Extract the raw regex
let end_idx = self.cursor.position();
- let regex_bytes = self.cursor.slice(start_idx, end_idx);
+ let regex_bytes = unsafe { self.cursor.slice_unchecked(start_idx, end_idx) };
let regex_str = unsafe { std::str::from_utf8_unchecked(regex_bytes) };
// Split into pattern and flags (skip the leading and trailing '/')
diff --git a/crates/swc_ecma_fast_parser/src/lexer/string.rs b/crates/swc_ecma_fast_parser/src/lexer/string.rs
index 44c4ed401ad4..912fae7bc641 100644
--- a/crates/swc_ecma_fast_parser/src/lexer/string.rs
+++ b/crates/swc_ecma_fast_parser/src/lexer/string.rs
@@ -169,7 +169,7 @@ impl Lexer<'_> {
// Extract the raw string (including quotes)
let raw_start = start_pos.0;
let raw_end = self.cursor.position();
- let raw_bytes = self.cursor.slice(raw_start, raw_end);
+ let raw_bytes = unsafe { self.cursor.slice_unchecked(raw_start, raw_end) };
let raw_str = unsafe { std::str::from_utf8_unchecked(raw_bytes) };
// Extract the string value if we used the fast path
@@ -181,7 +181,7 @@ impl Lexer<'_> {
})
} else {
// Direct extraction (excluding quotes)
- let value_bytes = self.cursor.slice(raw_start + 1, raw_end - 1);
+ let value_bytes = unsafe { self.cursor.slice_unchecked(raw_start + 1, raw_end - 1) };
Atom::from(unsafe { std::str::from_utf8_unchecked(value_bytes) })
};
diff --git a/crates/swc_ecma_fast_parser/src/lexer/template.rs b/crates/swc_ecma_fast_parser/src/lexer/template.rs
index 27b2fe33b80f..5a0f1b4c014e 100644
--- a/crates/swc_ecma_fast_parser/src/lexer/template.rs
+++ b/crates/swc_ecma_fast_parser/src/lexer/template.rs
@@ -238,7 +238,7 @@ impl Lexer<'_> {
// Add all these characters at once
let end = self.cursor.position();
if end > start {
- let slice = self.cursor.slice(start, end);
+ let slice = unsafe { self.cursor.slice_unchecked(start, end) };
value.push_str(unsafe { std::str::from_utf8_unchecked(slice) });
}
} else {
@@ -252,7 +252,7 @@ impl Lexer<'_> {
// Extract the raw template (including backticks)
let end_idx = self.cursor.position();
- let raw_bytes = self.cursor.slice(start_idx, end_idx);
+ let raw_bytes = unsafe { self.cursor.slice_unchecked(start_idx, end_idx) };
let raw_str = unsafe { std::str::from_utf8_unchecked(raw_bytes) };
let span = self.span();
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.