@teambit/snapping 1.0.142 → 1.0.144
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/artifacts/__bit_junit.xml +3 -3
- package/dist/flattened-edges.d.ts +1 -1
- package/dist/snapping.main.runtime.d.ts +1 -1
- package/dist/snapping.spec.js +14 -6
- package/dist/snapping.spec.js.map +1 -1
- package/package.json +26 -25
- package/tsconfig.json +4 -1
- /package/dist/{preview-1705806923881.js → preview-1706239131657.js} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<testsuites>
|
|
3
|
-
<testsuite name="teambit.component/snapping@1.0.
|
|
4
|
-
<testcase classname="snapping.spec.js" name="tag should throw an ComponentsHaveIssues error" time="0.
|
|
5
|
-
<testcase classname="snapping.spec.js" name="should not throw an error if the config was set to ignore MissingPackagesDependenciesOnFs error">
|
|
3
|
+
<testsuite name="teambit.component/snapping@1.0.144" tests="2" failures="0" errors="0" skipped="1">
|
|
4
|
+
<testcase classname="dist/snapping.spec.js" name="tag should throw an ComponentsHaveIssues error" time="0.07"/>
|
|
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
8
|
</testsuite>
|
|
@@ -52,7 +52,7 @@ export declare class FlattenedEdgesGetter {
|
|
|
52
52
|
private lane?;
|
|
53
53
|
private graph;
|
|
54
54
|
private missingFromGraph;
|
|
55
|
-
constructor(scope: ScopeMain, consumerComponents: ConsumerComponent[], logger: Logger, lane?: Lane);
|
|
55
|
+
constructor(scope: ScopeMain, consumerComponents: ConsumerComponent[], logger: Logger, lane?: Lane | undefined);
|
|
56
56
|
buildGraph(): Promise<Graph<ComponentID, DepEdgeType>>;
|
|
57
57
|
populateFlattenedAndEdgesForComp(component: ConsumerComponent): void;
|
|
58
58
|
private importMissingAndAddToGraph;
|
|
@@ -173,7 +173,7 @@ export declare class SnappingMain {
|
|
|
173
173
|
private updateSourceFiles;
|
|
174
174
|
updateDependenciesVersionsOfComponent(component: Component, dependencies: ComponentID[], currentBitIds: ComponentID[]): Promise<void>;
|
|
175
175
|
private getComponentsToTag;
|
|
176
|
-
static slots:
|
|
176
|
+
static slots: never[];
|
|
177
177
|
static dependencies: import("@teambit/harmony").Aspect[];
|
|
178
178
|
static runtime: import("@teambit/harmony").RuntimeDefinition;
|
|
179
179
|
static provider([workspace, cli, loggerMain, issues, insights, dependencyResolver, scope, exporter, builder, importer, globalConfig, deps,]: [
|
package/dist/snapping.spec.js
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
function _chai() {
|
|
4
|
+
const data = require("chai");
|
|
5
|
+
_chai = function () {
|
|
6
|
+
return data;
|
|
7
|
+
};
|
|
8
|
+
return data;
|
|
9
|
+
}
|
|
3
10
|
function _fsExtra() {
|
|
4
11
|
const data = _interopRequireDefault(require("fs-extra"));
|
|
5
12
|
_fsExtra = function () {
|
|
@@ -64,11 +71,12 @@ function _componentsHaveIssues() {
|
|
|
64
71
|
return data;
|
|
65
72
|
}
|
|
66
73
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
67
|
-
describe('Snapping aspect', ()
|
|
74
|
+
describe('Snapping aspect', function () {
|
|
75
|
+
this.timeout(0);
|
|
68
76
|
let workspaceData;
|
|
69
77
|
let snapping;
|
|
70
78
|
describe('components with issues', () => {
|
|
71
|
-
|
|
79
|
+
before(async () => {
|
|
72
80
|
workspaceData = (0, _workspaceTesting().mockWorkspace)();
|
|
73
81
|
const {
|
|
74
82
|
workspacePath
|
|
@@ -80,14 +88,14 @@ describe('Snapping aspect', () => {
|
|
|
80
88
|
const compiler = await (0, _harmonyTesting().loadAspect)(_compiler().CompilerAspect, workspacePath);
|
|
81
89
|
await compiler.compileOnWorkspace();
|
|
82
90
|
snapping = await (0, _harmonyTesting().loadAspect)(_snapping().SnappingAspect, workspacePath);
|
|
83
|
-
}
|
|
91
|
+
});
|
|
84
92
|
it('tag should throw an ComponentsHaveIssues error', async () => {
|
|
85
93
|
try {
|
|
86
94
|
await snapping.tag({
|
|
87
95
|
ids: ['comp1']
|
|
88
96
|
});
|
|
89
97
|
} catch (err) {
|
|
90
|
-
expect(err.constructor.name).
|
|
98
|
+
(0, _chai().expect)(err.constructor.name).to.equal(_componentsHaveIssues().ComponentsHaveIssues.name);
|
|
91
99
|
}
|
|
92
100
|
});
|
|
93
101
|
// @todo: this test fails during "bit build" for some reason. It passes on "bit test";
|
|
@@ -99,9 +107,9 @@ describe('Snapping aspect', () => {
|
|
|
99
107
|
const results = await snapping.tag({
|
|
100
108
|
ids: ['comp1']
|
|
101
109
|
});
|
|
102
|
-
expect(results?.taggedComponents.length).
|
|
110
|
+
(0, _chai().expect)(results?.taggedComponents.length).to.equal(1);
|
|
103
111
|
});
|
|
104
|
-
|
|
112
|
+
after(async () => {
|
|
105
113
|
await (0, _workspaceTesting().destroyWorkspace)(workspaceData);
|
|
106
114
|
});
|
|
107
115
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_chai","data","require","_fsExtra","_interopRequireDefault","_path","_harmonyTesting","_workspaceTesting","_issues","_compiler","_componentTesting","_snapping","_componentsHaveIssues","obj","__esModule","default","describe","timeout","workspaceData","snapping","before","mockWorkspace","workspacePath","console","log","mockComponents","fs","writeFile","path","join","compiler","loadAspect","CompilerAspect","compileOnWorkspace","SnappingAspect","it","tag","ids","err","expect","constructor","name","to","equal","ComponentsHaveIssues","skip","setWorkspaceConfig","IssuesAspect","id","ignoreIssues","results","taggedComponents","length","after","destroyWorkspace"],"sources":["snapping.spec.ts"],"sourcesContent":["import { expect } from 'chai';\nimport fs from 'fs-extra';\nimport path from 'path';\nimport { loadAspect } from '@teambit/harmony.testing.load-aspect';\nimport {\n mockWorkspace,\n destroyWorkspace,\n WorkspaceData,\n setWorkspaceConfig,\n} from '@teambit/workspace.testing.mock-workspace';\nimport IssuesAspect from '@teambit/issues';\nimport { CompilerAspect, CompilerMain } from '@teambit/compiler';\nimport { mockComponents } from '@teambit/component.testing.mock-components';\nimport { SnappingMain } from './snapping.main.runtime';\nimport { SnappingAspect } from './snapping.aspect';\nimport { ComponentsHaveIssues } from './components-have-issues';\n\ndescribe('Snapping aspect', function () {\n this.timeout(0);\n\n let workspaceData: WorkspaceData;\n let snapping: SnappingMain;\n describe('components with issues', () => {\n before(async () => {\n workspaceData = mockWorkspace();\n const { workspacePath } = workspaceData;\n // eslint-disable-next-line no-console\n console.log('workspace created at ', workspacePath);\n await mockComponents(workspacePath);\n await fs.writeFile(path.join(workspacePath, 'comp1/index.js'), `const nonExist = require(\"non-exist\");`);\n const compiler: CompilerMain = await loadAspect(CompilerAspect, workspacePath);\n await compiler.compileOnWorkspace();\n snapping = await loadAspect(SnappingAspect, workspacePath);\n });\n it('tag should throw an ComponentsHaveIssues error', async () => {\n try {\n await snapping.tag({ ids: ['comp1'] });\n } catch (err: any) {\n expect(err.constructor.name).to.equal(ComponentsHaveIssues.name);\n }\n });\n // @todo: this test fails during \"bit build\" for some reason. It passes on \"bit test\";\n it.skip('should not throw an error if the config was set to ignore MissingPackagesDependenciesOnFs error', async () => {\n await setWorkspaceConfig(workspaceData.workspacePath, IssuesAspect.id, {\n ignoreIssues: ['MissingPackagesDependenciesOnFs'],\n });\n snapping = await loadAspect(SnappingAspect, workspaceData.workspacePath);\n const results = await snapping.tag({ ids: ['comp1'] });\n expect(results?.taggedComponents.length).to.equal(1);\n });\n after(async () => {\n await destroyWorkspace(workspaceData);\n });\n });\n});\n"],"mappings":";;AAAA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,SAAA;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AAY,CAACC,EAAE,EAAE;QACrEC,YAAY,EAAE,CAAC,iCAAiC;MAClD,CAAC,CAAC;MACF9B,QAAQ,GAAG,MAAM,IAAAY,4BAAU,EAACG,0BAAc,EAAEhB,aAAa,CAACI,aAAa,CAAC;MACxE,MAAM4B,OAAO,GAAG,MAAM/B,QAAQ,CAACiB,GAAG,CAAC;QAAEC,GAAG,EAAE,CAAC,OAAO;MAAE,CAAC,CAAC;MACtD,IAAAE,cAAM,EAACW,OAAO,EAAEC,gBAAgB,CAACC,MAAM,CAAC,CAACV,EAAE,CAACC,KAAK,CAAC,CAAC,CAAC;IACtD,CAAC,CAAC;IACFU,KAAK,CAAC,YAAY;MAChB,MAAM,IAAAC,oCAAgB,EAACpC,aAAa,CAAC;IACvC,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/snapping",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.144",
|
|
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.144"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"chalk": "2.4.2",
|
|
@@ -21,36 +21,36 @@
|
|
|
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/issues": "1.0.
|
|
25
|
-
"@teambit/graph": "1.0.
|
|
26
|
-
"@teambit/logger": "0.0.
|
|
27
|
-
"@teambit/scope": "1.0.
|
|
28
|
-
"@teambit/component": "1.0.
|
|
29
|
-
"@teambit/dependencies": "1.0.
|
|
30
|
-
"@teambit/dependency-resolver": "1.0.
|
|
31
|
-
"@teambit/cli": "0.0.
|
|
32
|
-
"@teambit/component-issues": "0.0.
|
|
33
|
-
"@teambit/global-config": "0.0.
|
|
34
|
-
"@teambit/builder": "1.0.
|
|
35
|
-
"@teambit/export": "1.0.
|
|
36
|
-
"@teambit/importer": "1.0.
|
|
37
|
-
"@teambit/insights": "1.0.
|
|
38
|
-
"@teambit/workspace": "1.0.
|
|
39
|
-
"@teambit/workspace.modules.node-modules-linker": "0.0.
|
|
24
|
+
"@teambit/issues": "1.0.144",
|
|
25
|
+
"@teambit/graph": "1.0.144",
|
|
26
|
+
"@teambit/logger": "0.0.942",
|
|
27
|
+
"@teambit/scope": "1.0.144",
|
|
28
|
+
"@teambit/component": "1.0.144",
|
|
29
|
+
"@teambit/dependencies": "1.0.144",
|
|
30
|
+
"@teambit/dependency-resolver": "1.0.144",
|
|
31
|
+
"@teambit/cli": "0.0.849",
|
|
32
|
+
"@teambit/component-issues": "0.0.141",
|
|
33
|
+
"@teambit/global-config": "0.0.852",
|
|
34
|
+
"@teambit/builder": "1.0.144",
|
|
35
|
+
"@teambit/export": "1.0.144",
|
|
36
|
+
"@teambit/importer": "1.0.144",
|
|
37
|
+
"@teambit/insights": "1.0.144",
|
|
38
|
+
"@teambit/workspace": "1.0.144",
|
|
39
|
+
"@teambit/workspace.modules.node-modules-linker": "0.0.163"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@types/lodash": "4.14.165",
|
|
43
43
|
"@types/semver": "7.3.4",
|
|
44
|
+
"@types/chai": "4.2.15",
|
|
44
45
|
"@types/fs-extra": "9.0.7",
|
|
46
|
+
"chai": "4.3.0",
|
|
45
47
|
"fs-extra": "10.0.0",
|
|
46
48
|
"@types/uuid": "8.3.4",
|
|
47
49
|
"@types/mocha": "9.1.0",
|
|
48
|
-
"@
|
|
49
|
-
"@
|
|
50
|
-
"@teambit/
|
|
51
|
-
"@teambit/
|
|
52
|
-
"@teambit/component.testing.mock-components": "0.0.184",
|
|
53
|
-
"@teambit/harmony.testing.load-aspect": "0.0.183",
|
|
50
|
+
"@teambit/harmony.envs.core-aspect-env": "0.0.24",
|
|
51
|
+
"@teambit/compiler": "1.0.144",
|
|
52
|
+
"@teambit/component.testing.mock-components": "0.0.185",
|
|
53
|
+
"@teambit/harmony.testing.load-aspect": "0.0.184",
|
|
54
54
|
"@teambit/workspace.testing.mock-workspace": "0.0.23"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
@@ -68,7 +68,8 @@
|
|
|
68
68
|
"default": "./dist/index.js"
|
|
69
69
|
},
|
|
70
70
|
"./dist/*": "./dist/*",
|
|
71
|
-
"./artifacts/*": "./artifacts/*"
|
|
71
|
+
"./artifacts/*": "./artifacts/*",
|
|
72
|
+
"./*": "./*.ts"
|
|
72
73
|
},
|
|
73
74
|
"private": false,
|
|
74
75
|
"engines": {
|
package/tsconfig.json
CHANGED
|
@@ -17,7 +17,10 @@
|
|
|
17
17
|
"resolveJsonModule": true,
|
|
18
18
|
"allowJs": true,
|
|
19
19
|
"outDir": "dist",
|
|
20
|
-
"emitDeclarationOnly": true
|
|
20
|
+
"emitDeclarationOnly": true,
|
|
21
|
+
"strict": true,
|
|
22
|
+
"strictPropertyInitialization": false,
|
|
23
|
+
"noImplicitAny": false
|
|
21
24
|
},
|
|
22
25
|
"exclude": [
|
|
23
26
|
"artifacts",
|
|
File without changes
|