create-pwa-sv 1.5.1 → 1.6.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/README.md +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +3 -26
- package/dist/cli.js.map +1 -1
- package/dist/validators.d.ts.map +1 -0
- package/dist/validators.js +19 -0
- package/dist/validators.js.map +1 -0
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ A CLI tool that streamlines the creation of typesafe Progressive Web App (PWA) p
|
|
|
4
4
|
|
|
5
5
|

|
|
6
6
|
|
|
7
|
-

|
|
8
8
|
|
|
9
9
|
## Features
|
|
10
10
|
|
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
|
package/dist/cli.js
CHANGED
|
@@ -2,28 +2,13 @@
|
|
|
2
2
|
import { existsSync } from 'node:fs';
|
|
3
3
|
import { Command } from 'commander';
|
|
4
4
|
import { createProject } from './engine.js';
|
|
5
|
+
import { validateProjectName } from './validators.js';
|
|
5
6
|
const program = new Command();
|
|
6
|
-
// Validate project name to ensure it's a valid directory name
|
|
7
|
-
export const validateProjectName = (name) => {
|
|
8
|
-
if (!name) {
|
|
9
|
-
throw new Error('Project name is required');
|
|
10
|
-
}
|
|
11
|
-
// Check for invalid characters in directory name
|
|
12
|
-
const invalidChars = /[<>:"/\\|?*]/g;
|
|
13
|
-
if (invalidChars.test(name)) {
|
|
14
|
-
throw new Error('Project name contains invalid characters');
|
|
15
|
-
}
|
|
16
|
-
// Check for valid NPM package name (simplified)
|
|
17
|
-
if (name.startsWith('.') || name.startsWith('_')) {
|
|
18
|
-
throw new Error('Project name cannot start with "." or "_"');
|
|
19
|
-
}
|
|
20
|
-
return name;
|
|
21
|
-
};
|
|
22
7
|
// Define the main command
|
|
23
8
|
program
|
|
24
9
|
.name('create-pwa-sv')
|
|
25
10
|
.description('CLI tool to create SvelteKit PWA projects')
|
|
26
|
-
.version('1.
|
|
11
|
+
.version('1.6.0')
|
|
27
12
|
.argument('<project-name>', 'Name of the project to create')
|
|
28
13
|
.option('--yes', 'Skip confirmation prompts (CI/CD mode)')
|
|
29
14
|
.option('-d, --dexie', 'Include Dexie IndexedDB wrapper')
|
|
@@ -57,13 +42,5 @@ program
|
|
|
57
42
|
});
|
|
58
43
|
// Add help option
|
|
59
44
|
program.showHelpAfterError('(add --help for additional information)');
|
|
60
|
-
|
|
61
|
-
const argv1 = process.argv[1] ?? '';
|
|
62
|
-
return (import.meta.url === `file://${argv1}` ||
|
|
63
|
-
argv1.endsWith('/cli.js') ||
|
|
64
|
-
argv1.endsWith('\\cli.js'));
|
|
65
|
-
})();
|
|
66
|
-
if (isDirectExecution) {
|
|
67
|
-
program.parse();
|
|
68
|
-
}
|
|
45
|
+
program.parse();
|
|
69
46
|
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEtD,MAAM,OAA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,KAAK,CAAC,yBAAyB,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;QACxD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC,CAAC;AAEL,kBAAkB;AAClB,OAAO,CAAC,kBAAkB,CAAC,yCAAyC,CAAC,CAAC;AAEtE,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../src/validators.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,mBAAmB,GAAI,MAAM,MAAM,KAAG,MAiBlD,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validate project name to ensure it's a valid directory name
|
|
3
|
+
*/
|
|
4
|
+
export const validateProjectName = (name) => {
|
|
5
|
+
if (!name) {
|
|
6
|
+
throw new Error('Project name is required');
|
|
7
|
+
}
|
|
8
|
+
// Check for invalid characters in directory name
|
|
9
|
+
const invalidChars = /[<>:"/\\|?*]/g;
|
|
10
|
+
if (invalidChars.test(name)) {
|
|
11
|
+
throw new Error('Project name contains invalid characters');
|
|
12
|
+
}
|
|
13
|
+
// Check for valid NPM package name (simplified)
|
|
14
|
+
if (name.startsWith('.') || name.startsWith('_')) {
|
|
15
|
+
throw new Error('Project name cannot start with "." or "_"');
|
|
16
|
+
}
|
|
17
|
+
return name;
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=validators.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validators.js","sourceRoot":"","sources":["../src/validators.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,IAAY,EAAU,EAAE;IAC1D,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;IAC9C,CAAC;IAED,iDAAiD;IACjD,MAAM,YAAY,GAAG,eAAe,CAAC;IACrC,IAAI,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QAC5B,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC;IAC9D,CAAC;IAED,gDAAgD;IAChD,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QACjD,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;IAC/D,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-pwa-sv",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"description": "CLI tool to automate the creation of typesafe Progressive Web App (PWA) projects using SvelteKit",
|
|
5
5
|
"main": "dist/cli.js",
|
|
6
6
|
"bin": {
|
|
@@ -29,11 +29,11 @@
|
|
|
29
29
|
"author": "EduTherapy",
|
|
30
30
|
"repository": {
|
|
31
31
|
"type": "git",
|
|
32
|
-
"url": "https://gitlab.com/
|
|
32
|
+
"url": "https://gitlab.com/eduth/pwa-sv"
|
|
33
33
|
},
|
|
34
|
-
"homepage": "https://gitlab.com/
|
|
34
|
+
"homepage": "https://gitlab.com/eduth/pwa-sv#readme",
|
|
35
35
|
"bugs": {
|
|
36
|
-
"url": "https://gitlab.com/
|
|
36
|
+
"url": "https://gitlab.com/eduth/pwa-sv/issues"
|
|
37
37
|
},
|
|
38
38
|
"license": "MIT",
|
|
39
39
|
"dependencies": {
|