fresco 0.0.1 → 0.0.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 93c55d52fcf4445d93f529ebfbc40fd21ba6844f7af94f516e305ebfd827d62a
4
- data.tar.gz: fe611cbe51502fc2cbe2229796a68cb5c1e841869389f2cd3859a51a229a76c9
3
+ metadata.gz: 4f7b6f64c6bd5b23261c7452d83024a166651fefb519c4673d6bb36ffa483acc
4
+ data.tar.gz: 3fc5c6e9ae09f243159fc50bb870e7058e04a20641a6705475b4b2274d97f2d4
5
5
  SHA512:
6
- metadata.gz: 38cd762b679821ba12347aed98ddc83e95a935bedeec0b0a836c8812ee56d621b9c3e2aceb3976319e4f118f9c53ff52771c8ba0be72caa18a868a2d62b58cf0
7
- data.tar.gz: 24cacf9b0c77e7f899ae775898384d4aa497686cf90e0a9a2267d7873c63e208501e4e2897deb5fbd7e2ed78db602129677a0a42b77001708fd18b01dd621f76
6
+ metadata.gz: 6ba5dbf005600b3965e5937bd946d1beff29d7daacc55e7cbd8911568cddcbc951894c34a262c87c919766fea8c2fb283462127d2da7920c369d01bc55911e77
7
+ data.tar.gz: c211e492fa047174125d398a3146d70c774249030ff47e47ca397111cde05893602c02db2038319a90bb1228bbef648d7d71e05195e6c8365b88a2313fcb57dc
data/README.md ADDED
@@ -0,0 +1,169 @@
1
+ # Fresco
2
+
3
+ An application framework for Ruby that compiles to a static binary via
4
+ [Spinel][spinel]. Two modes from the same source tree:
5
+
6
+ - **Dev**: CRuby with auto-reload — `bin/dev`.
7
+ - **Release**: a single static binary, no Ruby on the host — `bin/release`
8
+ produces `build/app`.
9
+
10
+ A build-time DSL (routes, schema, models, migrations) is captured under
11
+ CRuby and codegen'd into `generated/`. The generated tree is what Spinel
12
+ AOT-compiles for release; CRuby loads the same tree for dev.
13
+
14
+ For a runnable tour of the framework, see
15
+ [afomera/fresco-example][fresco-example].
16
+
17
+ [spinel]: https://github.com/matz/spinel
18
+ [fresco-example]: https://github.com/afomera/fresco-example
19
+
20
+ ## Install
21
+
22
+ ```sh
23
+ gem install fresco
24
+ ```
25
+
26
+ Or in a Gemfile:
27
+
28
+ ```ruby
29
+ gem "fresco"
30
+ ```
31
+
32
+ Requires Ruby `>= 3.0` for the dev loop. The release binary has no Ruby
33
+ runtime dependency on the host machine.
34
+
35
+ ## Installing Spinel
36
+
37
+ `fresco dev` runs under CRuby and does **not** need Spinel. `fresco
38
+ release` shells out to a `spinel` binary to AOT-compile your app, so you
39
+ need Spinel installed before you ship a build.
40
+
41
+ Spinel doesn't ship a prebuilt binary today — clone and build it from
42
+ source:
43
+
44
+ ```sh
45
+ # Pick a checkout location. We'll symlink the resulting binary into your
46
+ # Fresco app, so anywhere on disk is fine.
47
+ git clone https://github.com/matz/spinel.git
48
+ cd spinel
49
+
50
+ make deps # fetch and build Spinel's vendored dependencies
51
+ make all # build the spinel binary
52
+ ```
53
+
54
+ That produces a `spinel` executable in the repo root. `fresco release`
55
+ looks for it in this order:
56
+
57
+ 1. `./spinel` in the Fresco app directory (symlink or copy)
58
+ 2. `./vendor/spinel/bin/spinel`
59
+ 3. `spinel` on `$PATH`
60
+
61
+ The simplest setup is a symlink at the app root:
62
+
63
+ ```sh
64
+ cd path/to/your-fresco-app
65
+ ln -s /absolute/path/to/spinel/spinel ./spinel
66
+ ```
67
+
68
+ `.gitignore` the symlink — the binary is per-machine.
69
+
70
+ ### macOS Postgres note
71
+
72
+ If your app uses the Postgres adapter, `fresco release` auto-detects
73
+ Homebrew's keg-only `libpq` (`/opt/homebrew/opt/libpq`,
74
+ `/usr/local/opt/libpq`) and `Postgres.app`, and prepends their
75
+ `include/` and `lib/` to `CPATH` / `LIBRARY_PATH` so Spinel's compile of
76
+ the libpq shim resolves `libpq-fe.h` and `-lpq` without manual export.
77
+ SQLite builds need no extra setup.
78
+
79
+ ## Quick start
80
+
81
+ ```sh
82
+ fresco new bookshelf
83
+ cd bookshelf
84
+ bundle install
85
+ bin/dev
86
+ ```
87
+
88
+ Open <http://localhost:3030/>.
89
+
90
+ To build a release binary:
91
+
92
+ ```sh
93
+ ln -s /path/to/spinel/spinel ./spinel
94
+ bin/release
95
+ ./build/app
96
+ ```
97
+
98
+ ## Commands
99
+
100
+ ```
101
+ fresco new <name> Scaffold a new app in ./<name>/
102
+ fresco build Regenerate generated/* from config + app/
103
+ fresco dev Run the CRuby dev loop (build + watch + serve)
104
+ fresco release Build a Spinel-compiled binary at ./build/app
105
+ ```
106
+
107
+ The scaffolded app's `bin/dev`, `bin/build`, and `bin/release` are thin
108
+ wrappers around `bundle exec fresco <subcommand>`.
109
+
110
+ ### `fresco new` flags
111
+
112
+ ```
113
+ --fresco-path <dir> Pin the generated Gemfile to a path-installed
114
+ fresco (useful when co-developing fresco itself).
115
+ ```
116
+
117
+ ## App layout
118
+
119
+ A Fresco app generated by `fresco new` looks like:
120
+
121
+ ```
122
+ app/
123
+ action.rb # base class
124
+ actions/ # request handlers
125
+ models/ # build-time model declarations
126
+ views/ # ERB templates (compiled at build time)
127
+ config/
128
+ app.rb # framework config
129
+ database.rb # adapter + DSN (omit for no DB)
130
+ routes.rb # route table
131
+ db/
132
+ schema.rb # table declarations
133
+ migrations/ # versioned SQL migrations
134
+ bin/
135
+ dev, build, release # wrappers for `bundle exec fresco …`
136
+ app.rb # Spinel entry point
137
+ ```
138
+
139
+ `generated/` and `build/` are produced by the toolchain and should be
140
+ gitignored.
141
+
142
+ ## How dev and release stay in sync
143
+
144
+ Both modes load the same `generated/` tree. `fresco dev` re-runs the
145
+ build step on file changes; `fresco release` runs it once and hands the
146
+ result to Spinel. There is no separate "production codepath" to drift —
147
+ if a route works in dev, it works in the compiled binary (modulo Spinel's
148
+ Ruby subset, which `rubocop_spinel` lints for at build time when present
149
+ in your Gemfile).
150
+
151
+ ## Development of the gem itself
152
+
153
+ ```sh
154
+ bundle install
155
+ bundle exec rake build # → pkg/fresco-<version>.gem
156
+ bundle exec rake install # build + install locally
157
+ bundle exec rake release # tag + push to rubygems.org
158
+ ```
159
+
160
+ When iterating on `fresco` alongside an app, scaffold the app against
161
+ your working copy:
162
+
163
+ ```sh
164
+ fresco new myapp --fresco-path ../fresco
165
+ ```
166
+
167
+ ## License
168
+
169
+ MIT.
@@ -64,7 +64,7 @@ module Fresco
64
64
  locals = {
65
65
  app_name: app_name,
66
66
  module_name: camelize(app_name),
67
- fresco_source: fresco_path ? ", path: #{File.expand_path(fresco_path).inspect}" : "",
67
+ fresco_source: fresco_path ? ", path: #{File.expand_path(fresco_path).inspect}" : ", source: \"https://rubygems.org\"",
68
68
  }
69
69
 
70
70
  FileUtils.mkdir_p(target)
@@ -1,3 +1,3 @@
1
1
  module Fresco
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fresco
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrea Fomera
@@ -46,6 +46,7 @@ executables:
46
46
  extensions: []
47
47
  extra_rdoc_files: []
48
48
  files:
49
+ - README.md
49
50
  - exe/fresco
50
51
  - lib/fresco.rb
51
52
  - lib/fresco/application.rb