@langri-sha/projen-project 0.2.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.json CHANGED
@@ -2,7 +2,51 @@
2
2
  "name": "@langri-sha/projen-project",
3
3
  "entries": [
4
4
  {
5
- "date": "Tue, 30 Apr 2024 23:02:26 GMT",
5
+ "date": "Fri, 03 May 2024 10:44:32 GMT",
6
+ "version": "0.4.0",
7
+ "tag": "@langri-sha/projen-project_v0.4.0",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "filip.dupanovic@gmail.com",
12
+ "package": "@langri-sha/projen-project",
13
+ "commit": "68e384490ef3496631d9e74f059a50a466179b5d",
14
+ "comment": "fix(workspace): Revise build command"
15
+ }
16
+ ],
17
+ "minor": [
18
+ {
19
+ "author": "filip.dupanovic@gmail.com",
20
+ "package": "@langri-sha/projen-project",
21
+ "commit": "976a3bb428390ade32e6a6a4332d335d4a39915b",
22
+ "comment": "feat(project): Configure package build"
23
+ },
24
+ {
25
+ "author": "filip.dupanovic@gmail.com",
26
+ "package": "@langri-sha/projen-project",
27
+ "commit": "19c7d9169fbe48b285e96250fbe4f2e73396979b",
28
+ "comment": "feat(project): Add workspace output ignore patterns"
29
+ }
30
+ ]
31
+ }
32
+ },
33
+ {
34
+ "date": "Wed, 01 May 2024 23:11:18 GMT",
35
+ "version": "0.3.0",
36
+ "tag": "@langri-sha/projen-project_v0.3.0",
37
+ "comments": {
38
+ "minor": [
39
+ {
40
+ "author": "filip.dupanovic@gmail.com",
41
+ "package": "@langri-sha/projen-project",
42
+ "commit": "71b1eccec703fc7903cea5182a198e66f5c765ce",
43
+ "comment": "feat(project): Add EditorConfig support"
44
+ }
45
+ ]
46
+ }
47
+ },
48
+ {
49
+ "date": "Tue, 30 Apr 2024 23:02:33 GMT",
6
50
  "version": "0.2.0",
7
51
  "tag": "@langri-sha/projen-project_v0.2.0",
8
52
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,33 @@
1
1
  # Change Log - @langri-sha/projen-project
2
2
 
3
- This log was last generated on Tue, 30 Apr 2024 23:02:26 GMT and should not be manually modified.
3
+ This log was last generated on Fri, 03 May 2024 10:44:32 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 0.4.0
8
+
9
+ Fri, 03 May 2024 10:44:32 GMT
10
+
11
+ ### Minor changes
12
+
13
+ - feat(project): Configure package build (filip.dupanovic@gmail.com)
14
+ - feat(project): Add workspace output ignore patterns (filip.dupanovic@gmail.com)
15
+
16
+ ### Patches
17
+
18
+ - fix(workspace): Revise build command (filip.dupanovic@gmail.com)
19
+
20
+ ## 0.3.0
21
+
22
+ Wed, 01 May 2024 23:11:18 GMT
23
+
24
+ ### Minor changes
25
+
26
+ - feat(project): Add EditorConfig support (filip.dupanovic@gmail.com)
27
+
7
28
  ## 0.2.0
8
29
 
9
- Tue, 30 Apr 2024 23:02:26 GMT
30
+ Tue, 30 Apr 2024 23:02:33 GMT
10
31
 
11
32
  ### Minor changes
12
33
 
package/lib/index.d.ts ADDED
@@ -0,0 +1,20 @@
1
+ import { Project as BaseProject, type ProjectOptions as BaseProjectOptions } from 'projen';
2
+ import { type BeachballConfig } from 'beachball';
3
+ import { type LintSynthesizedOptions } from '@langri-sha/projen-lint-synthesized';
4
+ import { type EditorConfigOptions } from '@langri-sha/projen-editorconfig';
5
+ export interface ProjectOptions extends BaseProjectOptions {
6
+ beachballConfig?: BeachballConfig;
7
+ /**
8
+ * EditorConfig options.
9
+ */
10
+ editorConfigOptions?: EditorConfigOptions;
11
+ lintSynthesizedOptions?: LintSynthesizedOptions;
12
+ withTerraform?: boolean;
13
+ withTypeScript?: boolean;
14
+ workspaces?: string[];
15
+ }
16
+ export declare class Project extends BaseProject {
17
+ #private;
18
+ constructor(options: ProjectOptions);
19
+ }
20
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,IAAI,WAAW,EACtB,KAAK,cAAc,IAAI,kBAAkB,EAG1C,MAAM,QAAQ,CAAA;AAGf,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,WAAW,CAAA;AAEhD,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,qCAAqC,CAAA;AAC5C,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,iCAAiC,CAAA;AAExC,MAAM,WAAW,cAAe,SAAQ,kBAAkB;IAIxD,eAAe,CAAC,EAAE,eAAe,CAAA;IAEjC;;OAEG;IACH,mBAAmB,CAAC,EAAE,mBAAmB,CAAA;IAKzC,sBAAsB,CAAC,EAAE,sBAAsB,CAAA;IAI/C,aAAa,CAAC,EAAE,OAAO,CAAA;IAKvB,cAAc,CAAC,EAAE,OAAO,CAAA;IAKxB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;CACtB;AAED,qBAAa,OAAQ,SAAQ,WAAW;;gBAC1B,OAAO,EAAE,cAAc;CAwGpC"}
package/lib/index.js ADDED
@@ -0,0 +1,134 @@
1
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
2
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
3
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
4
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
5
+ };
6
+ var _Project_instances, _Project_configureBeachball, _Project_configureDefaultTask, _Project_configureLintSynthesized, _Project_configureEditorConfig, _Project_createPnpmWorkspaces;
7
+ import { Project as BaseProject, TextFile, YamlFile, } from 'projen';
8
+ import * as R from 'ramda';
9
+ import { LintSynthesized, } from '@langri-sha/projen-lint-synthesized';
10
+ import { EditorConfig, } from '@langri-sha/projen-editorconfig';
11
+ export class Project extends BaseProject {
12
+ constructor(options) {
13
+ super({
14
+ ...options,
15
+ gitIgnoreOptions: getGitIgnoreOptions(options),
16
+ });
17
+ _Project_instances.add(this);
18
+ // Clean up tasks not required at top-level.
19
+ this.tasks.removeTask('build');
20
+ this.tasks.removeTask('compile');
21
+ this.tasks.removeTask('eject');
22
+ this.tasks.removeTask('package');
23
+ this.tasks.removeTask('post-compile');
24
+ this.tasks.removeTask('pre-compile');
25
+ this.tasks.removeTask('watch');
26
+ __classPrivateFieldGet(this, _Project_instances, "m", _Project_configureBeachball).call(this, options);
27
+ __classPrivateFieldGet(this, _Project_instances, "m", _Project_configureDefaultTask).call(this);
28
+ __classPrivateFieldGet(this, _Project_instances, "m", _Project_configureEditorConfig).call(this, options);
29
+ __classPrivateFieldGet(this, _Project_instances, "m", _Project_configureLintSynthesized).call(this, options);
30
+ __classPrivateFieldGet(this, _Project_instances, "m", _Project_createPnpmWorkspaces).call(this, options);
31
+ }
32
+ }
33
+ _Project_instances = new WeakSet(), _Project_configureBeachball = function _Project_configureBeachball({ beachballConfig }) {
34
+ if (!beachballConfig) {
35
+ return;
36
+ }
37
+ const options = deepMerge(beachballConfig, {
38
+ branch: 'origin/main',
39
+ gitTags: false,
40
+ ignorePatterns: [
41
+ '*.test.*',
42
+ '.*/**',
43
+ '__snapshots__/',
44
+ 'dist/',
45
+ 'node_modules/',
46
+ ],
47
+ });
48
+ const file = new TextFile(this, 'beachball.config.js', {
49
+ readonly: true,
50
+ marker: true,
51
+ });
52
+ for (const line of [
53
+ `/** @type {import('beachball').BeachballConfig} */`,
54
+ `module.exports = ${JSON.stringify(options, null, 2)}`,
55
+ ]) {
56
+ file.addLine(line);
57
+ }
58
+ }, _Project_configureDefaultTask = function _Project_configureDefaultTask() {
59
+ this.tasks
60
+ .tryFind('default')
61
+ ?.exec(`node --loader ts-node/esm .projenrc.mts`);
62
+ }, _Project_configureLintSynthesized = function _Project_configureLintSynthesized({ lintSynthesizedOptions }) {
63
+ new LintSynthesized(this, lintSynthesizedOptions ?? {
64
+ '*.{js,jsx,ts,tsx}': 'pnpm eslint --fix',
65
+ '*': 'pnpm prettier --write --ignore-unknown',
66
+ });
67
+ }, _Project_configureEditorConfig = function _Project_configureEditorConfig({ editorConfigOptions }) {
68
+ if (!editorConfigOptions) {
69
+ return;
70
+ }
71
+ const defaults = {
72
+ '*': {
73
+ // eslint-disable-next-line unicorn/text-encoding-identifier-case
74
+ charset: 'utf-8',
75
+ end_of_line: 'lf',
76
+ indent_style: 'space',
77
+ indent_size: 2,
78
+ insert_final_newline: true,
79
+ trim_trailing_whitespace: true,
80
+ },
81
+ Dockerfile: {
82
+ indent_style: 'tab',
83
+ },
84
+ };
85
+ new EditorConfig(this, deepMerge(editorConfigOptions ?? {}, defaults));
86
+ }, _Project_createPnpmWorkspaces = function _Project_createPnpmWorkspaces({ workspaces }) {
87
+ if (!workspaces) {
88
+ return;
89
+ }
90
+ new YamlFile(this, 'pnpm-workspace.yaml', {
91
+ readonly: true,
92
+ marker: true,
93
+ obj: {
94
+ packages: workspaces,
95
+ },
96
+ });
97
+ };
98
+ const getGitIgnoreOptions = ({ withTerraform, withTypeScript, ...options }) => ({
99
+ ...options.gitIgnoreOptions,
100
+ ignorePatterns: [
101
+ ...`
102
+ .*
103
+ !.babelrc
104
+ !.dockerignore
105
+ !.editorconfig
106
+ !.eslintignore
107
+ !.eslintrc.js
108
+ !.gitattributes
109
+ !.gitignore
110
+ !.gitkeep
111
+ !.husky
112
+ !.npmignore
113
+ !.openssl
114
+ !.prettierignore
115
+ !.projenrc*
116
+ ${withTerraform ? '!.terraform.lock.hcl' : ''}
117
+ *.db
118
+ *.log
119
+ ${withTypeScript ? '*.tsbuildinfo' : ''}
120
+
121
+ !.github/
122
+ !.husky/
123
+ !.projen/
124
+ ${options.workspaces?.map((workspace) => `${workspace}/lib/`).join('\n') ?? ''}
125
+ node_modules/
126
+ `
127
+ .split('\n')
128
+ .map((pattern) => pattern.trim())
129
+ .filter((pattern) => pattern.length > 0),
130
+ ...(options.gitIgnoreOptions?.ignorePatterns ?? []),
131
+ ],
132
+ });
133
+ const deepMerge = R.mergeDeepWith(R.concat);
134
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,OAAO,IAAI,WAAW,EAEtB,QAAQ,EACR,QAAQ,GACT,MAAM,QAAQ,CAAA;AAEf,OAAO,KAAK,CAAC,MAAM,OAAO,CAAA;AAG1B,OAAO,EACL,eAAe,GAEhB,MAAM,qCAAqC,CAAA;AAC5C,OAAO,EACL,YAAY,GAEb,MAAM,iCAAiC,CAAA;AAiCxC,MAAM,OAAO,OAAQ,SAAQ,WAAW;IACtC,YAAY,OAAuB;QACjC,KAAK,CAAC;YACJ,GAAG,OAAO;YACV,gBAAgB,EAAE,mBAAmB,CAAC,OAAO,CAAC;SAC/C,CAAC,CAAA;;QAEF,4CAA4C;QAC5C,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,CAAA;QAC9B,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,CAAA;QAChC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,CAAA;QAC9B,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,CAAA;QAChC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC,CAAA;QACrC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,CAAA;QACpC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,CAAA;QAE9B,uBAAA,IAAI,uDAAoB,MAAxB,IAAI,EAAqB,OAAO,CAAC,CAAA;QACjC,uBAAA,IAAI,yDAAsB,MAA1B,IAAI,CAAwB,CAAA;QAC5B,uBAAA,IAAI,0DAAuB,MAA3B,IAAI,EAAwB,OAAO,CAAC,CAAA;QACpC,uBAAA,IAAI,6DAA0B,MAA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AI,EAAE,CAAC;KACpD;CACF,CAAC,CAAA;AAEF,MAAM,SAAS,GAAG,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,19 +1,20 @@
1
1
  {
2
2
  "name": "@langri-sha/projen-project",
3
- "version": "0.2.0",
3
+ "version": "0.4.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
- "main": "src/index.ts",
6
+ "main": "dist/index.js",
7
7
  "dependencies": {
8
- "@langri-sha/projen-lint-synthesized": "0.1.0",
9
8
  "beachball": "2.43.1",
10
- "ramda": "0.29.1"
9
+ "ramda": "0.29.1",
10
+ "@langri-sha/projen-editorconfig": "0.3.0",
11
+ "@langri-sha/projen-lint-synthesized": "0.2.0"
11
12
  },
12
13
  "devDependencies": {
13
- "@langri-sha/jest-test": "0.2.0",
14
- "@langri-sha/tsconfig": "0.2.0",
15
14
  "@types/ramda": "0.29.12",
16
- "projen": "0.81.1"
15
+ "projen": "0.81.1",
16
+ "@langri-sha/jest-test": "0.7.0",
17
+ "@langri-sha/tsconfig": "0.9.0"
17
18
  },
18
19
  "peerDependencies": {
19
20
  "projen": "^0.81.1",
@@ -21,5 +22,7 @@
21
22
  },
22
23
  "publishConfig": {
23
24
  "access": "public"
24
- }
25
- }
25
+ },
26
+ "scripts": {},
27
+ "types": "dist/index.d.ts"
28
+ }
package/src/index.ts CHANGED
@@ -12,6 +12,10 @@ import {
12
12
  LintSynthesized,
13
13
  type LintSynthesizedOptions,
14
14
  } from '@langri-sha/projen-lint-synthesized'
