From 1b8bd0dbd07d6184af43d4024522ff2c670bf43a Mon Sep 17 00:00:00 2001 From: Jason Holt Smith Date: Thu, 23 May 2024 14:29:59 +0100 Subject: [PATCH] moves docs publishing to separate workflow and updates readme for config env var replacement changes --- .github/workflows/build-test-deploy-main.yml | 6 +----- .github/workflows/deploy-pages-main.yml | 20 ++++++++++++++++++++ packages/aft-core/README.md | 20 ++++++++++++-------- 3 files changed, 33 insertions(+), 13 deletions(-) create mode 100644 .github/workflows/deploy-pages-main.yml diff --git a/.github/workflows/build-test-deploy-main.yml b/.github/workflows/build-test-deploy-main.yml index cb5f6c1c..0bde65e5 100644 --- a/.github/workflows/build-test-deploy-main.yml +++ b/.github/workflows/build-test-deploy-main.yml @@ -37,8 +37,4 @@ jobs: run: npx lerna publish from-package --yes env: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - NPM_USER: ${{ secrets.NPM_USER }} - - name: Build HTML docs - id: builddocs - run: npm run docs - - uses: actions/deploy-pages@v4 \ No newline at end of file + NPM_USER: ${{ secrets.NPM_USER }} \ No newline at end of file diff --git a/.github/workflows/deploy-pages-main.yml b/.github/workflows/deploy-pages-main.yml new file mode 100644 index 00000000..2ad2f4ad --- /dev/null +++ b/.github/workflows/deploy-pages-main.yml @@ -0,0 +1,20 @@ +name: deploy-pages-main +on: + push: + branches: + - main +jobs: + deploy-pages: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: '18' + - name: Install Dependencies + id: installdeps + run: npm ci + - name: Build HTML docs + id: builddocs + run: npm run docs + - uses: actions/deploy-pages@v4 \ No newline at end of file diff --git a/packages/aft-core/README.md b/packages/aft-core/README.md index af77b1a0..53b27a06 100644 --- a/packages/aft-core/README.md +++ b/packages/aft-core/README.md @@ -15,19 +15,23 @@ Ex: with an `aftconfig.json` containing: ```json { "SomeCustomClassConfig": { - "configField1": "%your_env_var%", + "configField1": %your_env_var%, "configField2": "some-value", - "configField3": ["foo", true, 10] + "configField3": ["foo", true, 10], + "configField4": "%another_env_var%" } } ``` and with the following environment variables set: -> export your_env_var="an important value" +``` +> export your_env_var="42" +> export another_env_var="the meaning of everything" +``` and a config class of: ```typescript export class SomeCustomClassConfig { - configField1: string = 'default_value_here'; + configField1: number = 0; configField2: string = 'another_default_value'; configField3: Array = ['default_val']; configField4: string = 'last_default_value'; @@ -37,20 +41,20 @@ export class SomeCustomClassConfig { can be accessed using an `AftConfig` instance as follows: ```typescript const config = aftConfig.getSection(SomeCustomClassConfig); // or new AftConfig().getSection(SomeCustomClassConfig); -config.configField1; // returns "an important value" +config.configField1; // returns 42 config.configField2; // returns "some-value" config.configField3; // returns ["foo", true, 10] as an array -config.configField4; // returns "last_default_value" +config.configField4; // returns "the meaning of everything" ``` and if you wish to entirely disregard the configuration specified in your `aftconfig.json` file you can use the following (still based on the above example): ```typescript const config = new AftConfig({ SomeCustomClassConfig: { - configField1: 'custom_value_here' + configField1: 42 } }); -config.configField1; // returns "custom_value_here" +config.configField1; // returns 42 config.configField2; // returns "another_default_value" config.configField3; // returns ["default_val"] as an array config.configField4; // returns "last_default_value"