@blazetrails/stimulus 0.0.0-stage → 0.1.0-alpha0.2

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.
Files changed (44) hide show
  1. package/LICENSE +21 -0
  2. package/dist/constants.generated.js +4 -0
  3. package/dist/constants.generated.js.map +1 -0
  4. package/dist/engine.js +28 -0
  5. package/dist/engine.js.map +1 -0
  6. package/dist/generators/stimulus/USAGE +15 -0
  7. package/dist/generators/stimulus/USAGE.js +12 -0
  8. package/dist/generators/stimulus/stimulus-generator.js +32 -0
  9. package/dist/generators/stimulus/stimulus-generator.js.map +1 -0
  10. package/dist/generators/stimulus/templates/controller.js.tt +7 -0
  11. package/dist/generators/stimulus/templates/controller.js.tt.js +14 -0
  12. package/dist/index.js +5 -0
  13. package/dist/index.js.map +1 -0
  14. package/dist/install/app/javascript/controllers/application.js +9 -0
  15. package/dist/install/app/javascript/controllers/hello_controller.js +7 -0
  16. package/dist/install/app/javascript/controllers/index_for_node.js +8 -0
  17. package/dist/install/stimulus-with-bun.js +22 -0
  18. package/dist/install/stimulus-with-bun.js.map +1 -0
  19. package/dist/install/stimulus-with-node.js +28 -0
  20. package/dist/install/stimulus-with-node.js.map +1 -0
  21. package/dist/manifest.js +35 -0
  22. package/dist/manifest.js.map +1 -0
  23. package/dist/stimulus-trails.js +7 -0
  24. package/dist/stimulus-trails.js.map +1 -0
  25. package/dist/tasks/stimulus-tasks.js +58 -0
  26. package/dist/tasks/stimulus-tasks.js.map +1 -0
  27. package/dist/types/constants.generated.d.ts +2 -0
  28. package/dist/types/engine.d.ts +5 -0
  29. package/dist/types/generators/stimulus/stimulus-generator.d.ts +14 -0
  30. package/dist/types/index.d.ts +5 -0
  31. package/dist/types/install/stimulus-with-bun.d.ts +7 -0
  32. package/dist/types/install/stimulus-with-node.d.ts +8 -0
  33. package/dist/types/manifest.d.ts +7 -0
  34. package/dist/types/stimulus-trails.d.ts +15 -0
  35. package/dist/types/tasks/stimulus-tasks.d.ts +5 -0
  36. package/dist/types/test/generator.test.d.ts +2 -0
  37. package/dist/types/test/generators/lookup.trails.test.d.ts +2 -0
  38. package/dist/types/test/manifest.test.d.ts +2 -0
  39. package/dist/types/test/support/build-templates.d.ts +2 -0
  40. package/dist/types/version.d.ts +2 -0
  41. package/dist/version.js +2 -0
  42. package/dist/version.js.map +1 -0
  43. package/package.json +56 -3
  44. package/README.md +0 -3
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Dean Marano and Trails contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,4 @@
1
+ import { defineConstants } from "@blazetrails/ruby-compat/classpath";
2
+ import * as m0 from "./engine.js";
3
+ defineConstants([[() => m0, "Engine", "Stimulus::Engine"]]);
4
+ //# sourceMappingURL=constants.generated.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.generated.js","sourceRoot":"","sources":["../lib/constants.generated.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,KAAK,EAAE,MAAM,aAAa,CAAC;AAElC,eAAe,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,QAAQ,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAC"}
package/dist/engine.js ADDED
@@ -0,0 +1,28 @@
1
+ import { Trails } from "@blazetrails/trailties";
2
+ import { File } from "@blazetrails/ruby-compat";
3
+ import { Engine as TrailsEngine } from "@blazetrails/trailties/engine";
4
+ import { Stimulus } from "./stimulus-trails.js";
5
+ export class Engine extends TrailsEngine {
6
+ static PRECOMPILE_ASSETS = Object.freeze([
7
+ "stimulus.js",
8
+ "stimulus.min.js",
9
+ "stimulus.min.js.map",
10
+ ]);
11
+ static {
12
+ Stimulus.Engine = this;
13
+ TrailsEngine.register(this, import.meta.dirname);
14
+ /** @inventedArm add — PERMANENT */
15
+ this.config.paths().add("lib/tasks", {
16
+ with: File.join(import.meta.dirname, "tasks"),
17
+ glob: `*${File.extname(import.meta.filename)}`,
18
+ });
19
+ this.initializer("stimulus.assets", () => {
20
+ const config = Trails.application.config;
21
+ if (config.isRespondTo("assets")) {
22
+ const assets = config.get("assets");
23
+ assets.precompile = [...assets.precompile, ...Engine.PRECOMPILE_ASSETS];
24
+ }
25
+ });
26
+ }
27
+ }
28
+ //# sourceMappingURL=engine.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"engine.js","sourceRoot":"","sources":["../lib/engine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAChD,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,MAAM,OAAO,MAAO,SAAQ,YAAY;IACtC,MAAM,CAAU,iBAAiB,GAAG,MAAM,CAAC,MAAM,CAAC;QAChD,aAAa;QACb,iBAAiB;QACjB,qBAAqB;KACtB,CAAC,CAAC;IAEH;QACE,QAAQ,CAAC,MAAM,GAAG,IAAI,CAAC;QAEvB,YAAY,CAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;QAEjD,mCAAmC;QACnC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,WAAW,EAAE;YACnC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC;YAC7C,IAAI,EAAE,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,CAAC,QAAQ,CAAC,EAAE;SAC/C,CAAC,CAAC;QAEH,IAAI,CAAC,WAAW,CAAC,iBAAiB,EAAE,GAAG,EAAE;YACvC,MAAM,MAAM,GAAG,MAAM,CAAC,WAAY,CAAC,MAAM,CAAC;YAC1C,IAAI,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE,CAAC;gBACjC,MAAM,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,QAAQ,CAA6B,CAAC;gBAChE,MAAM,CAAC,UAAU,GAAG,CAAC,GAAG,MAAM,CAAC,UAAU,EAAE,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAC;YAC1E,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -0,0 +1,15 @@
1
+ Description:
2
+ ============
3
+ Generates a new Stimulus controller at the passed path. If running under node,
4
+ it'll also call the stimulus:manifest:update task to update the controllers/index.js.
5
+
6
+ Examples:
7
+ =========
8
+ bin/trails generate stimulus chat
9
+
10
+ creates: app/javascript/controllers/chat_controller.js
11
+
12
+
13
+ bin/trails generate stimulus nested/chat
14
+
15
+ creates: app/javascript/controllers/nested/chat_controller.js
@@ -0,0 +1,12 @@
1
+ import { StringIO } from "@blazetrails/ruby-compat";
2
+ async function render(context, locals) {
3
+ const _ob = this.outputBuffer;
4
+ this.outputBuffer.append("Description:\n============\n Generates a new Stimulus controller at the passed path. If running under node,\n it'll also call the stimulus:manifest:update task to update the controllers/index.js.\n\nExamples:\n=========\n bin/trails generate stimulus chat\n\n creates: app/javascript/controllers/chat_controller.js\n\n\n bin/trails generate stimulus nested/chat\n\n creates: app/javascript/controllers/nested/chat_controller.js\n");
5
+ return _ob;
6
+ }
7
+ export default async function () {
8
+ this.outputBuffer = new StringIO();
9
+ await render.call(this);
10
+ return this.outputBuffer.string();
11
+ }
12
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiVVNBR0UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJVU0FHRSJdLCJzb3VyY2VzQ29udGVudCI6WyJEZXNjcmlwdGlvbjpcbj09PT09PT09PT09PVxuICAgIEdlbmVyYXRlcyBhIG5ldyBTdGltdWx1cyBjb250cm9sbGVyIGF0IHRoZSBwYXNzZWQgcGF0aC4gSWYgcnVubmluZyB1bmRlciBub2RlLFxuICAgIGl0J2xsIGFsc28gY2FsbCB0aGUgc3RpbXVsdXM6bWFuaWZlc3Q6dXBkYXRlIHRhc2sgdG8gdXBkYXRlIHRoZSBjb250cm9sbGVycy9pbmRleC5qcy5cblxuRXhhbXBsZXM6XG49PT09PT09PT1cbiAgICBiaW4vdHJhaWxzIGdlbmVyYXRlIHN0aW11bHVzIGNoYXRcblxuICAgIGNyZWF0ZXM6IGFwcC9qYXZhc2NyaXB0L2NvbnRyb2xsZXJzL2NoYXRfY29udHJvbGxlci5qc1xuXG5cbiAgICBiaW4vdHJhaWxzIGdlbmVyYXRlIHN0aW11bHVzIG5lc3RlZC9jaGF0XG5cbiAgICBjcmVhdGVzOiBhcHAvamF2YXNjcmlwdC9jb250cm9sbGVycy9uZXN0ZWQvY2hhdF9jb250cm9sbGVyLmpzXG4iXSwibWFwcGluZ3MiOiI7QUFBQSxLQUFLLFVBQVUsTUFBTSxDQUFDLE9BQU8sRUFBRSxNQUFNO0lBQUksTUFBTSxHQUFHLEdBQUcsSUFBSSxDQUFDLFlBQVksQ0FBQztJQUFDLElBQUksQ0FBQyxZQUFZLENBQUMsTUFBTSxDQUFDLGljQUFpYyxDQUFDLENBQUMifQ==
@@ -0,0 +1,32 @@
1
+ import { File } from "@blazetrails/ruby-compat";
2
+ import { underscore } from "@blazetrails/activesupport";
3
+ import { NamedBase } from "@blazetrails/trailties/generators";
4
+ const __dir__ = File.dirname(decodeURIComponent(new URL(import.meta.url).pathname));
5
+ export class StimulusGenerator extends NamedBase {
6
+ static {
7
+ this.sourceRoot(File.expandPath("templates", __dir__));
8
+ this.classOption("skipManifest", {
9
+ type: "boolean",
10
+ default: false,
11
+ desc: "Don't update the stimulus manifest",
12
+ });
13
+ this.methodAdded("copyViewFiles");
14
+ }
15
+ /** @internal */
16
+ attribute;
17
+ async copyViewFiles() {
18
+ this.attribute = this.stimulusAttributeValue(this.controllerName());
19
+ await this.template("controller.js", `app/javascript/controllers/${this.controllerName()}_controller.js`);
20
+ if (!this.options.skipManifest)
21
+ await this.trailsCommand("stimulus:manifest:update");
22
+ }
23
+ /** @internal */
24
+ controllerName() {
25
+ return underscore(this.name).replace(/_controller$/, "");
26
+ }
27
+ /** @internal */
28
+ stimulusAttributeValue(controllerName) {
29
+ return controllerName.replaceAll("/", "--").replaceAll("_", "-");
30
+ }
31
+ }
32
+ //# sourceMappingURL=stimulus-generator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stimulus-generator.js","sourceRoot":"","sources":["../../../lib/generators/stimulus/stimulus-generator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,SAAS,EAAyB,MAAM,mCAAmC,CAAC;AAErF,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,IAAI,GAAG,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;AAEpF,MAAM,OAAO,iBAAkB,SAAQ,SAAS;IAC9C;QACE,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC;QACvD,IAAI,CAAC,WAAW,CAAC,cAAc,EAAE;YAC/B,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,KAAK;YACd,IAAI,EAAE,oCAAoC;SAC3C,CAAC,CAAC;QACH,IAAI,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;IACpC,CAAC;IAID,gBAAgB;IAChB,SAAS,CAAU;IAEnB,KAAK,CAAC,aAAa;QACjB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC;QACpE,MAAM,IAAI,CAAC,QAAQ,CACjB,eAAe,EACf,8BAA8B,IAAI,CAAC,cAAc,EAAE,gBAAgB,CACpE,CAAC;QACF,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY;YAAE,MAAM,IAAI,CAAC,aAAa,CAAC,0BAA0B,CAAC,CAAC;IACvF,CAAC;IAED,gBAAgB;IACR,cAAc;QACpB,OAAO,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC;IAC3D,CAAC;IAED,gBAAgB;IACR,sBAAsB,CAAC,cAAsB;QACnD,OAAO,cAAc,CAAC,UAAU,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACnE,CAAC;CACF"}
@@ -0,0 +1,7 @@
1
+ import { Controller } from "@hotwired/stimulus"
2
+
3
+ // Connects to data-controller="<%= this.attribute %>"
4
+ export default class extends Controller {
5
+ connect() {
6
+ }
7
+ }
@@ -0,0 +1,14 @@
1
+ import { StringIO, rbObjAsString } from "@blazetrails/ruby-compat";
2
+ async function render(context, locals) {
3
+ const _ob = this.outputBuffer;
4
+ this.outputBuffer.append("import { Controller } from \"@hotwired/stimulus\"\n\n// Connects to data-controller=\"");
5
+ ((value) => this.outputBuffer.append(rbObjAsString(value)))(this.attribute);
6
+ this.outputBuffer.append("\"\nexport default class extends Controller {\n connect() {\n }\n}\n");
7
+ return _ob;
8
+ }
9
+ export default async function () {
10
+ this.outputBuffer = new StringIO();
11
+ await render.call(this);
12
+ return this.outputBuffer.string();
13
+ }
14
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29udHJvbGxlci5qcy50dC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImNvbnRyb2xsZXIuanMudHQiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgQ29udHJvbGxlciB9IGZyb20gXCJAaG90d2lyZWQvc3RpbXVsdXNcIlxuXG4vLyBDb25uZWN0cyB0byBkYXRhLWNvbnRyb2xsZXI9XCI8JT0gdGhpcy5hdHRyaWJ1dGUgJT5cIlxuZXhwb3J0IGRlZmF1bHQgY2xhc3MgZXh0ZW5kcyBDb250cm9sbGVyIHtcbiAgY29ubmVjdCgpIHtcbiAgfVxufVxuIl0sIm1hcHBpbmdzIjoiO0FBQUEsS0FBSyxVQUFVLE1BQU0sQ0FBQyxPQUFPLEVBQUUsTUFBTTtJQUFJLE1BQU0sR0FBRyxHQUFHLElBQUksQ0FBQyxZQUFZLENBQUM7SUFBQyxJQUFJLENBQUMsWUFBWSxDQUFDLE1BQU0sQ0FBQyx3RkFBd0YsQ0FBQyxDQUFDO0lBQTNMLENBQUMsQ0FBQyxLQUFLLEVBQUUsRUFBRSxDQUFDLElBQUksQ0FBQyxZQUFZLENBQUMsTUFBTSxDQUFDLGFBQWEsQ0FBQyxLQUFLLENBQUMsQ0FBQyxDQUFDLENBQUUsSUFBSSxDQUFDLFNBQVMsQ0FBRSxDQUFDO0lBQUMsSUFBSSxDQUFDLFlBQVksQ0FBQyxNQUFNLENBQUMsd0VBQXdFLENBQUMsQ0FBQyJ9
package/dist/index.js ADDED
@@ -0,0 +1,5 @@
1
+ import "./constants.generated.js";
2
+ export { Stimulus } from "./stimulus-trails.js";
3
+ export { VERSION } from "./version.js";
4
+ import "./engine.js";
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,0BAA0B,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,aAAa,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { Application } from "@hotwired/stimulus";
2
+
3
+ const application = Application.start();
4
+
5
+ // Configure Stimulus development experience
6
+ application.debug = false;
7
+ window.Stimulus = application;
8
+
9
+ export { application };
@@ -0,0 +1,7 @@
1
+ import { Controller } from "@hotwired/stimulus";
2
+
3
+ export default class extends Controller {
4
+ connect() {
5
+ this.element.textContent = "Hello World!";
6
+ }
7
+ }
@@ -0,0 +1,8 @@
1
+ // This file is auto-generated by ./bin/trails stimulus:manifest:update
2
+ // Run that command whenever you add a new controller or create them with
3
+ // ./bin/trails generate stimulus controllerName
4
+
5
+ import { application } from "./application";
6
+
7
+ import HelloController from "./hello_controller";
8
+ application.register("hello", HelloController);
@@ -0,0 +1,22 @@
1
+ import { File, TopLevel } from "@blazetrails/ruby-compat";
2
+ /**
3
+ * @missingRailsArgs join — PERMANENT
4
+ * @missingRailsArgs append_to_file — PERMANENT
5
+ */
6
+ export default async function () {
7
+ this.say("Create controllers directory");
8
+ await this.emptyDirectory("app/javascript/controllers");
9
+ await this.copyFile(`${import.meta.dirname}/app/javascript/controllers/index_for_node.js`, "app/javascript/controllers/index.js");
10
+ await this.copyFile(`${import.meta.dirname}/app/javascript/controllers/application.js`, "app/javascript/controllers/application.js");
11
+ await this.copyFile(`${import.meta.dirname}/app/javascript/controllers/hello_controller.js`, "app/javascript/controllers/hello_controller.js");
12
+ if (await File.isExistAsync(TopLevel.Trails.root().join("app/javascript/entrypoints/application.js").toString())) {
13
+ this.say("Import Stimulus controllers");
14
+ await this.appendToFile("app/javascript/entrypoints/application.js", `import "~/controllers"\n`);
15
+ }
16
+ else {
17
+ this.say(`Couldn't find "app/javascript/entrypoints/application.js".\nYou must import "~/controllers" in your JavaScript entrypoint file`, "red");
18
+ }
19
+ this.say("Install Stimulus");
20
+ await this.run("bun add @hotwired/stimulus");
21
+ }
22
+ //# sourceMappingURL=stimulus-with-bun.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stimulus-with-bun.js","sourceRoot":"","sources":["../../lib/install/stimulus-with-bun.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAG1D;;;GAGG;AACH,MAAM,CAAC,OAAO,CAAC,KAAK;IAClB,IAAI,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAC;IACzC,MAAM,IAAI,CAAC,cAAc,CAAC,4BAA4B,CAAC,CAAC;IACxD,MAAM,IAAI,CAAC,QAAQ,CACjB,GAAG,OAAO,IAAI,CAAC,OAAO,+CAA+C,EACrE,qCAAqC,CACtC,CAAC;IACF,MAAM,IAAI,CAAC,QAAQ,CACjB,GAAG,OAAO,IAAI,CAAC,OAAO,4CAA4C,EAClE,2CAA2C,CAC5C,CAAC;IACF,MAAM,IAAI,CAAC,QAAQ,CACjB,GAAG,OAAO,IAAI,CAAC,OAAO,iDAAiD,EACvE,gDAAgD,CACjD,CAAC;IAEF,IACE,MAAM,IAAI,CAAC,YAAY,CACrB,QAAQ,CAAC,MAAO,CAAC,IAAI,EAAG,CAAC,IAAI,CAAC,2CAA2C,CAAC,CAAC,QAAQ,EAAE,CACtF,EACD,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAC;QACxC,MAAM,IAAI,CAAC,YAAY,CACrB,2CAA2C,EAC3C,0BAA0B,CAC3B,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,IAAI,CAAC,GAAG,CACN,gIAAgI,EAChI,KAAK,CACN,CAAC;IACJ,CAAC;IAED,IAAI,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;IAC7B,MAAM,IAAI,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;AAC/C,CAAC"}
@@ -0,0 +1,28 @@
1
+ import { File, TopLevel } from "@blazetrails/ruby-compat";
2
+ /**
3
+ * @missingRailsArgs join — PERMANENT
4
+ * @missingRailsArgs append_to_file — PERMANENT
5
+ * @missingRailsArgs run — PERMANENT
6
+ */
7
+ export default async function () {
8
+ this.say("Create controllers directory");
9
+ await this.emptyDirectory("app/javascript/controllers");
10
+ await this.copyFile(`${import.meta.dirname}/app/javascript/controllers/index_for_node.js`, "app/javascript/controllers/index.js");
11
+ await this.copyFile(`${import.meta.dirname}/app/javascript/controllers/application.js`, "app/javascript/controllers/application.js");
12
+ await this.copyFile(`${import.meta.dirname}/app/javascript/controllers/hello_controller.js`, "app/javascript/controllers/hello_controller.js");
13
+ if (await File.isExistAsync(TopLevel.Trails.root().join("app/javascript/entrypoints/application.js").toString())) {
14
+ this.say("Import Stimulus controllers");
15
+ await this.appendToFile("app/javascript/entrypoints/application.js", `import "~/controllers"\n`);
16
+ }
17
+ else {
18
+ this.say(`Couldn't find "app/javascript/entrypoints/application.js".\nYou must import "~/controllers" in your JavaScript entrypoint file`, "red");
19
+ }
20
+ this.say("Install Stimulus");
21
+ if (await File.isExistAsync(TopLevel.Trails.root().join("bun.config.js").toString())) {
22
+ await this.run("bun add @hotwired/stimulus");
23
+ }
24
+ else {
25
+ await this.run("pnpm add @hotwired/stimulus");
26
+ }
27
+ }
28
+ //# sourceMappingURL=stimulus-with-node.js.map
@@ -0,0 +1 @@
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C/C,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAC;IAChD,CAAC;AACH,CAAC"}
@@ -0,0 +1,35 @@
1
+ import { camelize, remove, underscore } from "@blazetrails/activesupport";
2
+ import { sort } from "@blazetrails/ruby-compat";
3
+ import { Stimulus } from "./stimulus-trails.js";
4
+ export const Manifest = {
5
+ async generateFrom(controllersPath) {
6
+ const manifest = (await this.extractControllersFrom(controllersPath)).map((controllerPath) => this.importAndRegisterController(controllersPath, controllerPath));
7
+ return [...new Set(manifest)];
8
+ },
9
+ importAndRegisterController(controllersPath, controllerPath) {
10
+ controllerPath = controllerPath.relativePathFrom(controllersPath).toString();
11
+ const modulePath = controllerPath.split(".")[0];
12
+ const controllerClassName = camelize(underscore(modulePath)).replace(/::/g, "__");
13
+ const tagName = remove(modulePath, /_controller/)
14
+ .replace(/_/g, "-")
15
+ .replace(/\//g, "--");
16
+ return `
17
+ import ${controllerClassName} from "./${modulePath}"
18
+ application.register("${tagName}", ${controllerClassName})
19
+ `;
20
+ },
21
+ async extractControllersFrom(directory) {
22
+ const children = await directory.children();
23
+ const directories = [];
24
+ for (const d of children) {
25
+ if (await d.isDirectory())
26
+ directories.push(await this.extractControllersFrom(d));
27
+ }
28
+ return sort([
29
+ ...children.filter((e) => /_controller(\.\w+)+$/m.test(e.toString())),
30
+ ...directories,
31
+ ].flat());
32
+ },
33
+ };
34
+ Stimulus.Manifest = Manifest;
35
+ //# sourceMappingURL=manifest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest.js","sourceRoot":"","sources":["../lib/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAC1E,OAAO,EAAE,IAAI,EAAiB,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,MAAM,CAAC,MAAM,QA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,IAAI,CACT;YACE,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,uBAAuB,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;YACrE,GAAG,WAAW;SACf,CAAC,IAAI,EAAE,CACT,CAAC;IACJ,CAAC;CACF,CAAC;AAEF,QAAQ,CAAC,QAAQ,GAAG,QAAQ,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { TopLevel } from "@blazetrails/ruby-compat";
2
+ import { VERSION } from "./version.js";
3
+ export const Stimulus = {
4
+ VERSION,
5
+ };
6
+ TopLevel.Stimulus = Stimulus;
7
+ //# sourceMappingURL=stimulus-trails.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stimulus-trails.js","sourceRoot":"","sources":["../lib/stimulus-trails.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAKvC,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,OAAO;CAMR,CAAC;AAEF,QAAQ,CAAC,QAAQ,GAAG,QAAQ,CAAC"}
@@ -0,0 +1,58 @@
1
+ import { DSL, Task } from "@blazetrails/rake";
2
+ import { File, RbConfig, STDOUT as $stdout, TopLevel, block } from "@blazetrails/ruby-compat";
3
+ import { rbFSystem } from "@blazetrails/ruby-compat/kernel-system";
4
+ import { Manifest } from "../manifest.js";
5
+ import { Stimulus } from "../stimulus-trails.js";
6
+ export const Tasks = {
7
+ async runStimulusInstallTemplate(path) {
8
+ return rbFSystem(RbConfig.ruby(), "./bin/trails", "app:template", `LOCATION=${File.expandPath(`../install/${path}${File.extname(import.meta.filename)}`, import.meta.dirname)}`);
9
+ },
10
+ async isUsingBun() {
11
+ return File.isExistAsync(TopLevel.Trails.root().join("bun.config.js").toString());
12
+ },
13
+ };
14
+ Stimulus.Tasks = Tasks;
15
+ DSL.namespace("stimulus", () => {
16
+ DSL.desc("Install Stimulus into the app");
17
+ DSL.task("install", block(async () => {
18
+ if ((await File.isExistAsync(TopLevel.Trails.root().join("package.json").toString())) &&
19
+ (await Stimulus.Tasks.isUsingBun())) {
20
+ await (await Task.get("stimulus:install:bun")).invoke();
21
+ }
22
+ else if (await File.isExistAsync(TopLevel.Trails.root().join("package.json").toString())) {
23
+ await (await Task.get("stimulus:install:node")).invoke();
24
+ }
25
+ else {
26
+ $stdout.puts("You must either be running with node (package.json) or importmap-rails (config/importmap.rb) to use this gem.");
27
+ }
28
+ }));
29
+ DSL.namespace("install", () => {
30
+ DSL.desc("Install Stimulus on an app running node");
31
+ DSL.task("node", block(async () => {
32
+ await Stimulus.Tasks.runStimulusInstallTemplate("stimulus-with-node");
33
+ }));
34
+ DSL.desc("Install Stimulus on an app running bun");
35
+ DSL.task("bun", block(async () => {
36
+ await Stimulus.Tasks.runStimulusInstallTemplate("stimulus-with-bun");
37
+ }));
38
+ });
39
+ DSL.namespace("manifest", () => {
40
+ DSL.desc("Show the current Stimulus manifest (all installed controllers)");
41
+ DSL.task("display", block(async () => {
42
+ $stdout.puts(await Manifest.generateFrom(TopLevel.Trails.root().join("app/javascript/controllers")));
43
+ }));
44
+ DSL.desc("Update the Stimulus manifest (will overwrite controllers/index.js)");
45
+ DSL.task("update", block(async () => {
46
+ const manifest = await Manifest.generateFrom(TopLevel.Trails.root().join("app/javascript/controllers"));
47
+ await File.openAsync(TopLevel.Trails.root().join("app/javascript/controllers/index.js").toString(), "w+", (index) => {
48
+ index.puts("// This file is auto-generated by ./bin/trails stimulus:manifest:update");
49
+ index.puts("// Run that command whenever you add a new controller or create them with");
50
+ index.puts("// ./bin/trails generate stimulus controllerName");
51
+ index.puts();
52
+ index.puts(`import { application } from "./application"`);
53
+ index.puts(manifest);
54
+ });
55
+ }));
56
+ });
57
+ });
58
+ //# sourceMappingURL=stimulus-tasks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stimulus-tasks.js","sourceR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KAAK,IAAI,EAAE;YACf,OAAO,CAAC,IAAI,CACV,MAAM,QAAQ,CAAC,YAAY,CAAC,QAAQ,CAAC,MAAO,CAAC,IAAI,EAAG,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAC,CACzF,CAAC;QACJ,CAAC,CAAC,CACH,CAAC;QAEF,GAAG,CAAC,IAAI,CAAC,oEAAoE,CAAC,CAAC;QAC/E,GAAG,CAAC,IAAI,CACN,QAAQ,EACR,KAAK,CAAC,KAAK,IAAI,EAAE;YACf,MAAM,QAAQ,GAAG,MAAM,QAAQ,CAAC,YAAY,CAC1C,QAAQ,CAAC,MAAO,CAAC,IAAI,EAAG,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAC5D,CAAC;YAEF,MAAM,IAAI,CAAC,SAAS,CAClB,QAAQ,CAAC,MAAO,CAAC,IAAI,EAAG,CAAC,IAAI,CAAC,qCAAqC,CAAC,CAAC,QAAQ,EAAE,EAC/E,IAAI,EACJ,CAAC,KAAK,EAAE,EAAE;gBACR,KAAK,CAAC,IAAI,CAAC,yEAAyE,CAAC,CAAC;gBACtF,KAAK,CAAC,IAAI,CAAC,2EAA2E,CAAC,CAAC;gBACxF,KAAK,CAAC,IAAI,CAAC,kDAAkD,CAAC,CAAC;gBAC/D,KAAK,CAAC,IAAI,EAAE,CAAC;gBACb,KAAK,CAAC,IAAI,CAAC,6CAA6C,CAAC,CAAC;gBAC1D,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YACvB,CAAC,CACF,CAAC;QACJ,CAAC,CAAC,CACH,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=constants.generated.d.ts.map
@@ -0,0 +1,5 @@
1
+ import { Engine as TrailsEngine } from "@blazetrails/trailties/engine";
2
+ export declare class Engine extends TrailsEngine {
3
+ static readonly PRECOMPILE_ASSETS: readonly string[];
4
+ }
5
+ //# sourceMappingURL=engine.d.ts.map
@@ -0,0 +1,14 @@
1
+ import { NamedBase, type GeneratorOptions } from "@blazetrails/trailties/generators";
2
+ export declare class StimulusGenerator extends NamedBase {
3
+ options: GeneratorOptions & {
4
+ skipManifest?: boolean;
5
+ };
6
+ /** @internal */
7
+ attribute?: string;
8
+ copyViewFiles(): Promise<void>;
9
+ /** @internal */
10
+ private controllerName;
11
+ /** @internal */
12
+ private stimulusAttributeValue;
13
+ }
14
+ //# sourceMappingURL=stimulus-generator.d.ts.map
@@ -0,0 +1,5 @@
1
+ import "./constants.generated.js";
2
+ export { Stimulus } from "./stimulus-trails.js";
3
+ export { VERSION } from "./version.js";
4
+ import "./engine.js";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,7 @@
1
+ import type { AppGenerator } from "@blazetrails/trailties/generators";
2
+ /**
3
+ * @missingRailsArgs join — PERMANENT
4
+ * @missingRailsArgs append_to_file — PERMANENT
5
+ */
6
+ export default function (this: AppGenerator): Promise<void>;
7
+ //# sourceMappingURL=stimulus-with-bun.d.ts.map
@@ -0,0 +1,8 @@
1
+ import type { AppGenerator } from "@blazetrails/trailties/generators";
2
+ /**
3
+ * @missingRailsArgs join — PERMANENT
4
+ * @missingRailsArgs append_to_file — PERMANENT
5
+ * @missingRailsArgs run — PERMANENT
6
+ */
7
+ export default function (this: AppGenerator): Promise<void>;
8
+ //# sourceMappingURL=stimulus-with-node.d.ts.map
@@ -0,0 +1,7 @@
1
+ import { type Pathname } from "@blazetrails/ruby-compat";
2
+ export declare const Manifest: {
3
+ generateFrom(controllersPath: Pathname): Promise<string[]>;
4
+ importAndRegisterController(controllersPath: Pathname, controllerPath: Pathname | string): string;
5
+ extractControllersFrom(directory: Pathname): Promise<Pathname[]>;
6
+ };
7
+ //# sourceMappingURL=manifest.d.ts.map
@@ -0,0 +1,15 @@
1
+ import type { Engine } from "./engine.js";
2
+ import type { Manifest } from "./manifest.js";
3
+ import type { Tasks } from "./tasks/stimulus-tasks.js";
4
+ export declare const Stimulus: {
5
+ VERSION: string;
6
+ Engine: typeof Engine;
7
+ Manifest: typeof Manifest;
8
+ Tasks: typeof Tasks;
9
+ };
10
+ declare module "@blazetrails/ruby-compat/object" {
11
+ interface TopLevelConstants {
12
+ Stimulus?: typeof Stimulus;
13
+ }
14
+ }
15
+ //# sourceMappingURL=stimulus-trails.d.ts.map
@@ -0,0 +1,5 @@
1
+ export declare const Tasks: {
2
+ runStimulusInstallTemplate(path: string): Promise<boolean | null>;
3
+ isUsingBun(): Promise<boolean>;
4
+ };
5
+ //# sourceMappingURL=stimulus-tasks.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=generator.test.d.ts.map
@@ -0,0 +1,2 @@
1
+ import "@blazetrails/trailties/generators";
2
+ //# sourceMappingURL=lookup.trails.test.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=manifest.test.d.ts.map
@@ -0,0 +1,2 @@
1
+ export default function setup(): Promise<void>;
2
+ //# sourceMappingURL=build-templates.d.ts.map
@@ -0,0 +1,2 @@
1
+ export declare const VERSION = "1.3.4";
2
+ //# sourceMappingURL=version.d.ts.map
@@ -0,0 +1,2 @@
1
+ export const VERSION = "1.3.4";
2
+ //# sourceMappingURL=version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../lib/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,59 @@
1
1
  {
2
2
  "name": "@blazetrails/stimulus",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.0-alpha0.2",
4
+ "description": "Stimulus for Trails, mirroring the stimulus-rails gem",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "url": "git+https://github.com/blazetrailsdev/trails.git",
8
+ "directory": "packages/stimulus"
9
+ },
10
+ "homepage": "https://github.com/blazetrailsdev/trails/tree/main/packages/stimulus#readme",
11
+ "type": "module",
12
+ "main": "dist/index.js",
13
+ "types": "dist/types/index.d.ts",
14
+ "exports": {
15
+ ".": {
16
+ "types": "./dist/types/index.d.ts",
17
+ "default": "./dist/index.js"
18
+ },
19
+ "./*.js": {
20
+ "types": "./dist/types/*.d.ts",
21
+ "default": "./dist/*.js"
22
+ },
23
+ "./*": {
24
+ "types": "./dist/types/*.d.ts",
25
+ "default": "./dist/*.js"
26
+ }
27
+ },
28
+ "files": [
29
+ "dist",
30
+ "!dist/**/*.d.ts.map"
31
+ ],
32
+ "dependencies": {
33
+ "@blazetrails/activesupport": "0.1.0-alpha0.2",
34
+ "@blazetrails/rake": "0.1.0-alpha0.2",
35
+ "@blazetrails/ruby-compat": "0.1.0-alpha0.2",
36
+ "@blazetrails/trailties": "0.1.0-alpha0.2"
37
+ },
38
+ "engines": {
39
+ "node": ">=26"
40
+ },
41
+ "mirrors": [
42
+ {
43
+ "source": "stimulus-rails",
44
+ "ref": "v1.3.4",
45
+ "sha": "8e34f2e4dd7716224317b635db1e5d9ed58324b1"
46
+ }
47
+ ],
48
+ "devDependencies": {
49
+ "@blazetrails/trails-tsc": "0.1.0-alpha0.2",
50
+ "@types/node": "25.3.5"
51
+ },
52
+ "publishConfig": {
53
+ "access": "public"
54
+ },
55
+ "scripts": {
56
+ "build": "tsc && pnpm build:templates",
57
+ "build:templates": "rm -rf dist/install/app && mkdir -p dist/install && cp -R lib/install/app dist/install/ && node -e \"require('fs').cpSync('lib/generators', 'dist/generators', { recursive: true, filter: (source) => !/\\\\.ts$/.test(source) })\" && trails-tsc-views build-templates dist/generators"
58
+ }
6
59
  }
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.