-
-
Notifications
You must be signed in to change notification settings - Fork 22
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
22ac822
commit 4d7051a
Showing
55 changed files
with
1,774 additions
and
786 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 |
---|---|---|
|
@@ -6,3 +6,4 @@ vendor/ | |
public/ | ||
coverage/ | ||
*.ember-try | ||
tests-self/ |
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 |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
# compiled output | ||
dist/ | ||
declarations/ | ||
__screenshots__/ | ||
/tmp/ | ||
/out/ | ||
|
||
|
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 |
---|---|---|
@@ -1 +1 @@ | ||
20.18 | ||
22 |
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
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 |
---|---|---|
@@ -1,36 +1,98 @@ | ||
import { Addon } from "@embroider/addon-dev/rollup"; | ||
|
||
import alias from "@rollup/plugin-alias"; | ||
import { babel } from "@rollup/plugin-babel"; | ||
import cjs from "@rollup/plugin-commonjs"; | ||
import { execaCommand } from "execa"; | ||
import commonjs from "@rollup/plugin-commonjs"; | ||
import { nodeResolve } from "@rollup/plugin-node-resolve"; | ||
import { defineConfig } from "rollup"; | ||
|
||
const addon = new Addon({ | ||
srcDir: "src", | ||
destDir: "dist", | ||
}); | ||
|
||
export default defineConfig({ | ||
output: addon.output(), | ||
external: ["@glimmer/compiler", "@glimmer/syntax"], | ||
plugins: [ | ||
addon.publicEntrypoints(["**/*.js"]), | ||
addon.appReexports([]), | ||
babel({ | ||
extensions: [".js", ".gjs", ".ts", ".gts"], | ||
babelHelpers: "bundled", | ||
}), | ||
addon.dependencies(), | ||
// line-column... | ||
cjs(), | ||
addon.keepAssets(["build/**/*"]), | ||
addon.clean(), | ||
const browser = new Addon({ srcDir: "src/browser", destDir: "dist/browser" }); | ||
const compiler = new Addon({ srcDir: "src/compiler-worker", destDir: "dist/compiler-worker" }); | ||
const sw = new Addon({ srcDir: "src/service-worker", destDir: "dist/service-worker" }); | ||
|
||
function ember(name) { | ||
return `./node_modules/ember-source/dist/${name}`; | ||
} | ||
|
||
function pkg(name) { | ||
return ember(`packages/${name}`); | ||
} | ||
|
||
const lookup = { | ||
"@ember/debug": pkg("@ember/debug/index.js"), | ||
"@ember/template-factory": pkg("@ember/template-factory/index.js"), | ||
"@ember/helper": pkg("@ember/helper/index.js"), | ||
"@ember/modifier": pkg("@ember/modifier/index.js"), | ||
"@ember/component": pkg("@ember/component/index.js"), | ||
"@ember/component/template-only": pkg("@ember/component/template-only.js"), | ||
"ember-template-compiler": ember("ember-template-compiler.js"), | ||
}; | ||
|
||
function bundledEmber() { | ||
return alias([ | ||
{ | ||
async closeBundle() { | ||
await execaCommand("tsc --emitDeclarationOnly --noEmit false", { stdio: "inherit" }); | ||
console.info("Declarations built successfully"); | ||
find: /(@?ember.+)/, | ||
replacement: "$1", | ||
customResolver(source) { | ||
return lookup[source]; | ||
}, | ||
}, | ||
], | ||
}); | ||
]); | ||
} | ||
|
||
function worker(input, out) { | ||
return { | ||
input: input, | ||
external: [], | ||
output: { | ||
sourcemap: true, | ||
format: "es", | ||
hoistTransitiveImports: false, | ||
inlineDynamicImports: true, | ||
file: out, | ||
}, | ||
plugins: [ | ||
babel({ | ||
extensions: [".js", ".gjs", ".ts", ".gts"], | ||
babelHelpers: "bundled", | ||
}), | ||
bundledEmber(), | ||
nodeResolve(), | ||
// unified>extends | ||
commonjs(), | ||
], | ||
}; | ||
} | ||
|
||
export default defineConfig([ | ||
{ | ||
output: browser.output(), | ||
plugins: [ | ||
browser.publicEntrypoints(["**/*.js"]), | ||
browser.appReexports(["./services/ember-repl/compiler.js"]), | ||
babel({ | ||
extensions: [".js", ".gjs", ".ts", ".gts"], | ||
babelHelpers: "bundled", | ||
}), | ||
browser.dependencies(), | ||
], | ||
}, | ||
worker("src/compiler-worker/index.ts", "dist/compiler-worker.js"), | ||
worker("src/markdown-worker/index.ts", "dist/markdown-worker.js"), | ||
{ | ||
input: "src/service-worker/index.ts", | ||
output: { | ||
sourcemap: true, | ||
format: "es", | ||
hoistTransitiveImports: false, | ||
file: "dist/service-worker.js", | ||
}, | ||
plugins: [ | ||
babel({ | ||
extensions: [".js", ".gjs", ".ts", ".gts"], | ||
babelHelpers: "bundled", | ||
}), | ||
bundledEmber(), | ||
], | ||
}, | ||
]); |
This file was deleted.
Oops, something went wrong.
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 @@ | ||
export { Compiled } from './resource.ts'; |
Oops, something went wrong.