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

Updated blueprints to match @embroider/[email protected] #62

Merged
merged 4 commits into from
Aug 12, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
9 changes: 9 additions & 0 deletions src/blueprints/ember-addon/__addonLocation__/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# unconventional js
/blueprints/*/files/

# compiled output
/declarations/
/dist/

# misc
/coverage/
7 changes: 7 additions & 0 deletions src/blueprints/ember-addon/__addonLocation__/__gitignore__
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,10 @@
# will also appear in published NPM packages.
/LICENSE.md
/README.md

# compiled output
/declarations
/dist

# npm/pnpm/yarn pack output
*.tgz
18 changes: 12 additions & 6 deletions src/blueprints/ember-addon/__addonLocation__/babel.config.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
{
<% if (options.packages.addon.hasTypeScript) { %> "presets": [["@babel/preset-typescript"]],
<% } %> "plugins": [
"@embroider/addon-dev/template-colocation-plugin",<% if (options.packages.addon.hasTypeScript) { %>
["@babel/plugin-transform-typescript", { "allowDeclareFields": true }],<% } %>
<% if (options.packages.addon.hasTypeScript) { %>{
"presets": [["@babel/preset-typescript"]],
"plugins": [
"@embroider/addon-dev/template-colocation-plugin",
["@babel/plugin-transform-typescript", { "allowDeclareFields": true }],
["@babel/plugin-proposal-decorators", { "version": "legacy" }],
"@babel/plugin-transform-class-properties"
]
}
}<% } else { %>{
"plugins": [
"@embroider/addon-dev/template-colocation-plugin",
["@babel/plugin-proposal-decorators", { "version": "legacy" }],
"@babel/plugin-transform-class-properties"
]
}<% } %>
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ const addon = new Addon({
destDir: 'dist',
});

// Add extensions here, such as ts, gjs, etc that you may import
const extensions = ['.js'<% if (options.packages.addon.hasTypeScript) { %>, '.ts'<% } %>];

export default {
// This provides defaults that work well alongside `publicEntrypoints` below.
// You can augment this if you need to.
Expand Down Expand Up @@ -38,7 +35,7 @@ export default {
// babel.config.json.
babel({
babelHelpers: 'bundled',
extensions,
extensions: ['.js'<% if (options.packages.addon.hasTypeScript) { %>, '.ts'<% } %>],
}),

// Ensure that standalone .hbs files are properly integrated as Javascript.
Expand Down
15 changes: 5 additions & 10 deletions src/blueprints/ember-addon/__gitignore__
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
# compiled output
declarations/
dist/

# npm/pnpm/yarn pack output
*.tgz
# See https://help.github.com/ignore-files/ for more about ignoring files.

# dependencies
node_modules/

# misc
/.env*
/.pnpm-debug.log
/npm-debug.log*
/yarn-error.log
.env*
.pnpm-debug.log
npm-debug.log*
yarn-error.log
6 changes: 3 additions & 3 deletions src/blueprints/ember-addon/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<% if (options.packageManager.isNpm) { %>{
"name": "<%= options.packages.addon.name %>",
"name": "workspace-root",
"version": "<%= options.packages.addon.version %>",
"private": true,
"repository": "",
Expand All @@ -23,7 +23,7 @@
"concurrently": "<%= context.projectRoot.devDependencies['concurrently'] %>"
}
}<% } else if (options.packageManager.isPnpm) { %>{
"name": "<%= options.packages.addon.name %>",
"name": "workspace-root",
Copy link
Owner Author

Choose a reason for hiding this comment

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

By giving the workspace root a name, we may easily distinguish where dependencies come from, when we run the outdated command, e.g. pnpm outdated -r.

"version": "<%= options.packages.addon.version %>",
"private": true,
"repository": "",
Expand All @@ -43,7 +43,7 @@
"concurrently": "<%= context.projectRoot.devDependencies['concurrently'] %>"
}
}<% } else if (options.packageManager.isYarn) { %>{
"name": "<%= options.packages.addon.name %>",
"name": "workspace-root",
"version": "<%= options.packages.addon.version %>",
"private": true,
"repository": "",
Expand Down
14 changes: 7 additions & 7 deletions src/utils/blueprints/get-version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ import { decideVersion } from '@codemod-utils/blueprints';
import type { Options } from '../../types/index.js';

const latestVersions = new Map([
['@babel/core', '7.22.6'],
['@babel/plugin-proposal-decorators', '7.22.6'],
['@babel/core', '7.22.10'],
['@babel/plugin-proposal-decorators', '7.22.10'],
['@babel/plugin-transform-class-properties', '7.22.5'],
['@babel/preset-typescript', '7.22.5'],
['@babel/runtime', '7.22.6'],
['@embroider/addon-dev', '3.1.1'],
['@embroider/addon-shim', '1.8.5'],
['@babel/runtime', '7.22.10'],
['@embroider/addon-dev', '4.1.0'],
['@embroider/addon-shim', '1.8.6'],
['@rollup/plugin-babel', '6.0.3'],
['concurrently', '8.2.0'],
['ember-auto-import', '2.6.3'],
['ember-cli-babel', '7.26.11'],
['ember-cli-htmlbars', '6.2.0'],
['rollup', '3.26.0'],
['ember-cli-htmlbars', '6.3.0'],
['rollup', '3.28.0'],
['rollup-plugin-copy', '3.4.0'],
]);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
# compiled output
declarations/
dist/

# npm/pnpm/yarn pack output
*.tgz
# See https://help.github.com/ignore-files/ for more about ignoring files.

# dependencies
node_modules/

# misc
/.env*
/.pnpm-debug.log
/npm-debug.log*
/yarn-error.log
.env*
.pnpm-debug.log
npm-debug.log*
yarn-error.log
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "ember-container-query",
"name": "workspace-root",
"version": "3.2.0",
"private": true,
"repository": "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,10 @@
# will also appear in published NPM packages.
/LICENSE.md
/README.md

# compiled output
/declarations
/dist

# npm/pnpm/yarn pack output
*.tgz
Original file line number Diff line number Diff line change
@@ -1,25 +1,9 @@
# unconventional js
/blueprints/*/files/
/vendor/

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

