Skip to content

Commit

Permalink
Add addon blueprint config & update (#489)
Browse files Browse the repository at this point in the history
* Add addon blueprint config

* Update addon blueprint

* Update package lock

* Fix package scripts & lint errors
  • Loading branch information
mkszepp authored May 8, 2024
1 parent 9a31bef commit 92a3bc1
Show file tree
Hide file tree
Showing 15 changed files with 288 additions and 41 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ on:
pull_request: {}

concurrency:
group: ci-${{ github.head_ref || github.ref }}
cancel-in-progress: true
group: ci-${{ github.head_ref || github.ref }}
cancel-in-progress: true

jobs:
lint:
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,3 @@ yarn-error.log
/package-lock.json.ember-try
/yarn.lock.ember-try
/pnpm-lock.ember-try.yaml

14 changes: 7 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,28 @@

- `git clone <repository-url>`
- `cd ember-power-calendar`
- `npm install`
- `pnpm install`

## Linting

- `npm run lint`
- `npm run lint:fix`
- `pnpm lint`
- `pnpm lint:fix`

## Building the addon

- `cd ember-power-calendar`
- `npm build`
- `pnpm build`

## Running tests

- `cd test-app`
- `npm run test` – Runs the test suite on the current Ember version
- `npm run test:watch` – Runs the test suite in "watch mode"
- `pnpm test` – Runs the test suite on the current Ember version
- `pnpm test:watch` – Runs the test suite in "watch mode"

## Running the test application

- `cd test-app`
- `npm run start`
- `pnpm start`
- Visit the test application at [http://localhost:4200](http://localhost:4200).

For more information on using ember-cli, visit [https://cli.emberjs.com/release/](https://cli.emberjs.com/release/).
20 changes: 20 additions & 0 deletions config/ember-cli-update.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"schemaVersion": "1.0.0",
"projectName": "ember-power-calendar",
"packages": [
{
"name": "@embroider/addon-blueprint",
"version": "2.16.0",
"blueprints": [
{
"name": "@embroider/addon-blueprint",
"isBaseBlueprint": true,
"options": [
"--pnpm",
"--typescript"
]
}
]
}
]
}
8 changes: 4 additions & 4 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@
},
"scripts": {
"build": "ember build --environment=production",
"lint": "concurrently \"npm:lint:*(!fix)\" --names \"lint:\"",
"lint": "concurrently \"pnpm:lint:*(!fix)\" --names \"lint:\"",
"lint:css": "stylelint \"**/*.css\"",
"lint:css:fix": "concurrently \"npm:lint:css -- --fix\"",
"lint:fix": "concurrently \"npm:lint:*:fix\" --names \"fix:\"",
"lint:css:fix": "concurrently \"pnpm:lint:css -- --fix\"",
"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",
"start": "ember serve",
"test": "concurrently \"npm:lint\" \"npm:test:*\" --names \"lint,test:\"",
"test": "concurrently \"pnpm:lint\" \"pnpm:test:*\" --names \"lint,test:\"",
"test:ember": "ember test"
},
"devDependencies": {
Expand Down
9 changes: 8 additions & 1 deletion ember-power-calendar/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = {
parserOptions: {
ecmaVersion: 'latest',
},
plugins: ['ember'],
plugins: ['ember', 'import'],
extends: [
'eslint:recommended',
'plugin:ember/recommended',
Expand All @@ -31,6 +31,13 @@ module.exports = {
'@typescript-eslint/no-explicit-any': 0,
},
},
// require relative imports use full extensions
{
files: ['src/**/*.{js,ts,gjs,gts}'],
rules: {
'import/extensions': ['error', 'always', { ignorePackages: true }],
},
},
// node files
{
files: [
Expand Down
13 changes: 10 additions & 3 deletions ember-power-calendar/.gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
# 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

# compiled output
/dist
/declarations
/vendor
dist/
declarations/
vendor/

# npm/pnpm/yarn pack output
*.tgz

# deps & caches
node_modules/
.eslintcache
.prettiercache
14 changes: 7 additions & 7 deletions ember-power-calendar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,22 +47,21 @@
"vendor"
],
"scripts": {
"build": "concurrently 'npm:build:*'",
"build": "concurrently 'pnpm: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 . --no-error-on-unmatched-pattern",
"lint:hbs:fix": "ember-template-lint . --fix --no-error-on-unmatched-pattern",
"lint:js": "eslint . --cache",
"lint:js:fix": "eslint . --fix",
"lint:types": "glint",
"prepack": "pnpm run build",
"start": "concurrently 'npm:start:*'",
"prepack": "concurrently 'pnpm:build:*'",
"start": "concurrently 'pnpm: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'",
"prepare": "pnpm run build"
"test": "echo 'A v2 addon does not have tests, run tests in test-app'"
},
"dependencies": {
"@embroider/addon-shim": "^1.8.7",
Expand Down Expand Up @@ -118,6 +117,7 @@
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-ember": "^12.0.2",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-n": "^16.6.2",
"eslint-plugin-prettier": "^5.1.3",
"node-sass": "^9.0.0",
Expand Down
4 changes: 4 additions & 0 deletions ember-power-calendar/src/template-registry.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// Easily allow apps, which are not yet using strict mode templates, to consume your Glint types, by importing this file.
// Add all your components, helpers and modifiers to the template registry here, so apps don't have to do this.
// See https://typed-ember.gitbook.io/glint/environments/ember/authoring-addons

import type PowerCalendarComponent from './components/power-calendar.ts';
import type PowerCalendarRangeComponent from './components/power-calendar-range.ts';
import type PowerCalendarMultipleComponent from './components/power-calendar-multiple.ts';
Expand Down
20 changes: 20 additions & 0 deletions ember-power-calendar/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,27 @@
"environment": ["ember-loose", "ember-template-imports"]
},
"compilerOptions": {
"allowJs": true,
"declarationDir": "declarations",
/**
https://www.typescriptlang.org/tsconfig#noEmit
We want to emit declarations, so this option must be set to `false`.
@tsconfig/ember sets this to `true`, which is incompatible with our need to set `emitDeclarationOnly`.
@tsconfig/ember is more optimized for apps, which wouldn't emit anything, only type check.
*/
"noEmit": false,
/**
https://www.typescriptlang.org/tsconfig#emitDeclarationOnly
We want to only emit declarations as we use Rollup to emit JavaScript.
*/
"emitDeclarationOnly": true,

/**
https://www.typescriptlang.org/tsconfig#noEmitOnError
Do not block emit on TS errors.
*/
"noEmitOnError": false,

/**
https://www.typescriptlang.org/tsconfig#rootDir
Expand Down
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,22 @@
"build:docs": "pnpm run --filter docs build",
"lint": "pnpm run --filter '*' lint",
"lint:fix": "pnpm run --filter '*' lint:fix",
"start": "concurrently 'npm:start:*' --restart-after 5000 --prefix-colors cyan,white,yellow",
"prepare": "pnpm run build",
"start": "concurrently 'pnpm:start:*' --restart-after 5000 --prefix-colors cyan,white,yellow",
"start:addon": "pnpm run --filter ember-power-calendar start --no-watch.clearScreen",
"start:docs": "pnpm run --filter docs start --preserveWatchOutput",
"start:test-app": "pnpm run --filter test-app start",
"test": "pnpm --filter '*' test",
"test:ember": "pnpm --filter '*' test:ember"
},
"devDependencies": {
"@glint/core": "^1.2.1",
"@release-it-plugins/lerna-changelog": "^6.1.0",
"@release-it-plugins/workspaces": "^4.2.0",
"concurrently": "^8.2.2",
"prettier": "^3.2.5",
"prettier-plugin-ember-template-tag": "^2.0.2",
"release-it": "^17.2.1"
"release-it": "^17.2.1",
"typescript": "^5.4.5"
},
"workspaces": [
"ember-power-calendar",
Expand Down Expand Up @@ -53,6 +55,5 @@
"tokenRef": "GITHUB_AUTH"
},
"npm": false
},
"version": "1.1.0"
}
}
}
Loading

0 comments on commit 92a3bc1

Please sign in to comment.