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

Move to addon v2 #66

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
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
24 changes: 10 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,15 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Install Node
uses: actions/setup-node@v2
with:
node-version: 12.x
cache: yarn
uses: volta-cli/action@v1
- name: Install Dependencies
run: yarn install --frozen-lockfile
- name: Lint
- name: Lint Addon
run: yarn lint
working-directory: packages/ember-render-modifiers
- name: Lint Test App
run: yarn lint
working-directory: packages/test-app
- name: Run Tests
run: yarn test:ember

Expand All @@ -39,14 +40,11 @@ jobs:

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 12.x
cache: yarn
- uses: volta-cli/action@v1
- name: Install Dependencies
run: yarn install --no-lockfile
- name: Run Tests
run: yarn test:ember
run: yarn test

try-scenarios:
name: ${{ matrix.try-scenario }}
Expand Down Expand Up @@ -74,11 +72,9 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Install Node
uses: actions/setup-node@v2
with:
node-version: 12.x
cache: yarn
uses: volta-cli/action@v1
- name: Install Dependencies
run: yarn install --frozen-lockfile
- name: Run Tests
run: ./node_modules/.bin/ember try:one ${{ matrix.try-scenario }}
working-directory: packages/test-app
33 changes: 5 additions & 28 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,29 +1,6 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.
# you definitely want this:
node_modules

# compiled output
/dist/
/tmp/

# dependencies
/bower_components/
/node_modules/

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

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/npm-shrinkwrap.json.ember-try
/package.json.ember-try
/package-lock.json.ember-try
/yarn.lock.ember-try
# and you can put in anything else that tends to accumulate in your environment:
yarn-error.log
.DS_Store
1 change: 0 additions & 1 deletion app/modifiers/did-insert.js

This file was deleted.

1 change: 0 additions & 1 deletion app/modifiers/did-update.js

This file was deleted.

1 change: 0 additions & 1 deletion app/modifiers/will-destroy.js

This file was deleted.

5 changes: 0 additions & 5 deletions config/environment.js

This file was deleted.

25 changes: 0 additions & 25 deletions ember-cli-build.js

This file was deleted.

5 changes: 0 additions & 5 deletions index.js

This file was deleted.

