Skip to content

Commit

Permalink
Updated package configurations (#456)
Browse files Browse the repository at this point in the history
* chore: Updated project configuration (ember-codemod-ember-render-helpers-to-v1)

* refactor: Simplified src

* chore: Updated project configuration (ember-render-helpers)

* chore: Standardized scripts

* chore: Installed update-workspace-root-version to help create tag names

* chore: Added lockfile

* chore: Added changeset

---------

Co-authored-by: ijlee2 <ijlee2@users.noreply.github.com>
  • Loading branch information
ijlee2 and ijlee2 authored Nov 11, 2024
1 parent 2ce450b commit ce56bc0
Show file tree
Hide file tree
Showing 13 changed files with 125 additions and 114 deletions.
7 changes: 7 additions & 0 deletions .changeset/two-snakes-fly.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"ember-codemod-ember-render-helpers-to-v1": patch
"ember-render-helpers": patch
"test-app": patch
---

Updated package configurations
15 changes: 8 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,22 @@
"license": "MIT",
"author": "",
"scripts": {
"build": "pnpm --filter './packages/**' build",
"lint": "pnpm --filter '*' lint",
"lint:fix": "pnpm --filter '*' lint:fix",
"build": "pnpm --filter \"./packages/**\" build",
"lint": "pnpm --filter \"*\" lint",
"lint:fix": "pnpm --filter \"*\" lint:fix",
"prepare": "pnpm build",
"release:changelog": "changeset version",
"release:changelog": "changeset version; update-workspace-root-version",
"release:publish": "pnpm build && changeset publish",
"start": "concurrently 'npm:start:*' --restart-after 5000 --prefix-colors cyan,white,yellow",
"start": "concurrently \"pnpm:start:*\" --restart-after 5000 --prefix-colors cyan,yellow",
"start:addon": "pnpm --filter ember-render-helpers start",
"start:test-app": "pnpm --filter test-app start",
"test": "pnpm --filter '*' test"
"test": "pnpm --filter \"*\" test"
},
"devDependencies": {
"@changesets/cli": "^2.27.9",
"@changesets/get-github-info": "^0.6.0",
"concurrently": "^9.1.0"
"concurrently": "^9.1.0",
"update-workspace-root-version": "^1.0.1"
},
"packageManager": "pnpm@9.12.3",
"engines": {
Expand Down
5 changes: 1 addition & 4 deletions packages/ember-codemod-ember-render-helpers-to-v1/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,5 @@
/.prettierignore
/.prettierrc.cjs
/build.sh
/codemod-test-fixture.sh
/codemod-test-fixtures.sh
/CONTRIBUTING.md
/create-test-fixture.sh
/tests/
/update-test-fixtures.sh

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
],
"scripts": {
"build": "./build.sh --production",
"lint": "concurrently \"npm:lint:*(!fix)\" --names \"lint:\"",
"lint:fix": "concurrently \"npm:lint:*:fix\" --names \"fix:\"",
"lint": "concurrently \"pnpm:lint:*(!fix)\" --names \"lint:\"",
"lint:fix": "concurrently \"pnpm:lint:*:fix\" --names \"fix:\"",
"lint:js": "eslint . --cache",
"lint:js:fix": "eslint . --fix",
"lint:types": "tsc --noEmit",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
import type { CodemodOptions, Options } from '../types/index.js';

function getSrc(projectType: CodemodOptions['projectType']): string[] {
switch (projectType) {
case 'app': {
return ['app/{components,templates}/**/*.hbs'];
}

case 'v1-addon': {
return ['addon/{components,templates}/**/*.hbs'];
}
}
}
const source = {
app: ['app/{components,templates}/**/*.hbs'],
'v1-addon': ['addon/{components,templates}/**/*.hbs'],
};

export function createOptions(codemodOptions: CodemodOptions): Options {
const { projectRoot, projectType } = codemodOptions;

const src = source[projectType];

return {
projectRoot,
src: getSrc(projectType),
src,
};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/env sh

#----------
#
# A. Purpose
#
# Fix all test fixtures after updating the source code.
#
# B. Usage
#
# ./update-test-fixtures.sh
#
#---------

# Compile TypeScript
pnpm build

# Update my-app
rm -r "tests/fixtures/my-app/output"
cp -r "tests/fixtures/my-app/input" "tests/fixtures/my-app/output"

./dist/bin/ember-codemod-ember-render-helpers-to-v1.js \
--root "tests/fixtures/my-app/output" \
--type "app"

# Update my-v1-addon
rm -r "tests/fixtures/my-v1-addon/output"
cp -r "tests/fixtures/my-v1-addon/input" "tests/fixtures/my-v1-addon/output"

./dist/bin/ember-codemod-ember-render-helpers-to-v1.js \
--root "tests/fixtures/my-v1-addon/output" \
--type "v1-addon"
3 changes: 0 additions & 3 deletions packages/ember-render-helpers/.prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,3 @@
# compiled output
/declarations/
/dist/

# misc
/coverage/
12 changes: 4 additions & 8 deletions packages/ember-render-helpers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,28 +35,24 @@
]
}
},
"directories": {
"doc": "doc",
"test": "tests"
},
"files": [
"addon-main.cjs",
"declarations",
"dist"
],
"scripts": {
"build": "concurrently \"npm:build:*\" --names \"build:\"",
"build": "concurrently \"pnpm:build:*\" --names \"build:\"",
"build:js": "rollup --config",
"build:types": "glint --declaration",
"lint": "concurrently \"npm:lint:*(!fix)\" --names \"lint:\"",
"lint:fix": "concurrently \"npm:lint:*:fix\" --names \"fix:\"",
"lint": "concurrently \"pnpm:lint:*(!fix)\" --names \"lint:\"",
"lint:fix": "concurrently \"pnpm:lint:*:fix\" --names \"fix:\"",
"lint:hbs": "ember-template-lint .",
"lint:hbs:fix": "ember-template-lint . --fix",
"lint:js": "eslint . --cache",
"lint:js:fix": "eslint . --fix",
"lint:types": "glint",
"prepack": "rollup --config",
"start": "concurrently \"npm:start:*\" --names \"start:\"",
"start": "concurrently \"pnpm:start:*\" --names \"start:\"",
"start:js": "rollup --config --watch --no-watch.clearScreen",
"start:types": "glint --declaration --watch",
"test": "echo 'A v2 addon does not have tests, run tests in test-app'"
Expand Down
9 changes: 2 additions & 7 deletions packages/ember-render-helpers/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,12 @@ export default {
// up your addon's public API. Also make sure your package.json#exports
// is aligned to the config here.
// See https://github.com/embroider-build/embroider/blob/main/docs/v2-faq.md#how-can-i-define-the-public-exports-of-my-addon
addon.publicEntrypoints(['**/*.js', 'index.js', 'template-registry.js']),
addon.publicEntrypoints(['**/*.js', 'index.ts', 'template-registry.ts']),

// These are the modules that should get reexported into the traditional
// "app" tree. Things in here should also be in publicEntrypoints above, but
// not everything in publicEntrypoints necessarily needs to go here.
addon.appReexports([
'components/**/*.js',
'helpers/**/*.js',
'modifiers/**/*.js',
'services/**/*.js',
]),
addon.appReexports(['helpers/**/*.js']),

// Follow the V2 Addon rules about dependencies. Your code can import from
// `dependencies` and `peerDependencies` as well as standard Ember-provided
Expand Down
61 changes: 60 additions & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit ce56bc0

Please sign in to comment.