@greenpandastudios/aug-cli 0.19.0 → 0.20.1
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/README.md +9 -6
- package/THIRD_PARTY_NOTICES.md +4 -0
- package/bin/aug.mjs +12 -2
- package/docs/about.md +27 -0
- package/docs/api/crypto.md +103 -69
- package/docs/api/io.md +35 -33
- package/docs/api/json.md +3 -3
- package/docs/api/memory.md +23 -19
- package/docs/api/time.md +10 -9
- package/docs/api/web.md +33 -38
- package/docs/compatibility.md +3 -3
- package/docs/contributing-benchmarks.md +38 -0
- package/docs/dev-containers.md +95 -0
- package/docs/diagnostics.md +15 -5
- package/docs/docker.md +174 -12
- package/docs/editor.md +35 -0
- package/docs/example-projects.json +206 -24
- package/docs/examples/approved-design/counters.md +34 -126
- package/docs/examples/approved-design/dependencies/august/0.20.1/io/contracts.md +178 -0
- package/docs/examples/approved-design/domain/app.md +13 -77
- package/docs/examples/approved-design/domain/export.md +5 -19
- package/docs/examples/approved-design/domain/models.md +4 -23
- package/docs/examples/approved-design/domain/numbers.md +24 -114
- package/docs/examples/approved-design/index.md +16 -7
- package/docs/examples/approved-design/main.md +19 -96
- package/docs/examples/benchmark/index.md +6 -5
- package/docs/examples/benchmark/main.md +7 -35
- package/docs/examples/cli-args/index.md +6 -5
- package/docs/examples/cli-args/main.md +6 -31
- package/docs/examples/collections/index.md +6 -5
- package/docs/examples/collections/main.md +7 -35
- package/docs/examples/collections-benchmark/index.md +6 -5
- package/docs/examples/collections-benchmark/main.md +7 -35
- package/docs/examples/cpu-benchmark/index.md +6 -5
- package/docs/examples/cpu-benchmark/main.md +5 -24
- package/docs/examples/developer-workflow/calculator.md +39 -186
- package/docs/examples/developer-workflow/dependencies/august/0.20.1/io/contracts.md +178 -0
- package/docs/examples/developer-workflow/index.md +16 -7
- package/docs/examples/developer-workflow/logging/console.md +10 -56
- package/docs/examples/developer-workflow/logging/export.md +4 -14
- package/docs/examples/developer-workflow/logging/logger.md +7 -43
- package/docs/examples/developer-workflow/main.md +17 -69
- package/docs/examples/drop/index.md +6 -5
- package/docs/examples/drop/main.md +7 -27
- package/docs/examples/drop/resource.md +7 -30
- package/docs/examples/errors/errors.md +7 -27
- package/docs/examples/errors/index.md +6 -5
- package/docs/examples/errors/main.md +7 -28
- package/docs/examples/ffi/index.md +6 -5
- package/docs/examples/ffi/main.md +6 -20
- package/docs/examples/ffi/native.md +8 -34
- package/docs/examples/generic-di/dependencies/august/0.20.1/io/contracts.md +178 -0
- package/docs/examples/generic-di/index.md +6 -5
- package/docs/examples/generic-di/main.md +9 -39
- package/docs/examples/generic-di/types.md +23 -92
- package/docs/examples/generics/index.md +6 -5
- package/docs/examples/generics/main.md +10 -47
- package/docs/examples/generics/types.md +25 -100
- package/docs/examples/hello/app/export.md +4 -12
- package/docs/examples/hello/app/greeter.md +13 -91
- package/docs/examples/hello/dependencies/august/0.20.1/io/contracts.md +178 -0
- package/docs/examples/hello/index.md +17 -6
- package/docs/examples/hello/logging/console.md +10 -54
- package/docs/examples/hello/logging/export.md +4 -14
- package/docs/examples/hello/logging/logger.md +7 -45
- package/docs/examples/hello/main.md +9 -39
- package/docs/examples/http-benchmark/index.md +6 -5
- package/docs/examples/http-benchmark/main.md +6 -20
- package/docs/examples/http-benchmark/routes.md +9 -31
- package/docs/examples/index.md +46 -29
- package/docs/examples/interceptors/app.md +20 -139
- package/docs/examples/interceptors/dependencies/august/0.20.1/io/contracts.md +178 -0
- package/docs/examples/interceptors/index.md +6 -5
- package/docs/examples/interceptors/interceptors.md +24 -148
- package/docs/examples/interceptors/logging.md +13 -76
- package/docs/examples/interceptors/main.md +10 -65
- package/docs/examples/json-benchmark/data.md +4 -20
- package/docs/examples/json-benchmark/dependencies/packages/@git/url_2d3c37c690c0fa115be1/0.0.0-git.a39fc582565d4fca40be4f75fa304d71adc69301/contracts.md +67 -0
- package/docs/examples/json-benchmark/index.md +7 -5
- package/docs/examples/json-benchmark/main-yaml.md +20 -0
- package/docs/examples/json-benchmark/main.md +10 -49
- package/docs/examples/new-syntax/console.md +10 -52
- package/docs/examples/new-syntax/dependencies/august/0.20.1/io/contracts.md +178 -0
- package/docs/examples/new-syntax/greeter.md +13 -71
- package/docs/examples/new-syntax/index.md +6 -5
- package/docs/examples/new-syntax/logger.md +7 -43
- package/docs/examples/new-syntax/main.md +10 -53
- package/docs/examples/new-syntax/math.md +6 -24
- package/docs/examples/oidc-login/client/contracts.md +10 -61
- package/docs/examples/oidc-login/client/endpoints.md +32 -154
- package/docs/examples/oidc-login/client/export.md +5 -23
- package/docs/examples/oidc-login/client/login.md +234 -344
- package/docs/examples/oidc-login/client/logout.md +38 -143
- package/docs/examples/oidc-login/client/protocol.md +183 -304
- package/docs/examples/oidc-login/client/session.md +41 -149
- package/docs/examples/oidc-login/client/views.md +13 -58
- package/docs/examples/oidc-login/common/export.md +6 -26
- package/docs/examples/oidc-login/common/headers.md +42 -72
- package/docs/examples/oidc-login/common/keys.md +40 -164
- package/docs/examples/oidc-login/common/settings.md +24 -40
- package/docs/examples/oidc-login/common/views.md +7 -28
- package/docs/examples/oidc-login/dependencies/packages/@git/url_0eb7c89453c87681ed15/0.0.0-git.a39fc582565d4fca40be4f75fa304d71adc69301/store.md +205 -0
- package/docs/examples/oidc-login/dependencies/packages/@git/url_2d3c37c690c0fa115be1/0.0.0-git.a39fc582565d4fca40be4f75fa304d71adc69301/contracts.md +67 -0
- package/docs/examples/oidc-login/dependencies/packages/@git/url_897efafd565158fc4908/0.0.0-git.a39fc582565d4fca40be4f75fa304d71adc69301/contracts.md +267 -0
- package/docs/examples/oidc-login/dependencies/packages/@git/url_9ef654c66d34ab8f5527/0.0.0-git.b14a0f9aa41f1ce58bd51133bcdc424033e40d40/contracts.md +415 -0
- package/docs/examples/oidc-login/dependencies/packages/@git/url_9ef654c66d34ab8f5527/0.0.0-git.b14a0f9aa41f1ce58bd51133bcdc424033e40d40/jose.md +271 -0
- package/docs/examples/oidc-login/dependencies/packages/@git/url_c092cd151499c4e1d8a1/0.0.0-git.a39fc582565d4fca40be4f75fa304d71adc69301/contracts.md +89 -0
- package/docs/examples/oidc-login/index.md +8 -7
- package/docs/examples/oidc-login/main-yaml.md +7 -0
- package/docs/examples/oidc-login/main.md +26 -153
- package/docs/examples/oidc-login/provider/authorization.md +232 -275
- package/docs/examples/oidc-login/provider/contracts.md +24 -146
- package/docs/examples/oidc-login/provider/credentials.md +24 -57
- package/docs/examples/oidc-login/provider/discovery.md +48 -122
- package/docs/examples/oidc-login/provider/export.md +11 -37
- package/docs/examples/oidc-login/provider/token.md +159 -237
- package/docs/examples/oidc-login/provider/userinfo.md +47 -102
- package/docs/examples/oidc-login/provider/views.md +13 -53
- package/docs/examples/ownership/counter.md +17 -63
- package/docs/examples/ownership/index.md +6 -5
- package/docs/examples/ownership/main.md +7 -30
- package/docs/examples/ownership-transfer/dependencies/august/0.20.1/io/contracts.md +178 -0
- package/docs/examples/ownership-transfer/index.md +6 -5
- package/docs/examples/ownership-transfer/main.md +10 -52
- package/docs/examples/ownership-transfer/resource.md +15 -67
- package/docs/examples/packages-app/dependencies/packages/@example/aug-math/0.1.0/arithmetic.md +12 -50
- package/docs/examples/packages-app/index.md +7 -6
- package/docs/examples/packages-app/main.md +7 -25
- package/docs/examples/packages-math/aug-package-json.md +1 -1
- package/docs/examples/packages-math/index.md +7 -6
- package/docs/examples/packages-math/src/arithmetic.md +12 -50
- package/docs/examples/packages-math/src/export.md +4 -12
- package/docs/examples/startup-benchmark/index.md +6 -5
- package/docs/examples/startup-benchmark/main.md +5 -17
- package/docs/examples/visibility/counter.md +19 -67
- package/docs/examples/visibility/index.md +6 -5
- package/docs/examples/visibility/main.md +7 -31
- package/docs/examples/weather-api/forecasts.md +168 -0
- package/docs/examples/weather-api/index.md +42 -0
- package/docs/examples/weather-api/main-yaml.md +21 -0
- package/docs/examples/weather-api/main.md +65 -0
- package/docs/examples.json +10 -0
- package/docs/getting-started.md +105 -2
- package/docs/grammar.md +6 -4
- package/docs/guides/change-a-module.md +64 -0
- package/docs/guides/index.md +27 -0
- package/docs/index.md +51 -29
- package/docs/language-conformance.md +1 -1
- package/docs/language-constructs.md +22 -22
- package/docs/language-design-audit.md +1 -1
- package/docs/learn/data-and-errors.md +77 -0
- package/docs/learn/index.md +30 -0
- package/docs/learn/modules-and-dependencies.md +73 -0
- package/docs/learn/state-and-tests.md +71 -0
- package/docs/learn/values-and-functions.md +62 -0
- package/docs/lesson-failures.json +8 -0
- package/docs/maintaining-docs.md +16 -4
- package/docs/packages.md +72 -126
- package/docs/performance.md +13 -41
- package/docs/production-readiness.md +5 -4
- package/docs/public/downloads/approved-design.zip +0 -0
- package/docs/public/downloads/benchmark.zip +0 -0
- package/docs/public/downloads/cli-args.zip +0 -0
- package/docs/public/downloads/collections-benchmark.zip +0 -0
- package/docs/public/downloads/collections.zip +0 -0
- package/docs/public/downloads/cpu-benchmark.zip +0 -0
- package/docs/public/downloads/developer-workflow.zip +0 -0
- package/docs/public/downloads/drop.zip +0 -0
- package/docs/public/downloads/errors.zip +0 -0
- package/docs/public/downloads/ffi.zip +0 -0
- package/docs/public/downloads/generic-di.zip +0 -0
- package/docs/public/downloads/generics.zip +0 -0
- package/docs/public/downloads/hello.zip +0 -0
- package/docs/public/downloads/http-benchmark.zip +0 -0
- package/docs/public/downloads/interceptors.zip +0 -0
- package/docs/public/downloads/json-benchmark.zip +0 -0
- package/docs/public/downloads/new-syntax.zip +0 -0
- package/docs/public/downloads/oidc-login.zip +0 -0
- package/docs/public/downloads/ownership-transfer.zip +0 -0
- package/docs/public/downloads/ownership.zip +0 -0
- package/docs/public/downloads/packages-app.zip +0 -0
- package/docs/public/downloads/packages-math.zip +0 -0
- package/docs/public/downloads/startup-benchmark.zip +0 -0
- package/docs/public/downloads/visibility.zip +0 -0
- package/docs/public/downloads/weather-api.zip +0 -0
- package/docs/reference.md +23 -17
- package/docs/releasing.md +29 -15
- package/docs/research/code-to-natural-language.md +108 -0
- package/docs/research/ecosystem-workflow.md +41 -0
- package/docs/research/wiki-editorial-design.md +71 -0
- package/docs/roadmap.md +1 -1
- package/docs/specifications.md +27 -11
- package/docs/testing.md +19 -5
- package/docs/tooling.md +25 -12
- package/docs/weather-api.md +65 -0
- package/docs/web.md +50 -18
- package/docs/writing-docs.md +49 -0
- package/examples/{hello/.aug-spec/august/0.19.0 → approved-design/.aug-spec/august/0.20.1}/io/contracts.aug +4 -3
- package/examples/approved-design/.aug-spec/august/0.20.1/io/contracts.aug.md +82 -0
- package/examples/approved-design/.aug-spec/manifest.json +3 -3
- package/examples/approved-design/counters.aug +5 -4
- package/examples/approved-design/counters.aug.md +25 -132
- package/examples/approved-design/domain/app.aug +2 -1
- package/examples/approved-design/domain/app.aug.md +10 -80
- package/examples/approved-design/domain/export.aug +1 -0
- package/examples/approved-design/domain/export.aug.md +4 -20
- package/examples/approved-design/domain/models.aug +1 -0
- package/examples/approved-design/domain/models.aug.md +3 -25
- package/examples/approved-design/domain/numbers.aug +3 -2
- package/examples/approved-design/domain/numbers.aug.md +19 -116
- package/examples/approved-design/main.aug +1 -0
- package/examples/approved-design/main.aug.md +12 -95
- package/examples/benchmark/.aug-spec/manifest.json +1 -1
- package/examples/benchmark/main.aug +1 -0
- package/examples/benchmark/main.aug.md +6 -36
- package/examples/cli-args/.aug-spec/manifest.json +1 -1
- package/examples/cli-args/main.aug +1 -0
- package/examples/cli-args/main.aug.md +5 -32
- package/examples/collections/.aug-spec/manifest.json +1 -1
- package/examples/collections/main.aug +1 -0
- package/examples/collections/main.aug.md +6 -36
- package/examples/{generic-di/.aug-spec/august/0.19.0 → developer-workflow/.aug-spec/august/0.20.1}/io/contracts.aug +4 -3
- package/examples/developer-workflow/.aug-spec/august/0.20.1/io/contracts.aug.md +82 -0
- package/examples/developer-workflow/.aug-spec/manifest.json +3 -3
- package/examples/developer-workflow/calculator.aug +3 -2
- package/examples/developer-workflow/calculator.aug.md +28 -189
- package/examples/developer-workflow/logging/console.aug +2 -1
- package/examples/developer-workflow/logging/console.aug.md +7 -57
- package/examples/developer-workflow/logging/export.aug +1 -0
- package/examples/developer-workflow/logging/export.aug.md +3 -15
- package/examples/developer-workflow/logging/logger.aug +1 -0
- package/examples/developer-workflow/logging/logger.aug.md +6 -46
- package/examples/developer-workflow/main.aug +1 -0
- package/examples/developer-workflow/main.aug.md +10 -68
- package/examples/drop/.aug-spec/manifest.json +1 -1
- package/examples/drop/main.aug +1 -0
- package/examples/drop/main.aug.md +6 -28
- package/examples/drop/resource.aug +1 -0
- package/examples/drop/resource.aug.md +6 -34
- package/examples/errors/.aug-spec/manifest.json +1 -1
- package/examples/errors/errors.aug +2 -1
- package/examples/errors/errors.aug.md +4 -27
- package/examples/errors/main.aug +1 -0
- package/examples/errors/main.aug.md +6 -29
- package/examples/ffi/.aug-spec/manifest.json +1 -1
- package/examples/ffi/main.aug +1 -0
- package/examples/ffi/main.aug.md +5 -21
- package/examples/ffi/native.aug +2 -1
- package/examples/ffi/native.aug.md +5 -35
- package/examples/{approved-design/.aug-spec/august/0.19.0 → generic-di/.aug-spec/august/0.20.1}/io/contracts.aug +4 -3
- package/examples/generic-di/.aug-spec/august/0.20.1/io/contracts.aug.md +82 -0
- package/examples/generic-di/.aug-spec/manifest.json +3 -3
- package/examples/generic-di/main.aug +1 -0
- package/examples/generic-di/main.aug.md +8 -40
- package/examples/generic-di/types.aug +3 -2
- package/examples/generic-di/types.aug.md +18 -97
- package/examples/generics/.aug-spec/manifest.json +1 -1
- package/examples/generics/main.aug +1 -0
- package/examples/generics/main.aug.md +9 -48
- package/examples/generics/types.aug +4 -3
- package/examples/generics/types.aug.md +18 -104
- package/examples/{developer-workflow/.aug-spec/august/0.19.0 → hello/.aug-spec/august/0.20.1}/io/contracts.aug +4 -3
- package/examples/hello/.aug-spec/august/0.20.1/io/contracts.aug.md +82 -0
- package/examples/hello/.aug-spec/manifest.json +3 -3
- package/examples/hello/app/export.aug +1 -0
- package/examples/hello/app/export.aug.md +3 -13
- package/examples/hello/app/greeter.aug +2 -1
- package/examples/hello/app/greeter.aug.md +10 -94
- package/examples/hello/logging/console.aug +2 -1
- package/examples/hello/logging/console.aug.md +7 -55
- package/examples/hello/logging/export.aug +1 -0
- package/examples/hello/logging/export.aug.md +3 -15
- package/examples/hello/logging/logger.aug +1 -0
- package/examples/hello/logging/logger.aug.md +6 -48
- package/examples/hello/main.aug +1 -0
- package/examples/hello/main.aug.md +8 -40
- package/examples/interceptors/.aug-spec/august/0.20.1/io/contracts.aug +37 -0
- package/examples/interceptors/.aug-spec/august/0.20.1/io/contracts.aug.md +82 -0
- package/examples/interceptors/.aug-spec/manifest.json +3 -3
- package/examples/interceptors/app.aug +3 -2
- package/examples/interceptors/app.aug.md +15 -141
- package/examples/interceptors/interceptors.aug +3 -2
- package/examples/interceptors/interceptors.aug.md +19 -152
- package/examples/interceptors/logging.aug +2 -1
- package/examples/interceptors/logging.aug.md +10 -79
- package/examples/interceptors/main.aug +1 -0
- package/examples/interceptors/main.aug.md +9 -66
- package/examples/new-syntax/.aug-spec/august/0.20.1/io/contracts.aug +37 -0
- package/examples/new-syntax/.aug-spec/august/0.20.1/io/contracts.aug.md +82 -0
- package/examples/new-syntax/.aug-spec/manifest.json +3 -3
- package/examples/new-syntax/console.aug +2 -1
- package/examples/new-syntax/console.aug.md +7 -53
- package/examples/new-syntax/greeter.aug +2 -1
- package/examples/new-syntax/greeter.aug.md +10 -74
- package/examples/new-syntax/logger.aug +1 -0
- package/examples/new-syntax/logger.aug.md +6 -46
- package/examples/new-syntax/main.aug +1 -0
- package/examples/new-syntax/main.aug.md +9 -54
- package/examples/new-syntax/math.aug +2 -1
- package/examples/new-syntax/math.aug.md +3 -24
- package/examples/oidc-login/.aug-spec/manifest.json +13 -13
- package/examples/oidc-login/.aug-spec/packages/@git/url_0eb7c89453c87681ed15/0.0.0-git.a39fc582565d4fca40be4f75fa304d71adc69301/store.aug.md +71 -0
- package/examples/oidc-login/.aug-spec/packages/@git/url_2d3c37c690c0fa115be1/0.0.0-git.a39fc582565d4fca40be4f75fa304d71adc69301/contracts.aug.md +17 -0
- package/examples/oidc-login/.aug-spec/packages/@git/url_897efafd565158fc4908/0.0.0-git.a39fc582565d4fca40be4f75fa304d71adc69301/contracts.aug.md +125 -0
- package/examples/oidc-login/.aug-spec/{august/0.19.0/crypto → packages/@git/url_9ef654c66d34ab8f5527/0.0.0-git.b14a0f9aa41f1ce58bd51133bcdc424033e40d40}/contracts.aug +12 -11
- package/examples/oidc-login/.aug-spec/packages/@git/url_9ef654c66d34ab8f5527/0.0.0-git.b14a0f9aa41f1ce58bd51133bcdc424033e40d40/contracts.aug.md +244 -0
- package/examples/oidc-login/.aug-spec/{august/0.19.0/crypto → packages/@git/url_9ef654c66d34ab8f5527/0.0.0-git.b14a0f9aa41f1ce58bd51133bcdc424033e40d40}/jose.aug +6 -5
- package/examples/oidc-login/.aug-spec/packages/@git/url_9ef654c66d34ab8f5527/0.0.0-git.b14a0f9aa41f1ce58bd51133bcdc424033e40d40/jose.aug.md +71 -0
- package/examples/oidc-login/.aug-spec/packages/@git/url_c092cd151499c4e1d8a1/0.0.0-git.a39fc582565d4fca40be4f75fa304d71adc69301/contracts.aug.md +30 -0
- package/examples/oidc-login/aug.lock.json +100 -0
- package/examples/oidc-login/client/contracts.aug +1 -0
- package/examples/oidc-login/client/contracts.aug.md +9 -66
- package/examples/oidc-login/client/endpoints.aug +6 -5
- package/examples/oidc-login/client/endpoints.aug.md +13 -145
- package/examples/oidc-login/client/export.aug +1 -0
- package/examples/oidc-login/client/export.aug.md +4 -24
- package/examples/oidc-login/client/login.aug +7 -6
- package/examples/oidc-login/client/login.aug.md +25 -303
- package/examples/oidc-login/client/logout.aug +5 -4
- package/examples/oidc-login/client/logout.aug.md +13 -135
- package/examples/oidc-login/client/protocol.aug +7 -6
- package/examples/oidc-login/client/protocol.aug.md +36 -283
- package/examples/oidc-login/client/session.aug +5 -4
- package/examples/oidc-login/client/session.aug.md +12 -139
- package/examples/oidc-login/client/views.aug +3 -2
- package/examples/oidc-login/client/views.aug.md +8 -57
- package/examples/oidc-login/common/export.aug +1 -0
- package/examples/oidc-login/common/export.aug.md +5 -27
- package/examples/oidc-login/common/headers.aug +4 -3
- package/examples/oidc-login/common/headers.aug.md +9 -67
- package/examples/oidc-login/common/keys.aug +6 -5
- package/examples/oidc-login/common/keys.aug.md +29 -165
- package/examples/oidc-login/common/settings.aug +2 -1
- package/examples/oidc-login/common/settings.aug.md +5 -39
- package/examples/oidc-login/common/views.aug +2 -1
- package/examples/oidc-login/common/views.aug.md +4 -28
- package/examples/oidc-login/main.aug +6 -16
- package/examples/oidc-login/main.aug.md +17 -146
- package/examples/oidc-login/main.yaml +7 -0
- package/examples/oidc-login/provider/authorization.aug +7 -6
- package/examples/oidc-login/provider/authorization.aug.md +23 -238
- package/examples/oidc-login/provider/contracts.aug +1 -0
- package/examples/oidc-login/provider/contracts.aug.md +23 -158
- package/examples/oidc-login/provider/credentials.aug +3 -2
- package/examples/oidc-login/provider/credentials.aug.md +9 -53
- package/examples/oidc-login/provider/discovery.aug +4 -3
- package/examples/oidc-login/provider/discovery.aug.md +11 -118
- package/examples/oidc-login/provider/export.aug +1 -0
- package/examples/oidc-login/provider/export.aug.md +6 -34
- package/examples/oidc-login/provider/token.aug +6 -5
- package/examples/oidc-login/provider/token.aug.md +16 -204
- package/examples/oidc-login/provider/userinfo.aug +4 -3
- package/examples/oidc-login/provider/userinfo.aug.md +10 -92
- package/examples/oidc-login/provider/views.aug +3 -2
- package/examples/oidc-login/provider/views.aug.md +8 -52
- package/examples/ownership/.aug-spec/manifest.json +1 -1
- package/examples/ownership/counter.aug +3 -2
- package/examples/ownership/counter.aug.md +12 -66
- package/examples/ownership/main.aug +1 -0
- package/examples/ownership/main.aug.md +6 -31
- package/examples/ownership-transfer/.aug-spec/august/0.20.1/io/contracts.aug +37 -0
- package/examples/ownership-transfer/.aug-spec/august/0.20.1/io/contracts.aug.md +82 -0
- package/examples/ownership-transfer/.aug-spec/manifest.json +3 -3
- package/examples/ownership-transfer/main.aug +1 -0
- package/examples/ownership-transfer/main.aug.md +9 -53
- package/examples/ownership-transfer/resource.aug +2 -1
- package/examples/ownership-transfer/resource.aug.md +12 -71
- package/examples/packages/app/.aug-spec/manifest.json +1 -1
- package/examples/packages/app/.aug-spec/packages/@example/aug-math/0.1.0/arithmetic.aug +2 -1
- package/examples/packages/app/.aug-spec/packages/@example/aug-math/0.1.0/arithmetic.aug.md +9 -51
- package/examples/packages/app/main.aug +1 -0
- package/examples/packages/app/main.aug.md +6 -26
- package/examples/packages/math/.aug-spec/manifest.json +1 -1
- package/examples/packages/math/aug-package.json +1 -1
- package/examples/packages/math/src/arithmetic.aug +2 -1
- package/examples/packages/math/src/arithmetic.aug.md +9 -51
- package/examples/packages/math/src/export.aug +1 -0
- package/examples/packages/math/src/export.aug.md +3 -13
- package/examples/visibility/.aug-spec/manifest.json +1 -1
- package/examples/visibility/counter.aug +4 -3
- package/examples/visibility/counter.aug.md +12 -68
- package/examples/visibility/main.aug +1 -0
- package/examples/visibility/main.aug.md +6 -32
- package/examples/weather-api/.aug-spec/manifest.json +8 -0
- package/examples/weather-api/AGENTS.md +17 -0
- package/examples/weather-api/README.md +19 -0
- package/examples/weather-api/forecasts.aug +47 -0
- package/examples/weather-api/forecasts.aug.md +32 -0
- package/examples/weather-api/main.aug +4 -0
- package/examples/weather-api/main.aug.md +15 -0
- package/examples/weather-api/main.yaml +5 -0
- package/examples/weather-api/weather.http +5 -0
- package/package.json +3 -4
- package/scripts/bootstrap-native.mjs +181 -106
- package/scripts/native-setup.mjs +98 -0
- package/scripts/native-toolchain.mjs +28 -0
- package/src/builtins.js +1 -1
- package/src/checker.js +259 -72
- package/src/cli.js +114 -20
- package/src/codegen.js +1 -1
- package/src/config.js +1 -1
- package/src/contracts.js +10 -0
- package/src/editor.js +71 -16
- package/src/fixes.js +90 -2
- package/src/formatter.js +19 -8
- package/src/git-packages.js +110 -0
- package/src/help.js +24 -23
- package/src/http-contracts.js +14 -0
- package/src/http-policies.js +5 -5
- package/src/libraries.js +1 -1
- package/src/lsp.js +14 -5
- package/src/native.js +19 -13
- package/src/navigation.js +4 -2
- package/src/openapi.js +5 -4
- package/src/package-locking.js +45 -0
- package/src/package-manager.js +251 -67
- package/src/parser.js +13 -5
- package/src/policies.js +3 -3
- package/src/project-init.js +78 -4
- package/src/project.js +9 -7
- package/src/semantic.js +46 -2
- package/src/snippets.js +59 -0
- package/src/spec-hints.js +56 -0
- package/src/spec-tree.js +241 -0
- package/src/spec.js +626 -303
- package/docs/examples/approved-design/dependencies/august/0.19.0/io/contracts.md +0 -395
- package/docs/examples/developer-workflow/dependencies/august/0.19.0/io/contracts.md +0 -395
- package/docs/examples/generic-di/dependencies/august/0.19.0/io/contracts.md +0 -395
- package/docs/examples/hello/dependencies/august/0.19.0/io/contracts.md +0 -395
- package/docs/examples/interceptors/dependencies/august/0.19.0/io/contracts.md +0 -395
- package/docs/examples/json-benchmark/dependencies/august/0.19.0/json/contracts.md +0 -103
- package/docs/examples/new-syntax/dependencies/august/0.19.0/io/contracts.md +0 -395
- package/docs/examples/oidc-login/dependencies/august/0.19.0/crypto/contracts.md +0 -925
- package/docs/examples/oidc-login/dependencies/august/0.19.0/crypto/jose.md +0 -434
- package/docs/examples/oidc-login/dependencies/august/0.19.0/json/contracts.md +0 -103
- package/docs/examples/oidc-login/dependencies/august/0.19.0/memory/store.md +0 -374
- package/docs/examples/oidc-login/dependencies/august/0.19.0/time/contracts.md +0 -150
- package/docs/examples/oidc-login/dependencies/august/0.19.0/web/contracts.md +0 -532
- package/docs/examples/ownership-transfer/dependencies/august/0.19.0/io/contracts.md +0 -395
- package/examples/approved-design/.aug-spec/august/0.19.0/io/contracts.aug.md +0 -316
- package/examples/developer-workflow/.aug-spec/august/0.19.0/io/contracts.aug.md +0 -316
- package/examples/generic-di/.aug-spec/august/0.19.0/io/contracts.aug.md +0 -316
- package/examples/hello/.aug-spec/august/0.19.0/io/contracts.aug.md +0 -316
- package/examples/interceptors/.aug-spec/august/0.19.0/io/contracts.aug +0 -36
- package/examples/interceptors/.aug-spec/august/0.19.0/io/contracts.aug.md +0 -316
- package/examples/new-syntax/.aug-spec/august/0.19.0/io/contracts.aug +0 -36
- package/examples/new-syntax/.aug-spec/august/0.19.0/io/contracts.aug.md +0 -316
- package/examples/oidc-login/.aug-spec/august/0.19.0/crypto/contracts.aug.md +0 -791
- package/examples/oidc-login/.aug-spec/august/0.19.0/crypto/jose.aug.md +0 -266
- package/examples/oidc-login/.aug-spec/august/0.19.0/json/contracts.aug.md +0 -55
- package/examples/oidc-login/.aug-spec/august/0.19.0/memory/store.aug.md +0 -250
- package/examples/oidc-login/.aug-spec/august/0.19.0/time/contracts.aug.md +0 -96
- package/examples/oidc-login/.aug-spec/august/0.19.0/web/contracts.aug.md +0 -420
- package/examples/ownership-transfer/.aug-spec/august/0.19.0/io/contracts.aug +0 -36
- package/examples/ownership-transfer/.aug-spec/august/0.19.0/io/contracts.aug.md +0 -316
- /package/examples/oidc-login/.aug-spec/{august/0.19.0/memory → packages/@git/url_0eb7c89453c87681ed15/0.0.0-git.a39fc582565d4fca40be4f75fa304d71adc69301}/store.aug +0 -0
- /package/examples/oidc-login/.aug-spec/{august/0.19.0/json → packages/@git/url_2d3c37c690c0fa115be1/0.0.0-git.a39fc582565d4fca40be4f75fa304d71adc69301}/contracts.aug +0 -0
- /package/examples/oidc-login/.aug-spec/{august/0.19.0/web → packages/@git/url_897efafd565158fc4908/0.0.0-git.a39fc582565d4fca40be4f75fa304d71adc69301}/contracts.aug +0 -0
- /package/examples/oidc-login/.aug-spec/{august/0.19.0/time → packages/@git/url_c092cd151499c4e1d8a1/0.0.0-git.a39fc582565d4fca40be4f75fa304d71adc69301}/contracts.aug +0 -0
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# Develop in a VS Code Dev Container
|
|
2
|
+
|
|
3
|
+
Run the August compiler, tests, and native dependencies inside a Linux container while editing your local project in VS Code. This keeps the C toolchain off your host. The project folder stays on your machine; the compiler and prepared dependencies live in the container image.
|
|
4
|
+
|
|
5
|
+
You need Docker with a running Linux engine, VS Code, and Microsoft's [Dev Containers extension](https://code.visualstudio.com/docs/devcontainers/containers). Creating a new project also needs Node.js 24 and npm on the host. You can instead open an existing project or a [downloaded example](examples/index.md).
|
|
6
|
+
|
|
7
|
+
Keep your project in a writable folder shared with the Docker engine. If container creation reports that the bind source path does not exist, enable that folder in your engine's file-sharing settings. A remote Docker engine needs a separate workspace-sharing setup; [Docker's bind mount guide](https://docs.docker.com/engine/storage/bind-mounts/#considerations-and-constraints) explains the constraint.
|
|
8
|
+
|
|
9
|
+
## Create the project and container files
|
|
10
|
+
|
|
11
|
+
Start a project:
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
npm install --global @greenpandastudios/aug-cli@next
|
|
15
|
+
aug init hello-august
|
|
16
|
+
cd hello-august
|
|
17
|
+
mkdir .devcontainer
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Save `.devcontainer/Dockerfile` with these contents. It installs the published CLI and prepares all native libraries, including web and crypto. No host C compiler is required.
|
|
21
|
+
|
|
22
|
+
```dockerfile
|
|
23
|
+
FROM node:24-bookworm
|
|
24
|
+
ARG AUG_VERSION=0.20.1
|
|
25
|
+
ENV AUG_NATIVE_HOME=/opt/augscript/.aug-native
|
|
26
|
+
RUN apt-get update \
|
|
27
|
+
&& apt-get install -y --no-install-recommends \
|
|
28
|
+
git clang libclang-rt-14-dev make cmake m4 autoconf \
|
|
29
|
+
automake libtool python3 zlib1g-dev ca-certificates \
|
|
30
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
31
|
+
RUN npm install --global --ignore-scripts --no-audit --no-fund \
|
|
32
|
+
@greenpandastudios/aug-cli@${AUG_VERSION} \
|
|
33
|
+
&& aug-native
|
|
34
|
+
WORKDIR /workspace
|
|
35
|
+
USER node
|
|
36
|
+
CMD ["sleep", "infinity"]
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Save `.devcontainer/devcontainer.json` beside it:
|
|
40
|
+
|
|
41
|
+
```json
|
|
42
|
+
{
|
|
43
|
+
"name": "August",
|
|
44
|
+
"build": {
|
|
45
|
+
"dockerfile": "Dockerfile",
|
|
46
|
+
"context": "."
|
|
47
|
+
},
|
|
48
|
+
"remoteUser": "node",
|
|
49
|
+
"updateRemoteUserUID": true,
|
|
50
|
+
"init": true,
|
|
51
|
+
"postCreateCommand": ["aug", "check", "."],
|
|
52
|
+
"forwardPorts": [8080],
|
|
53
|
+
"portsAttributes": {
|
|
54
|
+
"8080": { "label": "August HTTP" }
|
|
55
|
+
},
|
|
56
|
+
"customizations": {
|
|
57
|
+
"vscode": {
|
|
58
|
+
"extensions": ["augscript.augscript"],
|
|
59
|
+
"settings": {
|
|
60
|
+
"augscript.nativeHome": "/opt/augscript/.aug-native"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
The editor installs the August extension inside the container and points it at the prepared native cache. Terminal commands run as the image's `node` user. On Linux, the Dev Container tooling adjusts that user's ID to match your local files. The [non-root user guide](https://code.visualstudio.com/remote/advancedcontainers/add-nonroot-user) explains this behavior.
|
|
68
|
+
|
|
69
|
+
## Open and run it
|
|
70
|
+
|
|
71
|
+
Open `hello-august` in VS Code. From the Command Palette, choose **Dev Containers: Reopen in Container**. The first build downloads and compiles the native libraries and can take several minutes. Later opens reuse the built image. When the container is ready, the configured creation command checks your project.
|
|
72
|
+
|
|
73
|
+
Open a terminal **in that VS Code window** and run:
|
|
74
|
+
|
|
75
|
+
```sh
|
|
76
|
+
aug check .
|
|
77
|
+
aug run .
|
|
78
|
+
aug test .
|
|
79
|
+
aug spec .
|
|
80
|
+
aug spec . --check
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
The starter prints `Hello, August!`, its test passes, and spec generation writes the neighboring explanations. You can use `aug` directly because the CLI is installed in the image. Follow [Your first project](getting-started.md) to understand and change the source.
|
|
84
|
+
|
|
85
|
+
Edits, generated specs, and `.aug-build` remain in the mounted project folder. Native programs built here are Linux executables; run them inside the container. Rebuilding the container keeps your source files and rebuilds the environment. After changing the Dockerfile or CLI version, choose **Dev Containers: Rebuild Container**. Keep the toolchain and editor versions compatible with your project.
|
|
86
|
+
|
|
87
|
+
## Run an HTTP service
|
|
88
|
+
|
|
89
|
+
Use the [small HTTP service](docker.md#deploy-an-http-application) or a downloaded [web project](examples/index.md). Run `aug run .` in the container terminal. For a service on port 8080, the configuration forwards that port to your host. Open VS Code's **Ports** view and follow its local address; VS Code may choose a different local port if 8080 is occupied.
|
|
90
|
+
|
|
91
|
+
Add other listening ports to `forwardPorts` when your application needs them. Editor forwarding and Docker's `--publish` are different mechanisms: VS Code can forward a service listening on the container's loopback address, while a deployed Docker service needs the listening address shown in [the Docker guide](docker.md#deploy-an-http-application). The [Dev Container configuration reference](https://containers.dev/implementors/json_reference/#general-devcontainerjson-properties) describes port forwarding and lifecycle commands.
|
|
92
|
+
|
|
93
|
+
If the project imports source packages, run `aug install . --frozen` before checking it, and change `postCreateCommand` to `"aug install . --frozen && aug check ."`. Commit the manifest and lockfile. See [packages](packages.md#reproducible-builds) for the workflow.
|
|
94
|
+
|
|
95
|
+
For a deployment image, follow [Build and deploy with Docker](docker.md). The development image includes tools and a writable workspace; the deployment guide packages the compiled application for a server.
|
package/docs/diagnostics.md
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Diagnostics and fixes
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Start with the diagnostic's file, line, and message. The code identifies the rule that failed; the tables below explain likely remedies. VS Code shows the same diagnostics while you edit, with hover help and lightbulb actions where the compiler can offer a precise change. Warnings do not prevent a build.
|
|
4
|
+
|
|
5
|
+
Terminal diagnostics include the source line, a pointer to the location, and a `help:` explanation. `aug check --json` preserves structured diagnostics for tooling. Fix the first dependency or configuration error before investigating follow-on name errors.
|
|
6
|
+
|
|
7
|
+
If `aug run` cannot prepare or start a program, its message identifies the failed stage. A missing C compiler includes the host installation command and the `CC` override. A failed download identifies the library and URL; retry after checking the connection. A failed native build links its log. An offline cache miss explains how to prepare it online. Changed installed source packages require an explicit `aug install` so a run does not hide unexpected edits. A program stopped by a signal reports that signal after its own runtime output.
|
|
8
|
+
|
|
9
|
+
When a fix changes a dependency, effect, error, or mutable input, review the caller's contract too. A suggested edit can satisfy a language rule without deciding the right recovery or design for your application. [The book](learn/index.md) includes deliberate mistakes you can check and repair yourself.
|
|
4
10
|
|
|
5
11
|
## Syntax and data
|
|
6
12
|
|
|
@@ -40,7 +46,7 @@ Both braces and indentation are accepted. The formatter uses main.yaml preferenc
|
|
|
40
46
|
|
|
41
47
|
### EFFECT
|
|
42
48
|
|
|
43
|
-
|
|
49
|
+
Bodies infer `changes self` for state transitions and `changes input` for borrowed inputs. Bodyless interfaces declare permitted changes. Receive I/O capabilities through dependency headers. Executable bodies infer capability operations, mutations, and escaping checked errors. Bodyless interfaces declare their allowed effects with `uses dependency.operation`; explicit clauses remain checked bounds. Calls and interceptor layers must fit the effective contract.
|
|
44
50
|
|
|
45
51
|
Public fields and managed inputs grant reading. Mark local storage mutable when it needs initialization-independent changes. Constructors are pure; move startup effects into a named method. drop performs only local cleanup and cannot acquire effects/errors through interceptors.
|
|
46
52
|
|
|
@@ -64,7 +70,7 @@ A child task keeps its captured objects available until `wait for` or its scope
|
|
|
64
70
|
|
|
65
71
|
### THROWS
|
|
66
72
|
|
|
67
|
-
A checked error
|
|
73
|
+
A checked error reaches main without a compatible catch, or exceeds an explicit unless bound. Bodies infer escaping errors when unless is omitted. The language uses `unless`; THROWS is the diagnostic identifier retained for tooling.
|
|
68
74
|
|
|
69
75
|
**Propagate with unless** adds the specific error to the enclosing contract. At composition statements, **Catch and report the failure** creates a visible recovery template. Choose domain recovery deliberately; no fix silently discards an error.
|
|
70
76
|
|
|
@@ -91,7 +97,11 @@ Next exists only inside around. `next()` forwards original inputs; `next(y=value
|
|
|
91
97
|
| TEST | Put a class/function suite beside its declaration. Unique groups/cases; bindings before setup before cases. Check row arity/types and execute a bool assertion in each case. |
|
|
92
98
|
| DOC | @param labels, value-return tags, and error tags must match the effective signature. Unknown tags are errors. Missing public docs become warnings only when enabled. |
|
|
93
99
|
| CONFIG | main.yaml uses the supported keys and simple YAML lists. Unknown/duplicate keys and invalid values fail during check. |
|
|
94
|
-
| FFI | Use supported boundary types, matching C widths, labeled inputs, unsafe, and
|
|
100
|
+
| FFI | Use supported boundary types, matching C widths, labeled inputs, unsafe, and an inferred or declared C.function effect. |
|
|
95
101
|
| NATIVE | A C compiler error mapped to its .aug file and line. Fix the boundary declaration or linker configuration; inspect emit-c for generated details. |
|
|
96
102
|
|
|
97
103
|
See [testing](testing.md) and [native tooling](tooling.md) for executable examples and exact limits.
|
|
104
|
+
|
|
105
|
+
## INFERENCE: add a type anchor
|
|
106
|
+
|
|
107
|
+
The compiler cannot infer a result when recursive calls have no concrete return evidence, or when generic contracts keep expanding. State a finite `returns T`, `uses`, or `unless` contract at that boundary. Empty collections also need a contextual item type. This does not require repeating contracts on ordinary bodies.
|
package/docs/docker.md
CHANGED
|
@@ -1,21 +1,67 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Build and deploy with Docker
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Compile an August application in a Linux build container, then deploy its executable in a separate runtime image. You need Docker with a running Linux engine and a POSIX shell for these commands. The application does not need Node.js or a compiler in its deployed container. For editing and testing inside VS Code, use [a Dev Container](dev-containers.md).
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Prepare the toolchain images
|
|
6
|
+
|
|
7
|
+
Build two local images from the published npm CLI. The **build** image contains Node.js 24, the August compiler, Clang and its sanitizer runtime, and the pinned native task, JSON, web, and crypto dependencies. The **run** image is a small Debian userland with matching native shared libraries and CA certificates. It runs a compiled August executable as an unprivileged user. These are local image recipes; August does not currently publish registry tags for them.
|
|
8
|
+
|
|
9
|
+
Save this as `Dockerfile.build` in an empty working folder. It installs the published toolchain, then prepares its native dependencies. Pin `AUG_VERSION` to the version used by your application:
|
|
10
|
+
|
|
11
|
+
```dockerfile
|
|
12
|
+
FROM node:24-bookworm
|
|
13
|
+
ARG AUG_VERSION=0.20.1
|
|
14
|
+
ENV AUG_NATIVE_HOME=/opt/augscript/.aug-native
|
|
15
|
+
RUN apt-get update \
|
|
16
|
+
&& apt-get install -y --no-install-recommends \
|
|
17
|
+
git clang libclang-rt-14-dev make cmake m4 autoconf \
|
|
18
|
+
automake libtool python3 zlib1g-dev ca-certificates \
|
|
19
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
20
|
+
RUN npm install --global --ignore-scripts --no-audit --no-fund \
|
|
21
|
+
@greenpandastudios/aug-cli@${AUG_VERSION} \
|
|
22
|
+
&& aug-native
|
|
23
|
+
WORKDIR /workspace
|
|
24
|
+
ENTRYPOINT ["aug"]
|
|
25
|
+
CMD ["--help"]
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Save this as `Dockerfile.run` beside it. Keeping the same native library path preserves the executable's runtime search path:
|
|
29
|
+
|
|
30
|
+
```dockerfile
|
|
31
|
+
FROM augscript/build:local AS native
|
|
32
|
+
FROM debian:bookworm-slim
|
|
33
|
+
RUN apt-get update \
|
|
34
|
+
&& apt-get install -y --no-install-recommends ca-certificates zlib1g \
|
|
35
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
36
|
+
COPY --from=native /opt/augscript/.aug-native/prefix/lib /opt/augscript/.aug-native/prefix/lib
|
|
37
|
+
RUN groupadd --system august \
|
|
38
|
+
&& useradd --system --gid august --home-dir /app august
|
|
39
|
+
WORKDIR /app
|
|
40
|
+
USER august
|
|
41
|
+
ENTRYPOINT ["/app/program"]
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Build them in that order:
|
|
6
45
|
|
|
7
46
|
```sh
|
|
8
|
-
docker build -f
|
|
9
|
-
docker build -f
|
|
10
|
-
docker build -f docker/Dockerfile.crypto-smoke -t augscript/crypto-smoke:local .
|
|
11
|
-
docker run --rm augscript/crypto-smoke:local
|
|
12
|
-
docker build -f docker/Dockerfile.web-smoke -t augscript/web-smoke:local .
|
|
13
|
-
docker run --rm -p 127.0.0.1:8080:8080 augscript/web-smoke:local
|
|
47
|
+
docker build -f Dockerfile.build -t augscript/build:local .
|
|
48
|
+
docker build -f Dockerfile.run -t augscript/run:local .
|
|
14
49
|
```
|
|
15
50
|
|
|
16
|
-
|
|
51
|
+
The first build downloads and compiles native dependencies; later builds can reuse Docker's cached layers. Keep these local images on the same Docker engine that builds your application.
|
|
52
|
+
|
|
53
|
+
## Compile an existing project
|
|
54
|
+
|
|
55
|
+
Create your application with the [npx starter](getting-started.md) or download a [complete project](examples/index.md), then compile it for Linux. The mount is writable because `aug build` writes `.aug-build` and generated specifications into the project. Run the commands below from the parent of `my-app`.
|
|
56
|
+
|
|
57
|
+
Keep the project in a directory shared with your Docker engine. If Docker reports that the bind source path does not exist, check the engine's file-sharing settings. A remote engine cannot mount a folder that exists only on your client machine; see [bind mount constraints](https://docs.docker.com/engine/storage/bind-mounts/#considerations-and-constraints).
|
|
17
58
|
|
|
18
59
|
```sh
|
|
60
|
+
docker run --rm \
|
|
61
|
+
--user "$(id -u):$(id -g)" \
|
|
62
|
+
--mount type=bind,source="$PWD/my-app",target=/workspace \
|
|
63
|
+
augscript/build:local install .
|
|
64
|
+
|
|
19
65
|
docker run --rm \
|
|
20
66
|
--user "$(id -u):$(id -g)" \
|
|
21
67
|
--mount type=bind,source="$PWD/my-app",target=/workspace \
|
|
@@ -30,6 +76,122 @@ docker run --rm \
|
|
|
30
76
|
augscript/run:local
|
|
31
77
|
```
|
|
32
78
|
|
|
33
|
-
The
|
|
79
|
+
The two images use the same Debian distribution and native library paths. A Linux executable built here runs inside the runtime container, including when your host is macOS or Windows.
|
|
80
|
+
|
|
81
|
+
## Deploy an HTTP application
|
|
82
|
+
|
|
83
|
+
Start a project using Node.js 24 and npm on your host:
|
|
84
|
+
|
|
85
|
+
```sh
|
|
86
|
+
npm install --global @greenpandastudios/aug-cli@next
|
|
87
|
+
aug init my-api
|
|
88
|
+
cd my-api
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Replace `main.aug` and add `endpoints.aug`. The starter's unused greeting module can remain. This service has one endpoint that returns a record as JSON.
|
|
92
|
+
|
|
93
|
+
**main.aug**
|
|
94
|
+
|
|
95
|
+
```aug project=docker-http file=main.aug
|
|
96
|
+
import health from endpoints
|
|
97
|
+
|
|
98
|
+
serve health on port 8080
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
**endpoints.aug**
|
|
102
|
+
|
|
103
|
+
```aug project=docker-http file=endpoints.aug
|
|
104
|
+
record Health(string status)
|
|
105
|
+
|
|
106
|
+
/** Confirm that the HTTP handler can answer a request. */
|
|
107
|
+
endpoint GET "/health" as health() returns Health:
|
|
108
|
+
return Health(status="ok")
|
|
109
|
+
|
|
110
|
+
test endpoint health client:
|
|
111
|
+
when health_checks:
|
|
112
|
+
it answers_successfully:
|
|
113
|
+
response = client.request(method="GET", path="/health")
|
|
114
|
+
assert(condition=response.status == 200)
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Save `main.yaml` beside `main.aug`:
|
|
118
|
+
|
|
119
|
+
```yaml
|
|
120
|
+
optimization: release
|
|
121
|
+
web:
|
|
122
|
+
host: 0.0.0.0
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
`web.host` must accept connections through the container's network interface. August's default, `127.0.0.1`, only accepts connections inside that container. The port comes from the `serve` statement; `main.yaml` selects the listening address and release compilation.
|
|
126
|
+
|
|
127
|
+
Save this `Dockerfile` in `my-api`. Docker's [multi-stage build](https://docs.docker.com/build/building/multi-stage/) copies the compiled executable into the runtime image:
|
|
128
|
+
|
|
129
|
+
```dockerfile
|
|
130
|
+
FROM augscript/build:local AS build
|
|
131
|
+
COPY . /workspace
|
|
132
|
+
RUN aug test /workspace \
|
|
133
|
+
&& aug build /workspace --out /tmp/program
|
|
134
|
+
FROM augscript/run:local
|
|
135
|
+
COPY --from=build --chown=august:august /tmp/program /app/program
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
Save `.dockerignore` in the same folder:
|
|
139
|
+
|
|
140
|
+
```text
|
|
141
|
+
.git
|
|
142
|
+
.aug-build
|
|
143
|
+
.aug-native
|
|
144
|
+
.aug-packages
|
|
145
|
+
node_modules
|
|
146
|
+
.devcontainer
|
|
147
|
+
.env
|
|
148
|
+
.env.*
|
|
149
|
+
*.key
|
|
150
|
+
*.pem
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
Keep credentials out of the build context. Mount runtime files at the paths your application uses. The compiler reads `main.yaml` while building; environment variables configure your application only when its code reads them. If your application imports source packages, commit its manifest and `aug.lock.json`, then add `RUN aug install /workspace --frozen` before the test/build step. [Frozen installs](packages.md#reproducible-builds) restore the locked dependency graph; include local package sources in the build context when the manifest references them.
|
|
154
|
+
|
|
155
|
+
Build and start your application image. The build runs the endpoint test before compiling. Keep your terminal in `my-api`:
|
|
156
|
+
|
|
157
|
+
```sh
|
|
158
|
+
docker build -t my-api:0.1.0 .
|
|
159
|
+
docker run --detach --name my-api --init \
|
|
160
|
+
--restart unless-stopped \
|
|
161
|
+
--publish 127.0.0.1:8080:8080 \
|
|
162
|
+
my-api:0.1.0
|
|
163
|
+
curl --fail http://127.0.0.1:8080/health
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
The test passes, and the HTTP request returns `{"status":"ok"}`. The published port is available on the Docker host's loopback address. Change the mapping deliberately if clients must connect directly from other hosts; omitting `127.0.0.1` publishes on all host interfaces. See [Docker's port publishing guide](https://docs.docker.com/engine/network/port-publishing/).
|
|
167
|
+
|
|
168
|
+
Inspect output and stop this deployment with:
|
|
169
|
+
|
|
170
|
+
```sh
|
|
171
|
+
docker logs my-api
|
|
172
|
+
docker stop my-api
|
|
173
|
+
docker rm my-api
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
## Move the image to a server
|
|
177
|
+
|
|
178
|
+
Tag and push the **application** image to your registry. Replace `registry.example.com/team` with your registry and namespace, and sign in using that registry's instructions:
|
|
179
|
+
|
|
180
|
+
```sh
|
|
181
|
+
docker tag my-api:0.1.0 registry.example.com/team/my-api:0.1.0
|
|
182
|
+
docker push registry.example.com/team/my-api:0.1.0
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
On a Linux Docker server with access to that registry, pull and run it:
|
|
186
|
+
|
|
187
|
+
```sh
|
|
188
|
+
docker pull registry.example.com/team/my-api:0.1.0
|
|
189
|
+
docker run --detach --name my-api --init \
|
|
190
|
+
--restart unless-stopped \
|
|
191
|
+
--publish 127.0.0.1:8080:8080 \
|
|
192
|
+
registry.example.com/team/my-api:0.1.0
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
Place a TLS reverse proxy on that server in front of `127.0.0.1:8080`, or configure the application's [native TLS](web.md#openapi-configuration). For native TLS, use stable absolute container paths for the certificate and private key in `main.yaml`, then mount those files at the same paths when starting the container. Build for the server's CPU architecture: an ARM64 image does not become an x86-64 executable when pushed. These recipes build for the Docker engine's default platform; run the build on the target architecture or use a separately verified cross-platform build setup.
|
|
34
196
|
|
|
35
|
-
|
|
197
|
+
Pin the CLI version and retain the application image digest for each deployment. The base tags and Debian package versions can change; use reviewed base-image digests and controlled dependency updates when reproducing a release. Redistributed native libraries also have [license and notice obligations](production-readiness.md#dependencies-and-licenses). August remains experimental; use the [readiness review](production-readiness.md) when assessing a trial deployment.
|
package/docs/editor.md
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Write August in VS Code
|
|
2
|
+
|
|
3
|
+
Install the matching [AugScript extension](packages.md#vs-code), open the project folder, and start in `main.aug`. The editor reads the same checked contracts as the CLI, including unsaved changes. Install source dependencies with `aug run` or `aug install` so their declarations and documentation are available locally.
|
|
4
|
+
|
|
5
|
+
## Complete a call
|
|
6
|
+
|
|
7
|
+
Type part of a function or method name and choose a completion. The editor inserts its labeled inputs and places the cursor at the first value. Press Tab to move through the values. Injected `resolve` inputs are supplied by DI and do not appear as arguments you must fill in.
|
|
8
|
+
|
|
9
|
+
For a function such as `total(int price, int quantity)`, completion inserts a call shaped like `total(price=0, quantity=0)`. The numbers are editable placeholders. Signature help describes each input while you type. If a local value has the same name as its input, you can use August's labeled shorthand, such as `total(price, quantity)`.
|
|
10
|
+
|
|
11
|
+
Public declarations from nearby modules and installed packages also appear in completion. Choosing one can add its import. Imports follow `export.aug`; private names and unexported declarations stay out of the suggestions.
|
|
12
|
+
|
|
13
|
+
## Start a declaration or test
|
|
14
|
+
|
|
15
|
+
Type `record`, `interface`, `implementation`, or `method` for a declaration template. `test`, `testclass`, and `testendpoint` supply same-file tests. `endpointget`, `endpointpost`, `endpointpatch`, and `endpointdelete` supply route templates. Other templates cover imports, exports, conditions, errors, borrows, tasks, locks, interceptors, and comments.
|
|
16
|
+
|
|
17
|
+
The completion provider follows `block_style` and `indentation` in `main.yaml`. Templates are starting points: replace their names, values, and bodies before running the program. The extension also supplies VS Code snippets and enables Tab completion for August files.
|
|
18
|
+
|
|
19
|
+
## Understand a contract
|
|
20
|
+
|
|
21
|
+
Hover over a declaration, a call, a keyword, or a built-in operation. Help includes Javadoc when it is present. Ctrl-click, or Cmd-click on macOS, opens the declaration. In an import, clicking `from` opens the sibling file or the package's `export.aug`.
|
|
22
|
+
|
|
23
|
+
Contract hints show inferred return types, mutation, capabilities, and checked errors beside executable headers. They are display text; saving or formatting does not add them to the source. A tooltip expands long contracts. Set `augscript.inferredContractHints` to false to hide them. Bodyless interfaces and foreign declarations still state their contracts in code.
|
|
24
|
+
|
|
25
|
+
## Fix a diagnostic
|
|
26
|
+
|
|
27
|
+
Place the cursor on an error and open the lightbulb with Ctrl+. or Cmd+.. The editor offers fixes it can derive from the checked code: importing a visible declaration, correcting a nearby name or input label, expanding a wildcard import, adding a required method, or containing a mutable or native operation.
|
|
28
|
+
|
|
29
|
+
Review the edit before accepting it. A suggested name can be plausible without being the name you intended. After a change, run `aug check`, your tests, and `aug spec` to refresh the neighboring explanation.
|
|
30
|
+
|
|
31
|
+
## Find the files and run tests
|
|
32
|
+
|
|
33
|
+
Run **AugScript: Enable File Icons** for the August icon theme. Source files have a blue mark; `main.aug` has an amber startup mark, and `export.aug` has a purple module mark. **AugScript: Open Welcome** opens the bundled illustrated guide.
|
|
34
|
+
|
|
35
|
+
Same-file cases appear in VS Code's Testing view. Use that view to run a case or group, or run `aug test` in the terminal. [Tests](testing.md) explains fixtures and endpoint tests. [CLI and configuration](tooling.md) describes language-server integration, native cache settings, and command-line tools.
|
|
@@ -1,26 +1,208 @@
|
|
|
1
1
|
[
|
|
2
|
-
{
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
2
|
+
{
|
|
3
|
+
"path": "examples/hello",
|
|
4
|
+
"title": "Hello world with dependencies",
|
|
5
|
+
"group": "Start here",
|
|
6
|
+
"description": "The application prints a greeting through an injected logger. Its entry point selects the providers, and each folder exposes a small public surface.",
|
|
7
|
+
"walkthrough": [
|
|
8
|
+
{
|
|
9
|
+
"file": "main.aug",
|
|
10
|
+
"explanation": "Startup binds the console, logger, and application, then resolves the greeter and calls it."
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"file": "app/greeter.aug",
|
|
14
|
+
"explanation": "The greeter receives its logger in the header and delegates the greeting to it. The interface states the console effect."
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"file": "logging/export.aug",
|
|
18
|
+
"explanation": "This is the logging folder's public surface. Callers can import the exported contract and provider."
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"file": "logging/logger.aug",
|
|
22
|
+
"explanation": "The contract describes the log operation and its output capability; the console provider implements it."
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"path": "examples/weather-api",
|
|
28
|
+
"title": "Weather API",
|
|
29
|
+
"group": "Web applications",
|
|
30
|
+
"description": "Serve five simulated forecasts as typed JSON. The record, endpoint, and tests share a file; main.aug starts the listener and main.yaml enables OpenAPI.",
|
|
31
|
+
"walkthrough": [
|
|
32
|
+
{
|
|
33
|
+
"file": "main.aug",
|
|
34
|
+
"explanation": "Import the forecast endpoint and serve it on port 8787."
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"file": "forecasts.aug",
|
|
38
|
+
"explanation": "Read the response record, five fixed forecasts, and cases that exercise the endpoint pipeline."
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"path": "examples/new-syntax",
|
|
44
|
+
"title": "Labeled calls and injection",
|
|
45
|
+
"group": "Start here",
|
|
46
|
+
"description": "Constructor injection, named inputs, ordinary functions, and same-file tests."
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"path": "examples/developer-workflow",
|
|
50
|
+
"title": "A small tested application",
|
|
51
|
+
"group": "Start here",
|
|
52
|
+
"description": "A calculator logs each addition. Its nearby tests replace the logger and verify both labeled inputs and fresh setup.",
|
|
53
|
+
"walkthrough": [
|
|
54
|
+
{
|
|
55
|
+
"file": "main.aug",
|
|
56
|
+
"explanation": "Startup supplies providers, uses collections, invokes the calculator, and catches a simulated load failure."
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"file": "calculator.aug",
|
|
60
|
+
"explanation": "Read the arithmetic contract, the injected logger, and the same-file cases together. The private silent adapter keeps tests independent of output."
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"file": "logging/logger.aug",
|
|
64
|
+
"explanation": "This is the contract used by both the production logger and the test adapter."
|
|
65
|
+
}
|
|
66
|
+
]
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"path": "examples/cli-args",
|
|
70
|
+
"title": "Command-line arguments",
|
|
71
|
+
"group": "Start here",
|
|
72
|
+
"description": "Read arguments, inspect collections, and return a process exit status."
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"path": "examples/collections",
|
|
76
|
+
"title": "Lists, tuples, sets, and maps",
|
|
77
|
+
"group": "Values and errors",
|
|
78
|
+
"description": "Create typed collections and update them through checked mutable access."
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"path": "examples/generics",
|
|
82
|
+
"title": "Generic contracts",
|
|
83
|
+
"group": "Values and errors",
|
|
84
|
+
"description": "Write reusable records, interfaces, classes, and functions with type parameters."
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"path": "examples/generic-di",
|
|
88
|
+
"title": "Generic dependency injection",
|
|
89
|
+
"group": "Values and errors",
|
|
90
|
+
"description": "Bind a generic interface and resolve a class that uses it."
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"path": "examples/errors",
|
|
94
|
+
"title": "Checked failures",
|
|
95
|
+
"group": "Values and errors",
|
|
96
|
+
"description": "Declare errors with unless, catch them, and run cleanup."
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"path": "examples/ownership",
|
|
100
|
+
"title": "Read access and mutable borrows",
|
|
101
|
+
"group": "State and lifetime",
|
|
102
|
+
"description": "Share a reference for reading and grant explicit access for mutation."
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"path": "examples/ownership-transfer",
|
|
106
|
+
"title": "Move ownership",
|
|
107
|
+
"group": "State and lifetime",
|
|
108
|
+
"description": "Transfer an owned resource between labeled calls."
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"path": "examples/drop",
|
|
112
|
+
"title": "Resource cleanup",
|
|
113
|
+
"group": "State and lifetime",
|
|
114
|
+
"description": "Release an owned resource when its lifetime ends."
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"path": "examples/visibility",
|
|
118
|
+
"title": "Private state and helpers",
|
|
119
|
+
"group": "State and lifetime",
|
|
120
|
+
"description": "Keep underscore-prefixed implementation details inside their scope."
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"path": "examples/approved-design",
|
|
124
|
+
"title": "Modules and composition",
|
|
125
|
+
"group": "Modules and packages",
|
|
126
|
+
"description": "Startup combines narrow domain exports with a scoped counter provider. Records and validation keep data and checked failures visible.",
|
|
127
|
+
"walkthrough": [
|
|
128
|
+
{
|
|
129
|
+
"file": "main.aug",
|
|
130
|
+
"explanation": "Follow the domain imports, provider choices, explicit scope, and checked failure before opening the implementation files."
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"file": "domain/export.aug",
|
|
134
|
+
"explanation": "The export file gives callers the folder's deliberate public API."
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"file": "domain/numbers.aug",
|
|
138
|
+
"explanation": "The validation interceptor rejects a negative input. Tests cover successful doubling and recovery from that failure."
|
|
139
|
+
}
|
|
140
|
+
]
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
"path": "examples/interceptors",
|
|
144
|
+
"title": "Function and constructor middleware",
|
|
145
|
+
"group": "Modules and packages",
|
|
146
|
+
"description": "Layer interceptors, map inputs, and keep logging dependencies explicit."
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"path": "examples/packages/math",
|
|
150
|
+
"title": "Create a package",
|
|
151
|
+
"group": "Modules and packages",
|
|
152
|
+
"description": "Publish a small arithmetic library through export.aug and test its public surface."
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"path": "examples/packages/app",
|
|
156
|
+
"title": "Use a package",
|
|
157
|
+
"group": "Modules and packages",
|
|
158
|
+
"description": "Install the neighboring arithmetic package and import it through a local alias."
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"path": "examples/ffi",
|
|
162
|
+
"title": "A native C boundary",
|
|
163
|
+
"group": "Native applications",
|
|
164
|
+
"description": "Declare a C operation and call it inside an unsafe block."
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
"path": "examples/benchmark",
|
|
168
|
+
"title": "A finite benchmark",
|
|
169
|
+
"group": "Native applications",
|
|
170
|
+
"description": "Measure a deterministic arithmetic workload with aug bench."
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
"path": "examples/oidc-login",
|
|
174
|
+
"title": "OpenID Connect login application",
|
|
175
|
+
"group": "Web applications",
|
|
176
|
+
"description": "One executable hosts a login page, an OpenID Connect provider and client, session JWTs, and logout. Accounts, keys, and sessions are held in memory for this development demonstration."
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
"path": "benchmarks/startup",
|
|
180
|
+
"title": "Startup benchmark",
|
|
181
|
+
"group": "Measured programs",
|
|
182
|
+
"description": "The small program used to measure process startup."
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"path": "benchmarks/cpu",
|
|
186
|
+
"title": "CPU benchmark",
|
|
187
|
+
"group": "Measured programs",
|
|
188
|
+
"description": "Two million dependent integer steps with a checked result."
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
"path": "benchmarks/collections",
|
|
192
|
+
"title": "Map and Set benchmark",
|
|
193
|
+
"group": "Measured programs",
|
|
194
|
+
"description": "Insert, find, and iterate over 20,000 collection entries."
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
"path": "benchmarks/json",
|
|
198
|
+
"title": "JSON benchmark",
|
|
199
|
+
"group": "Measured programs",
|
|
200
|
+
"description": "Parse, decode, and serialize a typed record 5,000 times."
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"path": "benchmarks/http",
|
|
204
|
+
"title": "HTTP benchmark",
|
|
205
|
+
"group": "Measured programs",
|
|
206
|
+
"description": "Serve the typed JSON endpoint used in the throughput measurements."
|
|
207
|
+
}
|
|
26
208
|
]
|