dxfl 0.1.2 → 0.1.3

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/deploy.ts CHANGED
@@ -9,8 +9,8 @@ import {
9
9
  DeleteObjectsCommandOutput,
10
10
  } from "@aws-sdk/client-s3";
11
11
  import { Upload } from "@aws-sdk/lib-storage";
12
- import { openApiConf } from "./auth";
13
- import Pool from "@supercharge/promise-pool";
12
+ import { PromisePool } from "@supercharge/promise-pool";
13
+ import { openApiConf } from "./auth.js";
14
14
 
15
15
  // Walks through the local directory at path `dir`, and for each file it contains, returns :
16
16
  // - `localPath`: its path on the local filesystem (includes `dir`). On windows, this path
@@ -145,7 +145,7 @@ export async function deploy(vhost: string, localFolder: string) {
145
145
  }
146
146
 
147
147
  // Control concurrence while uploading
148
- await Pool
148
+ await PromisePool
149
149
  .for(localFiles)
150
150
  .withConcurrency(6)
151
151
  .process(({ localPath, s3Path }) => uploadFile(s3client, Bucket, s3Path,fs.createReadStream(localPath)));
package/dist/auth.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ import { Configuration } from "guichet-sdk-ts";
2
+ export declare function openApiConf(): Promise<Configuration>;
3
+ export declare function login(username: string): Promise<void>;
@@ -0,0 +1 @@
1
+ export declare function deploy(vhost: string, localFolder: string): Promise<void>;
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/dist/index.js ADDED
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/env node
2
+ import { program } from "commander";
3
+ import { login } from "./auth.js";
4
+ import { deploy } from "./deploy.js";
5
+ import { vhostsList } from "./vhosts.js";
6
+ program
7
+ .name('dxfl')
8
+ .description('Deuxfleurs CLI tool')
9
+ .version('0.1.0');
10
+ program.command('login')
11
+ .description('Link your Deuxfleurs account with this tool.')
12
+ .argument('<username>', 'your account username')
13
+ .action(login);
14
+ program.command('list')
15
+ .description('List all your websites')
16
+ .action(vhostsList);
17
+ program.command('deploy')
18
+ .description('Deploy your website')
19
+ .argument('<vhost>', 'selected vhost')
20
+ .argument('<local_folder>', 'your local folder')
21
+ .action(deploy);
22
+ program.parse();
@@ -0,0 +1 @@
1
+ export declare function vhostsList(): Promise<void>;
package/index.ts CHANGED
@@ -1,7 +1,8 @@
1
+ #!/usr/bin/env node
1
2
  import { program } from "commander";
2
- import { login } from "./auth";
3
- import { deploy } from "./deploy";
4
- import { vhostsList } from "./vhosts";
3
+ import { login } from "./auth.js";
4
+ import { deploy } from "./deploy.js";
5
+ import { vhostsList } from "./vhosts.js";
5
6
 
6
7
  program
7
8
  .name('dxfl')
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "dxfl",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "",
5
5
  "license": "EUPL-1.2",
6
6
  "author": "Deuxfleurs Team <coucou@deuxfleurs.fr>",
7
- "type": "commonjs",
8
- "main": "bootstrap.js",
7
+ "type": "module",
8
+ "main": "dist/main.js",
9
9
  "bin": {
10
- "dxfl": "./bootstrap.js"
10
+ "dxfl": "./dist/index.js"
11
11
  },
12
12
  "scripts": {
13
- "test": "echo \"Error: no test specified\" && exit 1"
13
+ "prepare": "npx tsc"
14
14
  },
15
15
  "dependencies": {
16
16
  "@aws-sdk/client-s3": "^3.750.0",
@@ -18,9 +18,9 @@
18
18
  "@supercharge/promise-pool": "^3.2.0",
19
19
  "@types/node": "^22.13.5",
20
20
  "commander": "^13.1.0",
21
- "guichet-sdk-ts": "git+https://git.deuxfleurs.fr/Deuxfleurs/guichet-sdk-ts",
21
+ "guichet-sdk-ts": "^0.1.0",
22
22
  "mime": "^4.0.6",
23
23
  "read": "^4.1.0",
24
- "tsx": "^4.19.3"
24
+ "typescript": "^5.7.3"
25
25
  }
26
26
  }
package/tsconfig.json CHANGED
@@ -12,7 +12,7 @@
12
12
 
13
13
  /* Language and Environment */
14
14
  "target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
15
- // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
15
+ "lib": [ "es6" ], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
16
16
  // "jsx": "preserve", /* Specify what JSX code is generated. */
17
17
  // "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */
18
18
  // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
@@ -25,13 +25,15 @@
25
25
  // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
26
26
 
27
27
  /* Modules */
28
- "module": "commonjs", /* Specify what module code is generated. */
28
+ "module": "nodenext", /* Specify what module code is generated. */
29
29
  // "rootDir": "./", /* Specify the root folder within your source files. */
30
- // "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */
30
+ //"moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */
31
31
  // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
32
32
  // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
33
33
  // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
34
- // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
34
+ "typeRoots": [
35
+ "node_modules/@types"
36
+ ], /* Specify multiple folders that act like './node_modules/@types'. */
35
37
  // "types": [], /* Specify type package names to be included without being referenced in a source file. */
36
38
  // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
37
39
  // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
@@ -51,14 +53,14 @@
51
53
  // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
52
54
 
53
55
  /* Emit */
54
- // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
56
+ "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
55
57
  // "declarationMap": true, /* Create sourcemaps for d.ts files. */
56
58
  // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
57
59
  // "sourceMap": true, /* Create source map files for emitted JavaScript files. */
58
60
  // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
59
61
  // "noEmit": true, /* Disable emitting files from a compilation. */
60
62
  // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
61
- // "outDir": "./", /* Specify an output folder for all emitted files. */
63
+ "outDir": "dist", /* Specify an output folder for all emitted files. */
62
64
  // "removeComments": true, /* Disable emitting comments. */
63
65
  // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
64
66
  // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
@@ -107,5 +109,9 @@
107
109
  /* Completeness */
108
110
  // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
109
111
  "skipLibCheck": true /* Skip type checking all .d.ts files. */
110
- }
112
+ },
113
+ "exclude": [
114
+ "dist",
115
+ "node_modules"
116
+ ]
111
117
  }
package/vhosts.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Configuration, WebsiteApi } from "guichet-sdk-ts";
2
- import { openApiConf } from "./auth";
2
+ import { openApiConf } from "./auth.js";
3
3
 
4
4
  export async function vhostsList() {
5
5
  const conf = await openApiConf();
package/bootstrap.js DELETED
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- require('tsx/cjs')
3
- require('./index.ts')