@vidavidorra/create-project 2.0.24 → 2.0.26

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.
@@ -221,5 +221,6 @@ declare class Package extends File {
221
221
  } | undefined;
222
222
  };
223
223
  process(): this;
224
+ private get gitHubUrl();
224
225
  }
225
226
  export { Package, type PackageJson };
@@ -73,6 +73,9 @@ class Package extends File {
73
73
  this._package.name = this._options.package;
74
74
  this._package.version = '0.1.0';
75
75
  this._package.description = this._options.description;
76
+ this._package.homepage = `${this.gitHubUrl}#readme`;
77
+ this._package.bugs.url = `${this.gitHubUrl}/issues`;
78
+ this._package.repository.url = `git+${this.gitHubUrl}.git`;
76
79
  this._package.author = this._options.author;
77
80
  this._package.devDependencies = {
78
81
  ...this._package.devDependencies,
@@ -128,6 +131,10 @@ class Package extends File {
128
131
  this._content = JSON.stringify(this._package, undefined, 2);
129
132
  return this;
130
133
  }
134
+ get gitHubUrl() {
135
+ const { githubOwner, githubRepository } = this._options;
136
+ return `https://github.com/${githubOwner}/${githubRepository}`;
137
+ }
131
138
  }
132
139
  export { Package };
133
140
  //# sourceMappingURL=package.js.map
@@ -122,7 +122,7 @@ class Readme extends File {
122
122
  }
123
123
  gitHubUrl(path, repository) {
124
124
  const { githubOwner: owner, githubRepository } = this._options;
125
- return new URL(path, `https://github.com/${`${owner}/${repository ?? githubRepository}`}/`).toString();
125
+ return new URL(path, `https://github.com/${owner}/${repository ?? githubRepository}/`).toString();
126
126
  }
127
127
  }
128
128
  export { Readme };
package/dist/options.js CHANGED
@@ -4,11 +4,11 @@ import validatePackageName from 'validate-npm-package-name';
4
4
  const schema = z
5
5
  .object({
6
6
  project: z.string().min(1),
7
- package: z.string().superRefine((value, ctx) => {
7
+ package: z.string().superRefine((value, context) => {
8
8
  const { validForNewPackages, errors, warnings } = validatePackageName(value);
9
9
  if (!validForNewPackages) {
10
10
  for (const message of [...(errors ?? []), ...(warnings ?? [])]) {
11
- ctx.addIssue({ code: z.ZodIssueCode.custom, message });
11
+ context.addIssue({ code: z.ZodIssueCode.custom, message });
12
12
  }
13
13
  }
14
14
  }),
@@ -23,11 +23,11 @@ const schema = z
23
23
  path: z
24
24
  .string()
25
25
  .min(1)
26
- .superRefine((value, ctx) => {
26
+ .superRefine((value, context) => {
27
27
  const exists = fs.existsSync(value);
28
28
  if (exists) {
29
29
  if (!fs.statSync(value).isDirectory()) {
30
- ctx.addIssue({
30
+ context.addIssue({
31
31
  code: z.ZodIssueCode.custom,
32
32
  message: 'Expected an empty directory, received a file.',
33
33
  });
@@ -35,7 +35,7 @@ const schema = z
35
35
  }
36
36
  const { files } = fs.statfsSync(value);
37
37
  if (files !== 0) {
38
- ctx.addIssue({
38
+ context.addIssue({
39
39
  code: z.ZodIssueCode.custom,
40
40
  message: [
41
41
  'Expected an empty directory, received a directory with',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vidavidorra/create-project",
3
- "version": "2.0.24",
3
+ "version": "2.0.26",
4
4
  "private": false,
5
5
  "description": "Interactively create a GitHub project",
6
6
  "keywords": [
@@ -225,7 +225,7 @@
225
225
  "lint-staged": "15.2.2",
226
226
  "semantic-release": "23.0.2",
227
227
  "sinon": "17.0.1",
228
- "xo": "0.56.0"
228
+ "xo": "0.57.0"
229
229
  },
230
230
  "engines": {
231
231
  "node": ">=18"