Skip to content

Commit

Permalink
Merge pull request #1674 from NullVoxPopuli/refactor-ember-repl
Browse files Browse the repository at this point in the history
Refactor the compilation library to prepare for broader usage
  • Loading branch information
NullVoxPopuli authored Feb 20, 2024
2 parents e8e090f + 761ad73 commit e700aa2
Show file tree
Hide file tree
Showing 29 changed files with 424 additions and 661 deletions.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@
"@nullvoxpopuli/eslint-configs": "^3.2.2",
"@embroider/addon-shim": "1.8.7",
"ember-element-helper": "^0.8.5",
"ember-auto-import": "^2.7.0"
"ember-auto-import": "^2.7.0",
"ember-source": ">= 5.5.0",
"webpack": "5.90.3"
},
"allowedDeprecatedVersions": {
"source-map-url": "^0.3.0",
Expand Down
50 changes: 28 additions & 22 deletions packages/ember-repl/addon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,34 +18,38 @@
"declarations/test-support/index.d.ts"
],
"markdown/parse": [
"./declarations/browser/compile/markdown-to-ember.d.ts"
"./declarations/compile/markdown-to-ember.d.ts"
],
"*": [
"declarations/browser/*",
"declarations/browser/*/index.d.ts"
"declarations/*",
"declarations/*/index.d.ts"
]
}
},
"exports": {
".": {
"types": "./declarations/browser/index.d.ts",
"default": "./dist/browser/index.js"
"types": "./declarations/index.d.ts",
"default": "./dist/index.js"
},
"./esm": {
"types": "./declarations/browser/esm/index.d.ts",
"default": "./dist/browser/esm/index.js"
"./formats/markdown": {
"types": "./declarations/compile/formats/markdown.d.ts",
"default": "./dist/compile/formats/markdown.js"
},
"./markdown/parse": {
"types": "./declarations/browser/compile/markdown-to-ember.d.ts",
"default": "./dist/browser/compile/markdown-to-ember.js"
"./formats/hbs": {
"types": "./declarations/compile/formats/hbs.d.ts",
"default": "./dist/compile/formats/hbs.js"
},
"./formats/gjs": {
"types": "./declarations/compile/formats/gjs/index.d.ts",
"default": "./dist/compile/formats/gjs/index.js"
},
"./test-support": {
"types": "./declarations/test-support/index.d.ts",
"default": "./dist/test-support/index.js"
},
"./__PRIVATE__DO_NOT_USE__": {
"types": "./declarations/browser/__PRIVATE__.d.ts",
"default": "./dist/browser/__PRIVATE__.js"
"types": "./declarations/__PRIVATE__.d.ts",
"default": "./dist/__PRIVATE__.js"
},
"./addon-main.js": "./addon-main.cjs"
},
Expand All @@ -56,8 +60,7 @@
"addon-main.cjs"
],
"scripts": {
"build": "concurrently 'npm:build:*'",
"build:js": "rollup --config",
"build": "rollup --config",
"lint:types": "tsc --noEmit",
"lint:fix": "pnpm -w exec lint fix",
"start": "rollup --config --watch",
Expand All @@ -68,10 +71,10 @@
"lint:hbs": "pnpm -w exec lint hbs",
"lint:hbs:fix": "pnpm -w exec lint hbs:fix",
"lint:prettier:fix": "pnpm -w exec lint prettier:fix",
"lint:prettier": "pnpm -w exec lint prettier",
"build:types": "tsc --emitDeclarationOnly --noEmit false"
"lint:prettier": "pnpm -w exec lint prettier"
},
"dependencies": {
"ember-resources": ">= 6.4.2",
"@babel/helper-plugin-utils": "^7.22.5",
"@babel/standalone": "^7.23.10",
"@embroider/addon-shim": "1.8.7",
Expand Down Expand Up @@ -139,6 +142,7 @@
"eslint-plugin-ember": "^12.0.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^5.1.3",
"execa": "^8.0.1",
"prettier": "^3.2.5",
"prettier-plugin-ember-template-tag": "^2.0.0",
"publint": "^0.2.6",
Expand All @@ -159,12 +163,14 @@
"app-js": {}
},
"peerDependencies": {
"@glimmer/compiler": ">= 0.86.0",
"@glimmer/component": "^1.1.2",
"@glimmer/syntax": ">= 0.86.0",
"@glint/template": ">= 1.3.0",
"ember-resources": ">= 6.4.2",
"ember-source": ">= 5.5.0"
"@glimmer/compiler": ">= 0.86.0",
"@glimmer/syntax": ">= 0.86.0"
},
"peerDependenciesMeta": {
"@glint/template": { "optional": true },
"@glimmer/compiler": { "optional": true },
"@glimmer/syntax": { "optional": true }
},
"engines": {
"node": ">= v16",
Expand Down
11 changes: 10 additions & 1 deletion packages/ember-repl/addon/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import cjs from "@rollup/plugin-commonjs";
import { Addon } from "@embroider/addon-dev/rollup";
import copy from "rollup-plugin-copy";
import { defineConfig } from "rollup";
import { execaCommand } from "execa";

const addon = new Addon({
srcDir: "src",
Expand All @@ -11,8 +12,9 @@ const addon = new Addon({

export default defineConfig({
output: addon.output(),
external: ["@glimmer/compiler", "@glimmer/syntax"],
plugins: [
addon.publicEntrypoints(["browser/**/*.js", "test-support/*.js"]),
addon.publicEntrypoints(["**/*.js"]),
addon.appReexports([]),
babel({
extensions: [".js", ".gjs", ".ts", ".gts"],
Expand All @@ -23,5 +25,12 @@ export default defineConfig({
cjs(),
addon.keepAssets(["build/**/*"]),
addon.clean(),

{
async closeBundle() {
await execaCommand("tsc --emitDeclarationOnly --noEmit false", { stdio: "inherit" });
console.info("Declarations built successfully");
},
},
],
});
44 changes: 0 additions & 44 deletions packages/ember-repl/addon/src/browser/cjs/index.ts

This file was deleted.

11 changes: 0 additions & 11 deletions packages/ember-repl/addon/src/browser/compile/types.ts

This file was deleted.

80 changes: 0 additions & 80 deletions packages/ember-repl/addon/src/browser/esm/index.ts

This file was deleted.

59 changes: 0 additions & 59 deletions packages/ember-repl/addon/src/browser/gjs.ts

This file was deleted.

8 changes: 0 additions & 8 deletions packages/ember-repl/addon/src/browser/index.ts

This file was deleted.

42 changes: 0 additions & 42 deletions packages/ember-repl/addon/src/browser/js.ts

This file was deleted.

Loading

0 comments on commit e700aa2

Please sign in to comment.