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

chore!: convert addon to v2 format #747

Merged
merged 1 commit into from
May 30, 2022
Merged

Conversation

SergeAstapov
Copy link
Contributor

@SergeAstapov SergeAstapov commented May 26, 2022

This is breaking change as it now requires the consuming addon or the add to have ember-auto-import >= v2.

This follows https://github.com/embroider-build/embroider/blob/main/PORTING-ADDONS-TO-V2.md#part-4-convert-addon-to-v2 guide

@@ -12,7 +12,16 @@
"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-cookies run lint:fix",
"lint:fix:test-app": "yarn workspace test-app run lint:fix"
"lint:fix:test-app": "yarn workspace test-app run lint:fix",
"prepare": "yarn workspace ember-cookies run build",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is needed to build the addon as v2 addon needs to be prebuilt before consumption

@@ -1,9 +0,0 @@
const { buildEmberPlugins } = require('ember-cli-babel');
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is not needed as we now provide babel.config.json

# ember-try
.node_modules.ember-try/
package.json.ember-try
# .md copies from release
Copy link
Contributor Author

Choose a reason for hiding this comment

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

to make those files explorable on github, we keep them in the root folder.

to make those files packed at publish time, we copy them to the addon folder.
This allows to keep single source of truth and at the same time keep all the nice parts of DX

"scripts": {
"build": "rollup --config",
"copyDoc": "cp ../../*.md .",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is where copy of the files happens.

packages/ember-cookies/src/clear-all-cookies.js Outdated Show resolved Hide resolved
packages/ember-cookies/src/test-support/index.js Outdated Show resolved Hide resolved
@SergeAstapov
Copy link
Contributor Author

@marcoow as a followup and to ease release process, I can open PR to introduce release-it similar to https://github.com/lifeart/ember-click-outside-modifier/pull/16/files

this really simplifies release management for v2 addons as otherwise it might be error prune as it needs to consist of at least:

  • bumping version in packages/ember-cookies
  • updating ember-cookies version in packages/test-app
  • updating changelog (not sure how it's managed so far, seem manual step?)
  • creating GitHub release (not sure how it's managed so far, seem manual step?)

README.md Outdated Show resolved Hide resolved
package.json.ember-try
# .md copies from release
/CHANGELOG.md
/README.md
Copy link
Member

Choose a reason for hiding this comment

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

newline missing

["@babel/plugin-proposal-decorators", { "legacy": true }],
"@babel/plugin-proposal-class-properties"
]
}
Copy link
Member

Choose a reason for hiding this comment

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

:eyes

packages/ember-cookies/src/test-support/index.js Outdated Show resolved Hide resolved
@marcoow marcoow force-pushed the v2-addon branch 2 times, most recently from 43b409d to 8821903 Compare May 30, 2022 06:24
This is breaking change as it now requires the consuming addon or the add to have ember-auto-import >= v2
@marcoow marcoow merged commit 5a7fdf0 into mainmatter:master May 30, 2022
@SergeAstapov SergeAstapov deleted the v2-addon branch June 10, 2022 02:17
This was referenced Jun 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants