@azure-tools/rlc-common 0.50.1 → 0.50.2

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,4 +1,4 @@
1
1
 
2
- > @azure-tools/rlc-common@0.50.1 build /mnt/vss/_work/1/s/packages/rlc-common
2
+ > @azure-tools/rlc-common@0.50.2 build /mnt/vss/_work/1/s/packages/rlc-common
3
3
  > rimraf --glob dist/* dist-esm/* types/* && tsc -p tsconfig.json && tsc -p tsconfig-cjs.json && node publishPackage.js
4
4
 
package/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 0.50.2 (2026-03-09)
2
+
3
+ - [Bugfix] Remove `hasWarpConfigFile` guard — always regenerate `warp.config.yml`. Please refer to [#3825](https://github.com/Azure/autorest.typescript/pull/3825)
4
+ - [Feature] Remove tshy and add warp config generation for HLC (autorest.typescript). Please refer to [#3827](https://github.com/Azure/autorest.typescript/pull/3827)
5
+
1
6
  ## 0.50.1 (2026-03-06)
2
7
 
3
8
  - [Feature] Add enable-storage-compat emitter option. Please refer to [#3814](https://github.com/Azure/autorest.typescript/pull/3814)
@@ -2,8 +2,31 @@
2
2
  // Copyright (c) Microsoft Corporation.
3
3
  // Licensed under the MIT License.
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.WarpConfigTemplate = void 0;
5
6
  exports.buildWarpConfig = buildWarpConfig;
6
7
  const packageUtil_js_1 = require("../helpers/packageUtil.js");
8
+ exports.WarpConfigTemplate = `# warp.config.yml — build configuration
9
+
10
+ exports:
11
+ {{exports}}
12
+
13
+ targets:
14
+ - name: browser
15
+ tsconfig: "../../../tsconfig.src.browser.json"
16
+ polyfillSuffix: "-browser"
17
+
18
+ - name: react-native
19
+ tsconfig: "../../../tsconfig.src.react-native.json"
20
+ polyfillSuffix: "-react-native"
21
+
22
+ - name: esm
23
+ condition: import
24
+ tsconfig: "../../../tsconfig.src.esm.json"
25
+
26
+ - name: commonjs
27
+ condition: require
28
+ tsconfig: "../../../tsconfig.src.cjs.json"
29
+ `;
7
30
  /**
8
31
  * Builds a warp.config.yml file for Azure SDK monorepo packages.
9
32
  * Only generated when azureSdkForJs is true.
@@ -21,34 +44,13 @@ function buildWarpConfig(model, { exports } = {}) {
21
44
  ".": "./src/index.ts",
22
45
  ...exports
23
46
  };
24
- const lines = [];
25
- lines.push("# warp.config.yml build configuration");
26
- lines.push("");
27
- lines.push("exports:");
28
- for (const [key, value] of Object.entries(allExports)) {
29
- lines.push(` ${JSON.stringify(key)}: ${JSON.stringify(value)}`);
30
- }
31
- lines.push("");
32
- lines.push("targets:");
33
- lines.push(" - name: browser");
34
- lines.push(' tsconfig: "../../../tsconfig.src.browser.json"');
35
- lines.push(' polyfillSuffix: "-browser"');
36
- lines.push("");
37
- lines.push(" - name: react-native");
38
- lines.push(' tsconfig: "../../../tsconfig.src.react-native.json"');
39
- lines.push(' polyfillSuffix: "-react-native"');
40
- lines.push("");
41
- lines.push(" - name: esm");
42
- lines.push(" condition: import");
43
- lines.push(' tsconfig: "../../../tsconfig.src.esm.json"');
44
- lines.push("");
45
- lines.push(" - name: commonjs");
46
- lines.push(" condition: require");
47
- lines.push(' tsconfig: "../../../tsconfig.src.cjs.json"');
48
- lines.push("");
47
+ const exportsContent = Object.entries(allExports)
48
+ .map(([key, value]) => ` ${JSON.stringify(key)}: ${JSON.stringify(value)}`)
49
+ .join("\n");
50
+ const content = exports.WarpConfigTemplate.replace("{{exports}}", exportsContent);
49
51
  return {
50
52
  path: "warp.config.yml",
51
- content: lines.join("\n")
53
+ content
52
54
  };
53
55
  }
54
56
  //# sourceMappingURL=buildWarpConfig.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"buildWarpConfig.js","sourceRoot":"","sources":["../../src/metadata/buildWarpConfig.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAclC,0CAgDC;AA3DD,8DAAmE;AAOnE;;;GAGG;AACH,SAAgB,eAAe,CAC7B,KAAe,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AAC,EAAE,EAAE,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC;SAC3E,IAAI,CAAC,IAAI,CAAC,CAAC;IAEd,MAAM,OAAO,GAAG,0BAAkB,CAAC,OAAO,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC;IAE1E,OAAO;QACL,IAAI,EAAE,iBAAiB;QACvB,OAAO;KACR,CAAC;AACJ,CAAC"}
package/dist/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@azure-tools/rlc-common","version":"0.50.1","description":"","type":"commonjs","main":"dist/index.js","module":"dist-esm/index.js","exports":{".":{"types":"./types/index.d.ts","require":"./dist/index.js","import":"./dist-esm/index.js"}},"types":"./types/index.d.ts","scripts":{"lint":"eslint src --ext .ts --max-warnings=0","lint:fix":"eslint src --fix --ext .ts","format":"npm run -s prettier -- --write","check-format":"npm run prettier -- --check","prettier":"prettier --config ./.prettierrc \"src/**/*.ts\"","build":"rimraf --glob dist/* dist-esm/* types/* && tsc -p tsconfig.json && tsc -p tsconfig-cjs.json && node publishPackage.js","build:cjs":"rimraf --glob dist/* dist-esm/* types/* && tsc -p tsconfig-cjs.json && node publishPackage.js","build:esm":"rimraf --glob dist/* dist-esm/* types/* && tsc -p tsconfig.json && node publishPackage.js","test":"npm run unit-test","unit-test":"cross-env TS_NODE_PROJECT=tsconfig.json mocha -r ts-node/register --loader=ts-node/esm --experimental-specifier-resolution=node test/**/*.spec.ts"},"keywords":[],"author":"","license":"ISC","dependencies":{"handlebars":"^4.7.7","lodash":"^4.17.21","ts-morph":"^23.0.0"},"devDependencies":{"@types/chai":"^4.3.4","@types/fs-extra":"^8.1.0","@types/lodash":"^4.14.182","@types/mocha":"^10.0.1","@typescript-eslint/eslint-plugin":"^8.18.0","@typescript-eslint/parser":"^8.18.0","chai":"^4.3.7","cross-env":"7.0.3","eslint-plugin-require-extensions":"0.1.3","fs-extra":"^10.0.0","mocha":"^10.2.0","prettier":"^3.1.0","rimraf":"^5.0.10","ts-node":"^10.7.0"},"bugs":{"url":"https://github.com/Azure/autorest.typescript/issues"},"homepage":"https://github.com/Azure/autorest.typescript/tree/main/packages/rlc-common/"}
1
+ {"name":"@azure-tools/rlc-common","version":"0.50.2","description":"","type":"commonjs","main":"dist/index.js","module":"dist-esm/index.js","exports":{".":{"types":"./types/index.d.ts","require":"./dist/index.js","import":"./dist-esm/index.js"}},"types":"./types/index.d.ts","scripts":{"lint":"eslint src --ext .ts --max-warnings=0","lint:fix":"eslint src --fix --ext .ts","format":"npm run -s prettier -- --write","check-format":"npm run prettier -- --check","prettier":"prettier --config ./.prettierrc \"src/**/*.ts\"","build":"rimraf --glob dist/* dist-esm/* types/* && tsc -p tsconfig.json && tsc -p tsconfig-cjs.json && node publishPackage.js","build:cjs":"rimraf --glob dist/* dist-esm/* types/* && tsc -p tsconfig-cjs.json && node publishPackage.js","build:esm":"rimraf --glob dist/* dist-esm/* types/* && tsc -p tsconfig.json && node publishPackage.js","test":"npm run unit-test","unit-test":"cross-env TS_NODE_PROJECT=tsconfig.json mocha -r ts-node/register --loader=ts-node/esm --experimental-specifier-resolution=node test/**/*.spec.ts"},"keywords":[],"author":"","license":"ISC","dependencies":{"handlebars":"^4.7.7","lodash":"^4.17.21","ts-morph":"^23.0.0"},"devDependencies":{"@types/chai":"^4.3.4","@types/fs-extra":"^8.1.0","@types/lodash":"^4.14.182","@types/mocha":"^10.0.1","@typescript-eslint/eslint-plugin":"^8.18.0","@typescript-eslint/parser":"^8.18.0","chai":"^4.3.7","cross-env":"7.0.3","eslint-plugin-require-extensions":"0.1.3","fs-extra":"^10.0.0","mocha":"^10.2.0","prettier":"^3.1.0","rimraf":"^5.0.10","ts-node":"^10.7.0"},"bugs":{"url":"https://github.com/Azure/autorest.typescript/issues"},"homepage":"https://github.com/Azure/autorest.typescript/tree/main/packages/rlc-common/"}
@@ -1,6 +1,28 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
3
  import { isAzureMonorepoPackage } from "../helpers/packageUtil.js";
