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

chore: update build to latest patterns from addon #340

Merged
merged 1 commit into from
Feb 3, 2025
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"test": "pnpm --filter test-app test",
"try:one": "pnpm --filter test-app try:one",
"clean:declarations": "rm -rf packages/*/declarations",
"clean:dist": "rm -rf packages/*/dist && rm -rf test-app/dist && rm -rf site/dist",
"clean:dist": "rm -rf packages/*/dist test-app/dist site/dist",
"clean": "concurrently 'npm:clean:*'"
},
"resolutions": {
Expand Down
24 changes: 0 additions & 24 deletions packages/addon-blueprint/babel.config.js

This file was deleted.

24 changes: 24 additions & 0 deletions packages/addon-blueprint/babel.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"plugins": [
[
"@babel/plugin-transform-typescript",
{
"allExtensions": true,
"onlyRemoveTypeImports": true,
"allowDeclareFields": true
}
],
"@embroider/addon-dev/template-colocation-plugin",
[
"babel-plugin-ember-template-compilation",
{
"targetFormat": "hbs",
"transforms": []
}
],
[
"module:decorator-transforms",
{ "runtime": { "import": "decorator-transforms/runtime" } }
]
]
}
67 changes: 32 additions & 35 deletions packages/addon-blueprint/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@frontile/addon-blueprint",
"private": true,
"version": "0.17.0-beta.5",
"private": true,
"description": "Component Library for Ember Octane apps",
"keywords": [
"ember-addon",
Expand All @@ -10,6 +10,24 @@
"repository": "https://github.com/josemarluedke/frontile",
"license": "MIT",
"author": "",
"exports": {
".": {
"types": "./declarations/index.d.ts",
"default": "./dist/index.js"
},
"./*": {
"types": "./declarations/*.d.ts",
"default": "./dist/*.js"
},
"./addon-main.js": "./addon-main.js"
},
"typesVersions": {
"*": {
"*": [
"declarations/*"
]
}
},
"directories": {
"doc": "doc",
"test": "tests"
Expand All @@ -20,53 +38,50 @@
"dist"
],
"scripts": {
"build": "concurrently -m 1 'npm:build:*'",
"build:js": "rollup --config",
"build:types": "glint --declaration",
"build": "rollup --config",
"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": "eslint . --cache",
"lint:js:fix": "eslint . --fix",
"lint:types": "glint",
"prepack": "concurrently 'npm:build'",
"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": {
"@babel/runtime": ">= 7",
"ember-source": ">= 4.12.0"
"test": "echo 'A v2 addon does not have tests, run tests in test-app'"
},
"dependencies": {
"@embroider/addon-shim": "^1.9.0",
"@frontile/theme": "workspace:0.17.0-beta.5"
},
"devDependencies": {
"@babel/core": "7.26.0",
"@babel/plugin-proposal-class-properties": "7.18.6",
"@babel/plugin-proposal-decorators": "7.25.9",
"@babel/plugin-transform-class-static-block": "^7.23.4",
"@babel/preset-typescript": "7.26.0",
"@babel/core": "7.26.7",
"@babel/plugin-transform-typescript": "^7.26.7",
"@embroider/addon-dev": "7.1.1",
"@glimmer/component": "^2.0.0",
"@glimmer/tracking": "^1.1.2",
"@glint/core": "1.5.2",
"@glint/environment-ember-loose": "1.5.2",
"@glint/environment-ember-template-imports": "1.5.2",
"@glint/template": "1.5.2",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-node-resolve": "^16.0.0",
"@tsconfig/ember": "^3.0.9",
"babel-plugin-ember-template-compilation": "^2.2.1",
"concurrently": "^9.1.0",
"decorator-transforms": "^2.3.0",
"ember-source": "^6.1.0",
"rollup": "^4.29.1",
"rollup-plugin-ts": "^3.4.5",
"rollup-plugin-copy": "^3.5.0",
"tailwindcss": "^3.4.17",
"typescript": "^5.7.3"
},
"peerDependencies": {
"@babel/runtime": ">= 7",
"ember-source": ">= 4.12.0"
},
"engines": {
"node": ">= 10.*"
},
Expand All @@ -83,23 +98,5 @@
"app-js": {
"./components/my-component.js": "./dist/_app_/components/my-component.js"
}
},
"exports": {
".": {
"types": "./declarations/index.d.ts",
"default": "./dist/index.js"
},
"./*": {
"types": "./declarations/*.d.ts",
"default": "./dist/*.js"
},
"./addon-main.js": "./addon-main.js"
},
"typesVersions": {
"*": {
"*": [
"declarations/*"
]
}
}
}
55 changes: 40 additions & 15 deletions packages/addon-blueprint/rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import ts from 'rollup-plugin-ts';
import { babel } from '@rollup/plugin-babel';
import copy from 'rollup-plugin-copy';
import { Addon } from '@embroider/addon-dev/rollup';
import { nodeResolve } from '@rollup/plugin-node-resolve';

const extensions = ['.js', '.gjs', '.ts', '.gts'];

const addon = new Addon({
srcDir: 'src',
destDir: 'dist'
destDir: 'dist',
});

const extensions = ['.js', '.gjs', '.ts', '.gts'];

export default {
// This provides defaults that work well alongside `publicEntrypoints` below.
// You can augment this if you need to.
Expand All @@ -17,45 +18,69 @@ export default {
plugins: [
// These are the modules that users should be able to import from your
// addon. Anything not listed here may get optimized away.
// By default all your JavaScript modules (**/*.js) will be importable.
// But you are encouraged to tweak this to only cover the modules that make
// 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([
'components/**/*.js',
'services/**/*.js',
'index.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']),
addon.appReexports([
'components/**/*.js',
'helpers/**/*.js',
'modifiers/**/*.js',
'services/**/*.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(),

nodeResolve({ extensions }),

// 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']
//
// By default, this will load the actual babel config from the file
// babel.config.json.
babel({
extensions,
babelHelpers: 'bundled',
}),

// Ensure that standalone .hbs files are properly integrated as Javascript.
addon.hbs(),

// Ensure that .gjs files are properly integrated as Javascript
addon.gjs(),

// Emit .d.ts declaration files
addon.declarations('declarations'),

// 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()
]
};
addon.clean(),

// Copy Readme and License into published package
copy({
targets: [
{ src: '../README.md', dest: '.' },
{ src: '../LICENSE.md', dest: '.' },
],
}),
],
};
25 changes: 0 additions & 25 deletions packages/buttons/babel.config.js

This file was deleted.

24 changes: 24 additions & 0 deletions packages/buttons/babel.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"plugins": [
[
"@babel/plugin-transform-typescript",
{
"allExtensions": true,
"onlyRemoveTypeImports": true,
"allowDeclareFields": true
}
],
"@embroider/addon-dev/template-colocation-plugin",
[
"babel-plugin-ember-template-compilation",
{
"targetFormat": "hbs",
"transforms": []
}
],
[
"module:decorator-transforms",
{ "runtime": { "import": "decorator-transforms/runtime" } }
]
]
}
Loading
Loading