From 02eeb67eaeac8eba73a4f320a3c7890440bea363 Mon Sep 17 00:00:00 2001 From: AmauryD Date: Sun, 1 Oct 2023 10:45:09 +0200 Subject: [PATCH] deploy doc --- .github/workflows/ci.yml | 16 +++--- .github/workflows/docs.yaml | 56 +++++++++++++++++++ README.md | 10 +--- test-app/app/router.js | 8 +-- test-app/app/styles/app.css | 5 ++ test-app/app/templates/index.hbs | 2 +- test-app/config/environment.js | 2 +- test-app/ember-cli-build.js | 2 +- .../components/application-test.ts | 26 --------- .../components/async-data/component-test.ts | 10 ---- .../tests/unit/routes/application-test.ts | 11 ---- test-app/tests/unit/routes/docs-test.ts | 11 ---- test-app/tests/unit/routes/index-test.ts | 11 ---- .../ember-data/types/registries/model.d.ts | 2 +- 14 files changed, 80 insertions(+), 92 deletions(-) create mode 100644 .github/workflows/docs.yaml delete mode 100644 test-app/tests/integration/components/application-test.ts delete mode 100644 test-app/tests/integration/components/async-data/component-test.ts delete mode 100644 test-app/tests/unit/routes/application-test.ts delete mode 100644 test-app/tests/unit/routes/docs-test.ts delete mode 100644 test-app/tests/unit/routes/index-test.ts diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2a18bc4..cfb8ab9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,7 @@ jobs: - uses: actions/checkout@v3 - uses: wyvox/action-setup-pnpm@v2 with: - node-version: 16 + node-version: 20 - name: Lint run: pnpm lint - name: Run Tests @@ -34,7 +34,7 @@ jobs: - uses: actions/checkout@v3 - uses: wyvox/action-setup-pnpm@v2 with: - node-version: 16 + node-version: 20 - name: Run Tests run: pnpm test @@ -47,11 +47,11 @@ jobs: fail-fast: false matrix: try-scenario: - - ember-lts-4.8 - - ember-lts-4.12 - - ember-release - - ember-beta - - ember-canary + # - ember-lts-4.8 + # - ember-lts-4.12 + # - ember-release + # - ember-beta + # - ember-canary - embroider-safe - embroider-optimized @@ -59,7 +59,7 @@ jobs: - uses: actions/checkout@v3 - uses: wyvox/action-setup-pnpm@v2 with: - node-version: 16 + node-version: 20 - name: Run Tests run: ./node_modules/.bin/ember try:one ${{ matrix.try-scenario }} working-directory: test-app diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml new file mode 100644 index 0000000..154ed77 --- /dev/null +++ b/.github/workflows/docs.yaml @@ -0,0 +1,56 @@ +# Simple workflow for deploying static content to GitHub Pages +name: Deploy static content to Pages + +on: + # Runs on pushes targeting the default branch + push: + branches: ["main"] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + # Single deploy job since we're just deploying + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Install Node.js + uses: actions/setup-node@v3 + with: + node-version: 20 + - uses: pnpm/action-setup@v2.2.1 + with: + version: 8 + run_install: true + - run: pnpm ember build --env=production + working-directory: test-app + - name: Setup Pages + uses: actions/configure-pages@v3 + - name: Upload artifact + uses: actions/upload-pages-artifact@v2 + with: + # Upload entire repository + path: 'test-app/dist' + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v2 + + + diff --git a/README.md b/README.md index ee00ca2..d6b3844 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # @triptyk/ember-utils -[Short description of the addon.] +Various utilities for TRIPTYK ember projects ## Compatibility @@ -13,13 +13,9 @@ ember install @triptyk/ember-utils ``` -## Usage +## Documentation -[Longer description of how to use the addon in apps.] - -## Contributing - -See the [Contributing](CONTRIBUTING.md) guide for details. +- [Documentation](https://triptyk.github.io/ember-utils/) ## License diff --git a/test-app/app/router.js b/test-app/app/router.js index 76c1b5d..69eb597 100644 --- a/test-app/app/router.js +++ b/test-app/app/router.js @@ -8,10 +8,10 @@ const Router = AddonDocsRouter.extend({ Router.map(function () { docsRoute(this, function () { - this.route('decorators', function() { + this.route('decorators', function () { this.route('disable-in-fastboot'); }); - this.route('helpers', function() { + this.route('helpers', function () { this.route('date-format'); this.route('html-safe'); this.route('includes'); @@ -19,14 +19,14 @@ Router.map(function () { this.route('translate-country'); this.route('truncate'); }); - this.route('services', function() { + this.route('services', function () { this.route('current-changeset'); this.route('current-transition'); this.route('download-file'); this.route('extended-store'); this.route('store-document'); }); - this.route('utils', function() { + this.route('utils', function () { this.route('ensure-model-properties'); this.route('file-to-form-data'); this.route('generic-diff'); diff --git a/test-app/app/styles/app.css b/test-app/app/styles/app.css index 2763afa..902707c 100644 --- a/test-app/app/styles/app.css +++ b/test-app/app/styles/app.css @@ -1 +1,6 @@ /* Ember supports plain CSS out of the box. More info: https://cli.emberjs.com/release/advanced-use/stylesheets/ */ +#demo-index { + max-width: 40rem; + margin: 0 auto; + padding: 0 1.5rem; +} diff --git a/test-app/app/templates/index.hbs b/test-app/app/templates/index.hbs index 4b3e740..bf3dc07 100644 --- a/test-app/app/templates/index.hbs +++ b/test-app/app/templates/index.hbs @@ -1,6 +1,6 @@ -
+
diff --git a/test-app/config/environment.js b/test-app/config/environment.js index d2a3369..3a8b74d 100644 --- a/test-app/config/environment.js +++ b/test-app/config/environment.js @@ -42,7 +42,7 @@ module.exports = function (environment) { if (environment === 'production') { // Allow ember-cli-addon-docs to update the rootURL in compiled assets - ENV.rootURL = '/ADDON_DOCS_ROOT_URL/'; + ENV.rootURL = '/ember-utils/'; // here you can enable a production-specific feature } diff --git a/test-app/ember-cli-build.js b/test-app/ember-cli-build.js index 5175571..362bdc2 100644 --- a/test-app/ember-cli-build.js +++ b/test-app/ember-cli-build.js @@ -10,7 +10,7 @@ module.exports = function (defaults) { }, 'ember-cli-addon-docs': { documentingAddonAt: '../ember-utils', - } + }, }); const { maybeEmbroider } = require('@embroider/test-setup'); diff --git a/test-app/tests/integration/components/application-test.ts b/test-app/tests/integration/components/application-test.ts deleted file mode 100644 index e8d7f96..0000000 --- a/test-app/tests/integration/components/application-test.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { module, test } from 'qunit'; -import { setupRenderingTest } from 'ember-qunit'; -import { render } from '@ember/test-helpers'; -import hbs from 'htmlbars-inline-precompile'; - -module('Integration | Component | application', function (hooks) { - setupRenderingTest(hooks); - - test('it renders', async function (assert) { - // Set any properties with this.set('myProperty', 'value'); - // Handle any actions with this.set('myAction', function(val) { ... }); - - await render(hbs`{{application}}`); - - assert.equal(this.element.textContent.trim(), ''); - - // Template block usage: - await render(hbs` - - template block text - - `); - - assert.equal(this.element.textContent.trim(), 'template block text'); - }); -}); diff --git a/test-app/tests/integration/components/async-data/component-test.ts b/test-app/tests/integration/components/async-data/component-test.ts deleted file mode 100644 index 98d9e8e..0000000 --- a/test-app/tests/integration/components/async-data/component-test.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { module, test } from 'qunit'; -import { setupRenderingTest } from 'ember-qunit'; - -module('Integration | Component | async-data', function (hooks) { - setupRenderingTest(hooks); - - test('it renders', async function (assert) { - assert.expect(0); - }); -}); diff --git a/test-app/tests/unit/routes/application-test.ts b/test-app/tests/unit/routes/application-test.ts deleted file mode 100644 index 9cf5aef..0000000 --- a/test-app/tests/unit/routes/application-test.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { module, test } from 'qunit'; -import { setupTest } from 'ember-qunit'; - -module('Unit | Route | application', function (hooks) { - setupTest(hooks); - - test('it exists', function (assert) { - const route = this.owner.lookup('route:application'); - assert.ok(route); - }); -}); diff --git a/test-app/tests/unit/routes/docs-test.ts b/test-app/tests/unit/routes/docs-test.ts deleted file mode 100644 index b214801..0000000 --- a/test-app/tests/unit/routes/docs-test.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { module, test } from 'qunit'; -import { setupTest } from 'ember-qunit'; - -module('Unit | Route | docs', function (hooks) { - setupTest(hooks); - - test('it exists', function (assert) { - const route = this.owner.lookup('route:docs'); - assert.ok(route); - }); -}); diff --git a/test-app/tests/unit/routes/index-test.ts b/test-app/tests/unit/routes/index-test.ts deleted file mode 100644 index edabb73..0000000 --- a/test-app/tests/unit/routes/index-test.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { module, test } from 'qunit'; -import { setupTest } from 'ember-qunit'; - -module('Unit | Route | index', function (hooks) { - setupTest(hooks); - - test('it exists', function (assert) { - const route = this.owner.lookup('route:index'); - assert.ok(route); - }); -}); diff --git a/test-app/types/ember-data/types/registries/model.d.ts b/test-app/types/ember-data/types/registries/model.d.ts index e7a68fc..c4811b7 100644 --- a/test-app/types/ember-data/types/registries/model.d.ts +++ b/test-app/types/ember-data/types/registries/model.d.ts @@ -2,5 +2,5 @@ * Catch-all for ember-data. */ export default interface ModelRegistry { - [key: string]: any; + [key: string]: unknown; }