@nx/rollup 22.7.0-pr.33655.2b96277 → 22.7.0-pr.33655.57246dd

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/executors.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
- "executors": {
3
- "rollup": {
4
- "implementation": "./src/executors/rollup/rollup.impl",
5
- "schema": "./src/executors/rollup/schema.json",
6
- "description": "Bundle a package using Rollup."
7
- }
2
+ "executors": {
3
+ "rollup": {
4
+ "implementation": "./src/executors/rollup/rollup.impl",
5
+ "schema": "./src/executors/rollup/schema.json",
6
+ "description": "Bundle a package using Rollup."
8
7
  }
8
+ }
9
9
  }
package/generators.json CHANGED
@@ -1,24 +1,24 @@
1
1
  {
2
- "name": "Nx rollup",
3
- "version": "0.1",
4
- "generators": {
5
- "init": {
6
- "factory": "./src/generators/init/init#rollupInitGenerator",
7
- "schema": "./src/generators/init/schema.json",
8
- "description": "Initialize the `@nx/rollup` plugin.",
9
- "aliases": ["ng-add"],
10
- "hidden": true
11
- },
12
- "configuration": {
13
- "aliases": ["rollup-project"],
14
- "factory": "./src/generators/configuration/configuration",
15
- "schema": "./src/generators/configuration/schema.json",
16
- "description": "Add rollup configuration to a project."
17
- },
18
- "convert-to-inferred": {
19
- "factory": "./src/generators/convert-to-inferred/convert-to-inferred",
20
- "schema": "./src/generators/convert-to-inferred/schema.json",
21
- "description": "Convert existing Rollup project(s) using `@nx/rollup:*` executors to use `@nx/rollup/plugin`."
22
- }
2
+ "name": "Nx rollup",
3
+ "version": "0.1",
4
+ "generators": {
5
+ "init": {
6
+ "factory": "./src/generators/init/init#rollupInitGenerator",
7
+ "schema": "./src/generators/init/schema.json",
8
+ "description": "Initialize the `@nx/rollup` plugin.",
9
+ "aliases": ["ng-add"],
10
+ "hidden": true
11
+ },
12
+ "configuration": {
13
+ "aliases": ["rollup-project"],
14
+ "factory": "./src/generators/configuration/configuration",
15
+ "schema": "./src/generators/configuration/schema.json",
16
+ "description": "Add rollup configuration to a project."
17
+ },
18
+ "convert-to-inferred": {
19
+ "factory": "./src/generators/convert-to-inferred/convert-to-inferred",
20
+ "schema": "./src/generators/convert-to-inferred/schema.json",
21
+ "description": "Convert existing Rollup project(s) using `@nx/rollup:*` executors to use `@nx/rollup/plugin`."
23
22
  }
23
+ }
24
24
  }
package/migrations.json CHANGED
@@ -1,4 +1,4 @@
1
1
  {
2
- "generators": {},
3
- "packageJsonUpdates": {}
2
+ "generators": {},
3
+ "packageJsonUpdates": {}
4
4
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/rollup",
3
- "version": "22.7.0-pr.33655.2b96277",
3
+ "version": "22.7.0-pr.33655.57246dd",
4
4
  "private": false,
5
5
  "description": "The Nx Plugin for Rollup contains executors and generators that support building applications using Rollup.",
6
6
  "repository": {
@@ -30,8 +30,8 @@
30
30
  "migrations": "./migrations.json"
31
31
  },
32
32
  "dependencies": {
33
- "@nx/devkit": "22.7.0-pr.33655.2b96277",
34
- "@nx/js": "22.7.0-pr.33655.2b96277",
33
+ "@nx/devkit": "22.7.0-pr.33655.57246dd",
34
+ "@nx/js": "22.7.0-pr.33655.57246dd",
35
35
  "@rollup/plugin-babel": "^6.0.4",
36
36
  "@rollup/plugin-commonjs": "^25.0.7",
37
37
  "@rollup/plugin-image": "^3.0.3",
@@ -49,7 +49,7 @@
49
49
  "tslib": "^2.3.0"
50
50
  },
51
51
  "devDependencies": {
52
- "nx": "22.7.0-pr.33655.2b96277",
52
+ "nx": "22.7.0-pr.33655.57246dd",
53
53
  "source-map-js": "^1.2.0"
54
54
  },
55
55
  "publishConfig": {
@@ -1,195 +1,195 @@
1
1
  {
2
- "version": 2,
3
- "outputCapture": "direct-nodejs",
4
- "title": "Web Library Rollup Target",
5
- "description": "Packages a library for different web usages (ESM, CommonJS).",
6
- "cli": "nx",
7
- "type": "object",
8
- "properties": {
9
- "project": {
10
- "type": "string",
11
- "description": "The path to package.json file."
12
- },
13
- "main": {
14
- "type": "string",
15
- "description": "The path to the entry file, relative to project.",
16
- "alias": "entryFile",
17
- "x-completion-type": "file",
18
- "x-completion-glob": "**/*@(.js|.ts)",
19
- "x-priority": "important"
20
- },
21
- "outputPath": {
22
- "type": "string",
23
- "description": "The output path of the generated files.",
24
- "x-completion-type": "directory",
25
- "x-priority": "important"
26
- },
27
- "outputFileName": {
28
- "type": "string",
29
- "description": "Name of the main output file. Defaults same basename as 'main' file."
30
- },
31
- "deleteOutputPath": {
32
- "type": "boolean",
33
- "description": "Delete the output path before building.",
34
- "default": true
35
- },
36
- "tsConfig": {
2
+ "version": 2,
3
+ "outputCapture": "direct-nodejs",
4
+ "title": "Web Library Rollup Target",
5
+ "description": "Packages a library for different web usages (ESM, CommonJS).",
6
+ "cli": "nx",
7
+ "type": "object",
8
+ "properties": {
9
+ "project": {
10
+ "type": "string",
11
+ "description": "The path to package.json file."
12
+ },
13
+ "main": {
14
+ "type": "string",
15
+ "description": "The path to the entry file, relative to project.",
16
+ "alias": "entryFile",
17
+ "x-completion-type": "file",
18
+ "x-completion-glob": "**/*@(.js|.ts)",
19
+ "x-priority": "important"
20
+ },
21
+ "outputPath": {
22
+ "type": "string",
23
+ "description": "The output path of the generated files.",
24
+ "x-completion-type": "directory",
25
+ "x-priority": "important"
26
+ },
27
+ "outputFileName": {
28
+ "type": "string",
29
+ "description": "Name of the main output file. Defaults same basename as 'main' file."
30
+ },
31
+ "deleteOutputPath": {
32
+ "type": "boolean",
33
+ "description": "Delete the output path before building.",
34
+ "default": true
35
+ },
36
+ "tsConfig": {
37
+ "type": "string",
38
+ "description": "The path to tsconfig file.",
39
+ "x-completion-type": "file",
40
+ "x-completion-glob": "tsconfig.*.json",
41
+ "x-priority": "important"
42
+ },
43
+ "allowJs": {
44
+ "type": "boolean",
45
+ "description": "Allow JavaScript files to be compiled.",
46
+ "default": false
47
+ },
48
+ "format": {
49
+ "type": "array",
50
+ "description": "List of module formats to output. Defaults to matching format from tsconfig (e.g. CJS for CommonJS, and ESM otherwise).",
51
+ "alias": "f",
52
+ "items": {
53
+ "type": "string",
54
+ "enum": ["esm", "cjs"]
55
+ }
56
+ },
57
+ "external": {
58
+ "type": "array",
59
+ "description": "A list of external modules that will not be bundled (`react`, `react-dom`, etc.). Can also be set to `all` (bundle nothing) or `none` (bundle everything).",
60
+ "oneOf": [
61
+ {
62
+ "type": "string",
63
+ "enum": ["all", "none"]
64
+ },
65
+ {
66
+ "type": "array",
67
+ "items": {
68
+ "type": "string"
69
+ }
70
+ }
71
+ ]
72
+ },
73
+ "watch": {
74
+ "type": "boolean",
75
+ "description": "Enable re-building when files change.",
76
+ "default": false
77
+ },
78
+ "rollupConfig": {
79
+ "oneOf": [
80
+ {
81
+ "type": "array",
82
+ "items": {
37
83
  "type": "string",
38
- "description": "The path to tsconfig file.",
39
84
  "x-completion-type": "file",
40
- "x-completion-glob": "tsconfig.*.json",
41
- "x-priority": "important"
42
- },
43
- "allowJs": {
44
- "type": "boolean",
45
- "description": "Allow JavaScript files to be compiled.",
46
- "default": false
85
+ "x-completion-glob": "rollup?(*)@(.js|.ts)"
86
+ }
47
87
  },
48
- "format": {
49
- "type": "array",
50
- "description": "List of module formats to output. Defaults to matching format from tsconfig (e.g. CJS for CommonJS, and ESM otherwise).",
51
- "alias": "f",
52
- "items": {
53
- "type": "string",
54
- "enum": ["esm", "cjs"]
55
- }
56
- },
57
- "external": {
58
- "type": "array",
59
- "description": "A list of external modules that will not be bundled (`react`, `react-dom`, etc.). Can also be set to `all` (bundle nothing) or `none` (bundle everything).",
60
- "oneOf": [
61
- {
62
- "type": "string",
63
- "enum": ["all", "none"]
64
- },
65
- {
66
- "type": "array",
67
- "items": {
68
- "type": "string"
69
- }
70
- }
71
- ]
72
- },
73
- "watch": {
74
- "type": "boolean",
75
- "description": "Enable re-building when files change.",
76
- "default": false
77
- },
78
- "rollupConfig": {
79
- "oneOf": [
80
- {
81
- "type": "array",
82
- "items": {
83
- "type": "string",
84
- "x-completion-type": "file",
85
- "x-completion-glob": "rollup?(*)@(.js|.ts)"
86
- }
87
- },
88
- {
89
- "type": "string",
90
- "x-completion-type": "file",
91
- "x-completion-glob": "rollup?(*)@(.js|.ts)"
92
- }
93
- ],
94
- "description": "Path to a function which takes a rollup config and returns an updated rollup config."
95
- },
96
- "extractCss": {
97
- "type": ["boolean", "string"],
98
- "description": "CSS files will be extracted to the output folder. Alternatively custom filename can be provided (e.g. styles.css)",
99
- "default": true
100
- },
101
- "assets": {
102
- "type": "array",
103
- "description": "List of static assets.",
104
- "default": [],
105
- "items": {
106
- "$ref": "#/definitions/assetPattern"
107
- }
108
- },
109
- "compiler": {
110
- "type": "string",
111
- "enum": ["babel", "swc", "tsc"],
112
- "default": "babel",
113
- "description": "Which compiler to use."
114
- },
115
- "babelUpwardRootMode": {
116
- "type": "boolean",
117
- "description": "Whether to set rootmode to upward. See https://babeljs.io/docs/en/options#rootmode",
118
- "default": false
119
- },
120
- "javascriptEnabled": {
121
- "type": "boolean",
122
- "description": "Sets `javascriptEnabled` option for less loader",
123
- "default": false
124
- },
125
- "generateExportsField": {
126
- "type": "boolean",
127
- "alias": "exports",
128
- "description": "Update the output package.json file's 'exports' field. This field is used by Node and bundles.",
129
- "default": false,
130
- "x-priority": "important"
131
- },
132
- "additionalEntryPoints": {
133
- "type": "array",
134
- "description": "Additional entry-points to add to exports field in the package.json file.",
135
- "items": {
136
- "type": "string"
137
- },
138
- "x-priority": "important"
139
- },
140
- "buildLibsFromSource": {
141
- "type": "boolean",
142
- "description": "Read buildable libraries from source instead of building them separately.",
143
- "default": true
144
- },
145
- "skipTypeCheck": {
146
- "type": "boolean",
147
- "description": "Whether to skip TypeScript type checking.",
148
- "default": false
149
- },
150
- "skipTypeField": {
151
- "type": "boolean",
152
- "description": "Prevents 'type' field from being added to compiled package.json file. Use this if you are having an issue with this field.",
153
- "default": false
154
- },
155
- "sourceMap": {
156
- "description": "Output sourcemaps.",
157
- "type": "boolean"
158
- },
159
- "useLegacyTypescriptPlugin": {
160
- "type": "boolean",
161
- "description": "Use rollup-plugin-typescript2 instead of @rollup/plugin-typescript.",
162
- "default": false
88
+ {
89
+ "type": "string",
90
+ "x-completion-type": "file",
91
+ "x-completion-glob": "rollup?(*)@(.js|.ts)"
163
92
  }
93
+ ],
94
+ "description": "Path to a function which takes a rollup config and returns an updated rollup config."
164
95
  },
165
- "required": ["tsConfig", "main", "outputPath"],
166
- "definitions": {
167
- "assetPattern": {
168
- "oneOf": [
169
- {
170
- "type": "object",
171
- "properties": {
172
- "glob": {
173
- "type": "string",
174
- "description": "The pattern to match."
175
- },
176
- "input": {
177
- "type": "string",
178
- "description": "The input directory path in which to apply `glob`. Defaults to the project root."
179
- },
180
- "output": {
181
- "type": "string",
182
- "description": "Relative path within the output folder."
183
- }
184
- },
185
- "additionalProperties": false,
186
- "required": ["glob", "input", "output"]
187
- },
188
- {
189
- "type": "string"
190
- }
191
- ]
192
- }
96
+ "extractCss": {
97
+ "type": ["boolean", "string"],
98
+ "description": "CSS files will be extracted to the output folder. Alternatively custom filename can be provided (e.g. styles.css)",
99
+ "default": true
100
+ },
101
+ "assets": {
102
+ "type": "array",
103
+ "description": "List of static assets.",
104
+ "default": [],
105
+ "items": {
106
+ "$ref": "#/definitions/assetPattern"
107
+ }
193
108
  },
194
- "examplesFile": "../../docs/rollup-examples.md"
109
+ "compiler": {
110
+ "type": "string",
111
+ "enum": ["babel", "swc", "tsc"],
112
+ "default": "babel",
113
+ "description": "Which compiler to use."
114
+ },
115
+ "babelUpwardRootMode": {
116
+ "type": "boolean",
117
+ "description": "Whether to set rootmode to upward. See https://babeljs.io/docs/en/options#rootmode",
118
+ "default": false
119
+ },
120
+ "javascriptEnabled": {
121
+ "type": "boolean",
122
+ "description": "Sets `javascriptEnabled` option for less loader",
123
+ "default": false
124
+ },
125
+ "generateExportsField": {
126
+ "type": "boolean",
127
+ "alias": "exports",
128
+ "description": "Update the output package.json file's 'exports' field. This field is used by Node and bundles.",
129
+ "default": false,
130
+ "x-priority": "important"
131
+ },
132
+ "additionalEntryPoints": {
133
+ "type": "array",
134
+ "description": "Additional entry-points to add to exports field in the package.json file.",
135
+ "items": {
136
+ "type": "string"
137
+ },
138
+ "x-priority": "important"
139
+ },
140
+ "buildLibsFromSource": {
141
+ "type": "boolean",
142
+ "description": "Read buildable libraries from source instead of building them separately.",
143
+ "default": true
144
+ },
145
+ "skipTypeCheck": {
146
+ "type": "boolean",
147
+ "description": "Whether to skip TypeScript type checking.",
148
+ "default": false
149
+ },
150
+ "skipTypeField": {
151
+ "type": "boolean",
152
+ "description": "Prevents 'type' field from being added to compiled package.json file. Use this if you are having an issue with this field.",
153
+ "default": false
154
+ },
155
+ "sourceMap": {
156
+ "description": "Output sourcemaps.",
157
+ "type": "boolean"
158
+ },
159
+ "useLegacyTypescriptPlugin": {
160
+ "type": "boolean",
161
+ "description": "Use rollup-plugin-typescript2 instead of @rollup/plugin-typescript.",
162
+ "default": false
163
+ }
164
+ },
165
+ "required": ["tsConfig", "main", "outputPath"],
166
+ "definitions": {
167
+ "assetPattern": {
168
+ "oneOf": [
169
+ {
170
+ "type": "object",
171
+ "properties": {
172
+ "glob": {
173
+ "type": "string",
174
+ "description": "The pattern to match."
175
+ },
176
+ "input": {
177
+ "type": "string",
178
+ "description": "The input directory path in which to apply `glob`. Defaults to the project root."
179
+ },
180
+ "output": {
181
+ "type": "string",
182
+ "description": "Relative path within the output folder."
183
+ }
184
+ },
185
+ "additionalProperties": false,
186
+ "required": ["glob", "input", "output"]
187
+ },
188
+ {
189
+ "type": "string"
190
+ }
191
+ ]
192
+ }
193
+ },
194
+ "examplesFile": "../../docs/rollup-examples.md"
195
195
  }
@@ -1,86 +1,86 @@
1
1
  {
2
- "$schema": "https://json-schema.org/schema",
3
- "$id": "NxRollupProject",
4
- "cli": "nx",
5
- "title": "Add Rollup Configuration to a project",
6
- "description": "Add Rollup Configuration to a project.",
7
- "type": "object",
8
- "properties": {
9
- "project": {
10
- "type": "string",
11
- "description": "The name of the project.",
12
- "$default": {
13
- "$source": "argv",
14
- "index": 0
15
- },
16
- "x-dropdown": "project",
17
- "x-prompt": "What is the name of the project to set up a rollup for?",
18
- "x-priority": "important"
19
- },
20
- "compiler": {
21
- "type": "string",
22
- "enum": ["babel", "swc", "tsc"],
23
- "description": "The compiler to use to build source.",
24
- "default": "babel"
25
- },
26
- "main": {
27
- "type": "string",
28
- "description": "Path relative to the workspace root for the main entry file. Defaults to '<projectRoot>/src/index.ts'.",
29
- "alias": "entryFile",
30
- "x-priority": "important"
31
- },
32
- "tsConfig": {
33
- "type": "string",
34
- "description": "Path relative to the workspace root for the tsconfig file to build with. Defaults to '<projectRoot>/tsconfig.lib.json'.",
35
- "x-priority": "important"
36
- },
37
- "skipFormat": {
38
- "description": "Skip formatting files.",
39
- "type": "boolean",
40
- "default": false,
41
- "x-priority": "internal"
42
- },
43
- "skipPackageJson": {
44
- "type": "boolean",
45
- "default": false,
46
- "description": "Do not add dependencies to `package.json`.",
47
- "x-priority": "internal"
48
- },
49
- "skipValidation": {
50
- "type": "boolean",
51
- "default": false,
52
- "description": "Do not perform any validation on existing project.",
53
- "x-priority": "internal"
54
- },
55
- "importPath": {
56
- "type": "string",
57
- "description": "The library name used to import it, like `@myorg/my-awesome-lib`."
58
- },
59
- "external": {
60
- "type": "array",
61
- "description": "A list of external modules that will not be bundled (`react`, `react-dom`, etc.).",
62
- "items": {
63
- "type": "string"
64
- }
65
- },
66
- "rollupConfig": {
67
- "type": "string",
68
- "description": "Path relative to workspace root to a custom rollup file that takes a config object and returns an updated config."
69
- },
70
- "buildTarget": {
71
- "description": "The build target to add.",
72
- "type": "string",
73
- "default": "build"
74
- },
75
- "format": {
76
- "description": "The format to build the library (esm or cjs).",
77
- "type": "array",
78
- "items": {
79
- "type": "string",
80
- "enum": ["esm", "cjs"]
81
- },
82
- "default": ["esm"]
83
- }
2
+ "$schema": "https://json-schema.org/schema",
3
+ "$id": "NxRollupProject",
4
+ "cli": "nx",
5
+ "title": "Add Rollup Configuration to a project",
6
+ "description": "Add Rollup Configuration to a project.",
7
+ "type": "object",
8
+ "properties": {
9
+ "project": {
10
+ "type": "string",
11
+ "description": "The name of the project.",
12
+ "$default": {
13
+ "$source": "argv",
14
+ "index": 0
15
+ },
16
+ "x-dropdown": "project",
17
+ "x-prompt": "What is the name of the project to set up a rollup for?",
18
+ "x-priority": "important"
84
19
  },
85
- "required": []
20
+ "compiler": {
21
+ "type": "string",
22
+ "enum": ["babel", "swc", "tsc"],
23
+ "description": "The compiler to use to build source.",
24
+ "default": "babel"
25
+ },
26
+ "main": {
27
+ "type": "string",
28
+ "description": "Path relative to the workspace root for the main entry file. Defaults to '<projectRoot>/src/index.ts'.",
29
+ "alias": "entryFile",
30
+ "x-priority": "important"
31
+ },
32
+ "tsConfig": {
33
+ "type": "string",
34
+ "description": "Path relative to the workspace root for the tsconfig file to build with. Defaults to '<projectRoot>/tsconfig.lib.json'.",
35
+ "x-priority": "important"
36
+ },
37
+ "skipFormat": {
38
+ "description": "Skip formatting files.",
39
+ "type": "boolean",
40
+ "default": false,
41
+ "x-priority": "internal"
42
+ },
43
+ "skipPackageJson": {
44
+ "type": "boolean",
45
+ "default": false,
46
+ "description": "Do not add dependencies to `package.json`.",
47
+ "x-priority": "internal"
48
+ },
49
+ "skipValidation": {
50
+ "type": "boolean",
51
+ "default": false,
52
+ "description": "Do not perform any validation on existing project.",
53
+ "x-priority": "internal"
54
+ },
55
+ "importPath": {
56
+ "type": "string",
57
+ "description": "The library name used to import it, like `@myorg/my-awesome-lib`."
58
+ },
59
+ "external": {
60
+ "type": "array",
61
+ "description": "A list of external modules that will not be bundled (`react`, `react-dom`, etc.).",
62
+ "items": {
63
+ "type": "string"
64
+ }
65
+ },
66
+ "rollupConfig": {
67
+ "type": "string",
68
+ "description": "Path relative to workspace root to a custom rollup file that takes a config object and returns an updated config."
69
+ },
70
+ "buildTarget": {
71
+ "description": "The build target to add.",
72
+ "type": "string",
73
+ "default": "build"
74
+ },
75
+ "format": {
76
+ "description": "The format to build the library (esm or cjs).",
77
+ "type": "array",
78
+ "items": {
79
+ "type": "string",
80
+ "enum": ["esm", "cjs"]
81
+ },
82
+ "default": ["esm"]
83
+ }
84
+ },
85
+ "required": []
86
86
  }
@@ -1,19 +1,19 @@
1
1
  {
2
- "$schema": "https://json-schema.org/schema",
3
- "$id": "NxRollupConvertToInferred",
4
- "description": "Convert existing Rollup project(s) using `@nx/rollup:rollup` executor to use `@nx/rollup/plugin`. Defaults to migrating all projects. Pass '--project' to migrate only one target.",
5
- "title": "Convert Rollup project from executor to plugin",
6
- "type": "object",
7
- "properties": {
8
- "project": {
9
- "type": "string",
10
- "description": "The project to convert from using the `@nx/rollup:rollup` executor to use `@nx/rollup/plugin`.",
11
- "x-priority": "important"
12
- },
13
- "skipFormat": {
14
- "type": "boolean",
15
- "description": "Whether to format files at the end of the migration.",
16
- "default": false
17
- }
2
+ "$schema": "https://json-schema.org/schema",
3
+ "$id": "NxRollupConvertToInferred",
4
+ "description": "Convert existing Rollup project(s) using `@nx/rollup:rollup` executor to use `@nx/rollup/plugin`. Defaults to migrating all projects. Pass '--project' to migrate only one target.",
5
+ "title": "Convert Rollup project from executor to plugin",
6
+ "type": "object",
7
+ "properties": {
8
+ "project": {
9
+ "type": "string",
10
+ "description": "The project to convert from using the `@nx/rollup:rollup` executor to use `@nx/rollup/plugin`.",
11
+ "x-priority": "important"
12
+ },
13
+ "skipFormat": {
14
+ "type": "boolean",
15
+ "description": "Whether to format files at the end of the migration.",
16
+ "default": false
18
17
  }
18
+ }
19
19
  }
@@ -1,33 +1,33 @@
1
1
  {
2
- "$schema": "https://json-schema.org/schema",
3
- "$id": "NxWebpackInit",
4
- "cli": "nx",
5
- "title": "Init Webpack Plugin",
6
- "description": "Init Webpack Plugin.",
7
- "type": "object",
8
- "properties": {
9
- "skipFormat": {
10
- "description": "Skip formatting files.",
11
- "type": "boolean",
12
- "default": false
13
- },
14
- "skipPackageJson": {
15
- "description": "Do not add dependencies to `package.json`.",
16
- "type": "boolean",
17
- "default": false
18
- },
19
- "keepExistingVersions": {
20
- "type": "boolean",
21
- "x-priority": "internal",
22
- "description": "Keep existing dependencies versions",
23
- "default": false
24
- },
25
- "updatePackageScripts": {
26
- "type": "boolean",
27
- "x-priority": "internal",
28
- "description": "Update `package.json` scripts with inferred targets",
29
- "default": false
30
- }
2
+ "$schema": "https://json-schema.org/schema",
3
+ "$id": "NxWebpackInit",
4
+ "cli": "nx",
5
+ "title": "Init Webpack Plugin",
6
+ "description": "Init Webpack Plugin.",
7
+ "type": "object",
8
+ "properties": {
9
+ "skipFormat": {
10
+ "description": "Skip formatting files.",
11
+ "type": "boolean",
12
+ "default": false
31
13
  },
32
- "required": []
14
+ "skipPackageJson": {
15
+ "description": "Do not add dependencies to `package.json`.",
16
+ "type": "boolean",
17
+ "default": false
18
+ },
19
+ "keepExistingVersions": {
20
+ "type": "boolean",
21
+ "x-priority": "internal",
22
+ "description": "Keep existing dependencies versions",
23
+ "default": false
24
+ },
25
+ "updatePackageScripts": {
26
+ "type": "boolean",
27
+ "x-priority": "internal",
28
+ "description": "Update `package.json` scripts with inferred targets",
29
+ "default": false
30
+ }
31
+ },
32
+ "required": []
33
33
  }
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../packages/rollup/src/plugins/plugin.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,kBAAkB,EAGvB,aAAa,EAOd,MAAM,YAAY,CAAC;AAwBpB;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,kBAEhC,CAAC;AAEF,MAAM,WAAW,mBAAmB;IAClC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAID,eAAO,MAAM,WAAW,EAAE,aAAa,CAAC,mBAAmB,CA8B1D,CAAC;AAEF,eAAO,MAAM,aAAa,oCAAc,CAAC"}
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../packages/rollup/src/plugins/plugin.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,kBAAkB,EAGvB,aAAa,EAOd,MAAM,YAAY,CAAC;AAsBpB;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,kBAEhC,CAAC;AAEF,MAAM,WAAW,mBAAmB;IAClC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAID,eAAO,MAAM,WAAW,EAAE,aAAa,CAAC,mBAAmB,CAkC1D,CAAC;AAEF,eAAO,MAAM,aAAa,oCAAc,CAAC"}
@@ -11,7 +11,6 @@ const get_named_inputs_1 = require("@nx/devkit/src/utils/get-named-inputs");
11
11
  const file_hasher_1 = require("nx/src/hasher/file-hasher");
12
12
  const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
13
13
  const util_1 = require("@nx/js/src/plugins/typescript/util");
14
- const pmc = (0, devkit_1.getPackageManagerCommand)();
15
14
  function readTargetsCache(cachePath) {
16
15
  return (0, fs_1.existsSync)(cachePath) ? (0, devkit_1.readJsonFile)(cachePath) : {};
17
16
  }
@@ -34,8 +33,9 @@ exports.createNodes = [
34
33
  const cachePath = (0, path_1.join)(cache_directory_1.workspaceDataDirectory, `rollup-${optionsHash}.hash`);
35
34
  const targetsCache = readTargetsCache(cachePath);
36
35
  const isTsSolutionSetup = (0, ts_solution_setup_1.isUsingTsSolutionSetup)();
36
+ const pmc = (0, devkit_1.getPackageManagerCommand)((0, devkit_1.detectPackageManager)(context.workspaceRoot));
37
37
  try {
38
- return await (0, devkit_1.createNodesFromFiles)((configFile, _, context) => createNodesInternal(configFile, normalizedOptions, context, targetsCache, isTsSolutionSetup), configFilePaths, normalizedOptions, context);
38
+ return await (0, devkit_1.createNodesFromFiles)((configFile, _, context) => createNodesInternal(configFile, normalizedOptions, context, targetsCache, isTsSolutionSetup, pmc), configFilePaths, normalizedOptions, context);
39
39
  }
40
40
  finally {
41
41
  writeTargetsToCache(cachePath, targetsCache);
@@ -43,7 +43,7 @@ exports.createNodes = [
43
43
  },
44
44
  ];
45
45
  exports.createNodesV2 = exports.createNodes;
46
- async function createNodesInternal(configFilePath, options, context, targetsCache, isTsSolutionSetup) {
46
+ async function createNodesInternal(configFilePath, options, context, targetsCache, isTsSolutionSetup, pmc) {
47
47
  const projectRoot = (0, path_1.dirname)(configFilePath);
48
48
  const fullyQualifiedProjectRoot = (0, path_1.join)(context.workspaceRoot, projectRoot);
49
49
  // Do not create a project if package.json and project.json do not exist
@@ -53,7 +53,7 @@ async function createNodesInternal(configFilePath, options, context, targetsCach
53
53
  return {};
54
54
  }
55
55
  const hash = await (0, calculate_hash_for_create_nodes_1.calculateHashForCreateNodes)(projectRoot, options, context, [(0, js_1.getLockFileName)((0, devkit_1.detectPackageManager)(context.workspaceRoot))]);
56
- targetsCache[hash] ??= await buildRollupTarget(configFilePath, projectRoot, options, context, isTsSolutionSetup);
56
+ targetsCache[hash] ??= await buildRollupTarget(configFilePath, projectRoot, options, context, isTsSolutionSetup, pmc);
57
57
  return {
58
58
  projects: {
59
59
  [projectRoot]: {
@@ -63,7 +63,7 @@ async function createNodesInternal(configFilePath, options, context, targetsCach
63
63
  },
64
64
  };
65
65
  }
66
- async function buildRollupTarget(configFilePath, projectRoot, options, context, isTsSolutionSetup) {
66
+ async function buildRollupTarget(configFilePath, projectRoot, options, context, isTsSolutionSetup, pmc) {
67
67
  let loadConfigFile;
68
68
  try {
69
69
  // Try to load the workspace version of rollup first (it should already exist).
@@ -1 +1 @@
1
- {"version":3,"file":"with-nx.d.ts","sourceRoot":"","sources":["../../../../../../packages/rollup/src/plugins/with-nx/with-nx.ts"],"names":[],"mappings":"AASA,OAAO,EAIL,6BAA6B,EAC9B,MAAM,uCAAuC,CAAC;AAW/C,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AAQjC,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AA4B9D,wBAAgB,MAAM,CACpB,UAAU,EAAE,yBAAyB,EACrC,YAAY,GAAE,MAAM,CAAC,aAAkB,EAEvC,YAAY,CAAC,EAAE,6BAA6B,EAAE,GAC7C,MAAM,CAAC,aAAa,CAwRtB"}
1
+ {"version":3,"file":"with-nx.d.ts","sourceRoot":"","sources":["../../../../../../packages/rollup/src/plugins/with-nx/with-nx.ts"],"names":[],"mappings":"AAUA,OAAO,EAIL,6BAA6B,EAC9B,MAAM,uCAAuC,CAAC;AAY/C,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AAQjC,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AA4B9D,wBAAgB,MAAM,CACpB,UAAU,EAAE,yBAAyB,EACrC,YAAY,GAAE,MAAM,CAAC,aAAkB,EAEvC,YAAY,CAAC,EAAE,6BAA6B,EAAE,GAC7C,MAAM,CAAC,aAAa,CA0RtB"}
@@ -3,9 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.withNx = withNx;
4
4
  const tslib_1 = require("tslib");
5
5
  const devkit_1 = require("@nx/devkit");
6
+ const path_1 = require("path");
6
7
  const type_definitions_1 = require("@nx/js/src/plugins/rollup/type-definitions");
7
8
  const buildable_libs_utils_1 = require("@nx/js/src/utils/buildable-libs-utils");
8
9
  const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
10
+ const ts_config_1 = require("@nx/js/src/utils/typescript/ts-config");
9
11
  const plugin_babel_1 = require("@rollup/plugin-babel");
10
12
  const plugin_node_resolve_1 = tslib_1.__importDefault(require("@rollup/plugin-node-resolve"));
11
13
  const autoprefixer_1 = tslib_1.__importDefault(require("autoprefixer"));
@@ -151,7 +153,8 @@ dependencies) {
151
153
  else {
152
154
  options.generatePackageJson ??= true;
153
155
  }
154
- const compilerOptions = createTsCompilerOptions(projectRoot, tsConfig, options, dependencies);
156
+ const originalTsConfigPath = (0, node_path_1.join)(devkit_1.workspaceRoot, options.tsConfig);
157
+ const compilerOptions = createTsCompilerOptions(projectRoot, tsConfig, originalTsConfigPath, options, dependencies);
155
158
  compilerOptions.outDir = Array.isArray(finalConfig.output)
156
159
  ? finalConfig.output[0].dir
157
160
  : finalConfig.output.dir;
@@ -264,8 +267,20 @@ function createInput(options) {
264
267
  });
265
268
  return input;
266
269
  }
267
- function createTsCompilerOptions(projectRoot, config, options, dependencies) {
270
+ function createTsCompilerOptions(projectRoot, config, tsConfigPath, options, dependencies) {
268
271
  const compilerOptionPaths = (0, buildable_libs_utils_1.computeCompilerOptionsPaths)(config, dependencies ?? []);
272
+ // Resolve paths to absolute so they work without baseUrl and regardless
273
+ // of which tsconfig the plugin reads (project vs workspace root).
274
+ const pathsBase = (0, ts_config_1.resolvePathsBaseUrl)(tsConfigPath);
275
+ for (const key of Object.keys(compilerOptionPaths)) {
276
+ compilerOptionPaths[key] = compilerOptionPaths[key].map((p) => {
277
+ if ((0, path_1.isAbsolute)(p)) {
278
+ return p;
279
+ }
280
+ const stripped = p.startsWith('./') ? p.slice(2) : p;
281
+ return (0, path_1.resolve)(pathsBase, stripped).replace(/\\/g, '/');
282
+ });
283
+ }
269
284
  const compilerOptions = {
270
285
  rootDir: projectRoot,
271
286
  allowJs: options.allowJs,
package/assets.json DELETED
@@ -1,23 +0,0 @@
1
- {
2
- "outDir": "dist/packages/rollup",
3
- "assets": [
4
- {
5
- "glob": "**/files/**"
6
- },
7
- {
8
- "glob": "**/files/**/.gitkeep"
9
- },
10
- {
11
- "glob": "**/*.json",
12
- "ignore": ["tsconfig*.json", "project.json", ".eslintrc.json"]
13
- },
14
- {
15
- "glob": "**/*.js",
16
- "ignore": ["**/jest.config.js"]
17
- },
18
- {
19
- "glob": "**/*.d.ts"
20
- },
21
- "LICENSE"
22
- ]
23
- }
package/project.json DELETED
@@ -1,13 +0,0 @@
1
- {
2
- "name": "rollup",
3
- "$schema": "../../node_modules/nx/schemas/project-schema.json",
4
- "sourceRoot": "packages/rollup",
5
- "projectType": "library",
6
- "targets": {
7
- "build": {
8
- "outputs": ["{workspaceRoot}/dist/packages/rollup/README.md"],
9
- "command": "node ./scripts/copy-readme.js rollup",
10
- "inputs": ["copyReadme"]
11
- }
12
- }
13
- }