-
Notifications
You must be signed in to change notification settings - Fork 1
DEPRECATION: add deprecation warning to this package #238
Conversation
As part of the new formkit release, all old form element repositories are being deprecated.
Reviewer's Guide by SourceryThis pull request adds a deprecation warning to the auro-select component and updates the documentation build process to accommodate deprecated components. It also updates the location of the design tokens CSS file in the README. Class diagram for deprecatedDocsProcessor.jsclassDiagram
class deprecatedDocsProcessor {
+fileConfigs()
+processDocFiles(config)
}
class templateFiller {
+formatApiTable()
+extractNames()
}
class Logger {
+log(message)
+error(message)
}
deprecatedDocsProcessor -- templateFiller : uses
deprecatedDocsProcessor -- Logger : uses
note for deprecatedDocsProcessor "This class handles the processing of documentation files for deprecated components."
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Surge demo deployment failed! 😭 |
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.
Hey @DukeFerdinand - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider adding a script to automatically update the year in the copyright notice.
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟡 Complexity: 1 issue found
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
// setup | ||
await templateFiller.extractNames(); | ||
|
||
for (const fileConfig of fileConfigs(config)) { |
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.
suggestion: Align the fileConfigs function signature with its usage.
The fileConfigs function is defined without parameters, but it is invoked with a config argument in processDocFiles. Consider either updating fileConfigs to accept this config or remove the unused parameter from the call.
Suggested implementation:
function fileConfigs(config) {
If the fileConfigs function is used elsewhere or if its logic needs to be adjusted to use the passed config, ensure you update the function accordingly.
return path.join(process.cwd(), filePath); | ||
} | ||
|
||
export const fileConfigs = () => [ |
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.
issue (complexity): Consider inlining the path resolution logic and converting the fileConfigs function to a constant.
Consider inlining the simple path resolution logic and the static configuration so that future readers don’t have to jump between functions. For example:
1. Inline `getAbsolutePath` calls with `path.join(process.cwd(), …)` directly.
2. Change `fileConfigs` from a function to a constant object.
For example, replace your current definitions with:
```js
import path from "node:path";
import { Logger } from "@aurodesignsystem/auro-library/scripts/utils/logger.mjs";
import {
processContentForFile,
templateFiller,
} from "@aurodesignsystem/auro-library/scripts/utils/sharedFileProcessorUtils.mjs";
export const fileConfigs = [
// README.md
{
identifier: "README.md",
input: path.join(process.cwd(), "docTemplates/README.md"),
output: path.join(process.cwd(), "README.md"),
},
// index.md
{
identifier: "index.md",
input: path.join(process.cwd(), "docs/partials/index.md"),
output: path.join(process.cwd(), "demo/index.md"),
mdMagicConfig: {
output: { directory: "./demo" },
},
},
// api.md
{
identifier: "api.md",
input: path.join(process.cwd(), "docs/partials/api.md"),
output: path.join(process.cwd(), "demo/api.md"),
preProcessors: [templateFiller.formatApiTable],
},
];
export const defaultDocsProcessorConfig = {
component: undefined,
overwriteLocalCopies: false,
remoteReadmeVersion: "master",
};
export async function processDocFiles(config = defaultDocsProcessorConfig) {
await templateFiller.extractNames();
for (const fileConfig of fileConfigs) { // Note: using the constant instead of calling a function
try {
await processContentForFile(fileConfig);
} catch (err) {
Logger.error(`Error processing ${fileConfig.identifier}: ${err.message}`);
}
}
}
processDocFiles({ overwriteLocalCopies: false })
.then(() => {
Logger.log("Docs processed successfully");
})
.catch((err) => {
Logger.error(`Error processing docs: ${err.message}`);
});
These changes remove unnecessary indirection while preserving all functionality.
🎉 This PR is included in version 3.3.6 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Resolves AlaskaAirlines/auro-formkit#394, adding deprecation warning to old form element repositories.
Summary by Sourcery
Adds a deprecation warning to the component and updates the documentation to reflect this change. The component is no longer supported and users are encouraged to migrate to Auro Formkit.
Documentation: