Skip to content

Commit

Permalink
Merge pull request #511 from adopted-ember-addons/release-prep
Browse files Browse the repository at this point in the history
Prep for Release (v5, Major)
  • Loading branch information
NullVoxPopuli authored Jan 29, 2023
2 parents 28174de + 6e8b649 commit 49f3f7a
Show file tree
Hide file tree
Showing 27 changed files with 13,408 additions and 13,080 deletions.
30 changes: 30 additions & 0 deletions .github/actions/assert-build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Build and Assert Assets Exists
description: Build the package and assert that file contents exist as we expect
runs:
using: "composite"
steps:
- name: Build and Assert Output
shell: bash
run: |-
echo '
target: ./addon/dist
setup:
run: pnpm build
cwd: ./addon/
expect: |
modifiers/sortable-group.js
modifiers/sortable-group.js.map
modifiers/sortable-handle.js
modifiers/sortable-handle.js.map
modifiers/sortable-item.js
modifiers/sortable-item.js.map
test-support/index.js
test-support/index.js.map
' >> assert-contents.config.yml
npx assert-folder-contents
- name: Upload dist assets to cache
uses: actions/upload-artifact@v3
with:
name: dist
path: ./addon/dist
15 changes: 15 additions & 0 deletions .github/actions/download-built-package/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Download built package from cache
description: Download built package from cache
runs:
using: "composite"
steps:
- name: Download built package from cache
uses: actions/download-artifact@v3
with:
name: dist
path: ./addon/dist

# https://github.com/pnpm/pnpm/issues/4965
- name: 'Install dependencies'
shell: 'bash'
run: pnpm install --force
14 changes: 14 additions & 0 deletions .github/actions/setup-job/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Setup node and package manager
description: Setup node and install dependencies using the package manager
runs:
using: "composite"
steps:
- uses: pnpm/[email protected]
with:
version: 7
- uses: actions/setup-node@v3
with:
cache: 'pnpm'
- name: 'Install dependencies'
shell: 'bash'
run: pnpm install
85 changes: 34 additions & 51 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,86 +12,74 @@ concurrency:
cancel-in-progress: true

jobs:
setup:
name: Setup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-job
- uses: ./.github/actions/assert-build

lint:
name: Lint
runs-on: ubuntu-latest
needs: [setup]

steps:
- uses: actions/checkout@v3
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 14.x
cache: yarn
- name: Install Dependencies
run: yarn install --frozen-lockfile
- name: Lint Addon
run: yarn lint
working-directory: addon
- name: Lint Test App
run: yarn lint
working-directory: test-app
- name: Lint Docs
run: yarn lint
working-directory: docs
- uses: ./.github/actions/setup-job
- name: Lint
run: pnpm lint

test:
name: "Tests"
runs-on: ubuntu-latest
needs: lint
needs: [setup]

steps:
- uses: actions/checkout@v3
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 14.x
cache: yarn
- name: Install Dependencies
run: yarn install --frozen-lockfile
- uses: ./.github/actions/setup-job
- uses: ./.github/actions/download-built-package
- name: Run Tests
run: yarn test:ember
run: pnpm test:ember
working-directory: test-app

docs:
name: "Docs App"
runs-on: ubuntu-latest
needs: lint
# This isn't a strict requirement, but it doesn't make
# sense to test the docs app if the main tests are not passing
needs: [test]

steps:
- uses: actions/checkout@v3
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 14.x
cache: yarn
- name: Install Dependencies
run: yarn install --frozen-lockfile
- uses: ./.github/actions/setup-job
- uses: ./.github/actions/download-built-package
- name: Run Tests
run: yarn test:ember
run: pnpm test:ember
working-directory: docs

floating:
name: "Floating Dependencies"
runs-on: ubuntu-latest
needs: lint
needs: [test]

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 14.x
cache: yarn
- uses: ./.github/actions/setup-job
- uses: ./.github/actions/download-built-package
- name: Install Dependencies
run: yarn install --no-lockfile
run: |
rm pnpm-lock.yaml
pnpm install
- name: Run Tests
run: yarn test:ember
run: pnpm test:ember
working-directory: test-app

try-scenarios:
name: ${{ matrix.try-scenario }}
runs-on: ubuntu-latest
needs: test
needs: [test]

strategy:
fail-fast: false
Expand All @@ -103,19 +91,14 @@ jobs:
- ember-release
- ember-beta
- ember-canary
- ember-classic
- ember-modifier-4
- embroider-safe
- embroider-optimized

steps:
- uses: actions/checkout@v3
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 14.x
cache: yarn
- name: Install Dependencies
run: yarn install --frozen-lockfile
- uses: ./.github/actions/setup-job
- uses: ./.github/actions/download-built-package
- name: Run Tests
run: ../node_modules/.bin/ember try:one ${{ matrix.try-scenario }}
run: node_modules/.bin/ember try:one ${{ matrix.try-scenario }} --skip-cleanup
working-directory: test-app
20 changes: 9 additions & 11 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,21 @@

- `git clone <repository-url>`
- `cd ember-sortable`
- `yarn install`
- `pnpm install`

## Linting
## Building

- `yarn lint:hbs`
- `yarn lint:js`
- `yarn lint:js --fix`
- `pnpm build`

## Running tests
## Linting

