@teambit/snapping 1.0.408 → 1.0.409
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.
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<testsuites tests="9" failures="0" errors="0" skipped="1">
|
|
3
|
-
<testsuite name="teambit.component/snapping@1.0.
|
|
4
|
-
<testcase classname="dist/snapping.spec.js" name="tag should throw an ComponentsHaveIssues error" time="0.
|
|
3
|
+
<testsuite name="teambit.component/snapping@1.0.409" tests="9" failures="0" errors="0" skipped="1">
|
|
4
|
+
<testcase classname="dist/snapping.spec.js" name="tag should throw an ComponentsHaveIssues error" time="0.035"/>
|
|
5
5
|
<testcase classname="dist/snapping.spec.js" name="should not throw an error if the config was set to ignore MissingPackagesDependenciesOnFs error">
|
|
6
6
|
<skipped/>
|
|
7
7
|
</testcase>
|
|
8
|
-
<testcase classname="dist/snapping.spec.js" name="should add the new dev dep" time="0.
|
|
8
|
+
<testcase classname="dist/snapping.spec.js" name="should add the new dev dep" time="0.003"/>
|
|
9
9
|
<testcase classname="dist/snapping.spec.js" name="should remove the specified dependency" time="0.001"/>
|
|
10
10
|
<testcase classname="dist/snapping.spec.js" name="should be able to list it"/>
|
|
11
|
-
<testcase classname="dist/snapping.spec.js" name="should be ignored by tag command" time="0.
|
|
12
|
-
<testcase classname="dist/snapping.spec.js" name="should be ignored by snap command" time="0.
|
|
13
|
-
<testcase classname="dist/snapping.spec.js" name="should be ignored when it is an auto-tag candidate" time="0.
|
|
14
|
-
<testcase classname="dist/snapping.spec.js" name="should block setting local-only when a component is staged" time="0.
|
|
11
|
+
<testcase classname="dist/snapping.spec.js" name="should be ignored by tag command" time="0.165"/>
|
|
12
|
+
<testcase classname="dist/snapping.spec.js" name="should be ignored by snap command" time="0.406"/>
|
|
13
|
+
<testcase classname="dist/snapping.spec.js" name="should be ignored when it is an auto-tag candidate" time="0.322"/>
|
|
14
|
+
<testcase classname="dist/snapping.spec.js" name="should block setting local-only when a component is staged" time="0.194"/>
|
|
15
15
|
</testsuite>
|
|
16
16
|
</testsuites>
|
package/artifacts/schema.json
CHANGED
|
@@ -11791,7 +11791,7 @@
|
|
|
11791
11791
|
"componentId": {
|
|
11792
11792
|
"scope": "teambit.component",
|
|
11793
11793
|
"name": "snapping",
|
|
11794
|
-
"version": "1.0.
|
|
11794
|
+
"version": "1.0.409"
|
|
11795
11795
|
},
|
|
11796
11796
|
"taggedModuleExports": []
|
|
11797
11797
|
}
|
|
@@ -58,7 +58,7 @@ an example of the final data: '[{"componentId":"ci.remote2/comp-b","message": "f
|
|
|
58
58
|
_defineProperty(this, "alias", '');
|
|
59
59
|
_defineProperty(this, "options", [['', 'push', 'export the updated objects to the original scopes once done'], ['m', 'message <message>', 'log message describing the latest changes'], ['', 'lane <lane-id>', 'fetch the components from the given lane'], ['', 'build', 'run the build pipeline'], ['', 'skip-tests', 'skip running component tests during snap process'], ['', 'disable-snap-pipeline', 'skip the snap pipeline'], ['', 'ignore-build-errors', 'run the snap pipeline although the build pipeline failed'], ['', 'rebuild-deps-graph', 'do not reuse the saved dependencies graph, instead build it from scratch'], ['i', 'ignore-issues [issues]', `ignore component issues (shown in "bit status" as "issues found"), issues to ignore:
|
|
60
60
|
[${Object.keys(_componentIssues().IssuesClasses).join(', ')}]
|
|
61
|
-
to ignore multiple issues, separate them by a comma and wrap with quotes. to ignore all issues, specify "*".`], ['', 'update-dependents', '
|
|
61
|
+
to ignore multiple issues, separate them by a comma and wrap with quotes. to ignore all issues, specify "*".`], ['', 'update-dependents', 'when snapped on a lane, mark it as update-dependents so it will be skipped from the workspace'], ['j', 'json', 'output as json format']]);
|
|
62
62
|
_defineProperty(this, "loader", true);
|
|
63
63
|
_defineProperty(this, "private", true);
|
|
64
64
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_componentIssues","_bitError","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","SnapFromScopeCmd","constructor","snapping","logger","keys","IssuesClasses","join","report","options","results","json","snappedIds","exportedIds","snappedOutput","chalk","bold","exportedOutput","length","push","message","lane","ignoreIssues","build","skipTests","disableSnapPipeline","ignoreBuildErrors","rebuildDepsGraph","updateDependents","disableTagAndSnapPipelines","BitError","snapDataPerCompRaw","parseData","snapFromScope","map","id","toString","dataParsed","JSON","parse","err","Error","Array","isArray","forEach","dataItem","componentId","files","file","path","content","Buffer","from","exports"],"sources":["snap-from-scope.cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { IssuesClasses } from '@teambit/component-issues';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { BitError } from '@teambit/bit-error';\nimport { Logger } from '@teambit/logger';\nimport { SnappingMain } from './snapping.main.runtime';\nimport { BasicTagSnapParams } from './tag-model-component';\n\nexport type FileData = { path: string; content: string; delete?: boolean };\n\nexport type SnapDataPerCompRaw = {\n componentId: string;\n dependencies?: string[];\n aspects?: Record<string, any>;\n message?: string;\n files?: FileData[];\n isNew?: boolean;\n mainFile?: string; // relevant when isNew is true. default to \"index.ts\".\n newDependencies?: Array<{\n id: string; // component-id or package-name. e.g. \"teambit.react/react\" or \"lodash\".\n version?: string; // version of the package. e.g. \"2.0.3\". for packages, it is mandatory.\n isComponent?: boolean; // default true. if false, it's a package dependency\n type?: 'runtime' | 'dev' | 'peer'; // default \"runtime\".\n }>;\n removeDependencies?: string[];\n};\n\ntype SnapFromScopeOptions = {\n push?: boolean;\n lane?: string;\n ignoreIssues?: string;\n disableSnapPipeline?: boolean;\n updateDependents?: boolean;\n} & BasicTagSnapParams;\n\nexport class SnapFromScopeCmd implements Command {\n name = '_snap <data>';\n description = 'snap components from a bare-scope';\n extendedDescription = `this command should be running from a new bare scope, it first imports the components it needs and then processes the snap.\nthe input data is a stringified JSON of an array of the following object.\n{\n componentId: string; // ids always have scope, so it's safe to parse them from string\n dependencies?: string[]; // dependencies include versions. for components use component-id. e.g. [teambit.compilation/compiler@1.0.0, lodash@4.17.21]\n aspects?: Record<string,any> // e.g. { \"teambit.react/react\": {}, \"teambit.envs/envs\": { \"env\": \"teambit.react/react\" } }\n message?: string; // tag-message.\n files?: Array<{path: string, content: string}>; // replace content of specified source-files. the content is base64 encoded.\n isNew?: boolean; // if it's new, it'll be generated from the given files. otherwise, it'll be fetched from the scope and updated.\n mainFile?: string; // relevant when isNew is true. default to \"index.ts\".\n newDependencies?: Array<{ // new dependencies (components and packages) to add.\n id: string; // component-id or package-name. e.g. \"teambit.react/react\" or \"lodash\".\n version?: string; // version of the package. e.g. \"2.0.3\". for packages, it is mandatory.\n isComponent?: boolean; // default true. if false, it's a package dependency\n type?: 'runtime' | 'dev' | 'peer'; // default \"runtime\".\n }>;\n removeDependencies?: string[]; // component-id (for components) or package-name (for packages) to remove from the dependencies.\n}\nan example of the final data: '[{\"componentId\":\"ci.remote2/comp-b\",\"message\": \"first snap\"}]'\n`;\n alias = '';\n options = [\n ['', 'push', 'export the updated objects to the original scopes once done'],\n ['m', 'message <message>', 'log message describing the latest changes'],\n ['', 'lane <lane-id>', 'fetch the components from the given lane'],\n ['', 'build', 'run the build pipeline'],\n ['', 'skip-tests', 'skip running component tests during snap process'],\n ['', 'disable-snap-pipeline', 'skip the snap pipeline'],\n ['', 'ignore-build-errors', 'run the snap pipeline although the build pipeline failed'],\n ['', 'rebuild-deps-graph', 'do not reuse the saved dependencies graph, instead build it from scratch'],\n [\n 'i',\n 'ignore-issues [issues]',\n `ignore component issues (shown in \"bit status\" as \"issues found\"), issues to ignore:\n[${Object.keys(IssuesClasses).join(', ')}]\nto ignore multiple issues, separate them by a comma and wrap with quotes. to ignore all issues, specify \"*\".`,\n ],\n [\n '',\n 'update-dependents',\n 'EXPERIMENTAL. when snapped on a lane, mark it as update-dependents so it will be skipped from the workspace',\n ],\n ['j', 'json', 'output as json format'],\n ] as CommandOptions;\n loader = true;\n private = true;\n\n constructor(private snapping: SnappingMain, private logger: Logger) {}\n\n async report([data]: [string], options: SnapFromScopeOptions) {\n const results = await this.json([data], options);\n\n const { snappedIds, exportedIds } = results;\n\n const snappedOutput = `${chalk.bold('snapped components')}\\n${snappedIds.join('\\n')}`;\n const exportedOutput =\n exportedIds && exportedIds.length ? `\\n\\n${chalk.bold('exported components')}\\n${exportedIds.join('\\n')}` : '';\n\n return `${snappedOutput}${exportedOutput}`;\n }\n async json(\n [data]: [string],\n {\n push = false,\n message = '',\n lane,\n ignoreIssues,\n build = false,\n skipTests = false,\n disableSnapPipeline = false,\n ignoreBuildErrors = false,\n rebuildDepsGraph,\n updateDependents,\n }: SnapFromScopeOptions\n ) {\n const disableTagAndSnapPipelines = disableSnapPipeline;\n if (disableTagAndSnapPipelines && ignoreBuildErrors) {\n throw new BitError('you can use either ignore-build-errors or disable-snap-pipeline, but not both');\n }\n if (updateDependents && !lane) {\n throw new BitError('update-dependents flag is only available when snapping from a lane');\n }\n\n const snapDataPerCompRaw = this.parseData(data);\n\n const results = await this.snapping.snapFromScope(snapDataPerCompRaw, {\n push,\n message,\n lane,\n ignoreIssues,\n build,\n skipTests,\n disableTagAndSnapPipelines,\n ignoreBuildErrors,\n rebuildDepsGraph,\n updateDependents,\n });\n\n return {\n exportedIds: results.exportedIds?.map((id) => id.toString()),\n snappedIds: results.snappedIds.map((id) => id.toString()),\n };\n }\n private parseData(data: string): SnapDataPerCompRaw[] {\n let dataParsed: unknown;\n try {\n dataParsed = JSON.parse(data);\n } catch (err: any) {\n throw new Error(`failed parsing the data entered as JSON. err ${err.message}`);\n }\n if (!Array.isArray(dataParsed)) {\n throw new Error('expect data to be an array');\n }\n dataParsed.forEach((dataItem) => {\n if (!dataItem.componentId) throw new Error('expect data item to have \"componentId\" prop');\n dataItem.files?.forEach((file) => {\n if (!file.path) throw new Error('expect file to have \"path\" prop');\n if (file.content) {\n file.content = Buffer.from(file.content, 'base64').toString();\n }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","require","_componentIssues","_bitError","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","SnapFromScopeCmd","constructor","snapping","logger","keys","IssuesClasses","join","report","options","results","json","snappedIds","exportedIds","snappedOutput","chalk","bold","exportedOutput","length","push","message","lane","ignoreIssues","build","skipTests","disableSnapPipeline","ignoreBuildErrors","rebuildDepsGraph","updateDependents","disableTagAndSnapPipelines","BitError","snapDataPerCompRaw","parseData","snapFromScope","map","id","toString","dataParsed","JSON","parse","err","Error","Array","isArray","forEach","dataItem","componentId","files","file","path","content","Buffer","from","exports"],"sources":["snap-from-scope.cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { IssuesClasses } from '@teambit/component-issues';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { BitError } from '@teambit/bit-error';\nimport { Logger } from '@teambit/logger';\nimport { SnappingMain } from './snapping.main.runtime';\nimport { BasicTagSnapParams } from './tag-model-component';\n\nexport type FileData = { path: string; content: string; delete?: boolean };\n\nexport type SnapDataPerCompRaw = {\n componentId: string;\n dependencies?: string[];\n aspects?: Record<string, any>;\n message?: string;\n files?: FileData[];\n isNew?: boolean;\n mainFile?: string; // relevant when isNew is true. default to \"index.ts\".\n newDependencies?: Array<{\n id: string; // component-id or package-name. e.g. \"teambit.react/react\" or \"lodash\".\n version?: string; // version of the package. e.g. \"2.0.3\". for packages, it is mandatory.\n isComponent?: boolean; // default true. if false, it's a package dependency\n type?: 'runtime' | 'dev' | 'peer'; // default \"runtime\".\n }>;\n removeDependencies?: string[];\n};\n\ntype SnapFromScopeOptions = {\n push?: boolean;\n lane?: string;\n ignoreIssues?: string;\n disableSnapPipeline?: boolean;\n updateDependents?: boolean;\n} & BasicTagSnapParams;\n\nexport class SnapFromScopeCmd implements Command {\n name = '_snap <data>';\n description = 'snap components from a bare-scope';\n extendedDescription = `this command should be running from a new bare scope, it first imports the components it needs and then processes the snap.\nthe input data is a stringified JSON of an array of the following object.\n{\n componentId: string; // ids always have scope, so it's safe to parse them from string\n dependencies?: string[]; // dependencies include versions. for components use component-id. e.g. [teambit.compilation/compiler@1.0.0, lodash@4.17.21]\n aspects?: Record<string,any> // e.g. { \"teambit.react/react\": {}, \"teambit.envs/envs\": { \"env\": \"teambit.react/react\" } }\n message?: string; // tag-message.\n files?: Array<{path: string, content: string}>; // replace content of specified source-files. the content is base64 encoded.\n isNew?: boolean; // if it's new, it'll be generated from the given files. otherwise, it'll be fetched from the scope and updated.\n mainFile?: string; // relevant when isNew is true. default to \"index.ts\".\n newDependencies?: Array<{ // new dependencies (components and packages) to add.\n id: string; // component-id or package-name. e.g. \"teambit.react/react\" or \"lodash\".\n version?: string; // version of the package. e.g. \"2.0.3\". for packages, it is mandatory.\n isComponent?: boolean; // default true. if false, it's a package dependency\n type?: 'runtime' | 'dev' | 'peer'; // default \"runtime\".\n }>;\n removeDependencies?: string[]; // component-id (for components) or package-name (for packages) to remove from the dependencies.\n}\nan example of the final data: '[{\"componentId\":\"ci.remote2/comp-b\",\"message\": \"first snap\"}]'\n`;\n alias = '';\n options = [\n ['', 'push', 'export the updated objects to the original scopes once done'],\n ['m', 'message <message>', 'log message describing the latest changes'],\n ['', 'lane <lane-id>', 'fetch the components from the given lane'],\n ['', 'build', 'run the build pipeline'],\n ['', 'skip-tests', 'skip running component tests during snap process'],\n ['', 'disable-snap-pipeline', 'skip the snap pipeline'],\n ['', 'ignore-build-errors', 'run the snap pipeline although the build pipeline failed'],\n ['', 'rebuild-deps-graph', 'do not reuse the saved dependencies graph, instead build it from scratch'],\n [\n 'i',\n 'ignore-issues [issues]',\n `ignore component issues (shown in \"bit status\" as \"issues found\"), issues to ignore:\n[${Object.keys(IssuesClasses).join(', ')}]\nto ignore multiple issues, separate them by a comma and wrap with quotes. to ignore all issues, specify \"*\".`,\n ],\n [\n '',\n 'update-dependents',\n 'when snapped on a lane, mark it as update-dependents so it will be skipped from the workspace',\n ],\n ['j', 'json', 'output as json format'],\n ] as CommandOptions;\n loader = true;\n private = true;\n\n constructor(private snapping: SnappingMain, private logger: Logger) {}\n\n async report([data]: [string], options: SnapFromScopeOptions) {\n const results = await this.json([data], options);\n\n const { snappedIds, exportedIds } = results;\n\n const snappedOutput = `${chalk.bold('snapped components')}\\n${snappedIds.join('\\n')}`;\n const exportedOutput =\n exportedIds && exportedIds.length ? `\\n\\n${chalk.bold('exported components')}\\n${exportedIds.join('\\n')}` : '';\n\n return `${snappedOutput}${exportedOutput}`;\n }\n async json(\n [data]: [string],\n {\n push = false,\n message = '',\n lane,\n ignoreIssues,\n build = false,\n skipTests = false,\n disableSnapPipeline = false,\n ignoreBuildErrors = false,\n rebuildDepsGraph,\n updateDependents,\n }: SnapFromScopeOptions\n ) {\n const disableTagAndSnapPipelines = disableSnapPipeline;\n if (disableTagAndSnapPipelines && ignoreBuildErrors) {\n throw new BitError('you can use either ignore-build-errors or disable-snap-pipeline, but not both');\n }\n if (updateDependents && !lane) {\n throw new BitError('update-dependents flag is only available when snapping from a lane');\n }\n\n const snapDataPerCompRaw = this.parseData(data);\n\n const results = await this.snapping.snapFromScope(snapDataPerCompRaw, {\n push,\n message,\n lane,\n ignoreIssues,\n build,\n skipTests,\n disableTagAndSnapPipelines,\n ignoreBuildErrors,\n rebuildDepsGraph,\n updateDependents,\n });\n\n return {\n exportedIds: results.exportedIds?.map((id) => id.toString()),\n snappedIds: results.snappedIds.map((id) => id.toString()),\n };\n }\n private parseData(data: string): SnapDataPerCompRaw[] {\n let dataParsed: unknown;\n try {\n dataParsed = JSON.parse(data);\n } catch (err: any) {\n throw new Error(`failed parsing the data entered as JSON. err ${err.message}`);\n }\n if (!Array.isArray(dataParsed)) {\n throw new Error('expect data to be an array');\n }\n dataParsed.forEach((dataItem) => {\n if (!dataItem.componentId) throw new Error('expect data item to have \"componentId\" prop');\n dataItem.files?.forEach((file) => {\n if (!file.path) throw new Error('expect file to have \"path\" prop');\n if (file.content) {\n file.content = Buffer.from(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12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/snapping",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.409",
|
|
4
4
|
"homepage": "https://bit.cloud/teambit/component/snapping",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.component",
|
|
8
8
|
"name": "snapping",
|
|
9
|
-
"version": "1.0.
|
|
9
|
+
"version": "1.0.409"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"chalk": "2.4.2",
|
|
@@ -21,32 +21,32 @@
|
|
|
21
21
|
"@teambit/harmony": "0.4.6",
|
|
22
22
|
"@teambit/component-version": "1.0.3",
|
|
23
23
|
"@teambit/lane-id": "0.0.311",
|
|
24
|
-
"@teambit/graph": "1.0.
|
|
25
|
-
"@teambit/logger": "0.0.
|
|
26
|
-
"@teambit/scope": "1.0.
|
|
24
|
+
"@teambit/graph": "1.0.409",
|
|
25
|
+
"@teambit/logger": "0.0.1079",
|
|
26
|
+
"@teambit/scope": "1.0.409",
|
|
27
27
|
"@teambit/toolbox.promise.map-pool": "0.0.1",
|
|
28
28
|
"@teambit/component.sources": "0.0.29",
|
|
29
|
-
"@teambit/component": "1.0.
|
|
30
|
-
"@teambit/dependencies": "1.0.
|
|
31
|
-
"@teambit/dependency-resolver": "1.0.
|
|
32
|
-
"@teambit/cli": "0.0.
|
|
29
|
+
"@teambit/component": "1.0.409",
|
|
30
|
+
"@teambit/dependencies": "1.0.409",
|
|
31
|
+
"@teambit/dependency-resolver": "1.0.409",
|
|
32
|
+
"@teambit/cli": "0.0.986",
|
|
33
33
|
"@teambit/legacy.component-list": "0.0.30",
|
|
34
34
|
"@teambit/component-issues": "0.0.150",
|
|
35
|
-
"@teambit/global-config": "0.0.
|
|
36
|
-
"@teambit/application": "1.0.
|
|
37
|
-
"@teambit/builder": "1.0.
|
|
38
|
-
"@teambit/export": "1.0.
|
|
35
|
+
"@teambit/global-config": "0.0.989",
|
|
36
|
+
"@teambit/application": "1.0.409",
|
|
37
|
+
"@teambit/builder": "1.0.409",
|
|
38
|
+
"@teambit/export": "1.0.409",
|
|
39
39
|
"@teambit/harmony.modules.concurrency": "0.0.1",
|
|
40
|
-
"@teambit/importer": "1.0.
|
|
41
|
-
"@teambit/insights": "1.0.
|
|
42
|
-
"@teambit/issues": "1.0.
|
|
40
|
+
"@teambit/importer": "1.0.409",
|
|
41
|
+
"@teambit/insights": "1.0.409",
|
|
42
|
+
"@teambit/issues": "1.0.409",
|
|
43
43
|
"@teambit/lanes.modules.create-lane": "0.0.10",
|
|
44
44
|
"@teambit/legacy.scope-api": "0.0.32",
|
|
45
45
|
"@teambit/pkg.modules.semver-helper": "0.0.1",
|
|
46
|
-
"@teambit/workspace": "1.0.
|
|
46
|
+
"@teambit/workspace": "1.0.409",
|
|
47
47
|
"@teambit/bit.get-bit-version": "0.0.1",
|
|
48
48
|
"@teambit/harmony.modules.get-basic-log": "0.0.1",
|
|
49
|
-
"@teambit/remove": "1.0.
|
|
49
|
+
"@teambit/remove": "1.0.409",
|
|
50
50
|
"@teambit/toolbox.crypto.sha1": "0.0.1",
|
|
51
51
|
"@teambit/workspace.modules.node-modules-linker": "0.0.204"
|
|
52
52
|
},
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"@types/uuid": "8.3.4",
|
|
61
61
|
"@types/mocha": "9.1.0",
|
|
62
62
|
"@teambit/harmony.envs.core-aspect-env": "0.0.47",
|
|
63
|
-
"@teambit/compiler": "1.0.
|
|
63
|
+
"@teambit/compiler": "1.0.409",
|
|
64
64
|
"@teambit/component.testing.mock-components": "0.0.235",
|
|
65
65
|
"@teambit/harmony.testing.load-aspect": "0.0.230",
|
|
66
66
|
"@teambit/workspace.testing.mock-workspace": "0.0.27"
|
|
File without changes
|