Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
5a5b28d
chore: setup linting, ci
NullVoxPopuli Jan 6, 2022
ba3f5ad
chore: add readme, contributing, license
NullVoxPopuli Jan 6, 2022
df425e0
chore: update CONTRIBUTING.md
NullVoxPopuli Jan 6, 2022
0a2926e
chore: start tailwind implementation
NullVoxPopuli Jan 6, 2022
abe4119
chore: minimizing plugin api
NullVoxPopuli Jan 6, 2022
26ca81c
chore: move files around, add more details to README
NullVoxPopuli Jan 6, 2022
2ee780c
chore: rename some files
NullVoxPopuli Jan 6, 2022
0885dfd
chore: fix typescript
NullVoxPopuli Jan 6, 2022
f883f3a
chore: tailwind demo almost done
NullVoxPopuli Jan 6, 2022
0b8e12b
chore: add missing build:types script
NullVoxPopuli Jan 6, 2022
766762f
chore: typescript improvements
NullVoxPopuli Jan 7, 2022
1755a63
chore: typescript green
NullVoxPopuli Jan 7, 2022
44c7be2
feat: successful first transform
NullVoxPopuli Jan 7, 2022
ec98e25
chore: idk why tsc is hanging
NullVoxPopuli Jan 7, 2022
4686102
chore: update README, consider making framework agnostic (by name onl…
NullVoxPopuli Jan 7, 2022
d5cc8b8
chore: re-arrange into a monorepo
NullVoxPopuli Jan 7, 2022
52cc494
chore: publishing attempts
NullVoxPopuli Jan 7, 2022
62df7c6
chore: monorepo fixed ts. ha
NullVoxPopuli Jan 7, 2022
ebfd7db
chore: use turborepo
NullVoxPopuli Jan 7, 2022
6baff3a
chore: fix script
NullVoxPopuli Jan 7, 2022
53d89a9
chore: symlink readme to package
NullVoxPopuli Jan 7, 2022
e4752f2
chore(internal): add testing, make tsconfigs re-usable
NullVoxPopuli Jan 11, 2022
adff671
chore(tailwind): snapshot tests are lazy tests
NullVoxPopuli Jan 11, 2022
ff103d4
chore(internal): lint:fix
NullVoxPopuli Jan 11, 2022
75dc3a9
chore(internal): add tests to ci
NullVoxPopuli Jan 12, 2022
33b8e4c
chore(internal): add ember-cli bin to ci.yml
NullVoxPopuli Jan 12, 2022
f07f189
chore(internal): try to fix type errors
NullVoxPopuli Jan 13, 2022
3b999ae
chore(internal): simplify scripts, eliminate peerDep warnings
NullVoxPopuli Jan 13, 2022
6c54c3a
chore(internal, ci): clean before build
NullVoxPopuli Jan 13, 2022
58022fa
chore(internal, ci): use continue on error for tsc, due to https://gi…
NullVoxPopuli Jan 13, 2022
46a16fb
chore(internal): disable the type checking part of CI
NullVoxPopuli Jan 13, 2022
81ea1a5
chore(internal): ensure publishing works
NullVoxPopuli Jan 13, 2022
4b0989b
chore(internal): ensure publishing works
NullVoxPopuli Jan 13, 2022
515ad2e
chore(internal): ensure publishing works
NullVoxPopuli Jan 13, 2022
ddda719
chore(internal): limit publish artifacts
NullVoxPopuli Jan 13, 2022
862c8ec
chore(publishing): don't use symlink, instead copy from root
NullVoxPopuli Jan 13, 2022
ee29aeb
chore: prep for release
NullVoxPopuli Jan 13, 2022
1309e07
chore(internal): update dependencies
NullVoxPopuli Jan 13, 2022
f58a3d7
chore(ci): maybe the tooling check won't work until publishing has al…
NullVoxPopuli Jan 13, 2022
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
10 changes: 0 additions & 10 deletions .eslintrc.js

This file was deleted.

73 changes: 73 additions & 0 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
// Docs:
// https://docs.renovatebot.com/configuration-options/
{
"extends": [
"config:base",
":semanticCommits"
],
"automerge": true,
"masterIssue": true,
// bump for apps
// update-lockfile for addons/libraries
"rangeStrategy": "update-lockfile",
// From the docs:
// https://docs.renovatebot.com/configuration-options/#packagerules
// Important to know: Renovate will evaluate all packageRules and not stop once it gets a first match.
// Therefore, you should order your packageRules in order of importance so that later rules can override
// settings from earlier rules if necessary.
//
// (so if something is to be disabled, place that rule last)
"packageRules": [
////////////////////////////////////////
// Grouping namespaced packages together
//
// This reduces overall PR count
////////////////////////////////////////
{
"groupName": "Lint Dependencies",
"schedule": ["after 9pm on sunday"],
"packageNames": [
"eslint",
"babel-eslint",
"ember-template-lint",
"prettier"
],
"packagePatterns": [
"eslint-plugin-.*",
"eslint-config-.*",
".*typescript-eslint.*",
"^@commitlint\/*",
"^remark-*"
]
},
{
"groupName": "HTML Packages",
"schedule": ["after 9pm on sunday"],
"packageNames": [
"rehype",
"unified"
],
"packagePatterns": [
"rehype-.*",
"unist-*"
]
},
{
"groupName": "Testing Dependencies",
"schedule": ["after 9pm on sunday"],
"packageNames": [
]
},
{
// changing peerDependencies *at all* is a breaking change
"matchDepTypes": ["peerDependencies"],
"enabled": false
},
{
// changing engines forces other people to need to upgrade their minimum node
// therefor engine changes are breaking changes
"depTypeList": ["engines"],
"enabled": false
}
]
}
87 changes: 87 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: "CI"
on:
pull_request:
push:
# filtering branches here prevents duplicate builds from pull_request and push
branches:
- main
- master

env:
CI: true
CACHE_PATH: '**/node_modules'

jobs:
install_dependencies:
name: Install Dependencies
runs-on: ubuntu-latest
timeout-minutes: 15

steps:
- uses: actions/checkout@v2
- uses: volta-cli/action@v1
- uses: actions/cache@v2
with:
path: ${{ env.CACHE_PATH }}
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
restore-keys: "${{ runner.os }}-modules-"
- run: yarn install

tests:
name: "Tests"
runs-on: ubuntu-latest
needs: [install_dependencies]

steps:
- uses: actions/checkout@v2
- uses: volta-cli/action@v1
- uses: actions/[email protected]
with:
path: ${{ env.CACHE_PATH }}
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- run: |
yarn install
yarn global add ember-cli
- name: Tests
run: yarn test

# tooling:
# name: Tooling
# runs-on: ubuntu-latest
# if: github.ref != 'refs/heads/main'
# timeout-minutes: 2
# needs: [install_dependencies]

# steps:
# - uses: actions/checkout@v2
# - uses: volta-cli/action@v1
# - uses: actions/[email protected]
# with:
# path: ${{ env.CACHE_PATH }}
# key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}

# - run: yarn install
# - name: Semantic Release
# run: yarn publish:dry-run
# env:
# NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

publish:
name: Release
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
needs: [tests]

steps:
- uses: actions/checkout@v2
with:
persist-credentials: false
- uses: volta-cli/action@v1
- run: yarn install

- name: Release
run: yarn publish
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
74 changes: 74 additions & 0 deletions .github/workflows/quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: "Quality"
on:
pull_request:
push:
# filtering branches here prevents duplicate builds from pull_request and push
branches:
- main
- master

env:
CI: true
CACHE_PATH: '**/node_modules'

jobs:
install_dependencies:
name: Install Dependencies
runs-on: ubuntu-latest
timeout-minutes: 15

steps:
- uses: actions/checkout@v2
- uses: volta-cli/action@v1
- uses: actions/cache@v2
with:
path: ${{ env.CACHE_PATH }}
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
restore-keys: "${{ runner.os }}-modules-"
- run: yarn install

lint_source:
name: Lint Source
runs-on: ubuntu-latest
needs: [install_dependencies]

steps:
- uses: actions/checkout@v2
- uses: volta-cli/action@v1
- uses: actions/[email protected]
with:
path: ${{ env.CACHE_PATH }}
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- run: yarn install
- name: Lints
run: yarn lint

commits:
name: Commit Messages
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- uses: volta-cli/action@v1
- uses: wagoid/[email protected]

# types:
# name: "Type Correctness"
# runs-on: ubuntu-latest
# timeout-minutes: 2
# needs: [install_dependencies]

# steps:
# - uses: actions/checkout@v2
# - uses: volta-cli/action@v1
# - uses: actions/cache@v2
# with:
# path: ${{ env.CACHE_PATH }}
# key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
# - run: yarn install
# # running with yarn causes tsc to hang
# - run: tsc --build --clean && tsc --build
# continue-on-error: true
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
node_modules/
declarations/
yarn-error.log
.turbo
/out/
coverage/
tsconfig.tsbuildinfo
16 changes: 16 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# How To Contribute

## Installation

* `git clone <repository-url>`
* `cd ember-apply`
* `yarn install`

## Linting

* `yarn lint`

## Running tests

tbd

9 changes: 9 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
The MIT License (MIT)

Copyright (c) 2021

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
96 changes: 96 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# ember-apply

_Automatic integration and configuration from the community._

This is a collection of recommended configurations provided via
transformation (codemods and other utilities) that work both on
existing apps as well as new apps to help make setting things
up a bit easier.

## Usage

```shell
npx ember-apply <feature-name>
```

where `<feature-name>` is one of the following:

### `tailwind`

```shell
npx ember-apply tailwind
```

_Automates the steps from [Tailwind's installation docs](https://tailwindcss.com/docs/installation)_

Known working capabilities:
- JIT
- Rebuilding during development

### `ssr`

implementation tbd (pr's welcome!)

```shell
npx ember-apply ssr
```

Known working capabilities:
- tbd

### any package published as ESM with a default export

when using a package name for the `<feature-name>`, an ESM version of the package
will attempt to be loaded and used, invoking the default export.
```shell
npx ember-apply @scope/feature-name
```

## Adding a new applyable

- clone this repository
- create a `applyables/<your-applyable>/index.js` file
- have a function exported as the default export.
within this function, you may import form `ember-apply` to use any of the utility functions.
the only argument passed to this function is the working directory `npx ember-apply` was invoked from.
how the `<your-applyable>` folder is managed is totally up to whomever implements and maintains that code.

### For Transforming JS

[JSCodeShift](https://github.com/facebook/jscodeshift) is used

### For Transforming Ember Templates

[ember-template-recast](https://github.com/ember-template-lint/ember-template-recast) is used

### For Transforming HTML

[rehype](https://github.com/rehypejs/rehype) is used

## Public API

While these public APIs aren't "needed", and could indeed be used with ember's blueprint system, or some other ecosystem

### `transformScript`
### `transformTemplate`
### `transformHTML`
### `addHTML`
### `gitIgnore`
### `addScript`
### `addScripts`
### `applyFolder`
### `copyFileTo`


## Related Projects

- [preset](https://github.com/preset/preset)
GOAL (tbd): be compatible with `npx apply`

- `preset` does not provide codemodding tools, but
it does provide basic pattern-based transforming
utilities, so it's a solid option. It also does
not have built-in support for template transforms.
- currently, `preset` forces the install of `esbuild` which fails due to having the security feature `ignore-scripts` enabled, so `preset` is a non-option for folks who care
about security. (or who don't mind adding an allow-list for `preset`)

Empty file removed applyables/tailwind/index.js
Empty file.
18 changes: 18 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
'use strict';

module.exports = {
extends: ['@commitlint/config-conventional'],
// https://commitlint.js.org/#/reference-rules
// Level [0..2]: 0 disables the rule. For 1 it will be considered a warning for 2 an error.
// Applicable always|never: never inverts the rule.
// Value: value to use for this rule.
rules: {
// 72, the default, is a little short
'header-max-length': [1, 'always', 100],
// Let people use caps
'header-case': [0],
// Let people write sentences
'header-full-stop': [0],
'subject-case': [0],
},
};
Loading