Skip to content

Commit

Permalink
Merge pull request #243 from embroider-build/update-dev-deps
Browse files Browse the repository at this point in the history
Update dependencies in the addon's package.json
  • Loading branch information
ef4 authored Dec 18, 2023
2 parents b2fd3fd + 8d5627a commit f32bc59
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 109 deletions.
85 changes: 43 additions & 42 deletions files/__addonLocation__/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,55 +33,56 @@
"prepack": "rollup --config"
},
"dependencies": {
"@embroider/addon-shim": "^1.0.0",
"@embroider/addon-shim": "^1.8.7",
"decorator-transforms": "^1.0.1"
},
"devDependencies": {
"@babel/core": "^7.17.0",
<% if (typescript) { %>"@babel/plugin-transform-typescript": "^7.22.15"<% } else { %>"@babel/eslint-parser": "^7.19.1"<% } %>,
"@babel/core": "^7.23.6",
<% if (typescript) { %>"@babel/plugin-transform-typescript": "^7.23.6"<% } else { %>"@babel/eslint-parser": "^7.23.3"<% } %>,
"@babel/runtime": "^7.17.0",
"@embroider/addon-dev": "^4.1.0",<% if (typescript) { %>
"@glint/core": "^1.2.0",
"@glint/environment-ember-loose": "^1.2.0",
"@glint/environment-ember-template-imports": "^1.2.0",
"@glint/template": "^1.2.0",
"@tsconfig/ember": "^2.0.0",
"@types/ember": "^4.0.4",
"@types/ember__object": "^4.0.6",
"@types/ember__owner": "^4.0.4",
"@types/ember__service": "^4.0.3",
"@types/ember__controller": "^4.0.5",
"@glint/core": "^1.2.1",
"@glint/environment-ember-loose": "^1.2.1",
"@glint/environment-ember-template-imports": "^1.2.1",
"@glint/template": "^1.2.1",
"@tsconfig/ember": "^3.0.2",
"@types/ember": "^4.0.10",
"@types/ember__object": "^4.0.11",
"@types/ember__destroyable": "^4.0.4",
"@types/ember__owner": "^4.0.8",
"@types/ember__service": "^4.0.8",
"@types/ember__controller": "^4.0.11",
"@types/ember__string": "^3.16.3",
"@types/ember__template": "^4.0.2",
"@types/ember__polyfills": "^4.0.2",
"@types/ember__utils": "^4.0.3",
"@types/ember__runloop": "^4.0.3",
"@types/ember__debug": "^4.0.4",
"@types/ember__engine": "^4.0.5",
"@types/ember__application": "^4.0.6",
"@types/ember__test": "^4.0.2",
"@types/ember__array": "^4.0.4",
"@types/ember__error": "^4.0.3",
"@types/ember__component": "^4.0.14",
"@types/ember__modifier": "^4.0.6",
"@types/ember__helper": "^4.0.3",
"@types/ember__routing": "^4.0.13",
"@typescript-eslint/eslint-plugin": "^6.7.2",
"@typescript-eslint/parser": "^6.7.2",<% } %>
"@rollup/plugin-babel": "^6.0.3",
"babel-plugin-ember-template-compilation": "^2.2.0",
"concurrently": "^8.0.1",
"ember-template-lint": "^5.11.2",
"eslint": "^8.33.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-ember": "^11.11.1",
"eslint-plugin-n": "^16.0.0",
"eslint-plugin-prettier": "^5.0.0",
"prettier": "^3.0.3",
"@types/ember__template": "^4.0.5",
"@types/ember__polyfills": "^4.0.5",
"@types/ember__utils": "^4.0.6",
"@types/ember__runloop": "^4.0.8",
"@types/ember__debug": "^4.0.7",
"@types/ember__engine": "^4.0.10",
"@types/ember__application": "^4.0.10",
"@types/ember__test": "^4.0.5",
"@types/ember__array": "^4.0.9",
"@types/ember__error": "^4.0.5",
"@types/ember__component": "^4.0.21",
"@types/ember__modifier": "^4.0.8",
"@types/ember__helper": "^4.0.5",
"@types/ember__routing": "^4.0.19",
"@typescript-eslint/eslint-plugin": "^6.14.0",
"@typescript-eslint/parser": "^6.14.0",<% } %>
"@rollup/plugin-babel": "^6.0.4",
"babel-plugin-ember-template-compilation": "^2.2.1",
"concurrently": "^8.2.2",
"ember-template-lint": "^5.13.0",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-ember": "^11.12.0",
"eslint-plugin-n": "^16.4.0",
"eslint-plugin-prettier": "^5.0.1",
"prettier": "^3.1.1",
"prettier-plugin-ember-template-tag": "^1.1.0",
"rollup": "^3.21.8"<% if (!isExistingMonorepo) { %>,
"rollup-plugin-copy": "^3.4.0"<% } %><% if (typescript) { %>,
"typescript": "^5.0.4"<% } %>
"rollup": "^4.9.1"<% if (!isExistingMonorepo) { %>,
"rollup-plugin-copy": "^3.5.0"<% } %><% if (typescript) { %>,
"typescript": "^5.3.3"<% } %>
},
"publishConfig": {
"registry": "https://registry.npmjs.org"
Expand Down
40 changes: 0 additions & 40 deletions tests/helpers/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,46 +22,6 @@ export async function createTmp() {
return tmpDirPath;
}

const ROLLUP_HASH = /[a-f0-9]{8}/

/**
* Filters out rollup-hashes from a list of files.
*
* When there are private files, rollup will add some
* hash to the emitted file path,
* such as:
* template-only-ab2e7769.js.map
*
* These hashes have predictable length, so we can have
* a fairly narrow matcher to remove them.
*/
export function withoutHashes(names: string[]) {
return names.filter(name => !ROLLUP_HASH.test(name));
}

/**
* Filters out a list of files, keeping only the rollup-emitted hashed files
*
* When there are private files, rollup will add some
* hash to the emitted file path,
* such as:
* template-only-ab2e7769.js.map
*
* These hashes have predictable length, so we can have
* a fairly narrow matcher to remove them.
* This a
*/
export function hashesOnly(names: string[]) {
return names.filter(name => ROLLUP_HASH.test(name));
}

export function splitHashedFiles(names: string[]) {
return {
hashed: hashesOnly(names),
unhashed: withoutHashes(names),
};
}

/**
* Abstraction for install, as the blueprint supports multiple package managers
*/
Expand Down
52 changes: 25 additions & 27 deletions tests/smoke-tests/--typescript.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
AddonHelper,
assertGeneratedCorrectly,
dirContents,
splitHashedFiles,
SUPPORTED_PACKAGE_MANAGERS,
} from '../helpers.js';