- `ember test` – Runs the test suite on the current Ember version
- `ember test --server` – Runs the test suite in "watch mode"
- `ember try:each` – Runs the test suite against multiple Ember versions
- `pnpm lint`
- `pnpm lint:fix`

## Running the dummy application
## Running the test application

- `cd test-app`
- `ember serve`
- Visit the dummy application at [http://localhost:4200](http://localhost:4200).
- Visit the test application at [http://localhost:4200](http://localhost:4200).

For more information on using ember-cli, visit [https://cli.emberjs.com/release/](https://cli.emberjs.com/release/).
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ Sortable UI primitives for Ember.
|----------------|-------|------|
| 3.0.0 | 3.24+ | 12+ |
| 4.0.0 | 3.24+ | 14+ |
| 5.0.0 | 3.28+ | 14+ |
| 5.0.0 | 3.28+ | n/a[^1] |

[^1]: Node is not relevant for v2 addons. As of v5.0.0, ember-sortable is a v2 addon. V2 addons don't have to be for browser-only contexts, but ember-sortable is -- so node is not relevant anymore. This is different from v1 addons, which are not browser libraries, but node programs that happen emit browser code to the consuming app at app-build time.

## Installation

Expand Down Expand Up @@ -343,20 +345,20 @@ and returns a `string` constructed from the `config`.
- [`reorder`][reorder]: Reorders elements to the specified state.
- [`keyboard`][keyboard]: Keycode constants for quick.

[drag]: addon-test-support/helpers/drag.js
[reorder]: addon-test-support/helpers/reorder.js
[keyboard]: addon-test-support/utils/kebyoard.js
[drag]: addon/src/test-support/helpers/drag.js
[reorder]: addon/src/test-support/helpers/reorder.js
[keyboard]: addon/src/test-support/utils/kebyoard.js

To include them in your application, you can import them:

```js
import { drag, reorder } from 'ember-sortable/test-support/helpers';
import {
import {
drag, reorder,
ENTER_KEY_CODE,
SPACE_KEY_CODE,
ESCAPE_KEY_CODE,
ARROW_KEY_CODES,
} from 'ember-sortable/test-support/utils/keyboard';
} from 'ember-sortable/test-support';
```

### Examples
Expand Down
5 changes: 3 additions & 2 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Once the prep work is completed, the actual release is straight forward:
* First, ensure that you have installed your projects dependencies:

```sh
yarn install
pnpm install
```

* Second, ensure that you have obtained a
Expand All @@ -50,7 +50,8 @@ yarn install
* And last (but not least 😁) do your release.

```sh
npx release-it
# optionally cd to the addon directory
pnpm release-it
```

[release-it](https://github.com/release-it/release-it/) manages the actual
Expand Down
3 changes: 3 additions & 0 deletions addon/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.
# copied from monorepo root
README.md
LICENSE.md

# compiled output
/dist/
Expand Down
29 changes: 25 additions & 4 deletions addon/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ember-sortable",
"version": "5.0.0",
"version": "4.0.3",
"description": "Sortable UI primitives for Ember.",
"keywords": [
"ember-addon",
Expand All @@ -15,7 +15,8 @@
},
"exports": {
".": "./dist/index.js",
"./*": "./dist/*",
"./modifiers/*": "./dist/modifiers/*",
"./services/*": "./dist/services/*",
"./test-support": "./dist/test-support/index.js",
"./addon-main.js": "./addon-main.js"
},
Expand All @@ -24,6 +25,7 @@
"dist"
],
"scripts": {
"release": "release-it",
"build": "rollup --config",
"prepublishOnly": "rollup --config",
"lint": "npm-run-all --aggregate-output --continue-on-error --parallel \"lint:!(fix)\"",
Expand All @@ -35,7 +37,8 @@
"peerDependencies": {
"ember-modifier": "^3.2.0 || ^4.0.0",
"@ember/test-helpers": "^2.6.0",
"@ember/test-waiters": "^3.0.1"
"@ember/test-waiters": "^3.0.1",
"ember-source": "^3.28.0 || ^4.0.0"
},
"dependencies": {
"@embroider/addon-shim": "^1.8.4"
Expand All @@ -45,6 +48,7 @@
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-proposal-decorators": "^7.20.7",
"@embroider/addon-dev": "^3.0.0",
"@release-it-plugins/lerna-changelog": "^5.0.0",
"@rollup/plugin-babel": "^6.0.3",
"babel-eslint": "^10.0.3",
"eslint": "^7.32.0",
Expand All @@ -55,11 +59,28 @@
"eslint-plugin-qunit": "^7.2.0",
"npm-run-all": "^4.1.5",
"prettier": "^2.5.1",
"rollup": "^3.10.0"
"release-it": "^15.6.0",
"rollup": "^3.10.0",
"rollup-plugin-copy": "^3.4.0"
},
"engines": {
"node": "14.* || >= 16"
},
"release-it": {
"plugins": {
"@release-it-plugins/lerna-changelog": {
"infile": "CHANGELOG.md",
"launchEditor": false
}
},
"git": {
"tagName": "v${version}"
},
"github": {
"release": true,
"tokenRef": "GITHUB_AUTH"
}
},
"publishConfig": {
"registry": "https://registry.npmjs.org"
},
Expand Down
Loading

0 comments on commit 49f3f7a

Please sign in to comment.