Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Covert to V2 addon (a real npm package!) #345

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions .ember-cli

This file was deleted.

17 changes: 17 additions & 0 deletions .github/actions/pnpm/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Setup node and pnpm
description: Setup node and install dependencies using pnpm
runs:
using: "composite"
steps:
- uses: volta-cli/action@v1
- name: Cache pnpm modules
uses: actions/cache@v3
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-
- uses: pnpm/[email protected]
with:
version: 7.1.0
run_install: true
69 changes: 32 additions & 37 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,39 @@ on:
schedule:
- cron: '0 3 * * *' # daily, at 3am

concurrency:
group: ci-${{ github.head_ref || github.ref }}
cancel-in-progress: true

jobs:
test:
name: Tests
name: "Tests"
runs-on: ubuntu-latest

steps:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did we lose testing against multiple node versions here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forgot to answer this!

There is no need, because the output of this repo is browser-code, so node isn't relevant.

- uses: actions/checkout@v2
- uses: volta-cli/action@v1
with:
node-version: 12.x
- run: yarn install --frozen-lockfile
- run: yarn lint
- run: yarn test:ember

floating-dependencies:
name: "Floating Dependencies"
- uses: actions/checkout@v3
- uses: ./.github/actions/pnpm
- run: pnpm build
- name: Lint
run: pnpm lint
- name: Run Tests
run: pnpm test

checktypes:
name: "Check Types"
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: volta-cli/action@v1
with:
node-version: 14.x
- run: yarn install --no-lockfile
- run: yarn test:ember
- uses: actions/checkout@v3
- uses: ./.github/actions/pnpm
- run: pnpm build
- run: tsc --noEmit
name: 'Types in the Tests'
working-directory: tests
- run: tsc --noEmit
name: 'Types in the Ember App'
working-directory: test-app


types-scenarios:
name: "Types: ${{ matrix.tsVersion }}"
Expand Down Expand Up @@ -64,9 +72,7 @@ jobs:

try-scenarios:
name: "Try: ${{ matrix.ember-try-scenario }}"

runs-on: ubuntu-latest

needs: test

strategy:
Expand All @@ -81,37 +87,26 @@ jobs:
- ember-release
- ember-beta
- ember-canary
- ember-default-with-jquery
- ember-classic
- embroider-safe
- embroider-optimized

steps:
- uses: actions/checkout@v2
- uses: volta-cli/action@v1
with:
node-version: 12.x
- uses: actions/checkout@v3
- uses: ./.github/actions/pnpm
- name: install dependencies
run: yarn install --frozen-lockfile
run: rm pnpm-lock.yaml; pnpm install
- name: test
working-directory: test-app
run: node_modules/.bin/ember try:one ${{ matrix.ember-try-scenario }} --skip-cleanup

publish:
name: Publish to npm
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install node
uses: actions/setup-node@v2
with:
node-version: 14.x
registry-url: 'https://registry.npmjs.org'

- name: install dependencies
run: yarn install --frozen-lockfile
- uses: actions/checkout@v3
- uses: ./.github/actions/pnpm
- run: pnpm build

- name: auto-dist-tag
run: npx auto-dist-tag@1 --write
Expand Down
86 changes: 86 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: CI

on:
push:
branches:
- main
- master
pull_request: {}

concurrency:
group: ci-${{ github.head_ref || github.ref }}
cancel-in-progress: true

jobs:
test:
name: "Tests"
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
with:
version: 8
- uses: actions/setup-node@v4
with:
node-version: 18
cache: pnpm
- name: Install Dependencies
run: pnpm install --frozen-lockfile
- name: Lint
run: pnpm lint
- name: Run Tests
run: pnpm test

floating:
name: "Floating Dependencies"
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
with:
version: 8
- uses: actions/setup-node@v4
with:
node-version: 18
cache: pnpm
- name: Install Dependencies
run: pnpm install --no-lockfile
- name: Run Tests
run: pnpm test

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

strategy:
fail-fast: false
matrix:
try-scenario:
- ember-lts-3.28
- ember-lts-4.4
- ember-lts-4.8
- ember-lts-4.12
- ember-lts-5.4
- ember-release
- ember-beta
- ember-canary
- embroider-safe
- embroider-optimized

steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
with:
version: 8
- uses: actions/setup-node@v4
with:
node-version: 18
cache: pnpm
- name: Install Dependencies
run: pnpm install --frozen-lockfile
- name: Run Tests
run: ./node_modules/.bin/ember try:one ${{ matrix.try-scenario }} --skip-cleanup
working-directory: test-app
33 changes: 33 additions & 0 deletions .github/workflows/push-dist.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Because this library needs to be built,
# we can't easily point package.json files at the git repo for easy cross-repo testing.
#
# This workflow brings back that capability by placing the compiled assets on a "dist" branch
# (configurable via the "branch" option below)
name: Push dist

on:
push:
branches:
- main
- master

jobs:
push-dist:
name: Push dist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
with:
version: 8
- uses: actions/setup-node@v4
with:
node-version: 18
cache: pnpm
- name: Install Dependencies
run: pnpm install --frozen-lockfile
- uses: kategengler/[email protected]
with:
branch: dist
token: ${{ secrets.GITHUB_TOKEN }}
working-directory: 'ember-string'
26 changes: 13 additions & 13 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
/dist/
/tmp/
dist/
tmp/

# dependencies
/bower_components/
/node_modules/
bower_components/
node_modules/

# misc
/.env*
.env*
/.sass-cache
/.eslintcache
.eslintcache
/connect.lock
/coverage/
coverage/
/libpeerconnection.log
/npm-debug.log*
/testem.log
/yarn-error.log
npm-debug.log*
testem.log
yarn-error.log

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try
.node_modules.ember-try/
bower.json.ember-try
package.json.ember-try

# typescript related output files
addon/**/*.js
Expand Down
46 changes: 0 additions & 46 deletions .npmignore

This file was deleted.

1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
prefer-workspace-packages=true
19 changes: 4 additions & 15 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,21 +1,10 @@
# unconventional js
/blueprints/*/files/
/vendor/

# compiled output
/dist/
/tmp/

# dependencies
/bower_components/
/node_modules/
# Prettier is also run from each package, so the ignores here
# protect against files that may not be within a package

# misc
/coverage/
!.*
.eslintcache
.lint-todo/

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try
/pnpm-lock.ember-try.yaml
6 changes: 6 additions & 0 deletions .prettierrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
'use strict';

module.exports = {
plugins: ['prettier-plugin-ember-template-tag'],
singleQuote: true,
};
Empty file removed .travis.yml
Empty file.
3 changes: 0 additions & 3 deletions .watchmanconfig

This file was deleted.

Loading