@git.zone/tsdocker 1.2.43 → 1.4.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.
Files changed (47) hide show
  1. package/cli.js +1 -1
  2. package/dist_ts/00_commitinfo_data.d.ts +8 -0
  3. package/dist_ts/00_commitinfo_data.js +9 -0
  4. package/dist_ts/classes.dockerfile.d.ts +85 -0
  5. package/dist_ts/classes.dockerfile.js +366 -0
  6. package/dist_ts/classes.dockerregistry.d.ts +29 -0
  7. package/dist_ts/classes.dockerregistry.js +83 -0
  8. package/dist_ts/classes.registrystorage.d.ts +35 -0
  9. package/dist_ts/classes.registrystorage.js +76 -0
  10. package/dist_ts/classes.tsdockermanager.d.ts +53 -0
  11. package/dist_ts/classes.tsdockermanager.js +222 -0
  12. package/dist_ts/index.d.ts +1 -0
  13. package/dist_ts/index.js +4 -0
  14. package/dist_ts/interfaces/index.d.ts +68 -0
  15. package/dist_ts/interfaces/index.js +2 -0
  16. package/dist_ts/tsdocker.cli.d.ts +1 -0
  17. package/dist_ts/tsdocker.cli.js +179 -0
  18. package/dist_ts/tsdocker.config.d.ts +5 -0
  19. package/dist_ts/tsdocker.config.js +37 -0
  20. package/dist_ts/tsdocker.docker.d.ts +2 -0
  21. package/dist_ts/tsdocker.docker.js +145 -0
  22. package/dist_ts/tsdocker.logging.d.ts +3 -0
  23. package/dist_ts/tsdocker.logging.js +15 -0
  24. package/dist_ts/tsdocker.paths.d.ts +4 -0
  25. package/dist_ts/tsdocker.paths.js +13 -0
  26. package/dist_ts/tsdocker.plugins.d.ts +16 -0
  27. package/dist_ts/tsdocker.plugins.js +19 -0
  28. package/dist_ts/tsdocker.snippets.d.ts +5 -0
  29. package/dist_ts/tsdocker.snippets.js +26 -0
  30. package/npmextra.json +12 -6
  31. package/package.json +26 -21
  32. package/readme.hints.md +95 -26
  33. package/readme.md +32 -33
  34. package/ts/00_commitinfo_data.ts +1 -1
  35. package/ts/classes.dockerfile.ts +462 -0
  36. package/ts/classes.dockerregistry.ts +91 -0
  37. package/ts/classes.registrystorage.ts +83 -0
  38. package/ts/classes.tsdockermanager.ts +254 -0
  39. package/ts/index.ts +2 -2
  40. package/ts/interfaces/index.ts +70 -0
  41. package/ts/tsdocker.cli.ts +129 -16
  42. package/ts/tsdocker.config.ts +17 -10
  43. package/ts/tsdocker.docker.ts +6 -6
  44. package/ts/tsdocker.logging.ts +1 -1
  45. package/ts/tsdocker.paths.ts +6 -1
  46. package/ts/tsdocker.plugins.ts +2 -0
  47. package/ts/tsdocker.snippets.ts +5 -8
@@ -1,14 +1,12 @@
1
- import * as plugins from './tsdocker.plugins';
2
- import * as paths from './tsdocker.paths';
1
+ import * as plugins from './tsdocker.plugins.js';
2
+ import * as paths from './tsdocker.paths.js';
3
3
  import * as fs from 'fs';
4
+ import type { ITsDockerConfig } from './interfaces/index.js';
4
5
 
5
- export interface IConfig {
6
- baseImage: string;
7
- command: string;
8
- dockerSock: boolean;
6
+ // Re-export ITsDockerConfig as IConfig for backward compatibility
7
+ export type IConfig = ITsDockerConfig & {
9
8
  exitCode?: number;
10
- keyValueObject: {[key: string]: any};
11
- }
9
+ };
12
10
 
