Skip to content

Commit

Permalink
Copied update-blueprints.js (#36)
Browse files Browse the repository at this point in the history
* bugfix: Copied update-blueprints.js

* chore: Ran update-blueprints-v2-addon

* chore: Added changeset

---------

Co-authored-by: ijlee2 <ijlee2@users.noreply.github.com>
  • Loading branch information
ijlee2 and ijlee2 authored Aug 30, 2024
1 parent 2965750 commit c43583a
Show file tree
Hide file tree
Showing 5 changed files with 113 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/seven-meals-attack.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"create-v2-addon-repo": patch
---

Copied update-blueprints.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/usr/bin/env node
'use strict';

import gitDiffApply from 'git-diff-apply';
import yargs from 'yargs';
import { hideBin } from 'yargs/helpers';

const CURRENT_VERSION = '0.1.0';

async function updateBlueprints({ from, to }) {
const startTag = from;
const endTag = to;

try {
await gitDiffApply({
cwd: process.cwd(),
endTag,
ignoredFiles: ['CHANGELOG.md'],
remoteUrl: 'https://github.com/ijlee2/blueprints-v2-addon-output/',
startTag,
});
} catch (error) {
console.error(`git-diff-apply: ${error}`);
}
}

// Provide a title to the process in `ps`
process.title = 'update-blueprints';

yargs(hideBin(process.argv))
.command({
builder: (yargs) => {
return yargs
.option('from', {
default: CURRENT_VERSION,
describe: "The start version (e.g. '0.1.0')",
type: 'string',
})
.option('to', {
describe: "The end version (e.g. '0.5.0')",
type: 'string',
})
.demandOption(['to']);
},
command: '*',
describe: 'Updates the blueprints for v2 addons',
handler: (argv) => {
updateBlueprints(argv);
},
})
.demandCommand()
.strict()
.parseSync();
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ function setExecutePermissions(options: Options) {

const files = new Set([
'blueprints/v2-addon/build.sh',
'blueprints/v2-addon/update-blueprints.js',
'blueprints/v2-addon/update-test-fixtures.sh',
]);

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/usr/bin/env node
'use strict';

import gitDiffApply from 'git-diff-apply';
import yargs from 'yargs';
import { hideBin } from 'yargs/helpers';

const CURRENT_VERSION = '0.1.0';

async function updateBlueprints({ from, to }) {
const startTag = from;
const endTag = to;

try {
await gitDiffApply({
cwd: process.cwd(),
endTag,
ignoredFiles: ['CHANGELOG.md'],
remoteUrl: 'https://github.com/ijlee2/blueprints-v2-addon-output/',
startTag,
});
} catch (error) {
console.error(`git-diff-apply: ${error}`);
}
}

// Provide a title to the process in `ps`
process.title = 'update-blueprints';

yargs(hideBin(process.argv))
.command({
builder: (yargs) => {
return yargs
.option('from', {
default: CURRENT_VERSION,
describe: "The start version (e.g. '0.1.0')",
type: 'string',
})
.option('to', {
describe: "The end version (e.g. '0.5.0')",
type: 'string',
})
.demandOption(['to']);
},
command: '*',
describe: 'Updates the blueprints for v2 addons',
handler: (argv) => {
updateBlueprints(argv);
},
})
.demandCommand()
.strict()
.parseSync();
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ cp "../blueprints-v2-addon/package.json" "src/blueprints/blueprints/v2-addon/pac
cp "../blueprints-v2-addon/README.md" "src/blueprints/blueprints/v2-addon/README.md"
cp "../blueprints-v2-addon/tsconfig.build.json" "src/blueprints/blueprints/v2-addon/tsconfig.build.json"
cp "../blueprints-v2-addon/tsconfig.json" "src/blueprints/blueprints/v2-addon/tsconfig.json"
cp "../blueprints-v2-addon/update-blueprints.js" "src/blueprints/blueprints/v2-addon/update-blueprints.js"
cp "../blueprints-v2-addon/update-test-fixtures.sh" "src/blueprints/blueprints/v2-addon/update-test-fixtures.sh"

mv "src/blueprints/blueprints/v2-addon/src/blueprints/run-new/__addonLocation__/__gitignore__" "src/blueprints/blueprints/v2-addon/src/blueprints/run-new/__addonLocation__/__.gitignore__"
Expand Down

0 comments on commit c43583a

Please sign in to comment.