Skip to content

Commit

Permalink
fix(@formatjs/cli-lib): make glimmer stuff external
Browse files Browse the repository at this point in the history
  • Loading branch information
longlho committed May 5, 2024
1 parent fd1e347 commit cc4432d
Show file tree
Hide file tree
Showing 6 changed files with 130 additions and 24 deletions.
26 changes: 12 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"@napi-rs/cli": "^2.11.0",
"@swc-node/register": "^1.5.4",
"@swc/core": "^1.3.56",
"@swc/helpers": "^0.5.1",
"@swc/jest": "^0.2.23",
"@taplo/cli": "^0.5.0",
"@testing-library/jest-dom": "^6.0.0",
Expand All @@ -63,8 +64,8 @@
"@types/minimist": "^1.2.1",
"@types/node": "^18.11.9",
"@types/picomatch": "^2.3.0",
"@types/react": "16 || 17 || 18",
"@types/react-dom": "17 || 18",
"@types/react": "16 || 17 || 18",
"@types/regenerate": "^1.4.1",
"@types/rimraf": "^3.0.0",
"@types/serialize-javascript": "^5.0.0",
Expand All @@ -91,6 +92,7 @@
"cldr-units-full": "43.1.0",
"clsx": "2",
"commander": "8",
"content-tag": "^2.0.1",
"core-js": "^3.6.5",
"ember-template-recast": "^6.1.4",
"emoji-regex": "^10.2.1",
Expand All @@ -101,23 +103,26 @@
"http-server": "^14.0.0",
"husky": "^8.0.0",
"jasmine-expect": "^5.0.0",
"jest": "29",
"jest-cli": "^29.5.0",
"jest-environment-jsdom": "29",
"jest-junit": "^16.0.0",
"jest": "29",
"json-stable-stringify": "^1.0.1",
"karma": "^6.0.4",
"karma-chrome-launcher": "^3.1.0",
"karma-jasmine": "5",
"karma-jasmine-matchers": "5",
"karma-jasmine": "5",
"karma-sauce-launcher": "4.3.6",
"karma": "^6.0.4",
"lodash": "^4.17.15",
"loud-rejection": "^2.2.0",
"magic-string": "^0.30.0",
"make-plural-compiler": "5.1.0",
"minimist": "^1.2.5",
"picomatch": "^2.3.1",
"pnpm": "8",
"prettier": "^3.0.3",
"react": "^16.6.0 || 17 || 18",
"react-dom": "^16.6.0 || 17 || 18",
"react": "^16.6.0 || 17 || 18",
"regenerate": "^1.4.2",
"regexpu-core": "^5.2.2",
"rimraf": "^3.0.2",
Expand All @@ -130,10 +135,10 @@
"typescript": "5.2.2",
"unicode-emoji-utils": "^1.1.1",
"unidiff": "^1.0.2",
"vue": "^3.4.0",
"vue-class-component": "^8.0.0-rc.1",
"vue-eslint-parser": "^9.4.0",
"vue-loader": "17",
"vue": "^3.4.0",
"webpack": "5"
},
"devEngines": {
Expand Down Expand Up @@ -189,12 +194,5 @@
"@glimmer/interfaces@0.91.2": "patches/@glimmer__interfaces@0.91.2.patch"
}
},
"author": "Seth Bertalotto <sbertal@verizonmedia.com>",
"dependencies": {
"@swc/helpers": "^0.5.1",
"content-tag": "^2.0.1",
"jest-cli": "^29.5.0",
"jest-junit": "^16.0.0",
"magic-string": "^0.30.0"
}
"author": "Seth Bertalotto <sbertal@verizonmedia.com>"
}
9 changes: 8 additions & 1 deletion packages/cli-lib/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ GLIMMER_HBS_DEPS = [
"//:node_modules/@glimmer/validator",
"//:node_modules/content-tag",
"//:node_modules/ember-template-recast",
":node_modules/@babel/parser",
]

SRC_DEPS = [
Expand Down Expand Up @@ -95,6 +94,14 @@ esbuild(
entry_point = "lib_esnext/main.js",
external = [
"vue",
"content-tag",
"@glimmer/env",
"@glimmer/reference",
"@glimmer/syntax",
"@glimmer/validator",
"@vue/compiler-core",
"content-tag",
"ember-template-recast",
],
platform = "node",
target = "node16",
Expand Down
30 changes: 24 additions & 6 deletions packages/cli-lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,14 @@
"url": "https://github.com/formatjs/formatjs/issues"
},
"dependencies": {
"@babel/parser": "^7.22.10",
"@formatjs/icu-messageformat-parser": "workspace:*",
"@formatjs/ts-transformer": "workspace:*",
"@glimmer/env": "^0.1.7",
"@glimmer/reference": "^0.91.1",
"@glimmer/syntax": "^0.91.1",
"@glimmer/validator": "^0.91.1",
"@types/estree": "^1.0.0",
"@types/fs-extra": "^9.0.1",
"@types/json-stable-stringify": "^1.0.32",
"@types/node": "14 || 16 || 17",
"chalk": "^4.0.0",
"commander": "8",
"ember-template-recast": "^6.1.4",
"fast-glob": "^3.2.7",
"fs-extra": "10",
"json-stable-stringify": "^1.0.1",
Expand All @@ -53,7 +47,13 @@
"typescript": "5"
},
"peerDependencies": {
"@glimmer/env": "^0.1.7",
"@glimmer/reference": "^0.91.1",
"@glimmer/syntax": "^0.91.1",
"@glimmer/validator": "^0.91.1",
"@vue/compiler-core": "^3.4.0",
"content-tag": "^2.0.1",
"ember-template-recast": "^6.1.4",
"vue": "^3.4.0"
},
"peerDependenciesMeta": {
Expand All @@ -62,6 +62,24 @@
},
"@vue/compiler-core": {
"optional": true
},
"@glimmer/env": {
"optional": true
},
"@glimmer/reference": {
"optional": true
},
"@glimmer/syntax": {
"optional": true
},
"@glimmer/validator": {
"optional": true
},
"ember-template-recast": {
"optional": true
},
"content-tag": {
"optional": true
}
},
"engines": {
Expand Down
11 changes: 10 additions & 1 deletion packages/cli/integration-tests/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@ load("//tools:jest.bzl", "jest_test")

npm_link_all_packages(name = "node_modules")

GLIMMER_HBS_DEPS = [
"//:node_modules/@glimmer/env",
"//:node_modules/@glimmer/reference",
"//:node_modules/@glimmer/syntax",
"//:node_modules/@glimmer/validator",
"//:node_modules/content-tag",
"//:node_modules/ember-template-recast",
]

jest_test(
name = "compile_folder_integration_test",
data = glob(
Expand Down Expand Up @@ -65,7 +74,7 @@ jest_test(
"//:node_modules/@babel/types",
"//:node_modules/@types/node",
"//:node_modules/fast-glob",
],
] + GLIMMER_HBS_DEPS,
flaky = True,
snapshots = glob(["extract-glimmer/__snapshots__/*"]),
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,54 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`gjs 1`] = `{}`;
exports[`gjs 1`] = `
{
"7MCO2v": {
"defaultMessage": "in template",
"description": "in template desc",
},
"FmytR9": {
"defaultMessage": "G'day!, from a secondary component in the same GJS file",
},
"getter-message": {
"defaultMessage": "js getter with an id",
},
"hdXT/o": {
"defaultMessage": "js getter with no id",
},
"lMXYqa": {
"defaultMessage": "{connectorName, select, none {Install Service} other {Install {connectorName}} }",
},
"mkhWoT": {
"defaultMessage": "Very long message with multiple'' breaklines and multiple spaces '<a href={href}>' Link '</a>'",
"description": "Nice description",
},
}
`;

exports[`gts 1`] = `{}`;
exports[`gts 1`] = `
{
"7MCO2v": {
"defaultMessage": "in template",
"description": "in template desc",
},
"getter-message": {
"defaultMessage": "js getter with an id",
},
"hdXT/o": {
"defaultMessage": "js getter with no id",
},
"lMXYqa": {
"defaultMessage": "{connectorName, select, none {Install Service} other {Install {connectorName}} }",
},
"mkhWoT": {
"defaultMessage": "Very long message with multiple'' breaklines and multiple spaces '<a href={href}>' Link '</a>'",
"description": "Nice description",
},
"o1wtct": {
"defaultMessage": "hello from a secondary component in the same file",
},
}
`;

exports[`hbs 1`] = `
{
Expand Down
28 changes: 28 additions & 0 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,39 @@
"@formatjs/cli-lib": "workspace:*"
},
"peerDependencies": {
"@glimmer/env": "^0.1.7",
"@glimmer/reference": "^0.91.1",
"@glimmer/syntax": "^0.91.1",
"@glimmer/validator": "^0.91.1",
"@vue/compiler-core": "^3.4.0",
"content-tag": "^2.0.1",
"ember-template-recast": "^6.1.4",
"vue": "^3.4.0"
},
"peerDependenciesMeta": {
"vue": {
"optional": true
},
"@vue/compiler-core": {
"optional": true
},
"@glimmer/env": {
"optional": true
},
"@glimmer/reference": {
"optional": true
},
"@glimmer/syntax": {
"optional": true
},
"@glimmer/validator": {
"optional": true
},
"ember-template-recast": {
"optional": true
},
"content-tag": {
"optional": true
}
},
"engines": {
Expand Down

0 comments on commit cc4432d

Please sign in to comment.