13
11
  const getQenvKeyValueObject = async () => {
14
12
  let qenvKeyValueObjectArray: { [key: string]: string | number };
@@ -22,12 +20,21 @@ const getQenvKeyValueObject = async () => {
22
20
 
23
21
  const buildConfig = async (qenvKeyValueObjectArg: { [key: string]: string | number }) => {
24
22
  const npmextra = new plugins.npmextra.Npmextra(paths.cwd);
25
- const config = npmextra.dataFor<IConfig>('npmdocker', {
23
+ const config = npmextra.dataFor<IConfig>('@git.zone/tsdocker', {
24
+ // Legacy options (backward compatible)
26
25
  baseImage: 'hosttoday/ht-docker-node:npmdocker',
27
26
  init: 'rm -rf node_nodules/ && yarn install',
28
27
  command: 'npmci npm test',
29
28
  dockerSock: false,
30
- keyValueObject: qenvKeyValueObjectArg
29
+ keyValueObject: qenvKeyValueObjectArg,
30
+
31
+ // New Docker build options
32
+ registries: [],
33
+ registryRepoMap: {},
34
+ buildArgEnvMap: {},
35
+ platforms: ['linux/amd64'],
36
+ push: false,
37
+ testDir: undefined,
31
38
  });
32
39
  return config;
33
40
  };
@@ -1,15 +1,15 @@
1
- import * as plugins from './tsdocker.plugins';
2
- import * as paths from './tsdocker.paths';
3
- import * as snippets from './tsdocker.snippets';
1
+ import * as plugins from './tsdocker.plugins.js';
2
+ import * as paths from './tsdocker.paths.js';
3
+ import * as snippets from './tsdocker.snippets.js';
4
4
 
5
- import { logger, ora } from './tsdocker.logging';
5
+ import { logger, ora } from './tsdocker.logging.js';
6
6
 
7
7
  const smartshellInstance = new plugins.smartshell.Smartshell({
8
8
  executor: 'bash'
9
9
  });
10
10
 
11
11
  // interfaces
12
- import { IConfig } from './tsdocker.config';
12
+ import type { IConfig } from './tsdocker.config.js';
13
13
 
14
14
  let config: IConfig;
15
15
 
@@ -67,7 +67,7 @@ const buildDockerImage = async () => {
67
67
  await smartshellInstance.exec(`docker pull ${config.baseImage}`);
68
68
  ora.text('building Dockerimage...');
69
69
  const execResult = await smartshellInstance.execSilent(
70
- `docker build -f npmdocker -t ${dockerData.imageTag} ${paths.cwd}`
70
+ `docker build --load -f npmdocker -t ${dockerData.imageTag} ${paths.cwd}`
71
71
  );
72
72
  if (execResult.exitCode !== 0) {
73
73
  console.log(execResult.stdout);
@@ -1,4 +1,4 @@
1
- import * as plugins from './tsdocker.plugins';
1
+ import * as plugins from './tsdocker.plugins.js';
2
2
 
3
3
  export const logger = new plugins.smartlog.Smartlog({
4
4
  logContext: {
@@ -1,5 +1,10 @@
1
- import * as plugins from './tsdocker.plugins';
1
+ import * as plugins from './tsdocker.plugins.js';
2
2
  import * as fs from 'fs';
3
+ import { fileURLToPath } from 'url';
4
+ import { dirname } from 'path';
5
+
6
+ const __filename = fileURLToPath(import.meta.url);
7
+ const __dirname = dirname(__filename);
3
8
 
4
9
  // directories
5
10
  export let cwd = process.cwd();
@@ -1,4 +1,5 @@
1
1
  // push.rocks scope
2
+ import * as lik from '@push.rocks/lik';
2
3
  import * as npmextra from '@push.rocks/npmextra';
3
4
  import * as path from 'path';
4
5
  import * as projectinfo from '@push.rocks/projectinfo';
@@ -17,6 +18,7 @@ import * as smartstring from '@push.rocks/smartstring';
17
18
  export const smartfs = new SmartFs(new SmartFsProviderNode());
18
19
 
19
20
  export {
21
+ lik,
20
22
  npmextra,
21
23
  path,
22
24
  projectinfo,
@@ -1,4 +1,4 @@
1
- import * as plugins from './tsdocker.plugins';
1
+ import * as plugins from './tsdocker.plugins.js';
2
2
 
3
3
  export interface IDockerfileSnippet {
4
4
  baseImage: string;
@@ -14,23 +14,20 @@ let getMountSolutionString = (optionsArg: IDockerfileSnippet) => {
14
14
  };
15
15
 
16
16
  let getGlobalPreparationString = (optionsArg: IDockerfileSnippet) => {
17
- if (optionsArg.baseImage !== 'hosttoday/ht-docker-node:npmdocker') {
18
- return 'RUN npm install -g npmdocker';
19
- } else {
20
- return '# not installing npmdocker since it is included in the base image';
21
- }
17
+ // Always install tsdocker to ensure the latest version is available
18
+ return 'RUN npm install -g @git.zone/tsdocker';
22
19
  };
23
20
 
24
21
  export let dockerfileSnippet = (optionsArg: IDockerfileSnippet): string => {
25
22
  return plugins.smartstring.indent.normalize(
26
23
  `
27
24
  FROM ${optionsArg.baseImage}
28
- # For info about what npmdocker does read the docs at https://gitzone.github.io/npmdocker
25
+ # For info about what tsdocker does read the docs at https://gitzone.github.io/tsdocker
29
26
  ${getGlobalPreparationString(optionsArg)}
30
27
  ${getMountSolutionString(optionsArg)}
31
28
  WORKDIR /workspace
32
29
  ENV CI=true
33
- ENTRYPOINT ["npmdocker"]
30
+ ENTRYPOINT ["tsdocker"]
34
31
  CMD ["runinside"]
35
32
  `
36
33
  );