-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1014 from mainmatter/typescript
chore(typescript): initial Typescript setup
- Loading branch information
Showing
28 changed files
with
725 additions
and
499 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
|
||
# compiled output | ||
/dist | ||
/declarations/ | ||
|
||
# dependencies | ||
/node_modules | ||
|
2 changes: 2 additions & 0 deletions
2
packages/ember-cookies/addon-main.js → packages/ember-cookies/addon-main.cjs
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,2 +1,4 @@ | ||
'use strict'; | ||
|
||
const { addonV1Shim } = require('@embroider/addon-shim'); | ||
module.exports = addonV1Shim(__dirname); |
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 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
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
15 changes: 13 additions & 2 deletions
15
...ber-cookies/src/utils/serialize-cookie.js → ...ber-cookies/src/utils/serialize-cookie.ts
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 |
---|---|---|
@@ -0,0 +1,57 @@ | ||
{ | ||
"extends": "@tsconfig/ember/tsconfig.json", | ||
"include": [ | ||
"src/**/*", | ||
"unpublished-development-types/**/*" | ||
], | ||
"glint": { | ||
"environment": ["ember-loose", "ember-template-imports"] | ||
}, | ||
"compilerOptions": { | ||
"allowJs": true, | ||
"declarationDir": "declarations", | ||
/** | ||
https://www.typescriptlang.org/tsconfig#noEmit | ||
We want to emit declarations, so this option must be set to `false`. | ||
@tsconfig/ember sets this to `true`, which is incompatible with our need to set `emitDeclarationOnly`. | ||
@tsconfig/ember is more optimized for apps, which wouldn't emit anything, only type check. | ||
*/ | ||
"noEmit": false, | ||
/** | ||
https://www.typescriptlang.org/tsconfig#emitDeclarationOnly | ||
We want to only emit declarations as we use Rollup to emit JavaScript. | ||
*/ | ||
"emitDeclarationOnly": true, | ||
|
||
/** | ||
https://www.typescriptlang.org/tsconfig#noEmitOnError | ||
Do not block emit on TS errors. | ||
*/ | ||
"noEmitOnError": false, | ||
|
||
/** | ||
https://www.typescriptlang.org/tsconfig#rootDir | ||
"Default: The longest common path of all non-declaration input files." | ||
Because we want our declarations' structure to match our rollup output, | ||
we need this "rootDir" to match the "srcDir" in the rollup.config.mjs. | ||
This way, we can have simpler `package.json#exports` that matches | ||
imports to files on disk | ||
*/ | ||
"rootDir": "./src", | ||
|
||
/** | ||
https://www.typescriptlang.org/tsconfig#allowImportingTsExtensions | ||
We want our tooling to know how to resolve our custom files so the appropriate plugins | ||
can do the proper transformations on those files. | ||
*/ | ||
"allowImportingTsExtensions": true, | ||
|
||
"types": [ | ||
"ember-source/types" | ||
] | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
packages/ember-cookies/unpublished-development-types/index.d.ts
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 @@ | ||
import '@types/ember__utils'; |
Empty file.
This file was deleted.
Oops, something went wrong.
Empty file.
Oops, something went wrong.