From 7302110f6e322d809dc57df85f39bfb37fc0ba47 Mon Sep 17 00:00:00 2001 From: Mike Maietta Date: Mon, 6 May 2024 14:00:32 -0700 Subject: [PATCH] Revert "fix(appx): Update `identityName` validation for windows 10 (#8203)" This reverts commit 66d6d6c73776b8a62ec30d569bf68c0f1eb83ce2. --- .changeset/gentle-bags-thank.md | 5 --- .../app-builder-lib/src/targets/AppxTarget.ts | 43 +++---------------- 2 files changed, 5 insertions(+), 43 deletions(-) delete mode 100644 .changeset/gentle-bags-thank.md diff --git a/.changeset/gentle-bags-thank.md b/.changeset/gentle-bags-thank.md deleted file mode 100644 index 757b6ca24e3..00000000000 --- a/.changeset/gentle-bags-thank.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"app-builder-lib": patch ---- - -feat(appx): Update identityName for windows 10 diff --git a/packages/app-builder-lib/src/targets/AppxTarget.ts b/packages/app-builder-lib/src/targets/AppxTarget.ts index 7871d69d78d..5a55a48864f 100644 --- a/packages/app-builder-lib/src/targets/AppxTarget.ts +++ b/packages/app-builder-lib/src/targets/AppxTarget.ts @@ -20,31 +20,6 @@ const vendorAssetsForDefaultAssets: { [key: string]: string } = { "Wide310x150Logo.png": "SampleAppx.310x150.png", } -const restrictedApplicationIdValues = [ - "CON", - "PRN", - "AUX", - "NUL", - "COM1", - "COM2", - "COM3", - "COM4", - "COM5", - "COM6", - "COM7", - "COM8", - "COM9", - "LPT1", - "LPT2", - "LPT3", - "LPT4", - "LPT5", - "LPT6", - "LPT7", - "LPT8", - "LPT9", -] - const DEFAULT_RESOURCE_LANG = "en-US" export default class AppXTarget extends Target { @@ -225,21 +200,13 @@ export default class AppXTarget extends Target { case "applicationId": { const result = options.applicationId || options.identityName || appInfo.name - const validCharactersRegex = /^[a-zA-Z0-9.-]+$/ - if (result.length < 3 || result.length > 50) { - const message = `Appx Application.Id with a value between 3 and 50 characters in length` - throw new InvalidConfigurationError(message) - } else if (!validCharactersRegex.test(result)) { - const message = `AppX Application.Id cat be consists of alpha-numeric, period, and dash characters"` - throw new InvalidConfigurationError(message) - } else if (restrictedApplicationIdValues.includes(result.toUpperCase())) { - const message = `AppX Application.Id cannot be some values` - throw new InvalidConfigurationError(message) - } else if (options.applicationId == null) { - const message = `Please set appx.applicationId (or correct appx.identityName or name)` + if (!isNaN(parseInt(result[0], 10))) { + let message = `AppX Application.Id can’t start with numbers: "${result}"` + if (options.applicationId == null) { + message += `\nPlease set appx.applicationId (or correct appx.identityName or name)` + } throw new InvalidConfigurationError(message) } - return result }