4
+ export const WarpConfigTemplate = `# warp.config.yml — build configuration
5
+
6
+ exports:
7
+ {{exports}}
8
+
9
+ targets:
10
+ - name: browser
11
+ tsconfig: "../../../tsconfig.src.browser.json"
12
+ polyfillSuffix: "-browser"
13
+
14
+ - name: react-native
15
+ tsconfig: "../../../tsconfig.src.react-native.json"
16
+ polyfillSuffix: "-react-native"
17
+
18
+ - name: esm
19
+ condition: import
20
+ tsconfig: "../../../tsconfig.src.esm.json"
21
+
22
+ - name: commonjs
23
+ condition: require
24
+ tsconfig: "../../../tsconfig.src.cjs.json"
25
+ `;
4
26
  /**
5
27
  * Builds a warp.config.yml file for Azure SDK monorepo packages.
6
28
  * Only generated when azureSdkForJs is true.
@@ -17,34 +39,13 @@ export function buildWarpConfig(model, { exports } = {}) {
17
39
  ".": "./src/index.ts",
18
40
  ...exports
19
41
  };
20
- const lines = [];
21
- lines.push("# warp.config.yml build configuration");
22
- lines.push("");
23
- lines.push("exports:");
24
- for (const [key, value] of Object.entries(allExports)) {
25
- lines.push(` ${JSON.stringify(key)}: ${JSON.stringify(value)}`);
26
- }
27
- lines.push("");
28
- lines.push("targets:");
29
- lines.push(" - name: browser");
30
- lines.push(' tsconfig: "../../../tsconfig.src.browser.json"');
31
- lines.push(' polyfillSuffix: "-browser"');
32
- lines.push("");
33
- lines.push(" - name: react-native");
34
- lines.push(' tsconfig: "../../../tsconfig.src.react-native.json"');
35
- lines.push(' polyfillSuffix: "-react-native"');
36
- lines.push("");
37
- lines.push(" - name: esm");
38
- lines.push(" condition: import");
39
- lines.push(' tsconfig: "../../../tsconfig.src.esm.json"');
40
- lines.push("");
41
- lines.push(" - name: commonjs");
42
- lines.push(" condition: require");
43
- lines.push(' tsconfig: "../../../tsconfig.src.cjs.json"');
44
- lines.push("");
42
+ const exportsContent = Object.entries(allExports)
43
+ .map(([key, value]) => ` ${JSON.stringify(key)}: ${JSON.stringify(value)}`)
44
+ .join("\n");
45
+ const content = WarpConfigTemplate.replace("{{exports}}", exportsContent);
45
46
  return {
46
47
  path: "warp.config.yml",
47
- content: lines.join("\n")
48
+ content
48
49
  };
49
50
  }
50
51
  //# sourceMappingURL=buildWarpConfig.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"buildWarpConfig.js","sourceRoot":"","sources":["../../src/metadata/buildWarpConfig.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAOnE;;;GAGG;AACH,MAAM,UAAU,eAAe,CAC7B,KAAe,EACf,EAAE,OAAO,KAAwB,EAAE;IAEnC,IAAI,CAAC,sBAAsB,CAAC,KAAK,CAAC,EAAE,CAAC;QACnC,OAAO;IACT,CAAC;IAED,IAAI,KAAK,CAAC,OAAO,EAAE,UAAU,KAAK,KAAK,EAAE,CAAC;QACxC,OAAO;IACT,CAAC;IAED,MAAM,UAAU,GAA2B;QACzC,gBAAgB,EAAE,gBAAgB;QAClC,GAAG,EAAE,gBAAgB;QACrB,GAAG,OAAO;KACX,CAAC;IAEF,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,KAAK,CAAC,IAAI,CAAC,yCAAyC,CAAC,CAAC;IACtD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACvB,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;QACtD,KAAK,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACnE,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,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AO,KAAwB,EAAE;IAEnC,IAAI,CAAC,sBAAsB,CAAC,KAAK,CAAC,EAAE,CAAC;QACnC,OAAO;IACT,CAAC;IAED,IAAI,KAAK,CAAC,OAAO,EAAE,UAAU,KAAK,KAAK,EAAE,CAAC;QACxC,OAAO;IACT,CAAC;IAED,MAAM,UAAU,GAA2B;QACzC,gBAAgB,EAAE,gBAAgB;QAClC,GAAG,EAAE,gBAAgB;QACrB,GAAG,OAAO;KACX,CAAC;IAEF,MAAM,cAAc,GAAG,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC;SAC9C,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC;SAC3E,IAAI,CAAC,IAAI,CAAC,CAAC;IAEd,MAAM,OAAO,GAAG,kBAAkB,CAAC,OAAO,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC;IAE1E,OAAO;QACL,IAAI,EAAE,iBAAiB;QACvB,OAAO;KACR,CAAC;AACJ,CAAC"}
@@ -1 +1 @@
1
- {"name":"@azure-tools/rlc-common","version":"0.50.1","description":"","type":"module","main":"dist/index.js","module":"dist-esm/index.js","exports":{".":{"types":"./types/index.d.ts","require":"./dist/index.js","import":"./dist-esm/index.js"}},"types":"./types/index.d.ts","scripts":{"lint":"eslint src --ext .ts --max-warnings=0","lint:fix":"eslint src --fix --ext .ts","format":"npm run -s prettier -- --write","check-format":"npm run prettier -- --check","prettier":"prettier --config ./.prettierrc \"src/**/*.ts\"","build":"rimraf --glob dist/* dist-esm/* types/* && tsc -p tsconfig.json && tsc -p tsconfig-cjs.json && node publishPackage.js","build:cjs":"rimraf --glob dist/* dist-esm/* types/* && tsc -p tsconfig-cjs.json && node publishPackage.js","build:esm":"rimraf --glob dist/* dist-esm/* types/* && tsc -p tsconfig.json && node publishPackage.js","test":"npm run unit-test","unit-test":"cross-env TS_NODE_PROJECT=tsconfig.json mocha -r ts-node/register --loader=ts-node/esm --experimental-specifier-resolution=node test/**/*.spec.ts"},"keywords":[],"author":"","license":"ISC","dependencies":{"handlebars":"^4.7.7","lodash":"^4.17.21","ts-morph":"^23.0.0"},"devDependencies":{"@types/chai":"^4.3.4","@types/fs-extra":"^8.1.0","@types/lodash":"^4.14.182","@types/mocha":"^10.0.1","@typescript-eslint/eslint-plugin":"^8.18.0","@typescript-eslint/parser":"^8.18.0","chai":"^4.3.7","cross-env":"7.0.3","eslint-plugin-require-extensions":"0.1.3","fs-extra":"^10.0.0","mocha":"^10.2.0","prettier":"^3.1.0","rimraf":"^5.0.10","ts-node":"^10.7.0"},"bugs":{"url":"https://github.com/Azure/autorest.typescript/issues"},"homepage":"https://github.com/Azure/autorest.typescript/tree/main/packages/rlc-common/"}
1
+ {"name":"@azure-tools/rlc-common","version":"0.50.2","description":"","type":"module","main":"dist/index.js","module":"dist-esm/index.js","exports":{".":{"types":"./types/index.d.ts","require":"./dist/index.js","import":"./dist-esm/index.js"}},"types":"./types/index.d.ts","scripts":{"lint":"eslint src --ext .ts --max-warnings=0","lint:fix":"eslint src --fix --ext .ts","format":"npm run -s prettier -- --write","check-format":"npm run prettier -- --check","prettier":"prettier --config ./.prettierrc \"src/**/*.ts\"","build":"rimraf --glob dist/* dist-esm/* types/* && tsc -p tsconfig.json && tsc -p tsconfig-cjs.json && node publishPackage.js","build:cjs":"rimraf --glob dist/* dist-esm/* types/* && tsc -p tsconfig-cjs.json && node publishPackage.js","build:esm":"rimraf --glob dist/* dist-esm/* types/* && tsc -p tsconfig.json && node publishPackage.js","test":"npm run unit-test","unit-test":"cross-env TS_NODE_PROJECT=tsconfig.json mocha -r ts-node/register --loader=ts-node/esm --experimental-specifier-resolution=node test/**/*.spec.ts"},"keywords":[],"author":"","license":"ISC","dependencies":{"handlebars":"^4.7.7","lodash":"^4.17.21","ts-morph":"^23.0.0"},"devDependencies":{"@types/chai":"^4.3.4","@types/fs-extra":"^8.1.0","@types/lodash":"^4.14.182","@types/mocha":"^10.0.1","@typescript-eslint/eslint-plugin":"^8.18.0","@typescript-eslint/parser":"^8.18.0","chai":"^4.3.7","cross-env":"7.0.3","eslint-plugin-require-extensions":"0.1.3","fs-extra":"^10.0.0","mocha":"^10.2.0","prettier":"^3.1.0","rimraf":"^5.0.10","ts-node":"^10.7.0"},"bugs":{"url":"https://github.com/Azure/autorest.typescript/issues"},"homepage":"https://github.com/Azure/autorest.typescript/tree/main/packages/rlc-common/"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azure-tools/rlc-common",
3
- "version": "0.50.1",
3
+ "version": "0.50.2",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -9,6 +9,29 @@ export interface WarpConfigOptions {
9
9
  exports?: Record<string, string>;
10
10
  }
11
11
 
12
+ export const WarpConfigTemplate = `# warp.config.yml — build configuration
13
+
14
+ exports:
15
+ {{exports}}
16
+
17
+ targets:
18
+ - name: browser
19
+ tsconfig: "../../../tsconfig.src.browser.json"
20
+ polyfillSuffix: "-browser"
21
+
22
+ - name: react-native
23
+ tsconfig: "../../../tsconfig.src.react-native.json"
24
+ polyfillSuffix: "-react-native"
25
+
26
+ - name: esm
27
+ condition: import
28
+ tsconfig: "../../../tsconfig.src.esm.json"
29
+
30
+ - name: commonjs
31
+ condition: require
32
+ tsconfig: "../../../tsconfig.src.cjs.json"
33
+ `;
34
+
12
35
  /**
13
36
  * Builds a warp.config.yml file for Azure SDK monorepo packages.
14
37
  * Only generated when azureSdkForJs is true.
@@ -31,34 +54,14 @@ export function buildWarpConfig(
31
54
  ...exports
32
55
  };
33
56
 
34
- const lines: string[] = [];
35
- lines.push("# warp.config.yml build configuration");
36
- lines.push("");
37
- lines.push("exports:");
38
- for (const [key, value] of Object.entries(allExports)) {
39
- lines.push(` ${JSON.stringify(key)}: ${JSON.stringify(value)}`);
40
- }
41
- lines.push("");
42
- lines.push("targets:");
43
- lines.push(" - name: browser");
44
- lines.push(' tsconfig: "../../../tsconfig.src.browser.json"');
45
- lines.push(' polyfillSuffix: "-browser"');
46
- lines.push("");
47
- lines.push(" - name: react-native");
48
- lines.push(' tsconfig: "../../../tsconfig.src.react-native.json"');
49
- lines.push(' polyfillSuffix: "-react-native"');
50
- lines.push("");
51
- lines.push(" - name: esm");
52
- lines.push(" condition: import");
53
- lines.push(' tsconfig: "../../../tsconfig.src.esm.json"');
54
- lines.push("");
55
- lines.push(" - name: commonjs");
56
- lines.push(" condition: require");
57
- lines.push(' tsconfig: "../../../tsconfig.src.cjs.json"');
58
- lines.push("");
57
+ const exportsContent = Object.entries(allExports)
58
+ .map(([key, value]) => ` ${JSON.stringify(key)}: ${JSON.stringify(value)}`)
59
+ .join("\n");
60
+
61
+ const content = WarpConfigTemplate.replace("{{exports}}", exportsContent);
59
62
 
60
63
  return {
61
64
  path: "warp.config.yml",
62
- content: lines.join("\n")
65
+ content
63
66
  };
64
67
  }
@@ -3,6 +3,7 @@ export interface WarpConfigOptions {
3
3
  /** Source-level exports, e.g. { ".": "./src/index.ts", "./models": "./src/models/index.ts" } */
4
4
  exports?: Record<string, string>;
5
5
  }
6
+ export declare const WarpConfigTemplate = "# warp.config.yml \u2014 build configuration\n\nexports:\n{{exports}}\n\ntargets:\n - name: browser\n tsconfig: \"../../../tsconfig.src.browser.json\"\n polyfillSuffix: \"-browser\"\n\n - name: react-native\n tsconfig: \"../../../tsconfig.src.react-native.json\"\n polyfillSuffix: \"-react-native\"\n\n - name: esm\n condition: import\n tsconfig: \"../../../tsconfig.src.esm.json\"\n\n - name: commonjs\n condition: require\n tsconfig: \"../../../tsconfig.src.cjs.json\"\n";
6
7
  /**
7
8
  * Builds a warp.config.yml file for Azure SDK monorepo packages.
8
9
  * Only generated when azureSdkForJs is true.