This repository has been archived by the owner on Jan 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cc39527
commit 5938936
Showing
22 changed files
with
343 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
"rollup-plugin-glimmer-template-tag": minor | ||
--- | ||
|
||
Add option to the rollup plugin so that folks can choose to separately due to the two-step transform. | ||
|
||
In 0.2.0, it became possible to _only_ use the rollup plugin for the entirety of the transform, whereas in 0.1.0, a babel plugin was needed as well. | ||
|
||
In this version, you may go back to the 0.1.0 style configuration via: | ||
|
||
```js | ||
// rollup.config.mjs | ||
export default { | ||
output: addon.output(), | ||
plugins: [ | ||
// ... | ||
glimmerTemplateTag({ preprocessOnly: true }), | ||
// ... | ||
], | ||
}; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
'use strict'; | ||
|
||
const { configs } = require('@nullvoxpopuli/eslint-configs'); | ||
|
||
let config = configs.ember(); | ||
|
||
module.exports = { | ||
overrides: [...config.overrides], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
'use strict'; | ||
|
||
module.exports = { | ||
singleQuote: true, | ||
printWidth: 100, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
'use strict'; | ||
|
||
const { addonV1Shim } = require('@embroider/addon-shim'); | ||
|
||
module.exports = addonV1Shim(__dirname); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"presets": ["@babel/preset-typescript"], | ||
"plugins": [ | ||
"ember-template-imports/src/babel-plugin", | ||
[ | ||
"@babel/plugin-transform-typescript", | ||
{ | ||
"allowDeclareFields": true | ||
} | ||
], | ||
"@embroider/addon-dev/template-colocation-plugin", | ||
["@babel/plugin-proposal-decorators", { "legacy": true }], | ||
"@babel/plugin-proposal-class-properties" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
{ | ||
"name": "@nullvoxpopuli/test-rollup-addon-split-gts", | ||
"version": "0.0.0", | ||
"private": true, | ||
"keywords": [ | ||
"ember-addon" | ||
], | ||
"exports": { | ||
".": "dist/index.js", | ||
"./components/ts-split-demo": "dist/components/ts-split-demo.js", | ||
"./components/ts-split-class-demo": "dist/components/ts-split-class-demo.js", | ||
"./glint-registry": { | ||
"types": "dist/glint-registry.d.ts" | ||
} | ||
}, | ||
"typesVersions": { | ||
"*": { | ||
"glint-registry": [ | ||
"dist/glint-registry.d.ts" | ||
] | ||
} | ||
}, | ||
"files": [ | ||
"dist", | ||
"addon-main.cjs" | ||
], | ||
"scripts": { | ||
"build": "rollup -c", | ||
"lint": "concurrently 'npm:lint:*(!fix)' --names 'lint:'", | ||
"lint:types": "glint", | ||
"lint:fix": "concurrently 'npm:lint:*:fix' --names 'fix:'", | ||
"lint:js": "eslint . --cache", | ||
"lint:prettier": "prettier --check .", | ||
"lint:prettier:fix": "prettier --write .", | ||
"lint:js:fix": "eslint . --fix" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.21.3", | ||
"@babel/eslint-parser": "^7.21.3", | ||
"@babel/plugin-proposal-class-properties": "^7.18.6", | ||
"@babel/plugin-proposal-decorators": "^7.21.0", | ||
"@babel/preset-typescript": "^7.21.0", | ||
"@babel/runtime": "^7.21.0", | ||
"@embroider/addon-dev": "^3.0.0", | ||
"@glimmer/component": "^1.1.2", | ||
"@glint/core": "^1.0.0-beta.3", | ||
"@glint/environment-ember-loose": "^1.0.0-beta.3", | ||
"@glint/environment-ember-template-imports": "^1.0.0-beta.3", | ||
"@glint/template": "^1.0.0-beta.3", | ||
"@nullvoxpopuli/eslint-configs": "^3.1.3", | ||
"@tsconfig/ember": "^2.0.0", | ||
"@types/rsvp": "^4.0.4", | ||
"ember-source": "^4.11.0", | ||
"ember-template-imports": "^3.4.1", | ||
"eslint": "^8.36.0", | ||
"eslint-plugin-ember": "^11.4.7", | ||
"eslint-plugin-qunit": "^7.3.4", | ||
"prettier": "^2.8.4", | ||
"rollup": "^3.19.1", | ||
"rollup-plugin-glimmer-template-tag": "workspace:*", | ||
"rollup-plugin-ts": "^3.2.0", | ||
"typescript": "^4.9.5" | ||
}, | ||
"ember-addon": { | ||
"version": 2, | ||
"type": "addon", | ||
"main": "addon-main.cjs", | ||
"app-js": { | ||
"./components/ts-split-class-demo.js": "./dist/_app_/components/ts-split-class-demo.js", | ||
"./components/ts-split-demo.js": "./dist/_app_/components/ts-split-demo.js" | ||
} | ||
}, | ||
"dependencies": { | ||
"@embroider/addon-shim": "^1.8.4" | ||
}, | ||
"peerDependencies": { | ||
"@glimmer/component": "^1.1.2", | ||
"ember-source": "^4.11.0" | ||
}, | ||
"volta": { | ||
"extends": "../../package.json" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { Addon } from '@embroider/addon-dev/rollup'; | ||
|
||
import typescript from 'rollup-plugin-ts'; | ||
import { defineConfig } from 'rollup'; | ||
import { glimmerTemplateTag } from 'rollup-plugin-glimmer-template-tag'; | ||
|
||
const addon = new Addon({ | ||
srcDir: 'src', | ||
destDir: 'dist', | ||
}); | ||
|
||
export default defineConfig({ | ||
output: addon.output(), | ||
plugins: [ | ||
addon.publicEntrypoints(['**/*.js']), | ||
addon.appReexports(['components/**/*.js']), | ||
glimmerTemplateTag({ preprocessOnly: true }), | ||
typescript({ | ||
transpiler: 'babel', | ||
// Babel defaults to "guessing" when there is no browserslist past | ||
// We want to do the least amount of work | ||
browserslist: ['last 1 firefox versions'], | ||
transpileOnly: true, | ||
}), | ||
addon.dependencies(), | ||
addon.clean(), | ||
], | ||
}); |
15 changes: 15 additions & 0 deletions
15
packages/test-rollup-addon-split-gts/src/components/ts-split-class-demo.gts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import Component from '@glimmer/component'; | ||
import { service } from '@ember/service'; | ||
|
||
import type RouterService from '@ember/routing/router-service'; | ||
|
||
export default class TsClassDemo extends Component { | ||
// Need TS Syntax for confident test | ||
@service declare router: RouterService; | ||
|
||
greeting = 'Hello World!'; | ||
|
||
<template> | ||
TS Split Class Demo: {{this.greeting}} | ||
</template> | ||
} |
5 changes: 5 additions & 0 deletions
5
packages/test-rollup-addon-split-gts/src/components/ts-split-demo.gts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
const greeting = 'Hello World!'; | ||
|
||
<template> | ||
TS Split Demo: {{greeting}} | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import type { ComponentLike } from '@glint/template'; | ||
|
||
export interface Registry { | ||
TsSplitDemo: ComponentLike; | ||
TsSplitClassDemo: ComponentLike; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export { default as TSClassDemo } from './components/ts-split-class-demo'; | ||
export { default as TSDemo } from './components/ts-split-demo'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"extends": "@tsconfig/ember/tsconfig.json", | ||
"include": ["src/**/*", "unpublished-development-types/**/*"], | ||
"glint": { | ||
"environment": ["ember-loose", "ember-template-imports"] | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
packages/test-rollup-addon-split-gts/unpublished-development-types/index.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import 'ember-source/types'; | ||
import 'ember-source/types/preview'; |
Oops, something went wrong.