-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore(utils,radio): remove unused merged ref and add truthy check for useReadyRef * chore(tools): combine update-dependabot-config and productionize scripts
- Loading branch information
Mike Wolf
authored
Oct 20, 2023
1 parent
dcc54db
commit aa44577
Showing
8 changed files
with
69 additions
and
51 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
'@real-system/utils-library': patch | ||
'@real-system/radio-group': patch | ||
--- | ||
|
||
remove unused useMergeRefs and add truthy check to useReadyRef |
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 |
---|---|---|
@@ -1,42 +1,3 @@ | ||
const fs = require('fs'); | ||
const yaml = require('js-yaml'); | ||
const { getWorkspacesInfo, logger, writeToFile } = require('./utils'); | ||
const { updateDependabotConfig } = require('./utils'); | ||
|
||
const DEPENDABOT_CONFIG_PATH = `${__dirname}/../.github/dependabot.yml`; | ||
const applyUpdate = (directory, restOptions = {}) => ({ | ||
'package-ecosystem': 'npm', | ||
directory, | ||
schedule: { interval: 'weekly' }, | ||
labels: ['area: infra', 'area: security', 'area: repo'], | ||
...restOptions, | ||
}); | ||
|
||
const staticUpdates = [ | ||
applyUpdate('/', { 'package-ecosystem': 'github-actions' }), | ||
applyUpdate('/', { 'package-ecosystem': 'npm' }), | ||
]; | ||
|
||
const makeTemplate = (packages) => { | ||
const updates = staticUpdates; | ||
|
||
packages.forEach((pkg) => { | ||
updates.push(applyUpdate(`/${pkg.location}`)); | ||
}); | ||
|
||
return updates; | ||
}; | ||
|
||
(async function updateDependabotConfig() { | ||
logger.info('Updating dependabot config'); | ||
|
||
const { pkgList } = await getWorkspacesInfo({ withCore: true }); | ||
|
||
let dependabot = yaml.load(fs.readFileSync(DEPENDABOT_CONFIG_PATH, 'utf-8')); | ||
const updates = makeTemplate(pkgList); | ||
|
||
dependabot.updates = updates; | ||
|
||
await writeToFile(DEPENDABOT_CONFIG_PATH, yaml.dump(dependabot), { | ||
successMessage: 'Updated dependabot config', | ||
}); | ||
})(); | ||
updateDependabotConfig(); |
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,46 @@ | ||
const fs = require('fs'); | ||
const yaml = require('js-yaml'); | ||
const { getWorkspacesInfo } = require('./workspaceUtils'); | ||
const { writeToFile } = require('./writeToFile'); | ||
const { logger } = require('./logger'); | ||
|
||
const DEPENDABOT_CONFIG_PATH = `${__dirname}/../../.github/dependabot.yml`; | ||
const applyUpdate = (directory, restOptions = {}) => ({ | ||
'package-ecosystem': 'npm', | ||
directory, | ||
schedule: { interval: 'weekly' }, | ||
labels: ['area: infra', 'area: security', 'area: repo'], | ||
...restOptions, | ||
}); | ||
|
||
const staticUpdates = [ | ||
applyUpdate('/', { 'package-ecosystem': 'github-actions' }), | ||
applyUpdate('/', { 'package-ecosystem': 'npm' }), | ||
]; | ||
|
||
const makeTemplate = (packages) => { | ||
const updates = staticUpdates; | ||
|
||
packages.forEach((pkg) => { | ||
updates.push(applyUpdate(`/${pkg.location}`)); | ||
}); | ||
|
||
return updates; | ||
}; | ||
|
||
async function updateDependabotConfig() { | ||
logger.info('Updating dependabot config'); | ||
|
||
const { pkgList } = await getWorkspacesInfo({ withCore: true }); | ||
|
||
let dependabot = yaml.load(fs.readFileSync(DEPENDABOT_CONFIG_PATH, 'utf-8')); | ||
const updates = makeTemplate(pkgList); | ||
|
||
dependabot.updates = updates; | ||
|
||
await writeToFile(DEPENDABOT_CONFIG_PATH, yaml.dump(dependabot), { | ||
successMessage: 'Updated dependabot config', | ||
}); | ||
} | ||
|
||
module.exports = { updateDependabotConfig }; |