generator-folklore 3.0.56 → 3.0.58
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/generators/agents/templates/serve-html.md +1 -0
- package/lib/generators/agents/templates/serve-laravel.md +1 -0
- package/lib/generators/agents/templates/workflow.md +4 -4
- package/lib/generators/claude/index.js +55 -0
- package/lib/generators/claude/templates/settings-html.json +31 -0
- package/lib/generators/claude/templates/settings-laravel.json +36 -0
- package/lib/generators/html-project/index.js +4 -0
- package/lib/generators/html-project/templates/gitignore +4 -0
- package/lib/generators/laravel-project/index.js +13 -0
- package/lib/generators/laravel-project/templates/gitignore +2 -1
- package/package.json +2 -2
|
@@ -7,6 +7,7 @@ Without a backend, the dev server serves the project directly on `localhost`.
|
|
|
7
7
|
|
|
8
8
|
Notes:
|
|
9
9
|
|
|
10
|
+
- The `dev` configuration of `.claude/launch.json` runs these steps for Claude Code's browser preview.
|
|
10
11
|
- Options reach `flklr` from `package.json` (`build` key), the environment (`FLKLR_*`) and the command line, the command line winning. Leave `package.json` as is and pass overrides on the command line.
|
|
11
12
|
- HTTP avoids the dev server's self-signed certificate, which browsers reject. Use the default HTTPS only when a feature requires a secure context the browser won't grant to `localhost`.
|
|
12
13
|
- Stop the dev server once testing is done.
|
|
@@ -8,6 +8,7 @@ Always test a Laravel project through its `.test` domain, never `localhost`: som
|
|
|
8
8
|
|
|
9
9
|
Notes:
|
|
10
10
|
|
|
11
|
+
- The `dev` configuration of `.claude/launch.json` runs these steps for Claude Code's browser preview.
|
|
11
12
|
- Options reach `flklr` from `package.json` (`build` key), the environment (`FLKLR_*`) and the command line, the command line winning. Leave `package.json` as is and pass overrides on the command line.
|
|
12
13
|
- On a certificate error, see [Fixing Valet certificates](#fixing-valet-certificates) rather than switching to `localhost` or plain HTTP.
|
|
13
14
|
- Stop the dev server once testing is done.
|
|
@@ -4,11 +4,11 @@ Branching follows Gitflow, kept light. `develop` is where development happens: e
|
|
|
4
4
|
|
|
5
5
|
On GitHub, `develop` is the default branch (so PRs target it and `Closes #<number>` closes issues on merge), and the `bug`, `enhancement` and `in-progress` labels exist.
|
|
6
6
|
|
|
7
|
-
###
|
|
7
|
+
### Work straight on `develop` (default)
|
|
8
8
|
|
|
9
|
-
- Small changes asked for directly in conversation: fixes, style or copy tweaks, translations, content.
|
|
9
|
+
- Small changes asked for directly in conversation: fixes, style or copy tweaks, translations, content.
|
|
10
10
|
- Documentation, comments and config with no runtime effect.
|
|
11
|
-
- Run the checks before
|
|
11
|
+
- Run the checks , then stop and leave the changes uncommitted: the maintainer reviews them before they land. Commit only when explicitly asked to. Never push unless asked.
|
|
12
12
|
|
|
13
13
|
### Use an issue and a PR
|
|
14
14
|
|
|
@@ -25,7 +25,7 @@ What decides the flow is where the request came from and what it touches, not th
|
|
|
25
25
|
2. Add the `in-progress` label before starting: it stops a second session from picking the same issue. Remove it if the work is abandoned.
|
|
26
26
|
3. For an `enhancement`, write a short plan in the issue body before coding. `bug` issues skip the plan.
|
|
27
27
|
4. One branch per issue, prefixed by its type: `feature/<number>-<slug>` for an `enhancement`, `bug/<number>-<slug>` for a `bug` (other types follow the same pattern, e.g. `docs/`, `refactor/`). Branch from an up-to-date `develop`, in its own worktree under `.claude/worktrees/<number>-<slug>` so parallel sessions don't share a checkout.
|
|
28
|
-
5. Run the checks, push and open the PR against `develop` with `Closes #<number>` in its body, without asking. If the change couldn't be verified in the session, list the test scenario as a checkbox list in the PR body.
|
|
28
|
+
5. Commit on the issue branch as the work progresses, without asking: the PR is where the review happens. Run the checks, push and open the PR against `develop` with `Closes #<number>` in its body, without asking. If the change couldn't be verified in the session, list the test scenario as a checkbox list in the PR body.
|
|
29
29
|
6. The issue closes when the PR merges into `develop`, never just because code was pushed. Remove the worktree (`git worktree remove`) once merged.
|
|
30
30
|
|
|
31
31
|
Something out of scope noticed along the way becomes a new issue (title, context, files involved) rather than growing the current change. Every issue carries a type label: `bug` or `enhancement`.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _chalk = _interopRequireDefault(require("chalk"));
|
|
8
|
+
var _generator = _interopRequireDefault(require("../../lib/generator"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
const launchArgs = {
|
|
11
|
+
laravel: ['run', 'server', '--', '--no-open'],
|
|
12
|
+
html: ['run', 'server', '--', '--server', 'http', '--no-open']
|
|
13
|
+
};
|
|
14
|
+
const defaultUrls = {
|
|
15
|
+
laravel: 'https://localhost:8080',
|
|
16
|
+
html: 'http://localhost:8080'
|
|
17
|
+
};
|
|
18
|
+
class ClaudeGenerator extends _generator.default {
|
|
19
|
+
constructor(...args) {
|
|
20
|
+
super(...args);
|
|
21
|
+
this.option('type', {
|
|
22
|
+
type: String,
|
|
23
|
+
desc: 'Project type: laravel (served through its .test domain) or html (served on localhost)',
|
|
24
|
+
defaults: 'html'
|
|
25
|
+
});
|
|
26
|
+
this.option('url', {
|
|
27
|
+
type: String,
|
|
28
|
+
desc: 'Url opened by the browser preview (defaults to the dev server url)'
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
prompting() {
|
|
32
|
+
if (this.options.quiet) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
console.log(_chalk.default.yellow('\n----------------------'));
|
|
36
|
+
console.log('Claude Code Generator');
|
|
37
|
+
console.log(_chalk.default.yellow('----------------------\n'));
|
|
38
|
+
}
|
|
39
|
+
writing() {
|
|
40
|
+
const type = this.options.type === 'laravel' ? 'laravel' : 'html';
|
|
41
|
+
const url = (this.options.url || defaultUrls[type]).replace(/\/$/, '');
|
|
42
|
+
this.fs.writeJSON(this.destinationPath('.claude/launch.json'), {
|
|
43
|
+
version: '0.0.1',
|
|
44
|
+
configurations: [{
|
|
45
|
+
name: 'dev',
|
|
46
|
+
runtimeExecutable: 'npm',
|
|
47
|
+
runtimeArgs: launchArgs[type],
|
|
48
|
+
port: 8080,
|
|
49
|
+
url
|
|
50
|
+
}]
|
|
51
|
+
}, null, 4);
|
|
52
|
+
this.fs.copy(this.templatePath(`settings-${type}.json`), this.destinationPath('.claude/settings.json'));
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
exports.default = ClaudeGenerator;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"permissions": {
|
|
3
|
+
"allow": [
|
|
4
|
+
"Bash(npm run lint*)",
|
|
5
|
+
"Bash(npm run format*)",
|
|
6
|
+
"Bash(npm run typecheck)",
|
|
7
|
+
"Bash(npm run test*)",
|
|
8
|
+
"Bash(npm test*)",
|
|
9
|
+
"Bash(npm run server*)",
|
|
10
|
+
"Bash(npx prettier *)",
|
|
11
|
+
"Bash(npx eslint *)",
|
|
12
|
+
"Bash(npx stylelint *)",
|
|
13
|
+
"Bash(npx tsc --noEmit*)",
|
|
14
|
+
"Bash(gh issue view *)",
|
|
15
|
+
"Bash(gh issue list*)",
|
|
16
|
+
"Bash(gh issue create *)",
|
|
17
|
+
"Bash(gh issue edit *)",
|
|
18
|
+
"Bash(gh issue comment *)",
|
|
19
|
+
"Bash(gh pr view*)",
|
|
20
|
+
"Bash(gh pr list*)",
|
|
21
|
+
"Bash(gh pr diff*)",
|
|
22
|
+
"Bash(gh pr checks*)",
|
|
23
|
+
"Bash(gh pr create *)",
|
|
24
|
+
"Bash(gh pr edit *)",
|
|
25
|
+
"Bash(gh pr comment *)"
|
|
26
|
+
],
|
|
27
|
+
"ask": [
|
|
28
|
+
"Bash(git push*)"
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"permissions": {
|
|
3
|
+
"allow": [
|
|
4
|
+
"Bash(npm run lint*)",
|
|
5
|
+
"Bash(npm run format*)",
|
|
6
|
+
"Bash(npm run typecheck)",
|
|
7
|
+
"Bash(npm run test*)",
|
|
8
|
+
"Bash(npm test*)",
|
|
9
|
+
"Bash(npm run server*)",
|
|
10
|
+
"Bash(npx prettier *)",
|
|
11
|
+
"Bash(npx eslint *)",
|
|
12
|
+
"Bash(npx stylelint *)",
|
|
13
|
+
"Bash(npx tsc --noEmit*)",
|
|
14
|
+
"Bash(php artisan test*)",
|
|
15
|
+
"Bash(npx flklr certificates*)",
|
|
16
|
+
"Bash(npx flklr certs*)",
|
|
17
|
+
"Bash(gh issue view *)",
|
|
18
|
+
"Bash(gh issue list*)",
|
|
19
|
+
"Bash(gh issue create *)",
|
|
20
|
+
"Bash(gh issue edit *)",
|
|
21
|
+
"Bash(gh issue comment *)",
|
|
22
|
+
"Bash(gh pr view*)",
|
|
23
|
+
"Bash(gh pr list*)",
|
|
24
|
+
"Bash(gh pr diff*)",
|
|
25
|
+
"Bash(gh pr checks*)",
|
|
26
|
+
"Bash(gh pr create *)",
|
|
27
|
+
"Bash(gh pr edit *)",
|
|
28
|
+
"Bash(gh pr comment *)"
|
|
29
|
+
],
|
|
30
|
+
"ask": [
|
|
31
|
+
"Bash(npx flklr certificates*--fix*)",
|
|
32
|
+
"Bash(npx flklr certs*--fix*)",
|
|
33
|
+
"Bash(git push*)"
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -154,6 +154,10 @@ class HTMLProjectGenerator extends _generator.default {
|
|
|
154
154
|
'src-path': srcPath,
|
|
155
155
|
quiet: true
|
|
156
156
|
});
|
|
157
|
+
this.composeWith('folklore:claude', {
|
|
158
|
+
type: 'html',
|
|
159
|
+
quiet: true
|
|
160
|
+
});
|
|
157
161
|
this.log('merging with folklore build');
|
|
158
162
|
this.composeWith('folklore:build', {
|
|
159
163
|
'src-path': srcPath,
|
|
@@ -249,6 +249,14 @@ class LaravelProjectGenerator extends _generator.default {
|
|
|
249
249
|
quiet: true,
|
|
250
250
|
'skip-install': true
|
|
251
251
|
});
|
|
252
|
+
this.composeWith('folklore:claude', {
|
|
253
|
+
type: 'laravel',
|
|
254
|
+
url: _lodashEs.default.template(_lodashEs.default.get(this.options, 'local-url'))({
|
|
255
|
+
project_host: this.options['project-host'],
|
|
256
|
+
project_name: this.options['project-name']
|
|
257
|
+
}),
|
|
258
|
+
quiet: true
|
|
259
|
+
});
|
|
252
260
|
if (this.options.mediatheque) {
|
|
253
261
|
this.composeWith('folklore:laravel-mediatheque', {
|
|
254
262
|
'project-name': this.options['project-name'],
|
|
@@ -263,6 +271,11 @@ class LaravelProjectGenerator extends _generator.default {
|
|
|
263
271
|
quiet: true
|
|
264
272
|
});
|
|
265
273
|
}
|
|
274
|
+
|
|
275
|
+
// Composed last so its writing runs once composer.json and package.json exist
|
|
276
|
+
this.composeWith('folklore:agents', {
|
|
277
|
+
quiet: true
|
|
278
|
+
});
|
|
266
279
|
}
|
|
267
280
|
get writing() {
|
|
268
281
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "generator-folklore",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.58",
|
|
4
4
|
"description": "Yeoman generator for projects at Folklore",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"yeoman-generator"
|
|
@@ -40,5 +40,5 @@
|
|
|
40
40
|
"yeoman-generator": "5.9.0",
|
|
41
41
|
"yeoman-remote": "^1.0.1"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "a4ecca2cee44ea11eb45fcfce91ff64404571ab8"
|
|
44
44
|
}
|