Expand Down Expand Up @@ -76,34 +75,33 @@ for (let packageManager of SUPPORTED_PACKAGE_MANAGERS) {

expect(buildResult.exitCode).toEqual(0);

let distContents = splitHashedFiles(await dirContents(distDir));
let distContents = await dirContents(distDir);
let declarationsContents = await dirContents(declarationsDir);

expect(distContents.unhashed).to.deep.equal([
'_app_',
'components',
'index.js',
'index.js.map',
'services',
'template-registry.js',
'template-registry.js.map',
]);

expect(distContents.hashed.length).toBe(2);
expect(
distContents.hashed
.filter((file) => file.includes('template-only'))
.map((file) => file.split('.js')[1]),
).to.deep.equal(['', '.map'], 'the template-only (private) component is emitted with a source map');

expect(declarationsContents).to.deep.equal([
'components',
'index.d.ts',
'index.d.ts.map',
'services',
'template-registry.d.ts',
'template-registry.d.ts.map',
]);
expect(distContents).toMatchInlineSnapshot(`
[
"_app_",
"components",
"index.js",
"index.js.map",
"services",
"template-only-dYTzhOEA.js",
"template-only-dYTzhOEA.js.map",
"template-registry.js",
"template-registry.js.map",
]
`);

expect(declarationsContents).toMatchInlineSnapshot(`
[
"components",
"index.d.ts",
"index.d.ts.map",
"services",
"template-registry.d.ts",
"template-registry.d.ts.map",
]
`);

let testResult = await helper.run('test');

Expand Down

0 comments on commit f32bc59

Please sign in to comment.