This repository has been archived by the owner on Oct 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Move generating deprecation message inside of packages #83
Merged
Merged
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
@using System | ||
@inherits AutoRest.Core.Template<AutoRest.NodeJS.Model.CodeModelJs> | ||
@Header("// ") | ||
@EmptyLine | ||
const resetColor = "\x1b[0m"; | ||
const brightColor = "\x1b[1m"; | ||
const highlightColor = "\x1b[31m"; | ||
@EmptyLine | ||
try { | ||
const invisibleCharactersLength = resetColor.length + brightColor.length + highlightColor.length; | ||
@EmptyLine | ||
const firstLine = `Active development of this SDK has been moved to ${highlightColor}@(Model.GetCorrespondingTypeScriptPackageName())${resetColor}${brightColor} package.`; | ||
const secondLine = "This package is in maintenance mode and will be deprecated in July 2018."; | ||
const thirdLine = "Visit https://aka.ms/azure-sdk-for-js-migration for more information."; | ||
@EmptyLine | ||
const framePadding = 4; | ||
const adjustedFirstLineLength = firstLine.length - invisibleCharactersLength; | ||
const width = Math.max(adjustedFirstLineLength, secondLine.length, thirdLine.length) + framePadding; | ||
const getPaddingLength = (strLength) => width - strLength - framePadding; | ||
@EmptyLine | ||
const firstLinePaddingLength = getPaddingLength(adjustedFirstLineLength); | ||
const secondLinePaddingLength = getPaddingLength(secondLine.length); | ||
const thirdLinePaddingLength = getPaddingLength(thirdLine.length); | ||
const line = "#".repeat(width); | ||
@EmptyLine | ||
const formatTextLine = (text, padding) => `#${" ".repeat(Math.floor(padding / 2))} ${text} ${" ".repeat(Math.ceil(padding / 2))}#`; | ||
@EmptyLine | ||
console.log(brightColor); | ||
console.log("\n" + line); | ||
console.log(formatTextLine(firstLine, firstLinePaddingLength)); | ||
console.log(formatTextLine(secondLine, secondLinePaddingLength)); | ||
console.log(formatTextLine(thirdLine, thirdLinePaddingLength)); | ||
console.log(line + "\n"); | ||
console.log(resetColor); | ||
} catch (err) { | ||
// ignore | ||
} |
41 changes: 41 additions & 0 deletions
41
...icense-vanilla-false/Expected/AcceptanceTests/ParameterFlattening/.scripts/postinstall.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. See License.txt in the project root for | ||
// license information. | ||
// | ||
// Code generated by Microsoft (R) AutoRest Code Generator. | ||
// Changes may cause incorrect behavior and will be lost if the code is | ||
// regenerated. | ||
|
||
const resetColor = "\x1b[0m"; | ||
const brightColor = "\x1b[1m"; | ||
const highlightColor = "\x1b[31m"; | ||
|
||
try { | ||
const invisibleCharactersLength = resetColor.length + brightColor.length + highlightColor.length; | ||
|
||
const firstLine = `Active development of this SDK has been moved to ${highlightColor}@azure/arm-parameterflattening${resetColor}${brightColor} package.`; | ||
const secondLine = "This package is in maintenance mode and will be deprecated in July 2018."; | ||
const thirdLine = "Visit https://aka.ms/azure-sdk-for-js-migration for more information."; | ||
|
||
const framePadding = 4; | ||
const adjustedFirstLineLength = firstLine.length - invisibleCharactersLength; | ||
const width = Math.max(adjustedFirstLineLength, secondLine.length, thirdLine.length) + framePadding; | ||
const getPaddingLength = (strLength) => width - strLength - framePadding; | ||
|
||
const firstLinePaddingLength = getPaddingLength(adjustedFirstLineLength); | ||
const secondLinePaddingLength = getPaddingLength(secondLine.length); | ||
const thirdLinePaddingLength = getPaddingLength(thirdLine.length); | ||
const line = "#".repeat(width); | ||
|
||
const formatTextLine = (text, padding) => `#${" ".repeat(Math.floor(padding / 2))} ${text} ${" ".repeat(Math.ceil(padding / 2))}#`; | ||
|
||
console.log(brightColor); | ||
console.log("\n" + line); | ||
console.log(formatTextLine(firstLine, firstLinePaddingLength)); | ||
console.log(formatTextLine(secondLine, secondLinePaddingLength)); | ||
console.log(formatTextLine(thirdLine, thirdLinePaddingLength)); | ||
console.log(line + "\n"); | ||
console.log(resetColor); | ||
} catch (err) { | ||
// ignore | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
...license-vanilla-true/Expected/AcceptanceTests/ParameterFlattening/.scripts/postinstall.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. See License.txt in the project root for | ||
// license information. | ||
// | ||
// Code generated by Microsoft (R) AutoRest Code Generator. | ||
// Changes may cause incorrect behavior and will be lost if the code is | ||
// regenerated. | ||
|
||
const resetColor = "\x1b[0m"; | ||
const brightColor = "\x1b[1m"; | ||
const highlightColor = "\x1b[31m"; | ||
|
||
try { | ||
const invisibleCharactersLength = resetColor.length + brightColor.length + highlightColor.length; | ||
|
||
const firstLine = `Active development of this SDK has been moved to ${highlightColor}@azure/arm-parameterflattening${resetColor}${brightColor} package.`; | ||
const secondLine = "This package is in maintenance mode and will be deprecated in July 2018."; | ||
const thirdLine = "Visit https://aka.ms/azure-sdk-for-js-migration for more information."; | ||
|
||
const framePadding = 4; | ||
const adjustedFirstLineLength = firstLine.length - invisibleCharactersLength; | ||
const width = Math.max(adjustedFirstLineLength, secondLine.length, thirdLine.length) + framePadding; | ||
const getPaddingLength = (strLength) => width - strLength - framePadding; | ||
|
||
const firstLinePaddingLength = getPaddingLength(adjustedFirstLineLength); | ||
const secondLinePaddingLength = getPaddingLength(secondLine.length); | ||
const thirdLinePaddingLength = getPaddingLength(thirdLine.length); | ||
const line = "#".repeat(width); | ||
|
||
const formatTextLine = (text, padding) => `#${" ".repeat(Math.floor(padding / 2))} ${text} ${" ".repeat(Math.ceil(padding / 2))}#`; | ||
|
||
console.log(brightColor); | ||
console.log("\n" + line); | ||
console.log(formatTextLine(firstLine, firstLinePaddingLength)); | ||
console.log(formatTextLine(secondLine, secondLinePaddingLength)); | ||
console.log(formatTextLine(thirdLine, thirdLinePaddingLength)); | ||
console.log(line + "\n"); | ||
console.log(resetColor); | ||
} catch (err) { | ||
// ignore | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
...gejson-vanilla-false/Expected/AcceptanceTests/ParameterFlattening/.scripts/postinstall.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. See License.txt in the project root for | ||
// license information. | ||
// | ||
// Code generated by Microsoft (R) AutoRest Code Generator. | ||
// Changes may cause incorrect behavior and will be lost if the code is | ||
// regenerated. | ||
|
||
const resetColor = "\x1b[0m"; | ||
const brightColor = "\x1b[1m"; | ||
const highlightColor = "\x1b[31m"; | ||
|
||
try { | ||
const invisibleCharactersLength = resetColor.length + brightColor.length + highlightColor.length; | ||
|
||
const firstLine = `Active development of this SDK has been moved to ${highlightColor}@azure/arm-parameterflattening${resetColor}${brightColor} package.`; | ||
const secondLine = "This package is in maintenance mode and will be deprecated in July 2018."; | ||
const thirdLine = "Visit https://aka.ms/azure-sdk-for-js-migration for more information."; | ||
|
||
const framePadding = 4; | ||
const adjustedFirstLineLength = firstLine.length - invisibleCharactersLength; | ||
const width = Math.max(adjustedFirstLineLength, secondLine.length, thirdLine.length) + framePadding; | ||
const getPaddingLength = (strLength) => width - strLength - framePadding; | ||
|
||
const firstLinePaddingLength = getPaddingLength(adjustedFirstLineLength); | ||
const secondLinePaddingLength = getPaddingLength(secondLine.length); | ||
const thirdLinePaddingLength = getPaddingLength(thirdLine.length); | ||
const line = "#".repeat(width); | ||
|
||
const formatTextLine = (text, padding) => `#${" ".repeat(Math.floor(padding / 2))} ${text} ${" ".repeat(Math.ceil(padding / 2))}#`; | ||
|
||
console.log(brightColor); | ||
console.log("\n" + line); | ||
console.log(formatTextLine(firstLine, firstLinePaddingLength)); | ||
console.log(formatTextLine(secondLine, secondLinePaddingLength)); | ||
console.log(formatTextLine(thirdLine, thirdLinePaddingLength)); | ||
console.log(line + "\n"); | ||
console.log(resetColor); | ||
} catch (err) { | ||
// ignore | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
...eadmemd-vanilla-true/Expected/AcceptanceTests/ParameterFlattening/.scripts/postinstall.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. See License.txt in the project root for | ||
// license information. | ||
// | ||
// Code generated by Microsoft (R) AutoRest Code Generator. | ||
// Changes may cause incorrect behavior and will be lost if the code is | ||
// regenerated. | ||
|
||
const resetColor = "\x1b[0m"; | ||
const brightColor = "\x1b[1m"; | ||
const highlightColor = "\x1b[31m"; | ||
|
||
try { | ||
const invisibleCharactersLength = resetColor.length + brightColor.length + highlightColor.length; | ||
|
||
const firstLine = `Active development of this SDK has been moved to ${highlightColor}@azure/arm-parameterflattening${resetColor}${brightColor} package.`; | ||
const secondLine = "This package is in maintenance mode and will be deprecated in July 2018."; | ||
const thirdLine = "Visit https://aka.ms/azure-sdk-for-js-migration for more information."; | ||
|
||
const framePadding = 4; | ||
const adjustedFirstLineLength = firstLine.length - invisibleCharactersLength; | ||
const width = Math.max(adjustedFirstLineLength, secondLine.length, thirdLine.length) + framePadding; | ||
const getPaddingLength = (strLength) => width - strLength - framePadding; | ||
|
||
const firstLinePaddingLength = getPaddingLength(adjustedFirstLineLength); | ||
const secondLinePaddingLength = getPaddingLength(secondLine.length); | ||
const thirdLinePaddingLength = getPaddingLength(thirdLine.length); | ||
const line = "#".repeat(width); | ||
|
||
const formatTextLine = (text, padding) => `#${" ".repeat(Math.floor(padding / 2))} ${text} ${" ".repeat(Math.ceil(padding / 2))}#`; | ||
|
||
console.log(brightColor); | ||
console.log("\n" + line); | ||
console.log(formatTextLine(firstLine, firstLinePaddingLength)); | ||
console.log(formatTextLine(secondLine, secondLinePaddingLength)); | ||
console.log(formatTextLine(thirdLine, thirdLinePaddingLength)); | ||
console.log(line + "\n"); | ||
console.log(resetColor); | ||
} catch (err) { | ||
// ignore | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
...path-vanilla-sources/Expected/AcceptanceTests/ParameterFlattening/.scripts/postinstall.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. See License.txt in the project root for | ||
// license information. | ||
// | ||
// Code generated by Microsoft (R) AutoRest Code Generator. | ||
// Changes may cause incorrect behavior and will be lost if the code is | ||
// regenerated. | ||
|
||
const resetColor = "\x1b[0m"; | ||
const brightColor = "\x1b[1m"; | ||
const highlightColor = "\x1b[31m"; | ||
|
||
try { | ||
const invisibleCharactersLength = resetColor.length + brightColor.length + highlightColor.length; | ||
|
||
const firstLine = `Active development of this SDK has been moved to ${highlightColor}@azure/arm-parameterflattening${resetColor}${brightColor} package.`; | ||
const secondLine = "This package is in maintenance mode and will be deprecated in July 2018."; | ||
const thirdLine = "Visit https://aka.ms/azure-sdk-for-js-migration for more information."; | ||
|
||
const framePadding = 4; | ||
const adjustedFirstLineLength = firstLine.length - invisibleCharactersLength; | ||
const width = Math.max(adjustedFirstLineLength, secondLine.length, thirdLine.length) + framePadding; | ||
const getPaddingLength = (strLength) => width - strLength - framePadding; | ||
|
||
const firstLinePaddingLength = getPaddingLength(adjustedFirstLineLength); | ||
const secondLinePaddingLength = getPaddingLength(secondLine.length); | ||
const thirdLinePaddingLength = getPaddingLength(thirdLine.length); | ||
const line = "#".repeat(width); | ||
|
||
const formatTextLine = (text, padding) => `#${" ".repeat(Math.floor(padding / 2))} ${text} ${" ".repeat(Math.ceil(padding / 2))}#`; | ||
|
||
console.log(brightColor); | ||
console.log("\n" + line); | ||
console.log(formatTextLine(firstLine, firstLinePaddingLength)); | ||
console.log(formatTextLine(secondLine, secondLinePaddingLength)); | ||
console.log(formatTextLine(thirdLine, thirdLinePaddingLength)); | ||
console.log(line + "\n"); | ||
console.log(resetColor); | ||
} catch (err) { | ||
// ignore | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should install be captalized?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name of the file is "postinstall.js" so that's why I capitalized it like that. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's fine with me. Leave it the way you have it.