15
+ import {
16
+ EditorConfig,
17
+ type EditorConfigOptions,
18
+ } from '@langri-sha/projen-editorconfig'
15
19
 
16
20
  export interface ProjectOptions extends BaseProjectOptions {
17
21
  /*
@@ -19,6 +23,11 @@ export interface ProjectOptions extends BaseProjectOptions {
19
23
  */
20
24
  beachballConfig?: BeachballConfig
21
25
 
26
+ /**
27
+ * EditorConfig options.
28
+ */
29
+ editorConfigOptions?: EditorConfigOptions
30
+
22
31
  /*
23
32
  * Options for the linting synthesized files.
24
33
  */
@@ -57,6 +66,7 @@ export class Project extends BaseProject {
57
66
 
58
67
  this.#configureBeachball(options)
59
68
  this.#configureDefaultTask()
69
+ this.#configureEditorConfig(options)
60
70
  this.#configureLintSynthesized(options)
61
71
  this.#createPnpmWorkspaces(options)
62
72
  }
@@ -107,6 +117,29 @@ export class Project extends BaseProject {
107
117
  )
108
118
  }
109
119
 
120
+ #configureEditorConfig({ editorConfigOptions }: ProjectOptions) {
121
+ if (!editorConfigOptions) {
122
+ return
123
+ }
124
+
125
+ const defaults: EditorConfigOptions = {
126
+ '*': {
127
+ // eslint-disable-next-line unicorn/text-encoding-identifier-case
128
+ charset: 'utf-8',
129
+ end_of_line: 'lf',
130
+ indent_style: 'space',
131
+ indent_size: 2,
132
+ insert_final_newline: true,
133
+ trim_trailing_whitespace: true,
134
+ },
135
+ Dockerfile: {
136
+ indent_style: 'tab',
137
+ },
138
+ }
139
+
140
+ new EditorConfig(this, deepMerge(editorConfigOptions ?? {}, defaults))
141
+ }
142
+
110
143
  #createPnpmWorkspaces({ workspaces }: ProjectOptions) {
