@vidavidorra/create-project 2.0.16 → 2.0.17-beta.1

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.
@@ -2,6 +2,7 @@ import { type Options } from '../options.js';
2
2
  type FileOptions = {
3
3
  mode: number;
4
4
  format: boolean;
5
+ read: boolean;
5
6
  };
6
7
  declare class File {
7
8
  readonly path: string;
@@ -10,8 +10,10 @@ class File {
10
10
  constructor(path, options) {
11
11
  this.path = path;
12
12
  this._directory = dirname(path);
13
- this._options = { mode: 0o644, format: false, ...options };
14
- this._content = fs.readFileSync(join(rootPath, path), 'utf8');
13
+ this._options = { mode: 0o644, format: false, read: true, ...options };
14
+ this._content = this._options.read
15
+ ? fs.readFileSync(join(rootPath, path), 'utf8')
16
+ : '';
15
17
  }
16
18
  get options() {
17
19
  return structuredClone(this._options);
@@ -1,6 +1,7 @@
1
1
  import { CiCd } from './ci-cd.js';
2
2
  import { File } from './file.js';
3
3
  import { LintStaged } from './lint-staged.js';
4
+ import { Npmrc } from './npmrc.js';
4
5
  import { Package } from './package.js';
5
6
  import { Readme } from './readme/index.js';
6
7
  import { TsConfig } from './ts-config.js';
@@ -13,7 +14,7 @@ function files(options) {
13
14
  new File('.github/renovate.json', options),
14
15
  new File('.editorconfig', options),
15
16
  new File('.gitignore', options),
16
- new File('.npmrc', options),
17
+ new Npmrc('.npmrc', options),
17
18
  new File('LICENSE.md', options),
18
19
  new Package('package.json', options),
19
20
  new Readme('README.md', options),
@@ -0,0 +1,7 @@
1
+ import { type Options } from '../options.js';
2
+ import { File } from './file.js';
3
+ declare class Npmrc extends File {
4
+ constructor(path: string, options: Options);
5
+ process(): this;
6
+ }
7
+ export { Npmrc };
@@ -0,0 +1,12 @@
1
+ import { File } from './file.js';
2
+ class Npmrc extends File {
3
+ constructor(path, options) {
4
+ super(path, { ...options, read: false });
5
+ }
6
+ process() {
7
+ this._content = 'save-exact=true\n';
8
+ return this;
9
+ }
10
+ }
11
+ export { Npmrc };
12
+ //# sourceMappingURL=npmrc.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vidavidorra/create-project",
3
- "version": "2.0.16",
3
+ "version": "2.0.17-beta.1",
4
4
  "private": false,
5
5
  "description": "Interactively create a GitHub project",
6
6
  "keywords": [
@@ -20,6 +20,7 @@
20
20
  "type": "module",
21
21
  "exports": "./dist/index.js",
22
22
  "bin": {
23
+ "@vidavidorra/create-project": "./dist/cli.js",
23
24
  "create-project": "./dist/cli.js"
24
25
  },
25
26
  "files": [
@@ -27,7 +28,6 @@
27
28
  "./.editorconfig",
28
29
  "./.github/",
29
30
  "./.gitignore",
30
- "./.npmrc",
31
31
  "./src/scripts/postinstall.js",
32
32
  "./LICENSE.md",
33
33
  "./tsconfig.json"