Skip to content

Commit

Permalink
CUUURSE YOU BAAAYLLLEE
Browse files Browse the repository at this point in the history
  • Loading branch information
NullVoxPopuli committed Dec 10, 2024
1 parent 22ac822 commit 4d7051a
Show file tree
Hide file tree
Showing 55 changed files with 1,774 additions and 786 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ vendor/
public/
coverage/
*.ember-try
tests-self/
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ jobs:


tests:
name: "Ember Tests"
name: "Browser Tests"
strategy:
matrix:
# os: [ubuntu-latest, macOS-latest, windows-latest]
Expand All @@ -109,7 +109,7 @@ jobs:
echo "NPM: $( npm --version )"
echo "pnpm: $( pnpm --version )"
- name: Test
run: pnpm turbo test:ember
run: pnpm turbo test:chrome test:firefox
env:
CI_BROWSER: ${{ matrix.ci_browser }}

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# compiled output
dist/
declarations/
__screenshots__/
/tmp/
/out/

Expand Down
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.18
22
3 changes: 2 additions & 1 deletion apps/repl/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"start": "ember serve -p 4201",
"start:iframe": "pnpx http-server ./public -i -p 4204",
"test:browserstack": "./scripts/browserstack.sh",
"test:ember": "ember test --test-port 0",
"test:chrome": "CI_BROWSER=Chrome ember test --test-port 0",
"test:firefox": "CI_BROWSER=Firefox ember test --test-port 0",
"lint": "pnpm -w exec lint",
"lint:js": "pnpm -w exec lint js",
"lint:js:fix": "pnpm -w exec lint js:fix",
Expand Down
3 changes: 2 additions & 1 deletion apps/tutorial/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"lint:fix": "pnpm -w exec lint fix",
"cf": "cd dist && npx wrangler pages dev --port 42000 ./",
"start": "ember serve",
"test:ember": "ember test --test-port 0",
"test:chrome": "CI_BROWSER=Chrome ember test --test-port 0",
"test:firefox": "CI_BROWSER=Firefox ember test --test-port 0",
"lint:js": "pnpm -w exec lint js",
"lint:js:fix": "pnpm -w exec lint js:fix",
"lint:hbs": "pnpm -w exec lint hbs",
Expand Down
3 changes: 2 additions & 1 deletion dev/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,6 @@
"directory": "dev"
},
"license": "MIT",
"author": "NullVoxPopuli"
"author": "NullVoxPopuli",
"version": "0.0.0"
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"@glimmer/component": "^2.0.0",
"@ember/test-waiters": "^4.0.0",
"ember-element-helper": "^0.8.5",
"ember-auto-import": "^2.9.0",
"ember-auto-import": "^2.10.0",
"ember-repl": "workspace:*",
"ember-source": ">= 6.0.1",
"webpack": ">= 5.92.0",
Expand Down
3 changes: 2 additions & 1 deletion packages/app-support/limber-ui/test-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"scripts": {
"lint:fix": "pnpm -w exec lint fix",
"start": "ember serve",
"test:ember": "ember test --test-port 0",
"test:chrome": "CI_BROWSER=Chrome ember test --test-port 0",
"test:firefox": "CI_BROWSER=Firefox ember test --test-port 0",
"lint": "pnpm -w exec lint",
"lint:js": "pnpm -w exec lint js",
"lint:js:fix": "pnpm -w exec lint js:fix",
Expand Down
73 changes: 29 additions & 44 deletions packages/ember-repl/addon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,44 +12,22 @@
},
"license": "MIT",
"author": "NullVoxPopuli",
"typesVersions": {
"*": {
"test-support": [
"declarations/test-support/index.d.ts"
],
"markdown/parse": [
"./declarations/compile/markdown-to-ember.d.ts"
],
"*": [
"declarations/*",
"declarations/*/index.d.ts"
]
}
},
"exports": {
".": {
"types": "./declarations/index.d.ts",
"default": "./dist/index.js"
},
"./formats/markdown": {
"types": "./declarations/compile/formats/markdown.d.ts",
"default": "./dist/compile/formats/markdown.js"
},
"./formats/hbs": {
"types": "./declarations/compile/formats/hbs.d.ts",
"default": "./dist/compile/formats/hbs.js"
"types": "./declarations/browser/index.d.ts",
"default": "./dist/browser/index.js"
},
"./formats/gjs": {
"types": "./declarations/compile/formats/gjs/index.d.ts",
"default": "./dist/compile/formats/gjs/index.js"
"./workers/compiler": {
"types": "./declarations/compiler-worker/index.d.ts",
"default": "./dist/compiler-worker/index.js"
},
"./test-support": {
"types": "./declarations/test-support/index.d.ts",
"default": "./dist/test-support/index.js"
"./workers/markdown": {
"types": "./declarations/markdown-worker/index.d.ts",
"default": "./dist/markdown-worker/index.js"
},
"./__PRIVATE__DO_NOT_USE__": {
"types": "./declarations/__PRIVATE__.d.ts",
"default": "./dist/__PRIVATE__.js"
"./sw": {
"types": "./declarations/service-worker/index.d.ts",
"default": "./dist/service-worker/index.js"
},
"./addon-main.js": "./addon-main.cjs"
},
Expand All @@ -60,10 +38,12 @@
"addon-main.cjs"
],
"scripts": {
"build": "rollup --config",
"build": "rm -rf dist declarations && concurrently 'pnpm:build:*'",
"build:browser": "rollup --config",
"build:types": "tsc --emitDeclarationOnly --noEmit false",
"start": "vite build --watch",
"lint:types": "tsc --noEmit",
"lint:fix": "pnpm -w exec lint fix",
"start": "rollup --config --watch",
"lint": "pnpm -w exec lint",
"lint:package": "pnpm publint",
"lint:js": "pnpm -w exec lint js",
Expand All @@ -76,8 +56,10 @@
"dependencies": {
"@babel/helper-plugin-utils": "^7.25.7",
"@babel/standalone": "^7.25.7",
"@embroider/addon-shim": "1.8.9",
"@ember/test-waiters": "^3.1.0",
"@embroider/addon-shim": "1.9.0",
"@embroider/macros": "1.16.9",
"@rollup/plugin-alias": "^5.1.1",
"babel-import-util": "^3.0.0",
"babel-plugin-ember-template-compilation": "^2.3.0",
"broccoli-file-creator": "^2.1.1",
Expand All @@ -87,17 +69,19 @@
"decorator-transforms": "^2.3.0",
"ember-resources": "^7.0.3",
"line-column": "^1.0.2",
"magic-string": "^0.30.6",
"magic-string": "^0.30.14",
"mdast": "^3.0.0",
"parse-static-imports": "^1.1.0",
"rehype-raw": "^6.1.1",
"rehype-stringify": "^9.0.4",
"remark-gfm": "^3.0.1",
"remark-parse": "^10.0.2",
"remark-rehype": "^10.1.0",
"unified": "^10.1.2",
"promise-worker-bi": "^4.1.1",
"register-service-worker": "^1.7.2",
"rehype-raw": "^7.0.0",
"rehype-stringify": "^10.0.1",
"remark-gfm": "^4.0.0",
"remark-parse": "^11.0.0",
"remark-rehype": "^11.1.1",
"unified": "^11.0.5",
"unist-util-visit": "^5.0.0",
"uuid": "^10.0.0",
"uuid": "^11.0.3",
"vfile": "^6.0.1"
},
"devDependencies": {
Expand All @@ -123,6 +107,7 @@
"@nullvoxpopuli/limber-untyped": "workspace:*",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-commonjs": "^28.0.0",
"@rollup/plugin-node-resolve": "^15.2.3",
"@tsconfig/ember": "^3.0.7",
"@types/babel__core": "^7.20.5",
"@types/babel__standalone": "^7.1.7",
Expand Down
116 changes: 89 additions & 27 deletions packages/ember-repl/addon/rollup.config.mjs
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(),
],
},
]);
1 change: 0 additions & 1 deletion packages/ember-repl/addon/src/__PRIVATE__.ts

This file was deleted.

1 change: 1 addition & 0 deletions packages/ember-repl/addon/src/browser/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { Compiled } from './resource.ts';
Loading

0 comments on commit 4d7051a

Please sign in to comment.