115 changes: 33 additions & 82 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,95 +1,46 @@
{
"name": "@ember/render-modifiers",
"version": "2.0.4",
"description": "Implements did-insert / did-update / will-destry modifiers for emberjs/rfcs#415",
"keywords": [
"ember-addon"
],
"repository": "[email protected]:emberjs/ember-render-modifiers.git",
"license": "MIT",
"author": "Robert Jackson <me@rwjblue>",
"main": "index.js",
"directories": {
"doc": "doc",
"test": "tests"
},
"private": true,
"workspaces": ["packages/*"],
"scripts": {
"build": "ember build --environment=production",
"prepare": "yarn workspace @ember/render-modifiers run prepare",
"start": "npm-run-all --parallel start:*",
"start:addon": "yarn workspace @ember/render-modifiers run start",
"start:test-app": "yarn workspace test-app run start",
"lint": "npm-run-all --aggregate-output --continue-on-error --parallel \"lint:!(fix)\"",
"lint:fix": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*:fix",
"lint:hbs": "ember-template-lint .",
"lint:hbs:fix": "ember-template-lint . --fix",
"lint:js": "eslint . --cache",
"lint:js:fix": "eslint . --fix",
"start": "ember serve",
"test": "npm-run-all lint test:*",
"test:ember": "ember test",
"test:ember-compatibility": "ember try:each"
},
"dependencies": {
"@embroider/macros": "^1.0.0",
"ember-cli-babel": "^7.26.11",
"ember-modifier-manager-polyfill": "^1.2.0"
"lint:addon": "yarn workspace @ember/render-modifiers run lint",
"lint:test-app": "yarn workspace test-app run lint",
"lint:fix": "npm-run-all --aggregate-output --continue-on-error --parallel lint:fix:*",
"lint:fix:addon": "yarn workspace @ember/render-modifiers run lint:fix",
"lint:fix:test-app": "yarn workspace test-app run lint:fix",
"test": "npm-run-all --aggregate-output --continue-on-error --parallel \"test:!(watch)\"",
"test:watch": "npm-run-all --aggregate-output --continue-on-error --parallel test:watch:*",
"test:test-app": "yarn workspace test-app run test",
"test:watch:test-app": "yarn workspace test-app run test:watch",
"test:watch:addon": "yarn workspace @ember/render-modifiers run start",
"release": "release-it"
},
"volta": {
"node": "16.14.2",
Copy link
Contributor

Choose a reason for hiding this comment

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

@ctjhoa I think this should stay as 12 as minimum supported version and the same what was used in CI.

Or we could remove engines.node from @ember/render-modifiers as it's purely frontend code and has nothing to do with Node.js versions anymore (fully delegated to build pipeline)

Copy link
Author

Choose a reason for hiding this comment

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

I've removed engines.node
226ff16

As this PR introduces a breaking change, go for the latest Node LTS seems fine to me.

"yarn": "1.22.17"
},
"devDependencies": {
"@ember/optional-features": "^2.0.0",
"@ember/test-helpers": "^2.6.0",
"@embroider/test-setup": "^1.0.0",
"@embroider/util": "^1.0.0",
"@glimmer/component": "^1.0.4",
"@glimmer/tracking": "^1.0.4",
"babel-eslint": "^10.1.0",
"ember-auto-import": "^2.2.4",
"ember-cli": "~4.1.0",
"ember-cli-dependency-checker": "^3.2.0",
"ember-cli-htmlbars": "^6.0.1",
"ember-cli-inject-live-reload": "^2.1.0",
"ember-cli-terser": "^4.0.2",
"ember-disable-prototype-extensions": "^1.1.3",
"ember-load-initializers": "^2.1.2",
"ember-page-title": "^7.0.0",
"ember-qunit": "^5.1.5",
"ember-resolver": "^8.0.3",
"ember-source": "~4.1.0",
"ember-source-channel-url": "^3.0.0",
"ember-template-lint": "^3.15.0",
"ember-try": "^2.0.0",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-ember": "^10.5.8",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-qunit": "^7.2.0",
"loader.js": "^4.7.0",
"npm-run-all": "^4.1.5",
"prettier": "^2.5.1",
"qunit": "^2.17.2",
"qunit-dom": "^2.0.0",
"release-it": "^14.11.6",
"release-it-lerna-changelog": "^3.1.0",
"webpack": "^5.65.0"
},
"peerDependencies": {
"ember-source": "^3.8 || 4"
},
"engines": {
"node": "12.* || 14.* || >= 16"
},
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org"
},
"ember": {
"edition": "octane"
},
"ember-addon": {
"configPath": "tests/dummy/config"
"release-it": "^15.0.0",
"@release-it-plugins/lerna-changelog": "^5.0.0",
"@release-it-plugins/workspaces": "^3.2.0"
},
"release-it": {
"plugins": {
"release-it-lerna-changelog": {
"@release-it-plugins/lerna-changelog": {
"infile": "CHANGELOG.md",
"launchEditor": true
"launchEditor": false
},
"@release-it-plugins/workspaces": {
"workspaces": ["packages/ember-render-modifiers"],
"additionalManifests": {
"dependencyUpdates": ["packages/test-app/package.json"],
"versionUpdates": ["packages/test-app/package.json"]
}
}
},
"git": {
Expand Down
46 changes: 46 additions & 0 deletions packages/ember-render-modifiers/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
'use strict';

module.exports = {
root: true,
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
ecmaFeatures: {
legacyDecorators: true,
},
},
plugins: ['ember'],
extends: [
'eslint:recommended',
'plugin:ember/recommended',
'plugin:prettier/recommended',
],
env: {
browser: true,
},
rules: {},
overrides: [
// node files
{
files: [
'./.eslintrc.js',
'./.prettierrc.js',
'./.template-lintrc.js',
'./addon-main.js',
'./testem.js',
'./blueprints/*/index.js',
'./config/**/*.js',
],
parserOptions: {
sourceType: 'script',
},
env: {
browser: false,
node: true,
},
plugins: ['node'],
extends: ['plugin:node/recommended'],
},
],
};
11 changes: 11 additions & 0 deletions packages/ember-render-modifiers/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# The authoritative copies of these live in the monorepo root (because they're
# more useful on github that way), but the build copies them into here so they
# will also appear in published NPM packages.
/README.md
/LICENSE.md
/CONTRIBUTING.md
/RELEASE.md
/CHANGELOG.md

# compiled output
/dist/
15 changes: 15 additions & 0 deletions packages/ember-render-modifiers/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# unconventional js
/blueprints/*/files/
/vendor/

# compiled output
/dist/
/tmp/

# dependencies
/node_modules/

# misc
/coverage/
!.*
.eslintcache
13 changes: 13 additions & 0 deletions packages/ember-render-modifiers/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
"use strict";

module.exports = {
singleQuote: true,
overrides: [
{
files: "*.hbs",
options: {
singleQuote: false,
},
},
],
};
2 changes: 2 additions & 0 deletions packages/ember-render-modifiers/addon-main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
const { addonV1Shim } = require('@embroider/addon-shim');
module.exports = addonV1Shim(__dirname);
7 changes: 7 additions & 0 deletions packages/ember-render-modifiers/babel.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"plugins": [
"@embroider/addon-dev/template-colocation-plugin",
["@babel/plugin-proposal-decorators", { "legacy": true }],
"@babel/plugin-proposal-class-properties"
]
}
Loading