Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
"[markdown]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.quickSuggestions": true,
"editor.suggest.showReferences": true,
"editor.wordWrap": "on"
},
"[yaml]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
"editor.tabSize": 2,
"editor.insertSpaces": true,
"editor.formatOnSave": true,
"eslint.format.enable": false
}
11 changes: 11 additions & 0 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ public readonly tsProject: TypeScriptProject;
| <code><a href="#@functionless/projen.Functionless.property.coreDependency">coreDependency</a></code> | <code>string</code> | *No description.* |
| <code><a href="#@functionless/projen.Functionless.property.dependencies">dependencies</a></code> | <code>string[]</code> | *No description.* |
| <code><a href="#@functionless/projen.Functionless.property.devDependencies">devDependencies</a></code> | <code>string[]</code> | *No description.* |
| <code><a href="#@functionless/projen.Functionless.property.languageServiceDependency">languageServiceDependency</a></code> | <code>string</code> | *No description.* |

---

Expand Down Expand Up @@ -134,6 +135,16 @@ public readonly devDependencies: string[];

---

##### `languageServiceDependency`<sup>Required</sup> <a name="languageServiceDependency" id="@functionless/projen.Functionless.property.languageServiceDependency"></a>

```typescript
public readonly languageServiceDependency: string;
```

- *Type:* string

---

### FunctionlessProject <a name="FunctionlessProject" id="@functionless/projen.FunctionlessProject"></a>

Project that wraps an AwsCdkTypeScriptProject and adds configures Functionless.
Expand Down
9 changes: 8 additions & 1 deletion src/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@ import { TypeScriptProject } from "projen/lib/typescript";
*/
export class Functionless extends Component {
static readonly coreDependency = "functionless";
static readonly languageServiceDependency = "@functionless/language-service";
static readonly dependencies = [
Functionless.coreDependency,
"@aws-cdk/aws-appsync-alpha",
];
static readonly devDependencies = ["ts-patch"];
static readonly devDependencies = [
"ts-patch",
Functionless.languageServiceDependency,
];

constructor(readonly tsProject: TypeScriptProject) {
super(tsProject);
Expand All @@ -29,6 +33,9 @@ export class Functionless extends Component {
plugins.push({
transform: `${Functionless.coreDependency}/lib/compile`,
});
plugins.push({
name: Functionless.languageServiceDependency,
});

compilerOptions.plugins = plugins;
}
Expand Down
1 change: 1 addition & 0 deletions test/component.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@ test("add dependency and ts plugin", () => {
expect((project.tsconfig!.compilerOptions as any).plugins).toEqual([
{ transform: "some other transform" },
{ transform: `${Functionless.coreDependency}/lib/compile` },
{ name: Functionless.languageServiceDependency },
]);
});
1 change: 1 addition & 0 deletions test/project.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ test("add dependency and ts plugin", () => {

expect((project.tsconfig!.compilerOptions as any).plugins).toEqual([
{ transform: `${Functionless.coreDependency}/lib/compile` },
{ name: Functionless.languageServiceDependency },
]);
});