Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

promote to stable #60

Merged
merged 18 commits into from
Aug 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
75ccb59
feat(vcs): nested repository-details under the vcs results object
travi Jul 29, 2024
eea11e0
feat(project-name): expect project-name as input rather than reposito…
travi Jul 29, 2024
0b30aeb
feat(repository-name): return the name of the created repository as p…
travi Jul 29, 2024
aedf6f5
chore(deps): update dependency husky to v9.1.4
renovate[bot] Jul 29, 2024
3d327b1
feat(host): set the `host` detail in the vcs results
travi Jul 30, 2024
594afde
feat(owner): return the provided `owner` as a vcs result detail
travi Jul 30, 2024
524bf14
feat(account): owner is no longer accepted as scaffolder input, promp…
travi Jul 30, 2024
ddf6c48
fix(deps): updated the core package and verified plugin compatibility…
travi Jul 30, 2024
1e7df42
Merge pull request #57 from form8ion/alpha
travi Jul 30, 2024
423cdd2
chore(deps): update dependency vitest to v2.0.5
renovate[bot] Jul 31, 2024
ed1a8b7
fix(deps): updated to the latest repo-settings plugin
travi Aug 1, 2024
14e268e
chore(deps): update dependency @form8ion/remark-lint-preset to v6.0.4
renovate[bot] Aug 1, 2024
c514b24
chore(deps): update dependency ls-engines to v0.9.3
renovate[bot] Aug 1, 2024
421578a
chore(deps): update dependency rollup to v4.19.2
renovate[bot] Aug 1, 2024
303b74e
feat(prompt-constants): exposed a constant for the prompt ID
travi Aug 1, 2024
515bff3
feat(prompt-constants): expose constant for question name
travi Aug 1, 2024
1a626cb
chore(deps): update dependency msw to v2.3.5
renovate[bot] Aug 2, 2024
50941d5
chore(deps): update dependency rollup to v4.20.0
renovate[bot] Aug 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 21 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,21 +92,34 @@ The settings file generated by this tool assumes that it is extending an

```javascript
import any from '@travi/any';
import {scaffold, test, lift} from '@form8ion/github';
import {lift, promptConstants, scaffold, test} from '@form8ion/github';
```

#### Execute

```javascript
const projectRoot = process.cwd();

await scaffold({
projectRoot,
name: 'foo',
owner: 'travi',
visibility: any.fromList(['Public', 'Private']),
description: any.sentence()
});
await scaffold(
{
projectRoot,
projectName: 'foo',
visibility: any.fromList(['Public', 'Private']),
description: any.sentence()
},
{
prompt: async ({id}) => {
const {questionNames, ids} = promptConstants;
const expectedPromptId = ids.GITHUB_DETAILS;

if (expectedPromptId === id) {
return {[questionNames[expectedPromptId].GITHUB_ACCOUNT]: any.word()};
}

throw new Error(`Unknown prompt with ID: ${id}`);
}
}
);

if (await test({projectRoot})) {
await lift({
Expand Down
29 changes: 21 additions & 8 deletions example.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import {resolve} from 'path';
import stubbedFs from 'mock-fs';
import any from '@travi/any';
import {scaffold, test, lift} from './lib/index.js';
import {lift, promptConstants, scaffold, test} from './lib/index.js';

// remark-usage-ignore-next
stubbedFs({node_modules: stubbedFs.load(resolve('node_modules'))});
Expand All @@ -12,13 +12,26 @@ stubbedFs({node_modules: stubbedFs.load(resolve('node_modules'))});

const projectRoot = process.cwd();

await scaffold({
projectRoot,
name: 'foo',
owner: 'travi',
visibility: any.fromList(['Public', 'Private']),
description: any.sentence()
});
await scaffold(
{
projectRoot,
projectName: 'foo',
visibility: any.fromList(['Public', 'Private']),
description: any.sentence()
},
{
prompt: async ({id}) => {
const {questionNames, ids} = promptConstants;
const expectedPromptId = ids.GITHUB_DETAILS;

if (expectedPromptId === id) {
return {[questionNames[expectedPromptId].GITHUB_ACCOUNT]: any.word()};
}

throw new Error(`Unknown prompt with ID: ${id}`);
}
}
);

if (await test({projectRoot})) {
await lift({
Expand Down
Loading
Loading