111
144
  if (!workspaces) {
112
145
  return
@@ -152,8 +185,7 @@ const getGitIgnoreOptions = ({
152
185
  !.github/
153
186
  !.husky/
154
187
  !.projen/
155
- dist/
156
- local/
188
+ ${options.workspaces?.map((workspace) => `${workspace}/lib/`).join('\n') ?? ''}
157
189
  node_modules/
158
190
  `
159
191
  .split('\n')
@@ -1,329 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`defaults 1`] = `
4
- {
5
- ".gitignore": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".
6
- .*
7
- !.babelrc
8
- !.dockerignore
9
- !.editorconfig
10
- !.eslintignore
11
- !.eslintrc.js
12
- !.gitattributes
13
- !.gitignore
14
- !.gitkeep
15
- !.husky
16
- !.npmignore
17
- !.openssl
18
- !.prettierignore
19
- !.projenrc*
20
- *.db
21
- *.log
22
- !.github/
23
- !.husky/
24
- !.projen/
25
- dist/
26
- local/
27
- node_modules/
28
- !/.gitattributes
29
- !/.projen/tasks.json
30
- !/.projen/deps.json
31
- !/.projen/files.json
32
- ",
33
- ".projen/files.json": {
34
- "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".",
35
- "files": [
36
- ".gitattributes",
37
- ".gitignore",
38
- ".projen/deps.json",
39
- ".projen/files.json",
40
- ".projen/tasks.json",
41
- ],
42
- },
43
- ".projen/tasks.json": {
44
- "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".",
45
- "tasks": {
46
- "default": {
47
- "description": "Synthesize project files",
48
- "name": "default",
49
- "steps": [
50
- {
51
- "exec": "node --loader ts-node/esm .projenrc.mts",
52
- },
53
- ],
54
- },
55
- "test": {
56
- "description": "Run tests",
57
- "name": "test",
58
- },
59
- },
60
- },
61
- }
62
- `;
63
-
64
- exports[`with Beachball configuration 1`] = `
65
- {
66
- ".gitignore": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".
67
- .*
68
- !.babelrc
69
- !.dockerignore
70
- !.editorconfig
71
- !.eslintignore
72
- !.eslintrc.js
73
- !.gitattributes
74
- !.gitignore
75
- !.gitkeep
76
- !.husky
77
- !.npmignore
78
- !.openssl
79
- !.prettierignore
80
- !.projenrc*
81
- *.db
82
- *.log
83
- !.github/
84
- !.husky/
85
- !.projen/
86
- dist/
87
- local/
88
- node_modules/
89
- !/.gitattributes
90
- !/.projen/tasks.json
91
- !/.projen/deps.json
92
- !/.projen/files.json
93
- !/beachball.config.js
94
- ",
95
- ".projen/files.json": {
96
- "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".",
97
- "files": [
98
- ".gitattributes",
99
- ".gitignore",
100
- ".projen/deps.json",
101
- ".projen/files.json",
102
- ".projen/tasks.json",
103
- "beachball.config.js",
104
- ],
105
- },
106
- ".projen/tasks.json": {
107
- "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".",
108
- "tasks": {
109
- "default": {
110
- "description": "Synthesize project files",
111
- "name": "default",
112
- "steps": [
113
- {
114
- "exec": "node --loader ts-node/esm .projenrc.mts",
115
- },
116
- ],
117
- },
118
- "test": {
119
- "description": "Run tests",
120
- "name": "test",
121
- },
122
- },
123
- },
124
- "beachball.config.js": "/** @type {import('beachball').BeachballConfig} */
125
- module.exports = {
126
- "branch": "origin/main",
127
- "gitTags": false,
128
- "ignorePatterns": [
129
- "*.test.*",
130
- ".*/**",
131
- "__snapshots__/",
132
- "dist/",
133
- "node_modules/"
134
- ]
135
- }",
136
- }
137
- `;
138
-
139
- exports[`with Terraform enabled 1`] = `
140
- {
141
- ".gitignore": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".
142
- .*
143
- !.babelrc
144
- !.dockerignore
145
- !.editorconfig
146
- !.eslintignore
147
- !.eslintrc.js
148
- !.gitattributes
149
- !.gitignore
150
- !.gitkeep
151
- !.husky
152
- !.npmignore
153
- !.openssl
154
- !.prettierignore
155
- !.projenrc*
156
- !.terraform.lock.hcl
157
- *.db
158
- *.log
159
- !.github/
160
- !.husky/
161
- !.projen/
162
- dist/
163
- local/
164
- node_modules/
165
- !/.gitattributes
166
- !/.projen/tasks.json
167
- !/.projen/deps.json
168
- !/.projen/files.json
169
- ",
170
- ".projen/files.json": {
171
- "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".",
172
- "files": [
173
- ".gitattributes",
174
- ".gitignore",
175
- ".projen/deps.json",
176
- ".projen/files.json",
177
- ".projen/tasks.json",
178
- ],
179
- },
180
- ".projen/tasks.json": {
181
- "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".",
182
- "tasks": {
183
- "default": {
184
- "description": "Synthesize project files",
185
- "name": "default",
186
- "steps": [
187
- {
188
- "exec": "node --loader ts-node/esm .projenrc.mts",
189
- },
190
- ],
191
- },
192
- "test": {
193
- "description": "Run tests",
194
- "name": "test",
195
- },
196
- },
197
- },
198
- }
199
- `;
200
-
201
- exports[`with TypeScript enabled 1`] = `
202
- {
203
- ".gitignore": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".
204
- .*
205
- !.babelrc
206
- !.dockerignore
207
- !.editorconfig
208
- !.eslintignore
209
- !.eslintrc.js
210
- !.gitattributes
211
- !.gitignore
212
- !.gitkeep
213
- !.husky
214
- !.npmignore
215
- !.openssl
216
- !.prettierignore
217
- !.projenrc*
218
- *.db
219
- *.log
220
- *.tsbuildinfo
221
- !.github/
222
- !.husky/
223
- !.projen/
224
- dist/
225
- local/
226
- node_modules/
227
- !/.gitattributes
228
- !/.projen/tasks.json
229
- !/.projen/deps.json
230
- !/.projen/files.json
231
- ",
232
- ".projen/files.json": {
233
- "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".",
234
- "files": [
235
- ".gitattributes",
236
- ".gitignore",
237
- ".projen/deps.json",
238
- ".projen/files.json",
239
- ".projen/tasks.json",
240
- ],
241
- },
242
- ".projen/tasks.json": {
243
- "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".",
244
- "tasks": {
245
- "default": {
246
- "description": "Synthesize project files",
247
- "name": "default",
248
- "steps": [
249
- {
250
- "exec": "node --loader ts-node/esm .projenrc.mts",
251
- },
252
- ],
253
- },
254
- "test": {
255
- "description": "Run tests",
256
- "name": "test",
257
- },
258
- },
259
- },
260
- }
261
- `;
262
-
263
- exports[`with workspaces 1`] = `
264
- {
265
- ".gitignore": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".
266
- .*
267
- !.babelrc
268
- !.dockerignore
269
- !.editorconfig
270
- !.eslintignore
271
- !.eslintrc.js
272
- !.gitattributes
273
- !.gitignore
274
- !.gitkeep
275
- !.husky
276
- !.npmignore
277
- !.openssl
278
- !.prettierignore
279
- !.projenrc*
280
- *.db
281
- *.log
282
- !.github/
283
- !.husky/
284
- !.projen/
285
- dist/
286
- local/
287
- node_modules/
288
- !/.gitattributes
289
- !/.projen/tasks.json
290
- !/.projen/deps.json
291
- !/.projen/files.json
292
- !/pnpm-workspace.yaml
293
- ",
294
- ".projen/files.json": {
295
- "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".",
296
- "files": [
297
- ".gitattributes",
298
- ".gitignore",
299
- ".projen/deps.json",
300
- ".projen/files.json",
301
- ".projen/tasks.json",
302
- "pnpm-workspace.yaml",
303
- ],
304
- },
305
- ".projen/tasks.json": {
306
- "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".",
307
- "tasks": {
308
- "default": {
309
- "description": "Synthesize project files",
310
- "name": "default",
311
- "steps": [
312
- {
313
- "exec": "node --loader ts-node/esm .projenrc.mts",
314
- },
315
- ],
316
- },
317
- "test": {
318
- "description": "Run tests",
319
- "name": "test",
320
- },
321
- },
322
- },
323
- "pnpm-workspace.yaml": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".
324
-
325
- packages:
326
- - packages/*
327
- ",
328
- }
329
- `;
package/src/index.test.ts DELETED
@@ -1,48 +0,0 @@
1
- import { synthSnapshot } from 'projen/lib/util/synth'
2
- import { expect, test } from '@langri-sha/jest-test'
3
-
4
- import { Project } from './index'
5
-
6
- test('defaults', () => {
7
- const project = new Project({
8
- name: 'test-project',
9
- })
10
-
11
- expect(synthSnapshot(project)).toMatchSnapshot()
12
- })
13
-
14
- test('with Beachball configuration', () => {
15
- const project = new Project({
16
- name: 'test-project',
17
- beachballConfig: {},
18
- })
19
-
20
- expect(synthSnapshot(project)).toMatchSnapshot()
21
- })
22
-
23
- test('with Terraform enabled', () => {
24
- const project = new Project({
25
- name: 'test-project',
26
- withTerraform: true,
27
- })
28
-
29
- expect(synthSnapshot(project)).toMatchSnapshot()
30
- })
31
-
32
- test('with TypeScript enabled', () => {
33
- const project = new Project({
34
- name: 'test-project',
35
- withTypeScript: true,
36
- })
37
-
38
- expect(synthSnapshot(project)).toMatchSnapshot()
39
- })
40
-
41
- test('with workspaces', () => {
42
- const project = new Project({
43
- name: 'test-project',
44
- workspaces: ['packages/*'],
45
- })
46
-
47
- expect(synthSnapshot(project)).toMatchSnapshot()
48
- })
package/tsconfig.json DELETED
@@ -1,13 +0,0 @@
1
- {
2
- "$schema": "https://json.schemastore.org/tsconfig",
3
- "extends": "@langri-sha/tsconfig/project.json",
4
- "compilerOptions": {
5
- "baseUrl": ".",
6
- "outDir": ".tsbuild"
7
- },
8
- "references": [
9
- { "path": "../jest-test" },
10
- { "path": "../projen-lint-synthesized" },
11
- { "path": "../tsconfig" }
12
- ]
13
- }