# dependencies
/bower_components/
/node_modules/

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

# 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
Original file line number Diff line number Diff line change
Expand Up @@ -59,23 +59,23 @@
}
},
"dependencies": {
"@embroider/addon-shim": "^1.8.5",
"@embroider/addon-shim": "^1.8.6",
"ember-cli-typescript": "^5.2.1",
"ember-element-helper": "^0.6.1",
"ember-modifier": "^3.2.7",
"ember-resize-observer-service": "^1.1.0",
"ember-test-selectors": "^6.0.0"
},
"devDependencies": {
"@babel/core": "^7.22.6",
"@babel/plugin-proposal-decorators": "^7.22.6",
"@babel/core": "^7.22.10",
"@babel/plugin-proposal-decorators": "^7.22.10",
"@babel/plugin-transform-class-properties": "^7.22.5",
"@babel/preset-typescript": "^7.22.5",
"@babel/runtime": "^7.22.6",
"@embroider/addon-dev": "^3.1.1",
"@babel/runtime": "^7.22.10",
"@embroider/addon-dev": "^4.1.0",
"@rollup/plugin-babel": "^6.0.3",
"concurrently": "^7.6.0",
"rollup": "^3.26.0",
"rollup": "^3.28.0",
"rollup-plugin-copy": "^3.4.0"
},
"engines": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ const addon = new Addon({
destDir: 'dist',
});

// Add extensions here, such as ts, gjs, etc that you may import
const extensions = ['.js', '.ts'];

export default {
// This provides defaults that work well alongside `publicEntrypoints` below.
// You can augment this if you need to.
Expand Down Expand Up @@ -38,7 +35,7 @@ export default {
// babel.config.json.
babel({
babelHelpers: 'bundled',
extensions,
extensions: ['.js', '.ts'],
}),

// Ensure that standalone .hbs files are properly integrated as Javascript.
Expand Down
15 changes: 5 additions & 10 deletions tests/fixtures/ember-container-query-glint/output/.gitignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
# compiled output
declarations/
dist/

# npm/pnpm/yarn pack output
*.tgz
# See https://help.github.com/ignore-files/ for more about ignoring files.

# dependencies
node_modules/

# misc
/.env*
/.pnpm-debug.log
/npm-debug.log*
/yarn-error.log
.env*
.pnpm-debug.log
npm-debug.log*
yarn-error.log
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,10 @@
# will also appear in published NPM packages.
/LICENSE.md
/README.md

# compiled output
/declarations
/dist

# npm/pnpm/yarn pack output
*.tgz
Original file line number Diff line number Diff line change
@@ -1,25 +1,9 @@
# unconventional js
/blueprints/*/files/
/vendor/

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

# dependencies
/bower_components/
/node_modules/

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

# 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
Original file line number Diff line number Diff line change
Expand Up @@ -59,23 +59,23 @@
}
},
"dependencies": {
"@embroider/addon-shim": "^1.8.5",
"@embroider/addon-shim": "^1.8.6",
"ember-cli-typescript": "^5.2.1",
"ember-element-helper": "^0.6.1",
"ember-modifier": "^3.2.7",
"ember-resize-observer-service": "^1.1.0",
"ember-test-selectors": "^6.0.0"
},
"devDependencies": {
"@babel/core": "^7.22.6",
"@babel/plugin-proposal-decorators": "^7.22.6",
"@babel/core": "^7.22.10",
"@babel/plugin-proposal-decorators": "^7.22.10",
"@babel/plugin-transform-class-properties": "^7.22.5",
"@babel/preset-typescript": "^7.22.5",
"@babel/runtime": "^7.22.6",
"@embroider/addon-dev": "^3.1.1",
"@babel/runtime": "^7.22.10",
"@embroider/addon-dev": "^4.1.0",
"@rollup/plugin-babel": "^6.0.3",
"concurrently": "^7.6.0",
"rollup": "^3.26.0",
"rollup": "^3.28.0",
"rollup-plugin-copy": "^3.4.0"
},
"engines": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ const addon = new Addon({
destDir: 'dist',
});

// Add extensions here, such as ts, gjs, etc that you may import
const extensions = ['.js', '.ts'];

export default {
// This provides defaults that work well alongside `publicEntrypoints` below.
// You can augment this if you need to.
Expand Down Expand Up @@ -38,7 +35,7 @@ export default {
// babel.config.json.
babel({
babelHelpers: 'bundled',
extensions,
extensions: ['.js', '.ts'],
}),

// Ensure that standalone .hbs files are properly integrated as Javascript.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "ember-container-query",
"name": "workspace-root",
"version": "3.2.0",
"private": true,
"repository": "",
Expand Down
15 changes: 5 additions & 10 deletions tests/fixtures/ember-container-query-javascript/output/.gitignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
# compiled output
declarations/
dist/

# npm/pnpm/yarn pack output
*.tgz
# See https://help.github.com/ignore-files/ for more about ignoring files.

# dependencies
node_modules/

# misc
/.env*
/.pnpm-debug.log
/npm-debug.log*
/yarn-error.log
.env*
.pnpm-debug.log
npm-debug.log*
yarn-error.log
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,10 @@
# will also appear in published NPM packages.
/LICENSE.md
/README.md

# compiled output
/declarations
/dist

# npm/pnpm/yarn pack output
*.tgz
Loading