aberlaas-init 2.22.2 → 2.23.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/lib/helper.js CHANGED
@@ -217,7 +217,6 @@ export const __ = {
217
217
 
218
218
  // Named exports of public methods, but wrapped in dynamic method so we can
219
219
  // still mock the inner methods in tests
220
- //
221
220
  export const addConfigFiles = wrap(__, 'addConfigFiles');
222
221
  export const addDefaultScripts = wrap(__, 'addDefaultScripts');
223
222
  export const addDocsScripts = wrap(__, 'addDocsScripts');
@@ -16,8 +16,8 @@ import {
16
16
  import { __ as initHelper } from '../../helper.js';
17
17
  import { __, run } from '../libdocs.js';
18
18
 
19
- describe('init > libdocs', () => {
20
- const testDirectory = tmpDirectory('aberlaas/init/libdocs');
19
+ describe('init/libdocs', () => {
20
+ const testDirectory = tmpDirectory(`aberlaas/${describeName}`);
21
21
  beforeEach(async () => {
22
22
  mockHelperPaths(testDirectory);
23
23
 
@@ -43,7 +43,10 @@ describe('init > libdocs', () => {
43
43
  name: 'my-project-root',
44
44
  author: 'my-name',
45
45
  description: 'my-project root workspace',
46
- repository: 'my-name/my-project',
46
+ repository: {
47
+ type: 'git',
48
+ url: 'https://github.com/my-name/my-project',
49
+ },
47
50
  homepage: 'https://projects.pixelastic.com/my-project',
48
51
  license: 'MIT',
49
52
  },
@@ -55,7 +58,6 @@ describe('init > libdocs', () => {
55
58
  workspaces: ['docs', 'lib'],
56
59
  type: 'module',
57
60
  packageManager: `yarn@${yarnVersion}`,
58
- dependencies: {},
59
61
  devDependencies: {
60
62
  aberlaas: '1.2.3',
61
63
  },
@@ -83,7 +85,10 @@ describe('init > libdocs', () => {
83
85
  version: '0.0.1',
84
86
  author: 'my-name',
85
87
  description: 'my-project docs',
86
- repository: 'my-name/my-project',
88
+ repository: {
89
+ type: 'git',
90
+ url: 'https://github.com/my-name/my-project',
91
+ },
87
92
  homepage: 'https://projects.pixelastic.com/my-project',
88
93
  license: 'MIT',
89
94
  },
@@ -92,7 +97,6 @@ describe('init > libdocs', () => {
92
97
  'should have docs specific data',
93
98
  {
94
99
  private: true,
95
- devDependencies: {},
96
100
  dependencies: {
97
101
  norska: norskaVersion,
98
102
  'norska-theme-docs': norskaThemeDocsVersion,
@@ -120,9 +124,12 @@ describe('init > libdocs', () => {
120
124
  name: 'my-project',
121
125
  version: '0.0.1',
122
126
  author: 'my-name',
123
- description: '',
124
- keywords: [],
125
- repository: 'my-name/my-project',
127
+ description: 'my-project module',
128
+ keywords: ['my-project'],
129
+ repository: {
130
+ type: 'git',
131
+ url: 'https://github.com/my-name/my-project',
132
+ },
126
133
  homepage: 'https://projects.pixelastic.com/my-project',
127
134
  license: 'MIT',
128
135
  },
@@ -130,7 +137,6 @@ describe('init > libdocs', () => {
130
137
  [
131
138
  'should have lib specific data',
132
139
  {
133
- private: false,
134
140
  type: 'module',
135
141
  sideEffects: false,
136
142
  engines: {
@@ -143,9 +149,6 @@ describe('init > libdocs', () => {
143
149
  // .main field for backward compatibility
144
150
  main: './main.js',
145
151
 
146
- devDependencies: {},
147
- dependencies: {},
148
-
149
152
  scripts: {
150
153
  build: 'cd .. && ./scripts/build',
151
154
  release: 'cd .. && ./scripts/release',
@@ -171,8 +174,7 @@ describe('init > libdocs', () => {
171
174
  });
172
175
  });
173
176
 
174
- describe('run', () => {
175
- vi.setConfig({ testTimeout: 10_000 });
177
+ describe.slow('run', () => {
176
178
  it('should build a libdocs structure', async () => {
177
179
  await run();
178
180
 
@@ -4,8 +4,8 @@ import { nodeVersion, yarnVersion } from 'aberlaas-versions';
4
4
  import { __ as initHelper } from '../../helper.js';
5
5
  import { __, run } from '../module.js';
6
6
 
7
- describe('init > module', () => {
8
- const testDirectory = tmpDirectory('aberlaas/init/module');
7
+ describe('init/module', () => {
8
+ const testDirectory = tmpDirectory(`aberlaas/${describeName}`);
9
9
  beforeEach(async () => {
10
10
  mockHelperPaths(testDirectory);
11
11
 
@@ -30,9 +30,12 @@ describe('init > module', () => {
30
30
  name: 'my-project',
31
31
  version: '0.0.1',
32
32
  author: 'my-name',
33
- description: '',
34
- keywords: [],
35
- repository: 'my-name/my-project',
33
+ description: 'my-project module',
34
+ keywords: ['my-project'],
35
+ repository: {
36
+ type: 'git',
37
+ url: 'https://github.com/my-name/my-project',
38
+ },
36
39
  homepage: 'https://github.com/my-name/my-project',
37
40
  },
38
41
  ],
@@ -16,8 +16,8 @@ import {
16
16
  import { __ as initHelper } from '../../helper.js';
17
17
  import { __, run } from '../monorepo.js';
18
18
 
19
- describe('init > monorepo', () => {
20
- const testDirectory = tmpDirectory('aberlaas/init/monorepo');
19
+ describe('init/monorepo', () => {
20
+ const testDirectory = tmpDirectory(`aberlaas/${describeName}`);
21
21
  beforeEach(async () => {
22
22
  mockHelperPaths(testDirectory);
23
23
 
@@ -43,7 +43,10 @@ describe('init > monorepo', () => {
43
43
  name: 'my-project-monorepo',
44
44
  author: 'my-name',
45
45
  description: 'my-project monorepo',
46
- repository: 'my-name/my-project',
46
+ repository: {
47
+ type: 'git',
48
+ url: 'https://github.com/my-name/my-project',
49
+ },
47
50
  homepage: 'https://projects.pixelastic.com/my-project',
48
51
  license: 'MIT',
49
52
  },
@@ -55,7 +58,6 @@ describe('init > monorepo', () => {
55
58
  workspaces: ['modules/*'],
56
59
  type: 'module',
57
60
  packageManager: `yarn@${yarnVersion}`,
58
- dependencies: {},
59
61
  devDependencies: {
60
62
  aberlaas: '1.2.3',
61
63
  },
@@ -83,7 +85,10 @@ describe('init > monorepo', () => {
83
85
  version: '0.0.1',
84
86
  author: 'my-name',
85
87
  description: 'my-project docs',
86
- repository: 'my-name/my-project',
88
+ repository: {
89
+ type: 'git',
90
+ url: 'https://github.com/my-name/my-project',
91
+ },
87
92
  homepage: 'https://projects.pixelastic.com/my-project',
88
93
  license: 'MIT',
89
94
  },
@@ -92,7 +97,6 @@ describe('init > monorepo', () => {
92
97
  'should have docs specific data',
93
98
  {
94
99
  private: true,
95
- devDependencies: {},
96
100
  dependencies: {
97
101
  norska: norskaVersion,
98
102
  'norska-theme-docs': norskaThemeDocsVersion,
@@ -120,9 +124,12 @@ describe('init > monorepo', () => {
120
124
  name: 'my-project',
121
125
  version: '0.0.1',
122
126
  author: 'my-name',
123
- description: '',
124
- keywords: [],
125
- repository: 'my-name/my-project',
127
+ description: 'my-project module',
128
+ keywords: ['my-project'],
129
+ repository: {
130
+ type: 'git',
131
+ url: 'https://github.com/my-name/my-project',
132
+ },
126
133
  homepage: 'https://projects.pixelastic.com/my-project',
127
134
  license: 'MIT',
128
135
  },
@@ -130,7 +137,6 @@ describe('init > monorepo', () => {
130
137
  [
131
138
  'should have lib specific data',
132
139
  {
133
- private: false,
134
140
  type: 'module',
135
141
  sideEffects: false,
136
142
  engines: {
@@ -143,9 +149,6 @@ describe('init > monorepo', () => {
143
149
  // .main field for backward compatibility
144
150
  main: './main.js',
145
151
 
146
- devDependencies: {},
147
- dependencies: {},
148
-
149
152
  scripts: {
150
153
  build: 'cd ../.. && ./scripts/build',
151
154
  release: 'cd ../.. && ./scripts/release',
@@ -53,44 +53,40 @@ __ = {
53
53
  // Name and version
54
54
  name: `${sharedProjectData.name}-root`,
55
55
 
56
- // Visibility
56
+ // Dev info
57
57
  private: true,
58
+ type: 'module',
58
59
  workspaces: ['docs', 'lib'],
59
60
 
60
61
  // Metadata
61
- author: sharedProjectData.author,
62
62
  description: `${sharedProjectData.name} root workspace`,
63
- repository: sharedProjectData.repository,
63
+ author: sharedProjectData.author,
64
64
  homepage: sharedProjectData.homepage,
65
+ repository: sharedProjectData.repository,
65
66
 
66
67
  // Compatibility
67
- type: 'module',
68
68
  license: sharedProjectData.license,
69
69
  engines,
70
70
  packageManager: `yarn@${yarnVersion}`,
71
71
 
72
72
  // Dependencies
73
- dependencies: {},
74
73
  devDependencies: {
75
74
  aberlaas: aberlaasVersion,
76
75
  },
77
76
 
78
77
  // Scripts
79
78
  scripts: {
80
- // Docs
81
79
  build: './scripts/build',
82
80
  'build:prod': './scripts/build-prod',
83
- cms: './scripts/cms',
84
- serve: './scripts/serve',
85
-
86
- // Lib
87
- release: './scripts/release',
88
- test: './scripts/test',
89
- 'test:watch': './scripts/test-watch',
90
81
  ci: './scripts/ci',
82
+ cms: './scripts/cms',
91
83
  compress: './scripts/compress',
92
84
  lint: './scripts/lint',
93
85
  'lint:fix': './scripts/lint-fix',
86
+ release: './scripts/release',
87
+ serve: './scripts/serve',
88
+ test: './scripts/test',
89
+ 'test:watch': './scripts/test-watch',
94
90
  },
95
91
  };
96
92
  await writeJson(packageContent, hostGitPath('./package.json'), {
@@ -109,14 +105,15 @@ __ = {
109
105
  name: `${sharedProjectData.name}-docs`,
110
106
  version: '0.0.1',
111
107
 
112
- // Visibility
108
+ // Dev info
113
109
  private: true,
110
+ type: 'commonjs',
114
111
 
115
112
  // Metadata
116
- author: sharedProjectData.author,
117
113
  description: `${sharedProjectData.name} docs`,
118
- repository: sharedProjectData.repository,
114
+ author: sharedProjectData.author,
119
115
  homepage: sharedProjectData.homepage,
116
+ repository: sharedProjectData.repository,
120
117
 
121
118
  // Compatibility
122
119
  license: sharedProjectData.license,
@@ -126,7 +123,6 @@ __ = {
126
123
  norska: norskaVersion,
127
124
  'norska-theme-docs': norskaThemeDocsVersion,
128
125
  },
129
- devDependencies: {},
130
126
 
131
127
  // Scripts
132
128
  scripts: sharedProjectData.scripts,
@@ -141,6 +137,7 @@ __ = {
141
137
  */
142
138
  async createLibWorkspace() {
143
139
  const sharedProjectData = await __.getSharedProjectData();
140
+ const projectName = sharedProjectData.name;
144
141
  const engines = {
145
142
  node: `>=${nodeVersion}`,
146
143
  };
@@ -150,18 +147,17 @@ __ = {
150
147
  name: sharedProjectData.name,
151
148
  version: '0.0.1',
152
149
 
153
- // Visibility
154
- private: false,
150
+ // Dev info
151
+ type: 'module',
155
152
 
156
153
  // Metadata
154
+ description: `${projectName} module`,
157
155
  author: sharedProjectData.author,
158
- description: '',
159
- keywords: [],
160
- repository: sharedProjectData.repository,
161
156
  homepage: sharedProjectData.homepage,
157
+ keywords: [projectName],
158
+ repository: sharedProjectData.repository,
162
159
 
163
160
  // Compatibility
164
- type: 'module',
165
161
  sideEffects: false,
166
162
  license: sharedProjectData.license,
167
163
  engines,
@@ -173,10 +169,6 @@ __ = {
173
169
  },
174
170
  main: './main.js',
175
171
 
176
- // Dependencies
177
- dependencies: {},
178
- devDependencies: {},
179
-
180
172
  // Scripts
181
173
  scripts: sharedProjectData.scripts,
182
174
  };
@@ -203,20 +195,23 @@ __ = {
203
195
  const name = await getProjectName();
204
196
  const author = await getProjectAuthor();
205
197
  const homepage = `https://projects.pixelastic.com/${name}`;
206
- const repository = `${author}/${name}`;
198
+ const repository = {
199
+ type: 'git',
200
+ url: `https://github.com/${author}/${name}`,
201
+ };
207
202
  const license = 'MIT';
208
203
  const scripts = {
209
204
  build: 'cd .. && ./scripts/build',
210
205
  'build:prod': 'cd .. && ./scripts/build-prod',
211
- cms: 'cd .. && ./scripts/cms',
212
- serve: 'cd .. && ./scripts/serve',
213
206
  ci: 'cd .. && ./scripts/ci',
214
- release: 'cd .. && ./scripts/release',
215
- test: 'cd .. && ./scripts/test',
216
- 'test:watch': 'cd .. && ./scripts/test-watch',
207
+ cms: 'cd .. && ./scripts/cms',
217
208
  compress: 'cd .. && ./scripts/compress',
218
209
  lint: 'cd .. && ./scripts/lint',
219
210
  'lint:fix': 'cd .. && ./scripts/lint-fix',
211
+ release: 'cd .. && ./scripts/release',
212
+ serve: 'cd .. && ./scripts/serve',
213
+ test: 'cd .. && ./scripts/test',
214
+ 'test:watch': 'cd .. && ./scripts/test-watch',
220
215
  };
221
216
  return {
222
217
  author,
@@ -32,16 +32,21 @@ __ = {
32
32
  */
33
33
  async createPackageJson() {
34
34
  const aberlaasVersion = await getAberlaasVersion();
35
+
35
36
  const name = await getProjectName();
36
37
  const version = '0.0.1';
37
38
 
39
+ const type = 'module';
40
+
41
+ const description = `${name} module`;
38
42
  const author = await getProjectAuthor();
39
- const description = '';
40
- const keywords = [];
41
- const repository = `${author}/${name}`;
42
- const homepage = `https://github.com/${repository}`;
43
+ const homepage = `https://github.com/${author}/${name}`;
44
+ const keywords = [name];
45
+ const repository = {
46
+ type: 'git',
47
+ url: homepage,
48
+ };
43
49
 
44
- const type = 'module';
45
50
  const sideEffects = false;
46
51
  const license = 'MIT';
47
52
  const engines = {
@@ -65,9 +70,9 @@ __ = {
65
70
  compress: './scripts/compress',
66
71
  lint: './scripts/lint',
67
72
  'lint:fix': './scripts/lint-fix',
73
+ release: './scripts/release',
68
74
  test: './scripts/test',
69
75
  'test:watch': './scripts/test-watch',
70
- release: './scripts/release',
71
76
  };
72
77
 
73
78
  const packageContent = {
@@ -75,15 +80,17 @@ __ = {
75
80
  name,
76
81
  version,
77
82
 
83
+ // Dev info
84
+ type,
85
+
78
86
  // Metadata
79
- author,
80
87
  description,
88
+ author,
89
+ homepage,
81
90
  keywords,
82
91
  repository,
83
- homepage,
84
92
 
85
93
  // Compatibility
86
- type,
87
94
  sideEffects,
88
95
  license,
89
96
  engines,
@@ -55,44 +55,39 @@ __ = {
55
55
  // Name and version
56
56
  name: `${sharedProjectData.name}-monorepo`,
57
57
 
58
- // Visibility
58
+ // Dev info
59
59
  private: true,
60
+ type: 'module',
60
61
  workspaces: ['modules/*'],
61
62
 
62
63
  // Metadata
63
- author: sharedProjectData.author,
64
64
  description: `${sharedProjectData.name} monorepo`,
65
- repository: sharedProjectData.repository,
65
+ author: sharedProjectData.author,
66
66
  homepage: sharedProjectData.homepage,
67
+ repository: sharedProjectData.repository,
67
68
 
68
69
  // Compatibility
69
- type: 'module',
70
70
  license: sharedProjectData.license,
71
71
  engines,
72
72
  packageManager: `yarn@${yarnVersion}`,
73
73
 
74
74
  // Dependencies
75
- dependencies: {},
76
75
  devDependencies: {
77
76
  aberlaas: aberlaasVersion,
78
77
  },
79
78
 
80
79
  // Scripts
81
80
  scripts: {
82
- // Docs
83
81
  build: './scripts/build',
84
82
  'build:prod': './scripts/build-prod',
85
83
  cms: './scripts/cms',
86
- serve: './scripts/serve',
87
-
88
- // Lib
89
- release: './scripts/release',
90
- test: './scripts/test',
91
- 'test:watch': './scripts/test-watch',
92
- ci: './scripts/ci',
93
84
  compress: './scripts/compress',
94
85
  lint: './scripts/lint',
95
86
  'lint:fix': './scripts/lint-fix',
87
+ release: './scripts/release',
88
+ serve: './scripts/serve',
89
+ test: './scripts/test',
90
+ 'test:watch': './scripts/test-watch',
96
91
  },
97
92
  };
98
93
  await writeJson(packageContent, hostGitPath('./package.json'), {
@@ -111,17 +106,17 @@ __ = {
111
106
  name: `${sharedProjectData.name}-docs`,
112
107
  version: '0.0.1',
113
108
 
114
- // Visibility
109
+ // Dev info
115
110
  private: true,
111
+ type: 'commonjs',
116
112
 
117
113
  // Metadata
118
- author: sharedProjectData.author,
119
114
  description: `${sharedProjectData.name} docs`,
120
- repository: sharedProjectData.repository,
115
+ author: sharedProjectData.author,
121
116
  homepage: sharedProjectData.homepage,
117
+ repository: sharedProjectData.repository,
122
118
 
123
119
  // Compatibility
124
- // "type": "module", // TODO: Uncomment once norska is ESM-compliant
125
120
  license: sharedProjectData.license,
126
121
 
127
122
  // Dependencies
@@ -129,7 +124,6 @@ __ = {
129
124
  norska: norskaVersion,
130
125
  'norska-theme-docs': norskaThemeDocsVersion,
131
126
  },
132
- devDependencies: {},
133
127
 
134
128
  // Scripts
135
129
  scripts: sharedProjectData.scripts,
@@ -148,6 +142,7 @@ __ = {
148
142
  */
149
143
  async createLibWorkspace() {
150
144
  const sharedProjectData = await __.getSharedProjectData();
145
+ const projectName = sharedProjectData.name;
151
146
  const engines = {
152
147
  node: `>=${nodeVersion}`,
153
148
  };
@@ -157,18 +152,17 @@ __ = {
157
152
  name: sharedProjectData.name,
158
153
  version: '0.0.1',
159
154
 
160
- // Visibility
161
- private: false,
155
+ // Dev info
156
+ type: 'module',
162
157
 
163
158
  // Metadata
159
+ description: `${projectName} module`,
164
160
  author: sharedProjectData.author,
165
- description: '',
166
- keywords: [],
167
- repository: sharedProjectData.repository,
168
161
  homepage: sharedProjectData.homepage,
162
+ keywords: [projectName],
163
+ repository: sharedProjectData.repository,
169
164
 
170
165
  // Compatibility
171
- type: 'module',
172
166
  sideEffects: false,
173
167
  license: sharedProjectData.license,
174
168
  engines,
@@ -180,10 +174,6 @@ __ = {
180
174
  },
181
175
  main: './main.js',
182
176
 
183
- // Dependencies
184
- dependencies: {},
185
- devDependencies: {},
186
-
187
177
  // Scripts
188
178
  scripts: sharedProjectData.scripts,
189
179
  };
@@ -210,20 +200,23 @@ __ = {
210
200
  const name = await getProjectName();
211
201
  const author = await getProjectAuthor();
212
202
  const homepage = `https://projects.pixelastic.com/${name}`;
213
- const repository = `${author}/${name}`;
203
+ const repository = {
204
+ type: 'git',
205
+ url: `https://github.com/${author}/${name}`,
206
+ };
214
207
  const license = 'MIT';
215
208
  const scripts = {
216
209
  build: 'cd ../.. && ./scripts/build',
217
210
  'build:prod': 'cd ../.. && ./scripts/build-prod',
218
- cms: 'cd ../.. && ./scripts/cms',
219
- serve: 'cd ../.. && ./scripts/serve',
220
211
  ci: 'cd ../.. && ./scripts/ci',
221
- release: 'cd ../.. && ./scripts/release',
222
- test: 'cd ../.. && ./scripts/test',
223
- 'test:watch': 'cd ../.. && ./scripts/test-watch',
212
+ cms: 'cd ../.. && ./scripts/cms',
224
213
  compress: 'cd ../.. && ./scripts/compress',
225
214
  lint: 'cd ../.. && ./scripts/lint',
226
215
  'lint:fix': 'cd ../.. && ./scripts/lint-fix',
216
+ release: 'cd ../.. && ./scripts/release',
217
+ serve: 'cd ../.. && ./scripts/serve',
218
+ test: 'cd ../.. && ./scripts/test',
219
+ 'test:watch': 'cd ../.. && ./scripts/test-watch',
227
220
  };
228
221
  return {
229
222
  author,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aberlaas-init",
3
- "version": "2.22.2",
3
+ "version": "2.23.0",
4
4
  "type": "module",
5
5
  "description": "aberlaas init command: Setup the repository with all needed config",
6
6
  "author": "Tim Carry <tim@pixelastic.com>",
@@ -23,13 +23,13 @@
23
23
  "templates/scripts/ci",
24
24
  "templates/scripts/cms",
25
25
  "templates/scripts/compress",
26
+ "templates/scripts/hooks/pre-commit",
26
27
  "templates/scripts/lint",
27
28
  "templates/scripts/lint-fix",
28
29
  "templates/scripts/release",
29
30
  "templates/scripts/serve",
30
31
  "templates/scripts/test",
31
- "templates/scripts/test-watch",
32
- "templates/scripts/hooks/pre-commit"
32
+ "templates/scripts/test-watch"
33
33
  ]
34
34
  },
35
35
  "exports": {
@@ -37,9 +37,9 @@
37
37
  },
38
38
  "main": "./lib/main.js",
39
39
  "dependencies": {
40
- "aberlaas-helper": "2.22.2",
41
- "aberlaas-versions": "2.22.2",
42
- "firost": "5.5.1",
40
+ "aberlaas-helper": "2.23.0",
41
+ "aberlaas-versions": "2.23.0",
42
+ "firost": "5.5.2",
43
43
  "gilmore": "1.2.0",
44
44
  "golgoth": "3.1.0"
45
45
  },
@@ -1,4 +1,5 @@
1
1
  # Important files that should not be committed
2
+ .env
2
3
  .envrc
3
4
 
4
5
  # Build directories