From 0d9698f246cd3c299e192f9de92bc432c087d3e6 Mon Sep 17 00:00:00 2001 From: Josemar Luedke Date: Mon, 31 Jul 2023 16:00:12 -0700 Subject: [PATCH] feat: Move buttons pkg to Addon V2 and gts --- .github/workflows/ci.yml | 2 +- packages/buttons/.ember-cli | 9 -- packages/buttons/.npmignore | 6 + packages/buttons/.watchmanconfig | 3 - packages/buttons/addon-main.js | 4 + packages/buttons/addon/components/button.hbs | 11 -- packages/buttons/app/.gitkeep | 0 packages/buttons/app/components/button.js | 1 - packages/buttons/babel.config.js | 16 +++ packages/buttons/config/ember-try.js | 3 - packages/buttons/config/environment.js | 5 - packages/buttons/ember-cli-build.js | 17 --- packages/buttons/index.js | 5 - packages/buttons/package.json | 110 +++++++++++------- packages/buttons/rollup.config.mjs | 63 ++++++++++ .../button.ts => src/components/button.gts} | 15 ++- .../{addon => src}/components/button.md | 0 packages/buttons/src/template-registry.ts | 5 + packages/buttons/testem.js | 1 - packages/buttons/tests/dummy/app/app.js | 12 -- .../tests/dummy/app/components/.gitkeep | 0 .../tests/dummy/app/config/environment.d.ts | 16 --- .../tests/dummy/app/controllers/.gitkeep | 0 .../buttons/tests/dummy/app/helpers/.gitkeep | 0 packages/buttons/tests/dummy/app/index.html | 25 ---- .../buttons/tests/dummy/app/models/.gitkeep | 0 packages/buttons/tests/dummy/app/router.js | 11 -- .../buttons/tests/dummy/app/routes/.gitkeep | 0 .../buttons/tests/dummy/app/styles/app.css | 0 .../buttons/tests/dummy/config/environment.js | 51 -------- .../tests/dummy/config/optional-features.json | 6 - .../buttons/tests/dummy/config/targets.js | 11 -- .../buttons/tests/dummy/public/robots.txt | 3 - packages/buttons/tests/helpers/.gitkeep | 0 packages/buttons/tests/index.html | 40 ------- packages/buttons/tests/integration/.gitkeep | 0 packages/buttons/tests/test-helper.ts | 13 --- packages/buttons/tests/unit/.gitkeep | 0 packages/buttons/tsconfig.json | 28 ++--- packages/buttons/types/dummy/index.d.ts | 0 packages/buttons/types/global.d.ts | 6 - packages/buttons/types/index.d.ts | 1 - .../unpublished-development-types/index.d.ts | 12 ++ packages/buttons/vendor/.gitkeep | 0 44 files changed, 197 insertions(+), 314 deletions(-) delete mode 100644 packages/buttons/.ember-cli delete mode 100644 packages/buttons/.watchmanconfig create mode 100644 packages/buttons/addon-main.js delete mode 100644 packages/buttons/addon/components/button.hbs delete mode 100644 packages/buttons/app/.gitkeep delete mode 100644 packages/buttons/app/components/button.js create mode 100644 packages/buttons/babel.config.js delete mode 100644 packages/buttons/config/ember-try.js delete mode 100644 packages/buttons/config/environment.js delete mode 100644 packages/buttons/ember-cli-build.js delete mode 100644 packages/buttons/index.js create mode 100644 packages/buttons/rollup.config.mjs rename packages/buttons/{addon/components/button.ts => src/components/button.gts} (79%) rename packages/buttons/{addon => src}/components/button.md (100%) create mode 100644 packages/buttons/src/template-registry.ts delete mode 100644 packages/buttons/testem.js delete mode 100644 packages/buttons/tests/dummy/app/app.js delete mode 100644 packages/buttons/tests/dummy/app/components/.gitkeep delete mode 100644 packages/buttons/tests/dummy/app/config/environment.d.ts delete mode 100644 packages/buttons/tests/dummy/app/controllers/.gitkeep delete mode 100644 packages/buttons/tests/dummy/app/helpers/.gitkeep delete mode 100644 packages/buttons/tests/dummy/app/index.html delete mode 100644 packages/buttons/tests/dummy/app/models/.gitkeep delete mode 100644 packages/buttons/tests/dummy/app/router.js delete mode 100644 packages/buttons/tests/dummy/app/routes/.gitkeep delete mode 100644 packages/buttons/tests/dummy/app/styles/app.css delete mode 100644 packages/buttons/tests/dummy/config/environment.js delete mode 100644 packages/buttons/tests/dummy/config/optional-features.json delete mode 100644 packages/buttons/tests/dummy/config/targets.js delete mode 100644 packages/buttons/tests/dummy/public/robots.txt delete mode 100644 packages/buttons/tests/helpers/.gitkeep delete mode 100644 packages/buttons/tests/index.html delete mode 100644 packages/buttons/tests/integration/.gitkeep delete mode 100644 packages/buttons/tests/test-helper.ts delete mode 100644 packages/buttons/tests/unit/.gitkeep delete mode 100644 packages/buttons/types/dummy/index.d.ts delete mode 100644 packages/buttons/types/global.d.ts delete mode 100644 packages/buttons/types/index.d.ts create mode 100644 packages/buttons/unpublished-development-types/index.d.ts delete mode 100644 packages/buttons/vendor/.gitkeep diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 79491e87..e9cd4993 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,7 +28,7 @@ jobs: - name: Lint HBS run: yarn lint:hbs - name: Build V2 Addons - run: yarn workspace @frontile/core run build + run: yarn workspace @frontile/core run build && yarn workspace @frontile/buttons run build - name: Test run: yarn test diff --git a/packages/buttons/.ember-cli b/packages/buttons/.ember-cli deleted file mode 100644 index ee64cfed..00000000 --- a/packages/buttons/.ember-cli +++ /dev/null @@ -1,9 +0,0 @@ -{ - /** - Ember CLI sends analytics information by default. The data is completely - anonymous, but there are times when you might want to disable this behavior. - - Setting `disableAnalytics` to true will prevent any data from being sent. - */ - "disableAnalytics": false -} diff --git a/packages/buttons/.npmignore b/packages/buttons/.npmignore index aa292107..5b5d2852 100644 --- a/packages/buttons/.npmignore +++ b/packages/buttons/.npmignore @@ -13,7 +13,10 @@ /.eslintignore /.eslintrc.js /.git/ +/.github/ /.gitignore +/.git +/.github /.template-lintrc.js /.travis.yml /.watchmanconfig @@ -30,4 +33,7 @@ # 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 diff --git a/packages/buttons/.watchmanconfig b/packages/buttons/.watchmanconfig deleted file mode 100644 index e7834e3e..00000000 --- a/packages/buttons/.watchmanconfig +++ /dev/null @@ -1,3 +0,0 @@ -{ - "ignore_dirs": ["tmp", "dist"] -} diff --git a/packages/buttons/addon-main.js b/packages/buttons/addon-main.js new file mode 100644 index 00000000..f868d6b9 --- /dev/null +++ b/packages/buttons/addon-main.js @@ -0,0 +1,4 @@ +'use strict'; + +const { addonV1Shim } = require('@embroider/addon-shim'); +module.exports = addonV1Shim(__dirname); diff --git a/packages/buttons/addon/components/button.hbs b/packages/buttons/addon/components/button.hbs deleted file mode 100644 index 5f05aab0..00000000 --- a/packages/buttons/addon/components/button.hbs +++ /dev/null @@ -1,11 +0,0 @@ -{{#if @isRenderless}} - {{yield (hash classNames=this.classNames)}} -{{else}} - -{{/if}} diff --git a/packages/buttons/app/.gitkeep b/packages/buttons/app/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/packages/buttons/app/components/button.js b/packages/buttons/app/components/button.js deleted file mode 100644 index eabda785..00000000 --- a/packages/buttons/app/components/button.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from '@frontile/buttons/components/button'; diff --git a/packages/buttons/babel.config.js b/packages/buttons/babel.config.js new file mode 100644 index 00000000..f3f78884 --- /dev/null +++ b/packages/buttons/babel.config.js @@ -0,0 +1,16 @@ +module.exports = { + presets: [['@babel/preset-typescript', { onlyRemoveTypeImports: true }]], + plugins: [ + '@embroider/addon-dev/template-colocation-plugin', + [ + 'babel-plugin-ember-template-compilation', + { + targetFormat: 'hbs', + compilerPath: 'ember-source/dist/ember-template-compiler' + } + ], + ['@babel/plugin-proposal-decorators', { legacy: true }], + '@babel/plugin-proposal-class-properties', + '@babel/plugin-transform-class-static-block' + ] +}; diff --git a/packages/buttons/config/ember-try.js b/packages/buttons/config/ember-try.js deleted file mode 100644 index 64b9f3d5..00000000 --- a/packages/buttons/config/ember-try.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('../../../config/ember-try'); diff --git a/packages/buttons/config/environment.js b/packages/buttons/config/environment.js deleted file mode 100644 index 331ab30d..00000000 --- a/packages/buttons/config/environment.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = function (/* environment, appConfig */) { - return {}; -}; diff --git a/packages/buttons/ember-cli-build.js b/packages/buttons/ember-cli-build.js deleted file mode 100644 index 529fc008..00000000 --- a/packages/buttons/ember-cli-build.js +++ /dev/null @@ -1,17 +0,0 @@ -'use strict'; - -const EmberAddon = require('ember-cli/lib/broccoli/ember-addon'); - -module.exports = function (defaults) { - const app = new EmberAddon(defaults, {}); - - /* - This build file specifies the options for the dummy test app of this - addon, located in `/tests/dummy` - This build file does *not* influence how the addon or the app using it - behave. You most likely want to be modifying `./index.js` or app's build file - */ - - const { maybeEmbroider } = require('@embroider/test-setup'); - return maybeEmbroider(app); -}; diff --git a/packages/buttons/index.js b/packages/buttons/index.js deleted file mode 100644 index 2e1d1d8d..00000000 --- a/packages/buttons/index.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = { - name: require('./package').name -}; diff --git a/packages/buttons/package.json b/packages/buttons/package.json index c9591259..3af5fcbc 100644 --- a/packages/buttons/package.json +++ b/packages/buttons/package.json @@ -13,56 +13,55 @@ "doc": "doc", "test": "tests" }, + "files": [ + "addon-main.js", + "declarations", + "dist", + "tailwind" + ], "scripts": { - "build": "ember build --environment=production", - "start": "ember serve", - "test": "ember test", - "test:all": "ember try:each", - "try:one": "ember try:one", - "prepack": "ember ts:precompile", - "postpack": "ember ts:clean" + "build": "concurrently 'npm: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:hbs": "ember-template-lint . --no-error-on-unmatched-pattern", + "lint:js": "eslint . --cache", + "lint:hbs:fix": "ember-template-lint . --fix --no-error-on-unmatched-pattern", + "lint:js:fix": "eslint . --fix", + "lint:types": "glint", + "start": "concurrently 'npm:start:*'", + "start:js": "rollup --config --watch --no-watch.clearScreen", + "start:types": "glint -d --watch", + "test": "echo 'A v2 addon does not have tests, run tests in test-app'", + "prepack": "concurrently 'npm:build'" }, "peerDependencies": { "ember-source": "^4.0.0 || ^5.0.0" }, "dependencies": { - "@frontile/tailwindcss-plugin-helpers": "^0.15.0", - "ember-cli-babel": "^7.26.11", - "ember-cli-htmlbars": "^6.2.0", - "ember-cli-typescript": "^5.2.1" + "@embroider/addon-shim": "^1.8.6", + "@frontile/tailwindcss-plugin-helpers": "^0.15.0" }, "devDependencies": { - "@babel/core": "^7.22.9", - "@ember/optional-features": "^2.0.0", - "@ember/test-helpers": "^3.2.0", - "@embroider/test-setup": "^3.0.1", - "@frontile/core": "^0.15.0", - "@glimmer/component": "^1.1.2", - "@glimmer/tracking": "^1.1.2", - "@types/ember-qunit": "^6.1.1", - "@types/ember-resolver": "^9.0.0", - "@types/htmlbars-inline-precompile": "^3.0.0", - "@types/qunit": "^2.19.6", - "@types/rsvp": "^4.0.4", - "broccoli-asset-rev": "^3.0.0", - "ember-auto-import": "^2.6.3", - "ember-cli": "^5.1.0", - "ember-cli-dependency-checker": "^3.3.2", - "ember-cli-inject-live-reload": "^2.1.0", - "ember-cli-typescript-blueprints": "^3.0.0", - "ember-cli-uglify": "^3.0.0", - "ember-disable-prototype-extensions": "^1.1.3", - "ember-load-initializers": "^2.1.2", - "ember-qunit": "^7.0.0", - "ember-resolver": "^11.0.0", + "@babel/core": "7.22.9", + "@babel/plugin-proposal-class-properties": "7.18.6", + "@babel/plugin-proposal-decorators": "7.22.7", + "@babel/plugin-transform-class-static-block": "^7.22.5", + "@babel/preset-typescript": "7.22.5", + "@embroider/addon-dev": "3.2.0", + "@glint/core": "1.0.2", + "@glint/environment-ember-loose": "1.0.2", + "@glint/environment-ember-template-imports": "1.0.2", + "@glint/template": "1.0.2", + "@tsconfig/ember": "^3.0.0", + "babel-plugin-ember-template-compilation": "^2.1.1", + "concurrently": "^8.2.0", "ember-source": "^5.1.2", - "ember-try": "^2.0.0", - "loader.js": "^4.7.0", - "qunit": "^2.19.4", - "qunit-dom": "^2.0.0", + "rollup": "^3.27.0", + "rollup-plugin-ts": "^3.2.0", "tailwindcss": "^3.3.3", - "typescript": "^5.1.6", - "webpack": "^5.88.2" + "typescript": "^5.1.6" }, "engines": { "node": "10.* || >= 12" @@ -74,6 +73,35 @@ "edition": "octane" }, "ember-addon": { - "configPath": "tests/dummy/config" + "version": 2, + "type": "addon", + "main": "addon-main.js", + "app-js": { + "./components/button.js": "./dist/_app_/components/button.js" + } + }, + "exports": { + ".": { + "types": "./declarations/index.d.ts", + "default": "./dist/index.js" + }, + "./*": { + "types": "./declarations/*.d.ts", + "default": "./dist/*.js" + }, + "./addon-main.js": "./addon-main.js", + "./tailwind": { + "default": "./tailwind/index.js" + }, + "./tailwind/*": { + "default": "./tailwind/*.js" + } + }, + "typesVersions": { + "*": { + "*": [ + "declarations/*" + ] + } } } diff --git a/packages/buttons/rollup.config.mjs b/packages/buttons/rollup.config.mjs new file mode 100644 index 00000000..8f3727aa --- /dev/null +++ b/packages/buttons/rollup.config.mjs @@ -0,0 +1,63 @@ +import ts from "rollup-plugin-ts"; +import { Addon } from '@embroider/addon-dev/rollup'; + +const addon = new Addon({ + srcDir: 'src', + destDir: 'dist', +}); + +export default { + // This provides defaults that work well alongside `publicEntrypoints` below. + // You can augment this if you need to. + output: addon.output(), + + plugins: [ + // These are the modules that users should be able to import from your + // addon. Anything not listed here may get optimized away. + addon.publicEntrypoints([ + 'components/**/*.js', + 'helpers/**/*.js', + 'utils/**/*.js', + 'template-registry.js', + ]), + + // 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', + 'utils/**/*.js', + ]), + + // Follow the V2 Addon rules about dependencies. Your code can import from + // `dependencies` and `peerDependencies` as well as standard Ember-provided + // package names. + addon.dependencies(), + + addon.gjs(), + + // This babel config should *not* apply presets or compile away ES modules. + // It exists only to provide development niceties for you, like automatic + // template colocation. + // See `babel.config.json` for the actual Babel configuration! + ts({ + transpiler: "babel", + transpileOnly: true, + babelConfig: "./babel.config.js", + browserslist: ["last 2 firefox versions", "last 2 chrome versions"], + }), + + + // Ensure that standalone .hbs files are properly integrated as Javascript. + addon.hbs(), + + + // addons are allowed to contain imports of .css files, which we want rollup + // to leave alone and keep in the published output. + addon.keepAssets(['**/*.css']), + + // Remove leftover build artifacts when starting a new build. + addon.clean(), + ], +}; diff --git a/packages/buttons/addon/components/button.ts b/packages/buttons/src/components/button.gts similarity index 79% rename from packages/buttons/addon/components/button.ts rename to packages/buttons/src/components/button.gts index 1f84481a..1cd03d14 100644 --- a/packages/buttons/addon/components/button.ts +++ b/packages/buttons/src/components/button.gts @@ -1,4 +1,5 @@ import Component from '@glimmer/component'; +import { hash } from '@ember/helper'; export interface ButtonArgs { /** @@ -34,9 +35,9 @@ export interface ButtonArgs { export interface ButtonSignature { Args: ButtonArgs; Blocks: { - default: [{ classNames: string } | null]; + default: [{ classNames: string }]; }; - Element: HTMLButtonElement | null; + Element: HTMLButtonElement; } export default class Button extends Component { @@ -70,4 +71,14 @@ export default class Button extends Component { return names.join(' '); } + + } diff --git a/packages/buttons/addon/components/button.md b/packages/buttons/src/components/button.md similarity index 100% rename from packages/buttons/addon/components/button.md rename to packages/buttons/src/components/button.md diff --git a/packages/buttons/src/template-registry.ts b/packages/buttons/src/template-registry.ts new file mode 100644 index 00000000..12a9928c --- /dev/null +++ b/packages/buttons/src/template-registry.ts @@ -0,0 +1,5 @@ +import type Button from './components/button'; + +export default interface Registry { + Button: typeof Button; +} diff --git a/packages/buttons/testem.js b/packages/buttons/testem.js deleted file mode 100644 index 31d830ab..00000000 --- a/packages/buttons/testem.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../../testem'); diff --git a/packages/buttons/tests/dummy/app/app.js b/packages/buttons/tests/dummy/app/app.js deleted file mode 100644 index 523bad60..00000000 --- a/packages/buttons/tests/dummy/app/app.js +++ /dev/null @@ -1,12 +0,0 @@ -import Application from '@ember/application'; -import Resolver from 'ember-resolver'; -import loadInitializers from 'ember-load-initializers'; -import config from 'dummy/config/environment'; - -export default class App extends Application { - modulePrefix = config.modulePrefix; - podModulePrefix = config.podModulePrefix; - Resolver = Resolver; -} - -loadInitializers(App, config.modulePrefix); diff --git a/packages/buttons/tests/dummy/app/components/.gitkeep b/packages/buttons/tests/dummy/app/components/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/packages/buttons/tests/dummy/app/config/environment.d.ts b/packages/buttons/tests/dummy/app/config/environment.d.ts deleted file mode 100644 index 4cd48662..00000000 --- a/packages/buttons/tests/dummy/app/config/environment.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -/** - * Type declarations for - * import config from './config/environment' - * - * For now these need to be managed by the developer - * since different ember addons can materialize new entries. - */ -declare const config: { - environment: string; - modulePrefix: string; - podModulePrefix: string; - locationType: string; - rootURL: string; -}; - -export default config; diff --git a/packages/buttons/tests/dummy/app/controllers/.gitkeep b/packages/buttons/tests/dummy/app/controllers/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/packages/buttons/tests/dummy/app/helpers/.gitkeep b/packages/buttons/tests/dummy/app/helpers/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/packages/buttons/tests/dummy/app/index.html b/packages/buttons/tests/dummy/app/index.html deleted file mode 100644 index bd7eedb6..00000000 --- a/packages/buttons/tests/dummy/app/index.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - @frontile/buttons - - - - {{content-for "head"}} - - - - - {{content-for "head-footer"}} - - - {{content-for "body"}} - - - - - {{content-for "body-footer"}} - - diff --git a/packages/buttons/tests/dummy/app/models/.gitkeep b/packages/buttons/tests/dummy/app/models/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/packages/buttons/tests/dummy/app/router.js b/packages/buttons/tests/dummy/app/router.js deleted file mode 100644 index 80e7d57d..00000000 --- a/packages/buttons/tests/dummy/app/router.js +++ /dev/null @@ -1,11 +0,0 @@ -import EmberRouter from '@ember/routing/router'; -import config from 'dummy/config/environment'; - -export default class Router extends EmberRouter { - location = config.locationType; - rootURL = config.rootURL; -} - -Router.map(function () { - // there are no routes in this dummy app -}); diff --git a/packages/buttons/tests/dummy/app/routes/.gitkeep b/packages/buttons/tests/dummy/app/routes/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/packages/buttons/tests/dummy/app/styles/app.css b/packages/buttons/tests/dummy/app/styles/app.css deleted file mode 100644 index e69de29b..00000000 diff --git a/packages/buttons/tests/dummy/config/environment.js b/packages/buttons/tests/dummy/config/environment.js deleted file mode 100644 index 90207563..00000000 --- a/packages/buttons/tests/dummy/config/environment.js +++ /dev/null @@ -1,51 +0,0 @@ -'use strict'; - -module.exports = function (environment) { - const ENV = { - modulePrefix: 'dummy', - environment, - rootURL: '/', - locationType: 'history', - EmberENV: { - FEATURES: { - // Here you can enable experimental features on an ember canary build - // e.g. EMBER_NATIVE_DECORATOR_SUPPORT: true - }, - EXTEND_PROTOTYPES: { - // Prevent Ember Data from overriding Date.parse. - Date: false - } - }, - - APP: { - // Here you can pass flags/options to your application instance - // when it is created - } - }; - - if (environment === 'development') { - // ENV.APP.LOG_RESOLVER = true; - // ENV.APP.LOG_ACTIVE_GENERATION = true; - // ENV.APP.LOG_TRANSITIONS = true; - // ENV.APP.LOG_TRANSITIONS_INTERNAL = true; - // ENV.APP.LOG_VIEW_LOOKUPS = true; - } - - if (environment === 'test') { - // Testem prefers this... - ENV.locationType = 'none'; - - // keep test console output quieter - ENV.APP.LOG_ACTIVE_GENERATION = false; - ENV.APP.LOG_VIEW_LOOKUPS = false; - - ENV.APP.rootElement = '#ember-testing'; - ENV.APP.autoboot = false; - } - - if (environment === 'production') { - // here you can enable a production-specific feature - } - - return ENV; -}; diff --git a/packages/buttons/tests/dummy/config/optional-features.json b/packages/buttons/tests/dummy/config/optional-features.json deleted file mode 100644 index b26286e2..00000000 --- a/packages/buttons/tests/dummy/config/optional-features.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "application-template-wrapper": false, - "default-async-observers": true, - "jquery-integration": false, - "template-only-glimmer-components": true -} diff --git a/packages/buttons/tests/dummy/config/targets.js b/packages/buttons/tests/dummy/config/targets.js deleted file mode 100644 index ddd4c596..00000000 --- a/packages/buttons/tests/dummy/config/targets.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -const browsers = [ - 'last 1 Chrome versions', - 'last 1 Firefox versions', - 'last 1 Safari versions' -]; - -module.exports = { - browsers -}; diff --git a/packages/buttons/tests/dummy/public/robots.txt b/packages/buttons/tests/dummy/public/robots.txt deleted file mode 100644 index f5916452..00000000 --- a/packages/buttons/tests/dummy/public/robots.txt +++ /dev/null @@ -1,3 +0,0 @@ -# http://www.robotstxt.org -User-agent: * -Disallow: diff --git a/packages/buttons/tests/helpers/.gitkeep b/packages/buttons/tests/helpers/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/packages/buttons/tests/index.html b/packages/buttons/tests/index.html deleted file mode 100644 index b68ce237..00000000 --- a/packages/buttons/tests/index.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - @frontile/buttons Tests - - - - {{content-for "head"}} - {{content-for "test-head"}} - - - - - - {{content-for "head-footer"}} - {{content-for "test-head-footer"}} - - - {{content-for "body"}} - {{content-for "test-body"}} - -
-
-
-
-
-
- - - - - - - - {{content-for "body-footer"}} - {{content-for "test-body-footer"}} - - diff --git a/packages/buttons/tests/integration/.gitkeep b/packages/buttons/tests/integration/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/packages/buttons/tests/test-helper.ts b/packages/buttons/tests/test-helper.ts deleted file mode 100644 index eafdb90a..00000000 --- a/packages/buttons/tests/test-helper.ts +++ /dev/null @@ -1,13 +0,0 @@ -// @ts-ignore -import Application from 'dummy/app'; -import config from 'dummy/config/environment'; -import QUnit from 'qunit'; -import { setApplication } from '@ember/test-helpers'; -import { start } from 'ember-qunit'; -import { setup } from 'qunit-dom'; - -// @ts-ignore -setApplication(Application.create(config.APP)); - -setup(QUnit.assert); -start(); diff --git a/packages/buttons/tests/unit/.gitkeep b/packages/buttons/tests/unit/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/packages/buttons/tsconfig.json b/packages/buttons/tsconfig.json index 0164c020..fd9228b0 100644 --- a/packages/buttons/tsconfig.json +++ b/packages/buttons/tsconfig.json @@ -1,23 +1,11 @@ { - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "baseUrl": ".", - "paths": { - "dummy/tests/*": ["tests/*"], - "dummy/*": ["tests/dummy/app/*", "app/*"], - "@frontile/buttons": ["addon"], - "@frontile/buttons/*": ["addon/*"], - "@frontile/buttons/test-support": ["addon-test-support"], - "@frontile/buttons/test-support/*": ["addon-test-support/*"], - "*": ["types/*"] - } + "extends": "@tsconfig/ember/tsconfig.json", + "include": ["src/**/*", "unpublished-development-types/**/*"], + "glint": { + "environment": ["ember-loose", "ember-template-imports"] }, - "include": [ - "app/**/*", - "addon/**/*", - "tests/**/*", - "types/**/*", - "test-support/**/*", - "addon-test-support/**/*" - ] + "compilerOptions": { + "allowImportingTsExtensions": true, + "declarationDir": "declarations" + } } diff --git a/packages/buttons/types/dummy/index.d.ts b/packages/buttons/types/dummy/index.d.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/packages/buttons/types/global.d.ts b/packages/buttons/types/global.d.ts deleted file mode 100644 index febc63a0..00000000 --- a/packages/buttons/types/global.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -// Types for compiled templates -declare module '@frontile/buttons/templates/*' { - import { TemplateFactory } from 'htmlbars-inline-precompile'; - const tmpl: TemplateFactory; - export default tmpl; -} diff --git a/packages/buttons/types/index.d.ts b/packages/buttons/types/index.d.ts deleted file mode 100644 index 33a43970..00000000 --- a/packages/buttons/types/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -import 'ember-source/types'; diff --git a/packages/buttons/unpublished-development-types/index.d.ts b/packages/buttons/unpublished-development-types/index.d.ts new file mode 100644 index 00000000..59accd69 --- /dev/null +++ b/packages/buttons/unpublished-development-types/index.d.ts @@ -0,0 +1,12 @@ +// Add any types here that you need for local development only. +// These will *not* be published as part of your addon, so be careful that your published code does not rely on them! + +import 'ember-source/types'; +import '@glint/environment-ember-template-imports'; +import type AddonRegistry from '../src/template-registry.ts'; + +declare module '@glint/environment-ember-loose/registry' { + export default interface Registry extends AddonRegistry { + // ... + } +} diff --git a/packages/buttons/vendor/.gitkeep b/packages/buttons/vendor/.gitkeep deleted file mode 100644 index e69de29b..00000000